-
Notifications
You must be signed in to change notification settings - Fork 105
Apply SWC transformation on step functions returned from factory function #360
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: swc-closure-scope-var-in-steps
Are you sure you want to change the base?
Apply SWC transformation on step functions returned from factory function #360
Conversation
🦋 Changeset detectedLatest commit: 411677b 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 |
|
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. |
packages/swc-plugin-workflow/transform/tests/fixture/factory-with-step-method/output-client.js
Show resolved
Hide resolved
2ade117 to
3fbc15f
Compare
1f99feb to
95f5114
Compare
2f8dded to
cd44969
Compare
3fbc15f to
411677b
Compare

Added support for transforming step functions that are returned from factory functions.
What changed?
Enhanced the SWC plugin to detect and transform step functions that are defined within object literals returned by factory functions. The transformation now properly identifies arrow functions with object literal bodies and processes their step functions accordingly.
Added test fixtures to verify the functionality:
How to test?
Why make this change?
This enhancement supports a common pattern where developers create factory functions that return objects containing step methods. Without this change, step functions defined in this pattern weren't being properly transformed, which limited the flexibility of the workflow system.