Skip to content

fix(compat): add entities to @vue/compat deps to fix CJS edge cases#12514

Merged
edison1105 merged 2 commits intovuejs:mainfrom
haoqunjiang:fix-compat-cjs-deps
Mar 4, 2026
Merged

fix(compat): add entities to @vue/compat deps to fix CJS edge cases#12514
edison1105 merged 2 commits intovuejs:mainfrom
haoqunjiang:fix-compat-cjs-deps

Conversation

@haoqunjiang
Copy link
Copy Markdown
Member

@haoqunjiang haoqunjiang commented Dec 9, 2024

Fixes #10609

Unlike the vue package, direct dependencies of @vue/compat are not externalized:

// externalize all direct deps unless it's the compat build.

So it depends on entities directly in its CJS build, unlike the vue one which indirectly depends on it via @vue/compiler-core. So entities must be explicitly added to @vue/compat deps to avoid incorrect dependency resolution due to different node_modules layouts, such as in #10609 (comment)

Summary by CodeRabbit

  • Chores
    • Unified dependency version management through a centralized catalog system to improve consistency across packages.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 9, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB 37.9 kB 34.2 kB
vue.global.prod.js 158 kB 57.8 kB 51.4 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.6 kB 18.3 kB 16.7 kB
createApp 54.6 kB 21.3 kB 19.4 kB
createSSRApp 58.7 kB 23 kB 20.9 kB
defineCustomElement 59.4 kB 22.8 kB 20.8 kB
overall 68.4 kB 26.4 kB 24 kB

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Dec 9, 2024

Open in StackBlitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@12514
npm i https://pkg.pr.new/@vue/compiler-core@12514
yarn add https://pkg.pr.new/@vue/compiler-core@12514.tgz

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@12514
npm i https://pkg.pr.new/@vue/compiler-dom@12514
yarn add https://pkg.pr.new/@vue/compiler-dom@12514.tgz

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@12514
npm i https://pkg.pr.new/@vue/compiler-sfc@12514
yarn add https://pkg.pr.new/@vue/compiler-sfc@12514.tgz

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@12514
npm i https://pkg.pr.new/@vue/compiler-ssr@12514
yarn add https://pkg.pr.new/@vue/compiler-ssr@12514.tgz

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@12514
npm i https://pkg.pr.new/@vue/reactivity@12514
yarn add https://pkg.pr.new/@vue/reactivity@12514.tgz

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@12514
npm i https://pkg.pr.new/@vue/runtime-core@12514
yarn add https://pkg.pr.new/@vue/runtime-core@12514.tgz

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@12514
npm i https://pkg.pr.new/@vue/runtime-dom@12514
yarn add https://pkg.pr.new/@vue/runtime-dom@12514.tgz

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@12514
npm i https://pkg.pr.new/@vue/server-renderer@12514
yarn add https://pkg.pr.new/@vue/server-renderer@12514.tgz

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@12514
npm i https://pkg.pr.new/@vue/shared@12514
yarn add https://pkg.pr.new/@vue/shared@12514.tgz

vue

pnpm add https://pkg.pr.new/vue@12514
npm i https://pkg.pr.new/vue@12514
yarn add https://pkg.pr.new/vue@12514.tgz

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@12514
npm i https://pkg.pr.new/@vue/compat@12514
yarn add https://pkg.pr.new/@vue/compat@12514.tgz

commit: 6dff884

Fixes vuejs#10609

Unlike the `vue` package, direct dependencies of `@vue/compat` are not
externalized:
https://github.com/vuejs/core/blob/201936f9a3909ae9dca4e131e1f5ad5a1c0feb77/rollup.config.js#L274

So it depends on `entities` directly in its CJS build, unlike the `vue`
one which indirectly depends on it via `@vue/compiler-core`.
So `entities` must be explicitly added to `@vue/compat` deps to avoid
incorrect dependency resolution due to different `node_modules` layouts,
such as in vuejs#10609 (comment)
@haoqunjiang haoqunjiang added the ready for review This PR requires more reviews label Dec 10, 2024
@markrian
Copy link
Copy Markdown
Contributor

markrian commented Mar 2, 2026

@edison1105 Would you be able to take another look at this?

# Conflicts:
#	packages/compiler-core/package.json
#	pnpm-lock.yaml
#	pnpm-workspace.yaml
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b47232c5-9831-49dc-8ac0-b352318f8514

📥 Commits

Reviewing files that changed from the base of the PR and between ea24576 and 65ff428.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • packages/compiler-core/package.json
  • packages/vue-compat/package.json
  • pnpm-workspace.yaml

📝 Walkthrough

Walkthrough

The pull request updates package dependencies to use pnpm's catalog feature for centralized version management. The "entities" package is moved from direct version specifications to catalog references, with the version declared once in the workspace configuration.

Changes

Cohort / File(s) Summary
Catalog Configuration
pnpm-workspace.yaml
Added "entities": "^7.0.1" entry to the catalog section for centralized dependency version management.
Dependency Updates
packages/compiler-core/package.json, packages/vue-compat/package.json
Updated and added "entities" dependencies to use catalog reference ("catalog:") instead of direct version specification.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

dependencies

Poem

🐰 Hopping through the catalog with glee,
Dependencies now unified, wild and free,
One version declared for all to share,
Less duplication floating in the air!
No more confusion, just clarity clear—
The entities package is welcome here! 🌱

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding 'entities' to @vue/compat dependencies to fix CJS edge cases.
Linked Issues check ✅ Passed The PR directly addresses #10609 by adding the 'entities' dependency to @vue/compat, enabling proper module resolution in Jest and fixing the EntityDecoder constructor error.
Out of Scope Changes check ✅ Passed All changes are directly related to resolving the entities dependency issue: updating compiler-core's entities reference, adding entities to vue-compat dependencies, and declaring entities in the pnpm catalog.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

@haoqunjiang haoqunjiang added ready to merge The PR is ready to be merged. and removed ready for review This PR requires more reviews labels Mar 4, 2026
@haoqunjiang haoqunjiang requested a review from edison1105 March 4, 2026 13:49
@edison1105 edison1105 merged commit e725a67 into vuejs:main Mar 4, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vue compat with Jest: "TypeError: decode_js.EntityDecoder is not a constructor"

3 participants