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(custom-element): ensure exposed methods are accessible from custom elements by making them enumerable#13634

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
linzhe141 wants to merge4 commits intovuejs:main
base:main
Choose a base branch
Loading
fromlinzhe141:fix-options-api-expose-enumerable

Conversation

linzhe141
Copy link
Contributor

@linzhe141linzhe141 commentedJul 15, 2025
edited by coderabbitaibot
Loading

close#13632

Summary by CodeRabbit

  • Refactor
    • Exposed component properties are now enumerable, improving their visibility and interaction.
  • Tests
    • Added a test confirming that exposed methods in components correctly update the UI when invoked.

@coderabbitaicoderabbitai
Copy link

coderabbitaibot commentedJul 15, 2025
edited
Loading

Walkthrough

The change updates theapplyOptions function to define exposed component properties withenumerable: true, making them iterable and accessible when exposed. No other logic or control flow was modified.

Changes

File(s)Change Summary
packages/runtime-core/src/componentOptions.tsMade exposed properties enumerable inapplyOptions function
packages/runtime-dom/tests/customElement.spec.tsAdded test for exposing method via Options API in custom element

Sequence Diagram(s)

sequenceDiagram    participant User    participant Component    participant ExposedObject    User->>Component: Define expose option with methods    Component->>ExposedObject: Define properties with enumerable: true    User->>Component: Access method via custom element    Component->>ExposedObject: Method is enumerable and accessible
Loading

Assessment against linked issues

ObjectiveAddressedExplanation
Ensure exposed methods are accessible from custom elements by making them enumerable (#13632)

Poem

🐇 With a twitch of my nose and a flick of my ear,
Exposed methods now sparkle and clearly appear!
Enumerable treasures for all to explore,
Custom elements shine and open the door.
A bunny’s delight, so simple and bright,
Making Vue’s magic just perfectly right! ✨🐰

Suggested labels

ready to merge


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and betweene6a9956 and11d9c28.

📒 Files selected for processing (1)
  • packages/runtime-dom/__tests__/customElement.spec.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/runtime-dom/tests/customElement.spec.ts
⏰ 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). (1)
  • GitHub Check: test / e2e-test
✨ 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

Size Report

Bundles

FileSizeGzipBrotli
runtime-dom.global.prod.js101 kB (+14 B)38.4 kB (+3 B)34.5 kB (-25 B)
vue.global.prod.js159 kB (+14 B)58.5 kB (+3 B)52.1 kB (-16 B)

Usages

NameSizeGzipBrotli
createApp (CAPI only)46.5 kB18.2 kB16.7 kB
createApp54.5 kB (+14 B)21.2 kB (+4 B)19.4 kB (+14 B)
createSSRApp58.7 kB (+14 B)22.9 kB (+3 B)20.9 kB (+7 B)
defineCustomElement59.5 kB (+14 B)22.8 kB (+1 B)20.8 kB (-8 B)
overall68.6 kB (+14 B)26.4 kB (+4 B)24 kB (-50 B)

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

pkg-pr-newbot commentedJul 15, 2025
edited
Loading

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit:11d9c28

@edison1105
Copy link
Member

edison1105 commentedJul 15, 2025
edited
Loading

LGTM.
Could you please add a test?

@edison1105edison1105 added need testThe PR has missing test cases. 🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: custom elements labelsJul 15, 2025
@linzhe141
Copy link
ContributorAuthor

LGTM. Could you please add a test?

Of course, I’ll add one right away.

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 between69f3d5b ande6a9956.

📒 Files selected for processing (1)
  • packages/runtime-dom/__tests__/customElement.spec.ts (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: ci
packages/runtime-dom/__tests__/customElement.spec.ts

[error] 1-1: Vitest unit test failure: 'defineCustomElement > expose > expose attributes and callback' test failed with NotSupportedError: This name has already been registered in the registry.

@edison1105edison1105 added ready to mergeThe PR is ready to be merged. and removed need testThe PR has missing test cases. labelsJul 16, 2025
@edison1105edison1105 changed the titlefix: properly handle expose in options API style custom element componentfix(custom-element): ensure exposed methods are accessible from custom elements by making them enumerableJul 16, 2025
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
🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.ready to mergeThe PR is ready to be merged.scope: custom elements
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Exposed method not accessible from custom element
2 participants
@linzhe141@edison1105

[8]ページ先頭

©2009-2025 Movatter.jp