Skip to content

Conversation

@drylint
Copy link
Contributor

@drylint drylint commented Dec 10, 2025

A breaking change has occurred between v4.6 and v4.5.

Before v4.6, vue-router use rollup to build, the rollup.config.mjs use es2015 as compress target:

// rollup.config.mjs in v4.5
function createMinifiedConfig(format) {
  return createConfig(
    format,
    {
      file: outputConfigs[format].file.replace(/.js$/, '.prod.js'),
      format: outputConfigs[format].format,
    },
    [
      terser({
        module: /^esm/.test(format),
        compress: {
          ecma: 2015,
          pure_getters: true,
        },
      }),
    ]
  )
}

Since version v4.6 switched to using tsdown for building, up until now the tsdown.config.ts configuration file has not specified a target for the production build.

As a result, the production build output of several v4.6 releases is no longer compatible with v4.5, showing noticeable inconsistencies in behavior — effectively introducing breaking changes.

Summary by CodeRabbit

  • Chores
    • Updated production build configuration to explicitly target ES2015 for browser and IIFE outputs, ensuring consistent JavaScript compatibility across production builds.

✏️ Tip: You can customize this high-level summary in your review settings.

@netlify
Copy link

netlify bot commented Dec 10, 2025

Deploy Preview for vue-router canceled.

Name Link
🔨 Latest commit cf0dab0
🔍 Latest deploy log https://app.netlify.com/projects/vue-router/deploys/693925d0ce868d0008768994

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 10, 2025

Walkthrough

The tsdown build configuration for the router package is updated to explicitly specify ES2015 as the target for production builds of esmBrowser and IIFE formats, ensuring consistent ES2015 output across these production configurations.

Changes

Cohort / File(s) Summary
Build Configuration
packages/router/tsdown.config.ts
Add explicit es2015 target specification to esmBrowserProd and iifeProd build configurations

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • posva

Poem

🐰 A rabbit hops through build configs with glee,
ES2015 targets, now for all to see!
esmBrowser, iife, both shiny and bright,
Production builds optimized just right! 🎯

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly relates to the main change: adding es2015 target to production builds to ensure v4.5 compatibility, addressing the breaking change introduced in v4.6.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9fc1c3 and cf0dab0.

📒 Files selected for processing (1)
  • packages/router/tsdown.config.ts (2 hunks)
🔇 Additional comments (3)
packages/router/tsdown.config.ts (3)

80-93: LGTM! ES2015 target restores v4.5 compatibility.

The addition of target: 'es2015' for the ESM browser production build correctly addresses the breaking change introduced when switching from Rollup/Terser to tsdown.


82-82: No action needed — 'es2015' is a valid tsdown target option.

The target: 'es2015' configuration is supported by tsdown and is a standard ECMAScript target version, consistent with TypeScript's own target values.


111-118: No action needed — cjsProd configuration is correct.

The omission of target: 'es2015' from cjsProd is intentional. The commit deliberately targets only browser-based production builds (esmBrowserProd and iifeProd) for ES2015 compatibility with v4.5, as stated in the PR scope. CJS builds target Node.js environments, which natively support ES2015+, so this constraint is unnecessary.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 10, 2025

Open in StackBlitz

npm i https://pkg.pr.new/vue-router@2591

commit: cf0dab0

@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.26%. Comparing base (c9fc1c3) to head (cf0dab0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2591   +/-   ##
=======================================
  Coverage   91.26%   91.26%           
=======================================
  Files          46       46           
  Lines        4180     4180           
  Branches     1113     1113           
=======================================
  Hits         3815     3815           
  Misses        358      358           
  Partials        7        7           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

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

Thanks!

@posva posva merged commit 42bc246 into vuejs:main Dec 10, 2025
9 checks passed
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.

2 participants