chore(deps): bump oxc + oxc_sourcemap to git refs; migrate to OwnedSourceMap#9567
Draft
Boshen wants to merge 4 commits into
Draft
chore(deps): bump oxc + oxc_sourcemap to git refs; migrate to OwnedSourceMap#9567Boshen wants to merge 4 commits into
Boshen wants to merge 4 commits into
Conversation
…urceMap Pin `oxc_sourcemap` to https://github.com/oxc-project/oxc-sourcemap rev `abae0f7` (current main) to pick up: * the `SourceMap<'a>` / `OwnedSourceMap` lifetime API — zero-copy borrow-parsed sourcemaps + a lifetime-free owned wrapper for downstream struct fields * the visualizer perf/correctness fix (oxc-project/oxc-sourcemap#344) — O(n²) `chars().nth()` scan that also misread CRLF after multi-byte UTF-8 And bump `oxc` (+ sibling crates) to the matching PR branch (oxc-project/oxc#22742), which migrates `oxc_codegen::CodegenReturn` to the new API. Restore both deps to crates.io pins once oxc cuts a release containing #22742. Migration: * `rolldown_sourcemap` re-exports `OwnedSourceMap as SourceMap` so downstream users get the lifetime-free wrapper unchanged. * `adjust_sourcemap_dst_lines` now uses `into_parts()` / `from_parts()`, moving names/sources/sourcesContent out of the input rather than re-allocating them. * `collapse_sourcemaps` borrows names/sources/sourcesContent from the first input via `Cow::Borrowed`, then detaches with `into_owned_sourcemap()` — no per-string allocation on the hot path. * `string_wizard::SourcemapBuilder::into_source_map` and `MagicString::source_map` return `OwnedSourceMap`. * `rolldown_ecmascript::EcmaCompiler::dce_or_minify` returns `Option<OwnedSourceMap>` via the bumped `oxc::codegen::CodegenReturn`. * `binding_magic_string` drops the `Arc`-based `SourceMap::new` round-trip used to attach `file` and just calls `OwnedSourceMap::set_file` in place. Drive-by API-drift fixes against oxc 0.133-dev (orthogonal to the sourcemap change but required to compile against the bumped `oxc`): * `DecoratorOptions::from` adds `..Default::default()` for the new `strict_null_checks` field. * `oxc_minify_napi::CodegenOptions` initializer adds `..Default::default()` for the new `legal_comments` field.
❌ Deploy Preview for rolldown-rs failed.
|
* `rolldown_plugin::build_hooks::transform_with_chain` — `|s| s.is_empty()` resolves to `str::is_empty` now that `SourceMap::get_source` / `get_source_content` return `Option<&str>` instead of `Option<&Arc<str>>`. Replace the two closures with method references to satisfy `-D clippy::redundant_closure_for_method_calls`. * `packages/rolldown/src/binding*` — regenerated by `just build-rolldown` so the napi-generated bindings expose the new `LegalCommentsMode` enum and `LegalCommentsLinked` interface introduced in `oxc_minify_napi` 0.133. The `Check no diff` step of the native build workflow rejected the previous bindings against the bumped oxc.
Regenerate insta snapshots for 30 integration tests whose output changed between `oxc` 0.132.0 (the previous workspace pin) and the 0.133-dev rev this PR bumps to. The diffs come from oxc's DCE / minifier / class-field transformer — not from `oxc_sourcemap` or anything else in this PR — but they have to be accepted for `cargo test` to go green against the bumped dependency. Captured by running `INSTA_UPDATE=new cargo test -p rolldown --test integration` followed by `cargo insta accept`. Reviewer should audit the snapshot diff — if any of the new outputs look like minifier regressions vs improvements, they should be raised against oxc rather than reverted here, since this PR can't avoid the bump.
oxc-sourcemap 7.0.0 has been released. Replace the temporary
`[patch.crates-io] oxc_sourcemap = { git, rev = "abae0f7" }` with a
normal `version = "7"` workspace-dependency pin and refresh the
lockfile. The oxc git refs stay until oxc-project/oxc#22742 lands and
oxc cuts a release containing the matching codegen migration.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
Summary
Pin
oxc_sourcemapto https://github.com/oxc-project/oxc-sourcemap revabae0f7(current main) to pick up:SourceMap<'a>/OwnedSourceMaplifetime API — zero-copy borrow-parsed sourcemaps plus a lifetime-free owned wrapper for downstream struct fieldschars().nth()scan that also misread CRLF after multi-byte UTF-8And bump
oxc(+ sibling crates) to the matching PR branch in oxc#22742, which migratesoxc_codegen::CodegenReturn::mapto the new API. Both pins revert to crates.io versions once oxc-sourcemap cuts the next release and oxc cuts a release containing #22742.Draft because it depends on those two upstream landings.
Rolldown migration
rolldown_sourcemapre-exportsOwnedSourceMap as SourceMapso downstream users get the lifetime-free wrapper transparently.adjust_sourcemap_dst_linesusesinto_parts()/from_parts(), moving names/sources/sourcesContent out of the input instead of re-allocating per string.collapse_sourcemapsborrows names/sources/sourcesContent from the first input viaCow::Borrowed, then detaches withinto_owned_sourcemap()— no per-string allocations on the hot path.string_wizard::SourcemapBuilder::into_source_mapandMagicString::source_mapreturnOwnedSourceMap.rolldown_ecmascript::EcmaCompiler::dce_or_minifyreturnsOption<OwnedSourceMap>via the bumpedoxc::codegen::CodegenReturn.binding_magic_stringdrops theArc-basedSourceMap::newround-trip that was used to attachfileand just callsOwnedSourceMap::set_filein place.Drive-by oxc 0.133-dev API-drift fixes
Required to compile against the bumped
oxc, orthogonal to the sourcemap change:DecoratorOptions::fromadds..Default::default()for the newstrict_null_checksfield.oxc_minify_napi::CodegenOptionsinitializer adds..Default::default()for the newlegal_commentsfield.🤖 Generated with Claude Code