tim-smart / tim-smart/effect-atom

Result Type - This is likely not portable. A type annotation is necessary

Open
#226 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
792
Forks
49
PR merge metrics
No merged PRs in 30d

Description

Just starting looking into this repo but ran into this issue. Importing Result from @effect-rx/rx-react fixes this.

Edit: This issue is from exporting fieldRx. It goes away when not exporting. Not a big deal so if you feel like closing this issue please feel free to do so. Not sure how often its expected to export the returned rx?

The inferred type of 'fieldRx' cannot be named without a reference to '.pnpm/@effect-rx+rx@0.43.1_@effect+platform@0.87.5_effect@3.16.10__effect@3.16.10/node_modules/@effect-rx/rx/Result'. This is likely not portable. A type annotation is necessary.
import { Rx, useRxValue } from '@effect-rx/rx-react'
import type { Meta, StoryObj } from '@storybook/react-vite'
import { TextFieldService } from '../repo
import { Effect, Layer } from 'effect'

const meta: Meta = {
	title: 'Field Types',
	decorators: [
		(StoryComponent) => (
			<div className='h-screen'>
				<StoryComponent />
			</div>
		),
	],
} satisfies Meta

export default meta
type Story = StoryObj<typeof meta>

const layers = Layer.mergeAll(TextFieldService.Default)
const runtimeRx = Rx.runtime(layers)

export const fieldRx = runtimeRx.rx(
	Effect.gen(function* () {
		const fieldService = yield* TextFieldService
		return fieldService.makeReactComponent()
	})
)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Storybook example that exports fieldRx and the runtimeRx.rx call. Reproduce the TypeScript portability diagnostic, then compare the behavior when Result is imported from @effect-rx/rx-react and when fieldRx is not exported. Done means the diagnostic is resolved or the issue is clearly documented as intentionally closed.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, storybook, typescript
Domain
developer-experience, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.