Skip to content

feat(core): keep TaskEngine.layer; compose Bun via layerNoDeps - #13

Open
arekbartnik wants to merge 2 commits into
julia-script:mainfrom
arekbartnik:feat/node-live-bun-composition
Open

feat(core): keep TaskEngine.layer; compose Bun via layerNoDeps#13
arekbartnik wants to merge 2 commits into
julia-script:mainfrom
arekbartnik:feat/node-live-bun-composition

Conversation

@arekbartnik

@arekbartnik arekbartnik commented Aug 24, 2026

Copy link
Copy Markdown

Why

TaskEngine.layer stays the call site. Process runtime and Redis adapter are separate axes: Node or Bun for runMain, NodeRedisPool for Redis. The engine does not pick a process runtime.

Scope

  • TaskEngine.layer({ engine?, redis? }) is the live graph (NodeRedisPool + NodeCrypto + engine). Its Layer.Services is never.
  • TaskEngine.layerNoDeps requires RedisPool only. That is the compose path for a custom client or BunCrypto.
  • NodeRedisPool stays public so BunRuntime + node-redis is a first-class pipe.
  • @effect/platform-bun is an optional peer and a pinned devDependency.
  • PublicContracts.test.ts pins layer() to never, layerNoDeps() to RedisPool, the live-graph success union, and the Bun plus node-redis pipe to never.
  • scripts/check-architecture.ts rejects redis and @effect/platform-node imports outside TaskEngine, NodeRedisPool, and the CLI.
  • Native Bun RedisClient is out of scope. Its send still cannot return bytes.

Tradeoffs

We keep redis and @effect/platform-node as package dependencies so TaskEngine.layer still ships a working graph. Bun users who want the same adapter get node-redis transitively. A public NodeLive module leaked the Node attachment and forced a call-site rename.

Blast Radius

Callers of TaskEngine.layer({ redis }) are unchanged. Custom layerNoDeps callers are unchanged. Bun with node-redis uses the same TaskEngine.layer plus BunRuntime.runMain, or layerNoDeps plus BunCrypto when Crypto must be explicit.

Verification

  • pnpm typecheck:src, typecheck:test, lint, check:architecture, check:docs passed.
  • pnpm vitest run src/PublicContracts.test.ts passed.
  • Bun 1.3.14 plus redis createClientPool against Redis 7.4: PONG, lossless binary GET, XREAD as Map.
  • Redis integration suite was not run.

TaskEngine no longer embeds node-redis or NodeCrypto. Node apps use
NodeLive.layer. Bun plus node-redis composes TaskEngine.layer with
NodeRedisPool.layer and BunCrypto.layer.
@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

@arekbartnik is attempting to deploy a commit to the juliascript's projects Team on Vercel.

A member of the Team first needs to authorize it.

NodeLive named the Node adapter. Callers should keep TaskEngine.layer.
layerNoDeps is the compose path for a custom RedisPool or BunCrypto.
@arekbartnik arekbartnik changed the title feat(core): split NodeLive from TaskEngine.layer feat(core): keep TaskEngine.layer; compose Bun via layerNoDeps Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant