0.4.0: close the gaps between definition and the legacy authoring surface - #6
Merged
Merged
Conversation
…face Timers (sleep, sleepUntil), continueAsNew, and child workflows (executeChild) join the WorkflowOps seam; versioned() is the run-table form of version(); the activity type helpers move to definition and codecsFor/ACTIVITY_EXIT_TYPE to wire; every client-side op accepts the declaration directly, plus completeDeferred; the new bundle module is the one sandbox import an application has. makeTestWorkflowOps implements all of it in memory: TestClock-driven timers (not instant), recorded continue-as-new, in-process children via handleWorkflow bindings with attach-on-taken-id. The fake client gains offer/offersTo; the live harness gains offer/request/stateOf/resolve. Deprecated (removed in 0.5.0): engine-sandbox's per-primitive calls, sleepUntil, continueAsNew, UpdateRequest alias; TypedActivity.make; the mailbox/update/state-cell make constructors; Versioning.match/version. New prefer-definition lint rule (recommended preset, error) reports each with its replacement. A history recorded on 0.3.0 replays through this bundle (replay-compat.test.ts). effect pinned to 4.0.0-rc.112.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
0.4.0 makes the
definition+bundle+activities+client/engine-client+testingsurface complete enough that an application never imports the legacy modules, then deprecates those modules for deletion in 0.5.0.Every gap here is something the Springbird monorepo still had to reach into
engine-sandbox,typed-activity,versioning, ormailboxfor:sleep,sleepUntilfromdefinition(shared timestamp rulesleepUntilTarget). In memory they follow Effect'sClock, soTestClock.adjustdrives them and the grace-period race (mailbox take vs timer) is pinned in both orders on both engines.continueAsNewon the seam — in memory it interrupts the fiber and records the continuation (world.continuedAsNewOf(W)), payload round-tripped through the workflow schema.executeChild(Child, payload, { discard? }); Temporal dispatches into upstreamexecute(identical commands).makeTestWorkflowOps({ workflows: [handleWorkflow(Child, handler)] })runs children in-process, forks discarded ones, attaches on a taken id.PayloadOf/SuccessOf/ErrorOf/AnyTypedActivity/… ondefinition;codecsFor/ACTIVITY_EXIT_TYPEonwire.engine-client/WorkflowClientop accepts the declaration directly (or its primitive); newcompleteDeferred. Fake client:offer/offersTo; harness client:offer/request/stateOf/resolve.versioned(site, { v1, v2 })— run-table form ofversion; the main-fiber lint rule recognises it.UpdateRequest— one parameter order (definition's<P, S, E>); theengine-sandboxalias is deprecated.bundlemodule —workflowBundle's home, "the one file the worker points at"; the rest ofengine-sandboxis documented engine-level or deprecated.effectpin →4.0.0-rc.112.Deprecations carry
@deprecated+ replacement; the newprefer-definitionlint rule (error inrecommended) reports every deprecated import with its replacement.CHANGELOG.mdhas the 0.5.0 deletion checklist under "Unreleased / planned".Wire safety
A real
defOrderhistory recorded with the 0.3.0 bundle before any code changed lives infixtures/histories/;replay-compat.test.tsreplays it through this bundle.OrderFlow's handler is byte-for-byte unchanged; the 0.4.0 fixtures sit beside it.Validation
examples/: noengine-sandboximport besidesworkflowBundle, notyped-activity/versioning/mailbox;oxlintwithrecommendedexits 0 there and fails on the deprecated fixtures