Repository navigation
chore(deps): update rolldown to 1.2.12 - #74
Merged
Merged
Conversation
Update both rolldown entries of the catalog to 1.2.12: @rolldown/browser, which @vrowzer/rolldown bundles for the browser, and the Node rolldown. Vite 8.3.1, whose build code #36 ports, expects rolldown ~1.2.11. The Node rolldown moves with @rolldown/browser because: - The vite-dev-server port takes its types from rolldown and its runtime from @vrowzer/rolldown. With only @rolldown/browser updated, the types no longer match the runtime. - vite-dev-server tells plugins the rolldownVersion of rolldown's package.json, which should be the version that runs. The catalog change makes pnpm resolve the workspace again. Besides rolldown and its dependencies (@emnapi/core and @emnapi/runtime 2.0.0-alpha.5, @emnapi/wasi-threads 2.1.0, @oxc-project/types 0.152.0), some projects move to versions that the lockfile already had, such as vue 3.5.40, @vitejs/plugin-vue 6.0.8, publint 0.3.22 and postcss 8.5.23. The e2e manifests of vite-vue and vite-react are generated again for vue 3.5.40 and the new prebundle hashes. pnpm 12.1.0 drops the vite entry of e2e/vite-vue, packages/service-worker-server and packages/vrowzer when it resolves the workspace again, then rejects the lockfile with --frozen-lockfile (ERR_PNPM_OUTDATED_LOCKFILE). The three entries are added back by hand, with the resolution of the other projects. A normal install keeps them.
The experimental entries of @vrowzer/rolldown bundle @rolldown/browser/experimental, so they already export the Vite plugins that rolldown implements natively. Their generated type declarations named only viteJsonPlugin and viteTransformPlugin, though. Declare the other plugins in both builds (the one that shares @vrowzer/fs and the standalone ./browser one): viteLoadFallbackPlugin, viteBuildImportAnalysisPlugin, viteModulePreloadPolyfillPlugin, viteReporterPlugin, viteManifestPlugin, viteDynamicImportVarsPlugin, viteImportGlobPlugin, viteAliasPlugin, viteResolvePlugin and viteWebWorkerPostPlugin. The browser build of #36 uses them as upstream Vite's build does.
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.
Part of #36
This PR updates rolldown to 1.2.12, both
@rolldown/browser(which@vrowzer/rolldownbundles for the browser) and the Noderolldown. It is stage 0 of #36. The next stage ports the build code of Vite 8.3.1 to a build Worker, and Vite 8.3.1 expectsrolldown ~1.2.11. On 1.2.12, the ported code can keep its upstream form.Changes
Catalog:
rolldownand@rolldown/browserare 1.2.12.rolldownmoves too, for two reasons. The vite-dev-server port takes its types fromrolldownand its runtime from@vrowzer/rolldown; with only@rolldown/browserupdated, the types no longer match the runtime. And vite-dev-server tells plugins therolldownVersionof the Noderolldown, which should be the version that runs.vite(vite-plus-core 0.3.0) bundles its own rolldown 1.2.5, so it does not change.Types:
@vrowzer/rolldown/experimentalnow declares the Vite plugins that rolldown implements natively:viteLoadFallbackPlugin,viteBuildImportAnalysisPlugin,viteModulePreloadPolyfillPlugin,viteReporterPlugin,viteManifestPluginviteDynamicImportVarsPlugin,viteImportGlobPlugin,viteAliasPlugin,viteResolvePlugin,viteWebWorkerPostPluginThe runtime already exported them, since the experimental entries bundle
@rolldown/browser/experimental. Only the generated declarations lacked them. The browser build of Add vrowzer.build() for browser-side production builds #36 uses them, as upstream Vite's build does.The rolldown integration test expects the version
1.2.12.Lockfile
The catalog change makes pnpm resolve the workspace again.
New in the lockfile: rolldown 1.2.12 and its bindings,
@rolldown/browser1.2.12,@emnapi/coreand@emnapi/runtime2.0.0-alpha.5 (from alpha.4),@emnapi/wasi-threads2.1.0 (from 2.0.1) and@oxc-project/types0.152.0. Nothing else is new.Moved to versions that the lockfile already had:
vue@vitejs/plugin-vuepublintobugwsbirpcpostcsslightningcss@babel/parser@types/estreemllypicomatchtinyglobbyufoThe Service Worker and Web Worker bundles of
@vrowzer/vite-dev-serverinclude their dependencies, so the published bundles get the newerbirpc,postcss,picomatchand so on. The version ranges in thepackage.jsonfiles do not change.e2e manifests: the manifests of vite-vue (paths of vue 3.5.40) and vite-react (new hashes of the prebundled react-dom server files) are generated again.
A workaround for pnpm 12.1.0: after it resolves the workspace again, pnpm 12.1.0 drops the
viteentry of three projects:e2e/vite-vue,packages/service-worker-serverandpackages/vrowzer.--frozen-lockfile, which CI uses, rejects that lockfile:ERR_PNPM_OUTDATED_LOCKFILE, "1 dependency was added: vite@npm:@voidzero-dev/vite-plus-core@0.3.0".node_modules/vitelink, so their imports fell back to the root'svite.packages/fs,e2e/vite-react).vp install --frozen-lockfilepasses, also in a fresh worktree, and linksvitein the three projects.vp installandvp install --lockfile-onlyreport "Already up to date" and keep the lockfile as it is.npm:alias overrides (herevite: 'catalog:'), such asoverrideswith annpm:alias is dropped when pnpm 12 re-resolves a locked dependency (resolves the real package instead) pnpm/pnpm#16309.pnpm install --fix-lockfilebroke the install instead (vite-pluscould not find@voidzero-dev/vite-plus-core), so I did not use it.Other effects
examples/vuenow includes@babel/helper-string-parser. Before, the build treated it as external, with anUNRESOLVED_IMPORTwarning.There are no breaking changes.
Tests
All on macOS (arm64):
vp install --frozen-lockfilepasses, also in a fresh worktree.vp run build, the type checks, oxlint, knip and the format check pass. The format check skips the lockfile.Unit tests: 1974 passed, 3 skipped, the same as
main.Integration tests:
1.2.12e2e, with the Vite caches cleared first:
main.The types: an import of the ten plugins from
@vrowzer/rolldown/experimentalin vite-dev-server type-checks. A name that does not exist fails with TS2305. The import was not committed.CI runs the WASM and its thread Workers on Linux for the first time with 1.2.12.