Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/corePublic

fix(slots): refine internal key checking logic#13612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
edison1105 wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromedison/fix/13611

Conversation

edison1105
Copy link
Member

@edison1105edison1105 commentedJul 10, 2025
edited by coderabbitaibot
Loading

close#13611

Summary by CodeRabbit

  • Refactor
    • Refined internal key recognition to a specific set of keys for improved slot handling.
  • Tests
    • Enhanced slot tests to verify rendering of slots with underscore-prefixed names and normalized slot values.

@coderabbitaicoderabbitai
Copy link

coderabbitaibot commentedJul 10, 2025
edited
Loading

Walkthrough

TheisInternalKey function incomponentSlots.ts was changed to explicitly check for the keys'_','__','_ctx', and'$stable' instead of any key starting with an underscore or equal to'$stable'. The test suite was updated to verify that slots with names starting with an underscore (e.g.,_foo) are rendered correctly.

Changes

File(s)Change Summary
packages/runtime-core/src/componentSlots.tsChangedisInternalKey to explicitly check keys'_','__','_ctx', and'$stable' only.
packages/runtime-core/tests/componentSlots.spec.tsAdded tests to confirm slots with names starting with underscore render correctly and updated warnings/assertions for_inner slot.

Sequence Diagram(s)

sequenceDiagram    participant ParentComponent    participant isInternalKey    participant assignSlots    participant ChildComponent    ParentComponent->>assignSlots: Provide slot keys (including keys starting with '_')    assignSlots->>isInternalKey: Check if key is internal (only '_', '__', '_ctx', '$stable')    isInternalKey-->>assignSlots: Return true/false    assignSlots->>ChildComponent: Assign slots excluding only internal keys
Loading

Possibly related PRs

Suggested labels

ready to merge,:exclamation: p4-important

Poem

🐇
A slot once lost in underscore's shade,
Now shines again, no longer delayed.
Keys once hidden, now come to light,
Rendering slots just right, in sight.
With careful checks and tests aligned,
The rabbit hops, code redefined!
✨🐰


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between95e4120 and4139e22.

📒 Files selected for processing (2)
  • packages/runtime-core/__tests__/componentSlots.spec.ts (4 hunks)
  • packages/runtime-core/src/componentSlots.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/runtime-core/src/componentSlots.ts
🔇 Additional comments (4)
packages/runtime-core/__tests__/componentSlots.spec.ts (4)

9-9:LGTM! Import addition is appropriate.

TheserializeInner import is correctly added and used in the new test case to verify rendered output.


78-80:LGTM! Warning expectation correctly added for_inner slot.

The warning expectation aligns with the behavior change where_inner slots are now treated as regular slots instead of internal keys, triggering the non-function value warning.


91-91:LGTM! Assertion correctly updated to reflect new behavior.

The assertion properly validates that_inner slots are now accessible and return the expected normalized vnode, confirming the fix to internal key checking logic.


451-467:LGTM! New test case effectively validates the core fix.

This test case properly verifies that slots with underscore-prefixed names (like_foo) are now correctly rendered instead of being treated as internal keys. The test structure is consistent with existing patterns and provides clear validation of the refined internal key checking logic.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat withCodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings togenerate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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 theconfiguration 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

Documentation and Community

  • Visit ourDocumentation for detailed information on how to use CodeRabbit.
  • Join ourDiscord Community to get help, request features, and share feedback.
  • Follow us onX/Twitter for updates and announcements.

@github-actionsGitHub Actions
Copy link

github-actionsbot commentedJul 10, 2025
edited
Loading

Size Report

Bundles

FileSizeGzipBrotli
runtime-dom.global.prod.js101 kB (+19 B)38.4 kB (+7 B)34.6 kB (+70 B)
vue.global.prod.js159 kB (+19 B)58.5 kB (+7 B)52.1 kB (+46 B)

Usages

NameSizeGzipBrotli
createApp (CAPI only)46.5 kB (+19 B)18.2 kB (+6 B)16.7 kB (+5 B)
createApp54.5 kB (+19 B)21.2 kB (+6 B)19.4 kB (+10 B)
createSSRApp58.7 kB (+19 B)22.9 kB (+4 B)20.9 kB (+3 B)
defineCustomElement59.5 kB (+19 B)22.8 kB (+5 B)20.8 kB (+58 B)
overall68.6 kB (+19 B)26.4 kB (+9 B)24 kB (-6 B)

@pkg-pr-newpkg.pr.new
Copy link

pkg-pr-newbot commentedJul 10, 2025
edited
Loading

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit:4139e22

@edison1105edison1105 marked this pull request as draftJuly 10, 2025 14:39
Copy link

@coderabbitaicoderabbitaibot 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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between347ef1d and95e4120.

📒 Files selected for processing (1)
  • packages/runtime-core/src/componentSlots.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). (3)
  • GitHub Check: Redirect rules
  • GitHub Check: Header rules
  • GitHub Check: Pages changed

@edison1105edison1105 changed the titlefix(slots): refine condition to avoid copying compile markerfix(slots): refine internal key checking logicJul 18, 2025
@edison1105edison1105 marked this pull request as ready for reviewJuly 18, 2025 14:27
@edison1105
Copy link
MemberAuthor

/ecosystem-ci run

github-actions[bot] reacted with thumbs up emoji

@vue-bot
Copy link
Contributor

📝 Ran ecosystem CI:Open

suiteresultlatest scheduled
nuxtsuccesssuccess
piniasuccesssuccess
language-toolssuccesssuccess
primevuesuccesssuccess
quasarsuccesssuccess
vantsuccesssuccess
routersuccesssuccess
vue-macrossuccessfailure
radix-vuesuccesssuccess
vitepresssuccesssuccess
vite-plugin-vuesuccesssuccess
vue-simple-compilersuccesssuccess
vuetifysuccesssuccess
vueusesuccesssuccess
test-utilssuccesssuccess
vue-i18nsuccesssuccess

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@coderabbitaicoderabbitai[bot]coderabbitai[bot] left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Slot <template> not working when its name starts with an underscore (_) since v3.5.14
2 participants
@edison1105@vue-bot

[8]ページ先頭

©2009-2025 Movatter.jp