Skip to content

Conversation

edison1105
Copy link
Member

@edison1105 edison1105 commented Sep 1, 2025

Fix the following warning while running nr build

/*! #__NO_SIDE_EFFECTS__ */
export const defineSSRCustomElement = ((
options: any,
extraOptions?: ComponentOptions,
) => {
// @ts-expect-error
return defineCustomElement(options, extraOptions, createSSRApp)
}) as typeof defineCustomElement

(!) packages/runtime-dom/src/apiCustomElement.ts (32:0): A comment

"/*! #__NO_SIDE_EFFECTS__ */"

in "packages/runtime-dom/src/apiCustomElement.ts" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.

esbuild supports the /* @__NO_SIDE_EFFECTS__ */ from v.0.18.1. (evanw/esbuild@cf687c9)

Summary by CodeRabbit

  • Style
    • Standardized no-side-effects directive annotations across the codebase to a consistent format.
    • No changes to behavior, performance, or public APIs.
  • Chores
    • Internal cleanup to align comment directives; no user-facing impact.
    • No functional differences; existing features and compatibility remain unchanged.

fix the following warning during build
 (!) packages/runtime-dom/src/apiCustomElement.ts (32:0): A comment

"/*! #__NO_SIDE_EFFECTS__ */"

in "packages/runtime-dom/src/apiCustomElement.ts" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.
Copy link

coderabbitai bot commented Sep 1, 2025

Walkthrough

Replaced side-effect-free directive comments from /! #NO_SIDE_EFFECTS / to /@NO_SIDE_EFFECTS/ across multiple files. No logic, control flow, or API signatures changed.

Changes

Cohort / File(s) Summary of Changes
Runtime Core APIs
packages/runtime-core/src/apiAsyncComponent.ts, packages/runtime-core/src/apiDefineComponent.ts
Updated no-side-effects directive comment to compact form /*@__NO_SIDE_EFFECTS__*/ before exported API functions.
Devtools Hook
packages/runtime-core/src/devtools.ts
Switched no-side-effects directive comment to /*@__NO_SIDE_EFFECTS__*/ above createDevtoolsComponentHook.
Runtime DOM APIs
packages/runtime-dom/src/apiCustomElement.ts
Replaced no-side-effects directive comments with /*@__NO_SIDE_EFFECTS__*/ for defineCustomElement and defineSSRCustomElement.
Shared Utilities
packages/shared/src/makeMap.ts
Changed directive comment to /*@__NO_SIDE_EFFECTS__*/ above makeMap export.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

I nudge a nib, a careful tweak,
From bang to at, so small, so sleek—
No ripples in the runtime stream,
Just tidy tracks where compilers gleam.
Thump-thump! my paws sign off the feat,
A carrot for comments—clean and neat. 🥕

✨ 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/rollupWarning

🪧 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 or @coderabbit 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

github-actions bot commented Sep 1, 2025

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.5 kB 52.2 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.5 kB 18.2 kB 16.7 kB
createApp 54.5 kB 21.2 kB 19.4 kB
createSSRApp 58.7 kB 22.9 kB 20.9 kB
defineCustomElement 59.5 kB 22.8 kB 20.8 kB
overall 68.5 kB 26.4 kB 24 kB

Copy link

pkg-pr-new bot commented Sep 1, 2025

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: fff914d

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/apiCustomElement.ts (1)

166-167: Add CI job to fail on legacy __NO_SIDE_EFFECTS__ annotations
Prevent regressions by scanning the repo in your CI workflow. For example, in GitHub Actions:

- name: Check for legacy NO_SIDE_EFFECTS annotations
  run: |
    rg -nP '/\*!\s*#?__NO_SIDE_EFFECTS__\s*\*/' -g '!**/dist/**' -S
    rg -nP '/\*\s*__NO_SIDE_EFFECTS__\s*\*/' -g '!**/dist/**' -S
📜 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 a28794e and fff914d.

📒 Files selected for processing (5)
  • packages/runtime-core/src/apiAsyncComponent.ts (1 hunks)
  • packages/runtime-core/src/apiDefineComponent.ts (1 hunks)
  • packages/runtime-core/src/devtools.ts (1 hunks)
  • packages/runtime-dom/src/apiCustomElement.ts (2 hunks)
  • packages/shared/src/makeMap.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
🔇 Additional comments (6)
packages/runtime-dom/src/apiCustomElement.ts (2)

166-175: LGTM: standardized side-effect annotation is correctly placed.

/*@__NO_SIDE_EFFECTS__*/ is immediately before the exported function, which Rollup/Terser can interpret. No functional impact.


187-195: LGTM: annotation before const function expression is valid.

The directive precedes the const assignment to the arrow function; safe for tree-shaking and resolves the warning.

packages/runtime-core/src/devtools.ts (1)

128-132: LGTM: directive updated to standard form.

Placement directly above createDevtoolsComponentHook is correct; no runtime changes.

packages/runtime-core/src/apiAsyncComponent.ts (1)

46-50: LGTM: standardized annotation applied to exported factory.

Correct location; aligns with other files.

packages/runtime-core/src/apiDefineComponent.ts (1)

304-315: LGTM: annotation normalized; IIFE remains properly marked PURE.

Combines /*@__NO_SIDE_EFFECTS__*/ on the declaration with the inner /*@__PURE__*/ IIFE—good for tree-shaking.

packages/shared/src/makeMap.ts (1)

9-14: LGTM: annotation placed before export; matches project-wide convention.

No behavior changes; aids Rollup in removing unused factories.

@edison1105 edison1105 added ready to merge The PR is ready to be merged. 🧹 p1-chore Priority 1: this doesn't change code behavior. labels Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 p1-chore Priority 1: this doesn't change code behavior. ready to merge The PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant