Skip to content

refactor(build): share the production lifecycle - #3376

Draft
james-elicx wants to merge 6 commits into
codex/vite-command-contractfrom
codex/shared-build-lifecycle
Draft

james-elicx wants to merge 6 commits into
codex/vite-command-contractfrom
codex/shared-build-lifecycle

Conversation

@james-elicx

@james-elicx james-elicx commented Sep 22, 2026

Copy link
Copy Markdown
Member

Summary

  • extract production preparation and finalization into one typed lifecycle
  • preserve build identities, secrets, hybrid Pages builds, prerendering, standalone output, precompression, and reports
  • keep lifecycle reports visible even when Vite logging is silent
  • keep the existing CLI as the caller in this layer

Validation

  • lifecycle and command contract tests
  • vp check
  • vp run vinext#build

PR 2 of 7.

@james-elicx
james-elicx added this pull request to stack #3382 September 22, 2026 11:37
@pkg-pr-new

pkg-pr-new Bot commented Sep 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vinext/cloudflare

npm i https://pkg.pr.new/@vinext/cloudflare@3376

create-vinext-app

npm i https://pkg.pr.new/create-vinext-app@3376

@vinext/types

npm i https://pkg.pr.new/@vinext/types@3376

vinext

npm i https://pkg.pr.new/vinext@3376

@cloudflare/workers-response-store

npm i https://pkg.pr.new/@cloudflare/workers-response-store@3376

commit: 1f61de6

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues\n\nTime limit: 8 minutes. Complete the review and post all findings within that limit.

Comment thread packages/vinext/src/build/lifecycle.ts Outdated
@ask-bonk

ask-bonk Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Posted 1 actionable inline finding. Targeted test and checks passed.

github run

@github-actions

Copy link
Copy Markdown
Contributor
Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original
response-store-demo preview production
workers-cache preview production
kv preview production
static-export preview production
web preview production

@github-actions

github-actions Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 1f61de6 against base 45976d7 using alternating same-runner rounds. Next.js was unchanged and skipped.

1 improved · 0 regressed · 5 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 142.3 KB 142.3 KB ⚫ -0.0%
Client entry size (gzip) vinext 129.7 KB 129.7 KB ⚫ 0.0%
Dev server cold start vinext 3.44 s 3.38 s 🟢 -1.6%
Production build time vinext 3.80 s 3.80 s ⚫ +0.1%
RSC entry closure size (gzip) vinext 127.9 KB 127.9 KB ⚫ +0.0%
Server bundle size (gzip) vinext 226.0 KB 226.0 KB ⚫ +0.0%

View detailed results and traces

🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head

@james-elicx
james-elicx force-pushed the codex/shared-build-lifecycle branch from 142155d to 5419c80 Compare September 22, 2026 12:16
@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

Time limit: 8 minutes. Complete the review and post all findings within that limit.

@ask-bonk

ask-bonk Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues\n\nTime limit: 8 minutes. Complete the review and post all findings within that limit.

@james-elicx
james-elicx force-pushed the codex/shared-build-lifecycle branch from 5419c80 to e65cd2d Compare September 22, 2026 12:44
@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues\n\nTime limit: 8 minutes. Complete the review and post all findings within that limit.

Comment thread packages/vinext/src/build/lifecycle.ts Outdated
@ask-bonk

ask-bonk Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Posted 1 actionable inline finding.

github run

@james-elicx
james-elicx force-pushed the codex/shared-build-lifecycle branch from e65cd2d to 07becc3 Compare September 22, 2026 13:06
@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

Time limit: 8 minutes. Complete the review and post all findings within that limit.

Comment thread packages/vinext/src/build/lifecycle.ts Outdated
@ask-bonk

ask-bonk Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Posted 1 actionable inline finding. Targeted tests and checks passed.

github run

@james-elicx
james-elicx force-pushed the codex/shared-build-lifecycle branch from 07becc3 to 1f61de6 Compare September 22, 2026 13:37
@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues\n\nTime limit: 8 minutes. Complete the review and post all findings within that limit.

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

Time limit: 8 minutes. Complete the review and post all findings within that limit.

@ask-bonk

ask-bonk Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

Time limit: 8 minutes. Complete the review and post all findings within that limit.

@ask-bonk

ask-bonk Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

Time limit: 8 minutes. Complete the review and post all findings within that limit.

rscBuildIdentity: process.env.__VINEXT_SHARED_RSC_BUILD_IDENTITY,
rscCompatibilityId: process.env.__VINEXT_SHARED_RSC_COMPATIBILITY_ID,
};
prepareBuildOutput(lifecycleContext);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Keep the standalone preflight ahead of dependency upgrades

This call now performs the standalone vinext dist/ existence check, but it runs after the getReactUpgradeDeps() block above. Previously that preflight ran before the automatic package-manager invocation, so a broken/source installation failed without modifying the application; now an App Router project that needs a React upgrade can install dependencies and only then hit the predictable missing-dist error. Please split the standalone validation from output cleanup (or otherwise run just that check before the React upgrade) while retaining cleanup at its current phase.

@ask-bonk

ask-bonk Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Posted 1 actionable inline finding.

github run

@ask-bonk

ask-bonk Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

@ask-bonk

ask-bonk Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

@james-elicx Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant