perf(next-plugin): profile and reuse Turbopack prewarm output - #645
Conversation
Changepacks@devup-ui/wasm@1.0.78 - bindings/devup-ui-wasm/package.jsonMaybe you forgot to write the following files to the latest version @devup-ui/bun-plugin@1.0.15 - packages/bun-plugin/package.jsonMaybe you forgot to write the following files to the latest version @devup-ui/components@0.1.53 - packages/components/package.jsonMaybe you forgot to write the following files to the latest version @devup-ui/eslint-plugin@1.0.18 - packages/eslint-plugin/package.jsonMaybe you forgot to write the following files to the latest version @devup-ui/next-plugin@1.0.83 - packages/next-plugin/package.jsonMaybe you forgot to write the following files to the latest version @devup-ui/plugin-utils@1.0.13 - packages/plugin-utils/package.jsonMaybe you forgot to write the following files to the latest version @devup-ui/react@1.0.40 - packages/react/package.jsonMaybe you forgot to write the following files to the latest version @devup-ui/reset-css@1.0.27 - packages/reset-css/package.jsonMaybe you forgot to write the following files to the latest version @devup-ui/rsbuild-plugin@1.0.61 - packages/rsbuild-plugin/package.jsonMaybe you forgot to write the following files to the latest version @devup-ui/vite-plugin@1.0.67 - packages/vite-plugin/package.jsonMaybe you forgot to write the following files to the latest version @devup-ui/webpack-plugin@1.0.66 - packages/webpack-plugin/package.jsonMaybe you forgot to write the following files to the latest version |
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
c417e05 to
679c2ec
Compare
|
Dependency refresh and CI benchmark update completed.
The local Bun test-cache false failure was traced to a stale absolute path from another worktree in Bun's global transpiler cache; rerunning with Bun's documented |
|
Follow-up warning cleanup is complete at
Validation:
Latest CI cold-build medians were Tailwind Turbo 7.43s vs Devup UI single Turbo 7.52s; the immediately previous green run was 6.72s vs 6.68s. The sign flips within ~0.1s, so the fair conclusion remains effective parity/runner variance, not a decisive performance win. The latest direct sample was 7.75s vs 7.61s in Devup UI's favor. |
Summary
DEVUP_UI_PROFILE=1structured Turbopack timings for graph setup, production prewarm, coordinator extraction, snapshots, serialization, and writessingleCssand per-file mode, avoiding duplicate WASM extraction and duplicate snapshot/write work on repeated Turbopack loader requestsstyle({...}).css.ts/.css.jsmodules to Devupcss({...})before extraction, allowing those builds to use the lite engine; variables, calls, spreads, extra statements, theme APIs, development mode, and source-map builds retain the full Boa enginebenchmark.jscomparison cold and order-balanced: clear.next,dist,df, andtsconfig.tsbuildinfo, use Turbopack for all three compared targets, alternate order, and report six-sample mediansNo separate benchmark workflow was added.
bun.lockremains unrelated and excluded. The add-bench PR was not touched.Correctness boundary
The static fast path accepts only one
styleimport and exportedstyle()calls whose values are recursively static objects, arrays, strings, numbers, booleans, ornull. Anything executable or unsupported fails closed to the existing full evaluator. Watch mode and production browser source maps always use full WASM. Public React declarations and theme inference are unchanged.An actual production Turbopack build of the vanilla fixture selected
wasmVariant:"lite"; its generated CSS matched the previous full build, prewarm extraction was 0.69 ms on the build config evaluation, and every loader request was a byte-identical cache hit withextractMs:0. An actual build after changing the fixture to use a local variable selectedwasmVariant:"full"and also succeeded; that temporary fixture change was reverted.Validation
Existing benchmark.js CI results
All rows are six cold samples in the existing Publish workflow. Initial one-shot records are excluded from medians.
4858b339Tailwind Turbo4858b339Devup static.css.ts4858b339Devup direct APIs / singleCss4b94b161Tailwind Turbo4b94b161Devup full Boa.css.tsThe optimized static
.css.tsfixture is 30 ms faster by independent medians; the median of its six same-round Devup-minus-Tailwind deltas is about -20 ms. The ranges overlap, so the defensible conclusion is a narrow win/parity within CI-runner noise, not a universal performance victory. Dynamic.css.tsstill takes the full Boa path; the prior fair run was 80 ms slower by independent medians, so this PR does not claim a dynamic-full victory.Rejected experiments and benchmark limits
-O3increased WASM size/package-build time and regressed the CI median; compactz/-Ozsettings remainThe fixtures are not semantically identical: Tailwind uses untyped class strings and emits framework CSS, while Devup validates typed style props and emits much less CSS. The benchmark is useful for regression/directional evidence, not proof that either library is always faster. Type checking and inference were deliberately not weakened.