Skip to content

feat: unwrap InstanceState + EffectBridge namespaces to flat exports + barrel#22721

Merged
kitlangton merged 1 commit intodevfrom
kit/ns-effect
Apr 16, 2026
Merged

feat: unwrap InstanceState + EffectBridge namespaces to flat exports + barrel#22721
kitlangton merged 1 commit intodevfrom
kit/ns-effect

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

Convert export namespace InstanceState { ... } and export namespace EffectBridge { ... } to flat exports with shared export * as barrel in effect/index.ts.

Declaration merging edge case

InstanceState is both a namespace (with make, get, use, etc.) and an interface (InstanceState<A, E, R>). With export namespace, TypeScript merges them. With export * as, the namespace wins and the type is accessed as InstanceState.InstanceState<A, E> — consistent with how effect-smol does Effect.Effect<A, E, R>.

2 files needed this adjustment (share-next.ts, instance-state.test.ts).

Part of the namespace tree-shake migration.

…+ barrel

Handles the declaration-merging edge case: InstanceState is both a namespace
and an interface with the same name. Consumers that use it as a type use the
Effect-consistent pattern: InstanceState.InstanceState<A, E> (same as how
Effect.Effect<A, E, R> works in effect-smol).
@kitlangton kitlangton enabled auto-merge (squash) April 16, 2026 02:38
@kitlangton kitlangton disabled auto-merge April 16, 2026 02:41
@kitlangton kitlangton enabled auto-merge (squash) April 16, 2026 02:42
@kitlangton kitlangton merged commit 379e40d into dev Apr 16, 2026
13 checks passed
@kitlangton kitlangton deleted the kit/ns-effect branch April 16, 2026 02:45
jerome-benoit pushed a commit to jerome-benoit/opencode that referenced this pull request Apr 16, 2026
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant