fix: preserve Nitro workflow step registration side effects#1386
Open
comfuture wants to merge 2 commits intovercel:mainfrom
Open
fix: preserve Nitro workflow step registration side effects#1386comfuture wants to merge 2 commits intovercel:mainfrom
comfuture wants to merge 2 commits intovercel:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 2d6de62 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 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
|
@comfuture is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
Collaborator
|
@VaguelySerious @pi0 what do you think? |
Collaborator
|
LGTM if it is delibrate to even have side effects... Is there any backstory to this? (why we need side-effects?) |
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.
Summary
POSTexportworkflow/steps.mjsWhy
In Nitro/Nuxt local production builds, the generated
workflow/steps.mjsbundle can be treated as a pure export provider when the virtual handler only imports{ POST }. That allows the step bundle's top-levelregisterStepFunction(...)calls to disappear from the final Nitro server bundle, which leads to runtime failures likeStep \"...\" not foundwhen a queued step executes.Importing the generated bundle for side effects before consuming
POSTkeeps the registration code in the final server output.Validation
pnpm vitest run packages/nitro/src/index.test.tspnpm --filter @workflow/example-nuxt buildregisterStepFunction(...)calls for app steps after this change