Uh oh!
There was an error while loading. Please reload this page.
feat(builders): add an after-transform observer - #3163
Conversation
🦋 Changeset detectedLatest commit: 1f7007b 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 |
@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
commented
Jul 29, 2026
@vercel/workflow ready for review |
VaguelySerious
commented
Jul 31, 2026
@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? |
c0005fa to
60043a0Comparelucamaraschi
commented
Aug 2, 2026
Thanks! I squashed the branch into a single signed commit and force-pushed it. We’re using this for Platformatic’s Workflow Upgrade Risk tooling, based on our white paper. It compares workflow versions and estimates whether an upgrade can safely drain or requires preserving the originating deployment. |
VaguelySerious
commented
Aug 3, 2026
Thanks! It looks like the commits still aren't signed, however. This is sadly a hard policy and I can't merge without |
Signed-off-by: Luca Maraschi <luca.maraschi@gmail.com>
e037f22 to
1f7007bComparelucamaraschi
commented
Aug 10, 2026
Sorry @VaguelySerious, it should be signed now. |
VaguelySerious
commented
Aug 10, 2026
Thanks! Will merge once CI run completes |
Uh oh!
There was an error while loading. Please reload this page.
No backport to This commit adds a new optional To override, re-run the Backport to stable workflow manually via |
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