feat(builders): add an after-transform observer - #3163
Open
lucamaraschi wants to merge 1 commit into
Open
Conversation
Signed-off-by: Luca Maraschi <luca.maraschi@gmail.com>
🦋 Changeset detectedLatest commit: c0005fa 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
|
@lucamaraschi is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
lucamaraschi
marked this pull request as ready for review
July 29, 2026 21:07
Author
|
@vercel/workflow ready for review |
VaguelySerious
approved these changes
Jul 31, 2026
Member
|
@lucamaraschi We require commits to be signed. Could you squash+sign the PR and force-push? Also, I'm curious what you're using this for! Can you share an example? |
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.
Description
Add an optional
onAfterTransformobserver to@workflow/builders.The observer exposes the accepted result of each workflow SWC transform, including:
The callback runs only after the transformed manifest has been validated and accepted into the bundle manifest. It is awaited, and throwing from it aborts the build.
The observer cannot replace generated code. A source file may be observed multiple times across transform modes, bundles, and watch rebuilds.
BaseBuilderpropagates the observer through step, workflow, and client bundle creation. The API is optional and has no effect on existing builder integrations.How did you test your changes?
Added focused tests covering:
Validation performed:
pnpm --filter @workflow/builders buildpnpm --filter @workflow/builders typecheckpnpm --filter @workflow/builders testgit diff --check main...HEADPR Checklist - Required to merge
pnpm changesetwas run to create a changelog for this PR@workflow/buildersAPI@vercel/workflowin a comment once the PR is ready