Add explicit lifecycle pipelines and scheduled query refreshes #68

Merged
Thilawyn merged 4 commits from next into master 2026-07-30 15:36:50 +02:00
Owner

Summary

  • Replace auto-running service constructors with explicit make(...).pipe(thenRun) lifecycle pipelines.
  • Add scoped, schedule-driven Query refreshes with Query.withScheduledRefresh.
  • Upgrade the Effect v4 stack to beta 102.
  • Add @effect-view/vite-plugin to the publish workflow.
  • Update examples and documentation for the new APIs.

Breaking changes

The following constructors have been replaced:

  • Query.service(options)Query.make(options).pipe(Query.thenRun)
  • QueryClient.service(options)QueryClient.make(options).pipe(QueryClient.thenRun)
  • MutationForm.service(options)MutationForm.make(options).pipe(MutationForm.thenRun)
  • LensForm.service(options)LensForm.make(options).pipe(LensForm.thenRun)

This separates object construction from starting its scoped background behavior.

Scheduled Query refreshes

Queries can now be refreshed with any Effect Schedule:

const query = yield* Query.make(options).pipe(
  Query.thenRun,
  Query.withScheduledRefresh(Schedule.spaced("5 minutes")),
)
## Summary - Replace auto-running `service` constructors with explicit `make(...).pipe(thenRun)` lifecycle pipelines. - Add scoped, schedule-driven Query refreshes with `Query.withScheduledRefresh`. - Upgrade the Effect v4 stack to beta 102. - Add `@effect-view/vite-plugin` to the publish workflow. - Update examples and documentation for the new APIs. ## Breaking changes The following constructors have been replaced: - `Query.service(options)` → `Query.make(options).pipe(Query.thenRun)` - `QueryClient.service(options)` → `QueryClient.make(options).pipe(QueryClient.thenRun)` - `MutationForm.service(options)` → `MutationForm.make(options).pipe(MutationForm.thenRun)` - `LensForm.service(options)` → `LensForm.make(options).pipe(LensForm.thenRun)` This separates object construction from starting its scoped background behavior. ## Scheduled Query refreshes Queries can now be refreshed with any Effect `Schedule`: ```ts const query = yield* Query.make(options).pipe( Query.thenRun, Query.withScheduledRefresh(Schedule.spaced("5 minutes")), )
Thilawyn added 4 commits 2026-07-30 15:34:33 +02:00
Add Query.withScheduledRefresh
Lint / lint (push) Successful in 1m53s
e412943e64
Refactor API
Lint / lint (push) Successful in 48s
66b7a08ef7
run -> thenRun
Lint / lint (push) Successful in 47s
f8ac04101a
Upgrade Effect v4
Lint / lint (push) Successful in 48s
Test build / test-build (pull_request) Successful in 2m8s
d3622f4779
Thilawyn merged commit 2b1c6aeda9 into master 2026-07-30 15:36:50 +02:00
Thilawyn deleted branch next 2026-07-30 15:36:50 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Thilawyn/effect-view#68