Repository navigation
fix: expose a module's Workflows in ctx.exports as their bindings (#266) - #274
Merged
Merged
Conversation
- A `WorkflowEntrypoint` class export is its Workflow's binding, keyed by the class name as workerd keys it: `ctx.exports.Slow` is a `[object WrappedBinding]` (a `WorkflowImpl` over the shared `WrappedBinding` level, `create`/`createBatch`/`deleteBatch`/`get` on the prototype, no own property), a distinct object over the same instance store `env.SLOW` reaches, in a Durable Object as in a plain Worker. - `env.<binding>` reflects workerd's binding shape too: the workflow name moved from an own `_workflowName` property into a private slot, and the private `_create` helper off the prototype. - A config naming one class for two workflows, or naming `default`, is refused at deploy, as workerd refuses it (the class name is the key, and `default` is the Worker's handler). - Gate: new `workflow` fixture with `workflow-exports` and `workflow-exports-do`, both failing before this change (500: no `ctx.exports.Slow`). 242 cases agree.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 19 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
A module's
WorkflowEntrypointclass export is its Workflow's binding, keyed by the class name, as workerd keys it:ctx.exports.Slowis a[object WrappedBinding]over the same instance storeenv.SLOWreaches, in a Durable Object as in a stateless entrypoint. Reserved alias names stay hidden; configs naming one class for two workflows (ordefault) are refused at deploy, as workerd refuses them.Gate:
workflow-exports+workflow-exports-dofail before (500: noctx.exports.Slow) and all 246 cases agree after. Full suite, clippy, fmt and docs check green.Closes #266