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

perf: improve regexp performance with non-capturing groups#13567

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
KazariEX wants to merge3 commits intovuejs:main
base:main
Choose a base branch
Loading
fromKazariEX:perf/regex-group

Conversation

KazariEX
Copy link
Member

@KazariEXKazariEX commentedJul 4, 2025
edited by coderabbitaibot
Loading

Use non-capturing groups or remove them as far as possible.

Summary by CodeRabbit

  • Refactor
    • Improved internal pattern matching for directive and attribute processing to enhance consistency.
    • Refined string transformation logic for better reliability in formatting and style handling.

No impact on existing features or functionality is expected.

@coderabbitaicoderabbitai
Copy link

coderabbitaibot commentedJul 4, 2025
edited
Loading

Walkthrough

This update systematically revises regular expressions across multiple files to replace capturing groups with non-capturing groups or alternative matching mechanisms such as string methods. The changes affect internal pattern matching logic but do not alter exported APIs, control flow, or overall behavior of the affected functions.

Changes

File(s)Change Summary
packages/compiler-core/src/transforms/vIf.ts
packages/compiler-ssr/src/transforms/ssrVIf.ts
Changed regex for directive name matching from capturing to non-capturing groups.
packages/compiler-core/src/transforms/vSlot.tsUpdated regexes in slot directive matching to use non-capturing groups.
packages/compiler-core/src/utils.tsModified function expression regex to use non-capturing groups.
packages/compiler-dom/src/transforms/stringifyStatic.tsChangeddataAriaRE regex to use a non-capturing group for attribute prefixes.
packages/compiler-sfc/src/style/pluginScoped.tsUpdated animation property regexes to use non-capturing groups for vendor prefixes.
packages/compiler-sfc/src/template/templateUtils.tsChangedexternalRE regex to use a non-capturing group for the scheme.
packages/runtime-core/src/compat/global.ts
packages/runtime-dom/src/index.ts
Updated attribute prefix regex in mount logic to use non-capturing groups.
packages/runtime-core/src/component.tsRemoved capturing group inclassifyRE regex and updated replacement logic accordingly.
packages/runtime-dom/src/components/Transition.tsChanged transition property regex to use non-capturing groups.
packages/runtime-dom/src/components/TransitionGroup.tsReplaced regex test withendsWith('transform') for transition property name check.
packages/runtime-dom/src/modules/style.tsChanged display property regex to use a non-capturing group for the prefix.
packages/shared/src/general.tsUpdatedcamelizeRE and replacement logic to remove capture group, using string slicing instead.

Sequence Diagram(s)

sequenceDiagram    participant SourceCode    participant RegexEngine    SourceCode->>RegexEngine: Use regex with capturing group (old)    Note over RegexEngine: Captures matched subpatterns    SourceCode->>RegexEngine: Use regex with non-capturing group or string methods (new)    Note over RegexEngine: Matches without capturing, or uses string methods for checks
Loading

Poem

🐇
Regexes prance in the code at night,
Swapping their groups out of sight.
From capturing hands to non-capturing paws,
They hop through the logic without a pause.
No APIs changed, just patterns refined—
Regex rabbits, ever aligned!
🥕


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between1779b63 ande80b7ed.

📒 Files selected for processing (1)
  • packages/compiler-sfc/src/style/pluginScoped.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/compiler-sfc/src/style/pluginScoped.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). (3)
  • GitHub Check: Redirect rules
  • GitHub Check: Header rules
  • GitHub Check: Pages changed
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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 4, 2025
edited
Loading

Size Report

Bundles

FileSizeGzipBrotli
runtime-dom.global.prod.js101 kB (+7 B)38.4 kB (+2 B)34.6 kB (+12 B)
vue.global.prod.js159 kB (+21 B)58.5 kB (-1 B)52.1 kB (-8 B)

Usages

NameSizeGzipBrotli
createApp (CAPI only)46.5 kB18.2 kB (-5 B)16.7 kB (+4 B)
createApp54.5 kB21.2 kB (-7 B)19.4 kB (+8 B)
createSSRApp58.7 kB22.9 kB (-9 B)20.9 kB (+2 B)
defineCustomElement59.5 kB22.8 kB (-8 B)20.8 kB (-15 B)
overall68.6 kB (+4 B)26.4 kB (-2 B)24 kB (-10 B)

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

pkg-pr-newbot commentedJul 4, 2025
edited
Loading

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit:e80b7ed

@edison1105
Copy link
Member

/ecosystem-ci run

github-actions[bot] reacted with thumbs up emoji

@vue-bot
Copy link
Contributor

📝 Ran ecosystem CI:Open

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

@edison1105edison1105 added ready to mergeThe PR is ready to be merged. 🧹 p1-chorePriority 1: this doesn't change code behavior. labelsJul 5, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@skirtles-codeskirtles-codeskirtles-code left review comments

Assignees
No one assigned
Labels
🧹 p1-chorePriority 1: this doesn't change code behavior.ready to mergeThe PR is ready to be merged.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@KazariEX@edison1105@vue-bot@skirtles-code

[8]ページ先頭

©2009-2025 Movatter.jp