-
Notifications
You must be signed in to change notification settings - Fork 117
Support nested "use step" declarations in non-workflow functions
#418
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
Merged
TooTallNate
merged 4 commits into
main
from
11-25-support_nested_use_step_declarations_in_non-workflow_functions
Nov 27, 2025
Merged
Support nested "use step" declarations in non-workflow functions
#418
TooTallNate
merged 4 commits into
main
from
11-25-support_nested_use_step_declarations_in_non-workflow_functions
Nov 27, 2025
Conversation
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
🦋 Changeset detectedLatest commit: bef8c1c The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 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 |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
"use step" declarations in non-workflow functions
VaguelySerious
approved these changes
Nov 26, 2025
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.

Added support for nested
"use step"declarations in non-workflow functions.What changed?
This PR enhances the SWC plugin to properly handle "use step" declarations that appear inside regular functions, not just workflow functions. The implementation:
How to test?
Test by creating nested step functions inside regular functions:
Verify that these functions are properly hoisted and transformed in step mode, and that they work correctly in workflow and client modes.
Why make this change?
Previously,
"use step"declarations were only properly handled when they appeared at the module level or inside workflow functions. This limitation prevented developers from creating utility functions that return or contain step functions. This change enables more flexible code organization patterns, allowing step functions to be created and returned from any function context.