`@effect/ui-native` (Effect-TS/ui): `Native.Host` is in `Command.FrameworkServices` (`R = never`) but missing from `@effect/ui-native/testing`
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react-native, typescript
調査の方向性
Read packages/ui-native/src/testing/index.ts and the TestDevice.layer(...) implementation, then compare their provided services with Native.Host in packages/ui-native/src/Native.ts. Run the supplied Vitest reproduction to confirm the missing service. Done when native Play or Scene tests provide a usable Native.Host and the reproduction runs without the service-not-found error.
索引モデルが issue の本文から書いたものです。
説明
partially generated with help of my ai friend - neon 4.4
Hi effect team,
I was trying out this package and wanted to report some bugs encountered while porting a library to effect native
What version of Effect is running?
effect:4.1.7@effect/ui&@effect/ui-native:Effect-TS/uimainat77391ee50ae3d3175d670facbf675e9a819ba6a6react-native:0.88.1
What steps can reproduce the bug?
- Clone the minimal reproduction repository:
git clone https://github.com/cliffordfajardo/effectui-native-error-reproductions.git cd effectui-native-error-reproductions pnpm install pnpm vitest run 06-native-host-missing-in-testing-layer - Write a
Native.componentwhoseCommand.makeyieldsNative.Host(for example callinghost.measure(node)orhost.scrollTo(...)— the same pattern used internally by@effect/ui-native/kit/VirtualList):
const measureCmd = Command.make(
Effect.fn(function*() {
const refs = yield* Renderer.Refs
const host = yield* Native.Host
const node = refs.get("box") as NativeHost.NativeNode | undefined
return node ? host.measure(node) : undefined
})
)
- Run the component in a Vitest
Play.maketest using the documented native test layersLayer.merge(TestHost.layer(), TestDevice.layer("ios"))(see06-native-host-missing-in-testing-layer/repro.test.ts).
What is the expected behavior?
Because Native.Host is declared in Command.FrameworkServices (packages/ui-native/src/Native.ts:1239-1243), TypeScript intentionally does not require tests to provide Native.Host manually (R = never). Accordingly, @effect/ui-native/testing (e.g. TestDevice.layer(...) or a dedicated TestNativeHost.layer(...)) should provide a working test Native.Host service so components using measure, scrollTo, focus, blur, etc. run cleanly in Play / Scene tests.
What do you see instead?
The test compiles with R = never, then fails at runtime as soon as the command executes:
Error: Service not found: @effect/ui-native/Native/Host
NativeApp.register provides Native.Host on real devices, but @effect/ui-native/testing (packages/ui-native/src/testing/index.ts) currently only exports TestDevice and provides no Native.Host implementation.
Additional information
Possible fix:
- Provide a default/configurable
Native.Hostimplementation fromTestDevice.layer(...)(or exportTestNativeHost.layer(...)from@effect/ui-native/testing) that recordsscrollTo/focus/blur/commandcalls and lets tests stubmeasure(node)rects.
- 主要言語
- TypeScript
- スター
- 16.7k
- フォーク
- 808
- 平均マージ
- 21時間 22分
- マージ済み PR(30日)
- 486
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Effect-TS/effect のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
`@effect/ui-native` (Effect-TS/ui): `kit/VirtualList` `list` part widens `R` to `any`, poisoning enclosing components対応中かも @effect-bot が今日担当しました。 オープン
Effect-TS/effect#11097 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
`@effect/ui-native` (Effect-TS/ui): Controlled `input` rejected-edit restore never calls `host.commit()`対応中かも @effect-bot が今日担当しました。 オープン
Effect-TS/effect#11096 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
Effect-TS/effect の issue をすべて見る
似ている issue
-
check:failed streams:edit
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
iptv-org/iptv#60585 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Critical path skips a child span that ends exactly when the next one starts対応中かも @Piyush4801 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jaegertracing/jaeger-ui#4865 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
anthropics/claude-code#112972 ·
-
Type: Improvement
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信