`@effect/ui-native` (Effect-TS/ui): `Native.Host` is in `Command.FrameworkServices` (`R = never`) but missing from `@effect/ui-native/testing`
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react-native, typescript
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 16.7k
- Fork
- 808
- Merge medio
- 21h 22m
- PR unite (30g)
- 486
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Effect-TS/effect
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
`@effect/ui-native` (Effect-TS/ui): `kit/VirtualList` `list` part widens `R` to `any`, poisoning enclosing componentsForse già presa @effect-bot l’ha presa oggi. Aperta
Effect-TS/effect#11097 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`@effect/ui-native` (Effect-TS/ui): Controlled `input` rejected-edit restore never calls `host.commit()`Forse già presa @effect-bot l’ha presa oggi. Aperta
Effect-TS/effect#11096 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Effect-TS/effect
Issue simili
-
check:failed streams:edit
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
iptv-org/iptv#60585 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Critical path skips a child span that ends exactly when the next one startsForse già presa @Piyush4801 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
jaegertracing/jaeger-ui#4865 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
anthropics/claude-code#112972 ·
-
Type: Improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno