Skip to content

chore: use Effect Console in @effex/platform instead of raw console.*#46

Merged
jonlaing merged 1 commit into
mainfrom
chore/platform-effect-console
Jul 24, 2026
Merged

chore: use Effect Console in @effex/platform instead of raw console.*#46
jonlaing merged 1 commit into
mainfrom
chore/platform-effect-console

Conversation

@jonlaing

Copy link
Copy Markdown
Owner

Summary

Follow-up on the merged PRs #41 (data-provider fallback) — swap raw `console.error` / `console.warn` / `console.log` for Effect's `Console` service everywhere in `@effex/platform`.

Why

Every log site in Platform is already inside an `Effect` chain, so wrapping `console.*` in `Effect.sync` (as those PRs did) was unnecessarily un-Effect-native. Effect's `Console.error` / `Console.warn` / `Console.log`:

  • Returns `Effect` — no `Effect.sync(() => ...)` boilerplate
  • Runs inside the fiber (interruptable, part of the flow)
  • Layer-swappable so tests can capture output programmatically instead of `vi.spyOn(console, ...)`

Default sink still delegates to the real browser/Node console, so existing spy-based tests keep working unchanged.

Sites updated

Test plan

  • `npx tsc --noEmit` clean
  • Full suite: 744 pass / 2 skipped (unchanged)

🤖 Generated with Claude Code

Same rationale as the equivalent change in @effex/dom's subscribeReconcile — Effect's Console goes through a service (Layer-swappable for tests), returns Effect<void> directly (no Effect.sync wrapping), and is more idiomatic in an otherwise Effect-native codebase. Default sink still delegates to the real console.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying effex with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5587f24
Status: ✅  Deploy successful!
Preview URL: https://e85079b6.effex.pages.dev
Branch Preview URL: https://chore-platform-effect-consol.effex.pages.dev

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying effex-api with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5587f24
Status: ✅  Deploy successful!
Preview URL: https://7d48eddc.effex-api.pages.dev
Branch Preview URL: https://chore-platform-effect-consol.effex-api.pages.dev

View logs

@jonlaing
jonlaing merged commit 85e8610 into main Jul 24, 2026
4 checks passed
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