-
Notifications
You must be signed in to change notification settings - Fork 106
Support closure variables for serialized step functions #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: factory-with-step-method
Are you sure you want to change the base?
Support closure variables for serialized step functions #366
Conversation
🦋 Changeset detectedLatest commit: 76cb745 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
a48a0af to
76cb745
Compare
3fbc15f to
411677b
Compare

Added support for closure variables in serialized step functions, allowing step functions to access variables from their lexical scope when executed remotely.
What changed?
StepFunctionreducer to capture and serialize closure variablesStepFunctionreviver to restore closure variables in the execution contextWhy make this change?
Previously, serialized step functions could only access their arguments when executed remotely, but not variables from their lexical scope. This limitation made it difficult to write reusable step functions that needed to access shared configuration or context. This change enables more natural programming patterns by allowing step functions to access closure variables, making the code more intuitive and reducing the need to pass all context as function arguments.