fix(isolated-declarations): preserve unresolved parameter types - #25909
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
Monitor OxcCommit:
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: daf7d55700
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 393da97680
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2144ea357a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
235a101 to
8b19972
Compare
Merge activity
|
#25292 made isolated declaration emit report a false TS9025 for a defaulted parameter whose annotation is an indexed access type. This breaks Vite's `UserConfig["base"]` case when Rolldown upgrades Oxc, even though the indexed property already includes `undefined`. Oxc's isolated declaration emitter has no type checker, so it cannot safely resolve indexed accesses, type references, conditional types, or similar annotations. This change uses a syntax-only classification: widen or diagnose types whose syntax is conclusive, and preserve checker-dependent types rather than emit an unstable error. The union/intersection rules retain the distinct behavior of `any`, `never`, `unknown`, and `void`, and an explicit `undefined` union member is never duplicated. Regression coverage includes the Rolldown/Vite case and a compact matrix of the relevant type algebra. The implementation and tests were reduced to one commit after review. Validated with the isolated-declarations tests, strict Clippy, the all-features workspace suite, lint, docs, AST generation, and TypeScript 5.6.1-rc/6.0.3 type-algebra checks. The full local `just ready` run stopped only at a runner-dependent source-map snapshot because the repository expects Node 26.5.0 and this machine has 25.8.1; the remaining suite passed with that and the known terminal-color snapshot group skipped. Follow-up to #25292. Related Rolldown failure: https://github.com/rolldown/rolldown/actions/runs/32158377691/job/95782148042?pr=10707 Disclosure: this change was prepared and verified with AI assistance (Codex).
8b19972 to
134fb22
Compare
### 🚀 Features - 83cb516 minifier: Improve negation of expressions in boolean context (#25755) (Armano) ### 🐛 Bug Fixes - 134fb22 isolated-declarations: Preserve unresolved parameter types (#25909) (Dunqing) - 526c2b3 codegen: Remove deprecated test APIs (#25889) (camc314) - 344a9b2 codegen: Align enum template sourcemaps (#25872) (camc314) ### ⚡ Performance - 5ef0c93 minifier: Unwrap all unary exprs without creating dummy expressions (#25891) (Armano) - 8783524 packages/codegen: Remove loop from `growMappingBuffer` (#25886) (overlookmotel) - b6b14c0 packages/codegen: Remove redundant branch (#25885) (overlookmotel) - be6adf0 packages/sourcemap: Make `location` passed to `recordSourceMapping` always a number (#25884) (overlookmotel) - f720f15 packages/codegen: Take named-mapping only code off hot path in `recordSourceMapping` (#25883) (overlookmotel) - a734af5 packages/codegen: Remove redundant setting of `last` in `printImportAttributes` and `printIf` (#25882) (overlookmotel) - c6e44c6 packages/codegen: Combine 2 writes in `printJSXElement` (#25881) (overlookmotel) - 8801662 packages/codegen: Remove redundant mapping from `printParams` (#25880) (overlookmotel) ### 📚 Documentation - 5ad330e packages/codegen: Reformat comments (#25876) (overlookmotel)
Rolldown needs Oxc 0.146.0 to pick up the isolated-declarations fix for unresolved parameter types while retaining the 0.145.0 property-mangler migration. ### Regression fix Oxc 0.146.0 includes [oxc-project/oxc#25909](oxc-project/oxc#25909), which preserves unresolved parameter types during isolated declaration generation. This removes the declaration-generation failure observed in Rolldown's Vite compatibility job. The Rust workspace dependencies, `Cargo.lock`, and npm catalog packages (`@oxc-project/runtime`, `@oxc-project/types`, `oxc-parser`, and `oxc-transform`) now use 0.146.0. ### Breaking changes Both come from oxc's new property mangler: - `oxc::minifier::MinifierOptions` gained a required `mangle_properties: Option<ManglePropertiesOptions>` field. Set to `None` in all three initializers in `minify_options.rs` — the bundler does not plumb property mangling through. - `oxc_minify_napi::MinifyOptions` gained `mangleProps`, which leaked into rolldown's public `MinifyOptions` (`Omit<BindingMinifyOptions, 'module' | 'sourcemap'>`) and broke the `IsSchemaSubType` assertion in `validator.ts`. Added `'mangleProps'` to the `Omit`, since `normalize_binding_options` only reads `mangle`/`compress`/`codegen` and would silently drop the option. ### Snapshot churn - **Class bindings are now preserved by DCE** — `(class { static { foo } })` becomes `var A_keep = class { static { foo } };`. This accounts for most of the changed snapshots. - **`@__KEY__` / `#__KEY__` annotations are now emitted** by codegen (`mangle_props_key_comment*`, `preserve_key_comment`) — groundwork for the new property mangler. - **Better template-literal DCE** — `dce_template_literal` drops `var alsoKeep;` and `${alsoKeep}`, which is provably `undefined` and so has no `ToString` side effect. The esbuild compatibility metric is unchanged: `stats.md` stays at 688 passed / 87.42%, and every `summary/*.md` regenerated byte-identical, so none of these codegen changes move a case across the pass/fail line. ### Transitive updates `oxc-browserslist` 3.0.11 → 5.0.1, `oxc_sourcemap` 8.1.0 → 8.1.2, `oxc-miette` 4.0.0 dropped, `lazy-regex` 3.6.1 added (pulled in by the property mangler). Verified after rebasing onto current `main`: the full Rust workspace suite, parser and transformer package smoke tests, native Rolldown debug binding build, Vite monorepo build and declaration generation, plus 934 unit, 1,128 serve, 690 bundled-serve, and 923 build tests. Co-authored-by: Dunqing <dengqing0821@gmail.com> Co-authored-by: Jerry Zhao <165626830+shulaoda@users.noreply.github.com>
#25292 made isolated declaration emit report a false TS9025 for a defaulted parameter whose annotation is an indexed access type. This breaks Vite's
UserConfig["base"]case when Rolldown upgrades Oxc, even though the indexed property already includesundefined.Oxc's isolated declaration emitter has no type checker, so it cannot safely resolve indexed accesses, type references, conditional types, or similar annotations. This change uses a syntax-only classification: widen or diagnose types whose syntax is conclusive, and preserve checker-dependent types rather than emit an unstable error. The union/intersection rules retain the distinct behavior of
any,never,unknown, andvoid, and an explicitundefinedunion member is never duplicated.Regression coverage includes the Rolldown/Vite case and a compact matrix of the relevant type algebra. The implementation and tests were reduced to one commit after review.
Validated with the isolated-declarations tests, strict Clippy, the all-features workspace suite, lint, docs, AST generation, and TypeScript 5.6.1-rc/6.0.3 type-algebra checks. The full local
just readyrun stopped only at a runner-dependent source-map snapshot because the repository expects Node 26.5.0 and this machine has 25.8.1; the remaining suite passed with that and the known terminal-color snapshot group skipped.Follow-up to #25292. Related Rolldown failure: https://github.com/rolldown/rolldown/actions/runs/32158377691/job/95782148042?pr=10707
Disclosure: this change was prepared and verified with AI assistance (Codex).