Skip to content

Conversation

edison1105
Copy link
Member

@edison1105 edison1105 commented Aug 18, 2025

close #13744

Summary by CodeRabbit

  • Bug Fixes
    • Ensures the visibility directive’s name is assigned in more build scenarios, improving the clarity of hydration mismatch details and related diagnostics.
    • Enhances developer-facing messages and tooling output by consistently exposing directive names where applicable.
    • No impact on runtime behavior or public APIs; end-users may see clearer warnings or logs in environments that surface hydration or rendering diagnostics.

Copy link

coderabbitai bot commented Aug 18, 2025

Walkthrough

The vShow directive’s name assignment is now gated by (DEV || FEATURE_PROD_HYDRATION_MISMATCH_DETAILS), ensuring vShow.name = 'show' in development and when the production hydration mismatch details feature is enabled. No other logic or exports were modified.

Changes

Cohort / File(s) Summary
Directive metadata tweak
packages/runtime-dom/src/directives/vShow.ts
Broadened condition for setting vShow.name from DEV to (DEV

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Eliminate SSR hydration mismatch error for v-show + style attr (#13744) Only adjusts directive name assignment under specific flags; does not change hydration or v-show/style behavior.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Set vShow.name when (DEV

Suggested labels

:hammer: p3-minor-bug, scope:hydration

Suggested reviewers

  • Doctor-wu
  • LittleSound
  • KazariEX
  • baiwusanyu-c

Poem

In burrows of code I hop with delight,
A name now shows in dev and in night,
When hydration whispers, the tag shall glow—
“show,” it squeaks, so debuggers know.
Thump-thump, I log, with ears held high,
Small tweak today; bigger bugs goodbye. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch edison/fix/13744

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

pkg-pr-new bot commented Aug 18, 2025

Open in StackBlitz

@vue/compiler-core

npm i https://pkg.pr.new/@vue/compiler-core@13777

@vue/compiler-dom

npm i https://pkg.pr.new/@vue/compiler-dom@13777

@vue/compiler-sfc

npm i https://pkg.pr.new/@vue/compiler-sfc@13777

@vue/compiler-ssr

npm i https://pkg.pr.new/@vue/compiler-ssr@13777

@vue/reactivity

npm i https://pkg.pr.new/@vue/reactivity@13777

@vue/runtime-core

npm i https://pkg.pr.new/@vue/runtime-core@13777

@vue/runtime-dom

npm i https://pkg.pr.new/@vue/runtime-dom@13777

@vue/server-renderer

npm i https://pkg.pr.new/@vue/server-renderer@13777

@vue/shared

npm i https://pkg.pr.new/@vue/shared@13777

vue

npm i https://pkg.pr.new/vue@13777

@vue/compat

npm i https://pkg.pr.new/@vue/compat@13777

commit: e921bcc

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/runtime-dom/src/directives/vShow.ts (1)

48-50: Clarify vShow.name guard and verify feature flag declaration

  • The __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__ macro is declared in packages/global.d.ts.
  • No other directives in packages/runtime-dom/src/directives/ assign .name, so no additional guards are needed.

Optional: add an explanatory comment before the guard to document why we expose the directive name in production mismatch logs:

 packages/runtime-dom/src/directives/vShow.ts
@@
- if (__DEV__ || __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__) {
+ // Expose directive name when hydration mismatch details are enabled in prod
+ // so hydration errors can reference "v-show" explicitly.
+ if (__DEV__ || __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__) {
     vShow.name = 'show'
   }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c875019 and e921bcc.

📒 Files selected for processing (1)
  • packages/runtime-dom/src/directives/vShow.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Redirect rules
  • GitHub Check: Header rules
  • GitHub Check: continuous-release
  • GitHub Check: Pages changed
🔇 Additional comments (1)
packages/runtime-dom/src/directives/vShow.ts (1)

48-50: LGTM: correctly gate vShow.name for prod hydration mismatch details

Setting vShow.name when __DEV__ || __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__ is true aligns with how other diagnostics are exposed and should unblock richer mismatch messaging in flagged prod builds without affecting normal prod bundles. No runtime behavior changes to v-show itself.

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 101 kB 38.4 kB 34.6 kB
vue.global.prod.js 159 kB 58.6 kB 52.2 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.6 kB 18.2 kB 16.7 kB
createApp 54.6 kB 21.2 kB 19.4 kB
createSSRApp 58.8 kB 23 kB 20.9 kB
defineCustomElement 59.6 kB 22.8 kB 20.8 kB
overall 68.7 kB 26.4 kB 24.1 kB

@edison1105 edison1105 added ready to merge The PR is ready to be merged. 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope:hydration labels Aug 18, 2025
@edison1105 edison1105 merged commit 439e1a5 into main Aug 20, 2025
16 checks passed
@edison1105 edison1105 deleted the edison/fix/13744 branch August 20, 2025 12:41
edison1105 added a commit that referenced this pull request Aug 25, 2025
close #13805
re-fix #13744
revert #13777

The implementation in #13777 requires users to configure __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__, otherwise errors like #13805 will occur.
9romise pushed a commit to 9romise/core that referenced this pull request Sep 23, 2025
)

close vuejs#13805
re-fix vuejs#13744
revert vuejs#13777

The implementation in vuejs#13777 requires users to configure __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__, otherwise errors like vuejs#13805 will occur.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. ready to merge The PR is ready to be merged. scope:hydration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSR hydration mismatch warning/error with v-show + style attr

1 participant