Skip to content

Conversation

@tux-tn
Copy link

@tux-tn tux-tn commented Nov 23, 2025

Pinia’s IIFE build is unusable because @vue/devtools-api doesn’t ship an IIFE (see #2914). This PR drops the broken output from distributed formats and points unpkg/jsfiddle to the esm-browser build instead.

Summary by CodeRabbit

  • Chores
    • Updated CDN distribution formats to use modern ESM standard for unpkg and jsdelivr deliveries.
    • Removed legacy IIFE build configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

@netlify
Copy link

netlify bot commented Nov 23, 2025

Deploy Preview for pinia-official canceled.

Name Link
🔨 Latest commit b309b57
🔍 Latest deploy log https://app.netlify.com/projects/pinia-official/deploys/69237fac42a4610008ac7b99

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 23, 2025

Walkthrough

These changes remove IIFE build support from Pinia, redirecting unpkg and jsDelivr CDN entry points to ESM browser distribution instead of IIFE, and eliminating corresponding global build configuration from the Rollup build system.

Changes

Cohort / File(s) Summary
Package Configuration
packages/pinia/package.json
Updated unpkg and jsdelivr export fields from dist/pinia.iife.js to dist/pinia.esm-browser.js
Build Configuration
rollup.config.mjs
Removed IIFE global build configuration, including isGlobalBuild logic, globals mapping, and IIFE-specific minified naming; hard-coded __GLOBAL__ replacement to 'false'

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • The package.json changes are straightforward entry point updates
  • The rollup config changes involve coherent removal of a complete build variant (IIFE), which simplifies rather than complexifies the logic
  • Review should focus on ensuring no dependent build processes or documentation still reference the removed IIFE format

Poem

🐰 Hops through the build with glee,
ESM browser now runs free!
No more IIFE, simplicity gained,
The config's refined, CDN sustained! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Remove broken IIFE build' clearly and directly describes the main change: removing the IIFE build configuration from the project due to incompatibility issues.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@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)
rollup.config.mjs (1)

120-137: Browser ESM config now matches CDN targets

The browser output (file: 'dist/pinia.esm-browser.js', format: 'es') lines up with the new unpkg/jsdelivr entries and cleanly drops the global/IIFE path. The overall config wiring (TS plugin, externals, replace plugin flags) still looks coherent with the remaining formats.

One very minor thing: the comment “Browser ESM build inlines everything so that it can be used alone.” is now a bit misleading since external still lists vue and @vue/devtools-api. If the intent is to keep those as externals, consider tweaking the comment to avoid implying a fully self‑contained bundle.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94cc16c and b309b57.

📒 Files selected for processing (2)
  • packages/pinia/package.json (1 hunks)
  • rollup.config.mjs (3 hunks)
🔇 Additional comments (3)
packages/pinia/package.json (1)

8-9: CDN entrypoints now aligned to ESM browser build

Pointing both unpkg and jsdelivr to dist/pinia.esm-browser.js matches the browser output in rollup.config.mjs and removes the broken IIFE path. From a packaging/build perspective this is consistent and correct.

You may just want to double‑check that all docs, CDN examples, and JSFiddle links now use type="module" / ESM‑style usage and no longer mention a global Pinia IIFE, to avoid confusion for users coming from older snippets.

rollup.config.mjs (2)

161-176: Global build flags simplified; check remaining call sites of __GLOBAL__

Setting __GLOBAL__ unconditionally to 'false' and keeping __BROWSER__ / __BUNDLER__ / __NODE_JS__ based solely on the three formats is consistent with the removal of the IIFE/global build. This should make global‑specific branches in the runtime dead‑code and easier to tree‑shake.

Just make sure there are no remaining runtime paths that still rely on __GLOBAL__ === true for any behavior that should now be covered by the browser ESM build (e.g. docs or examples that might still mention a global build).


200-205: No leftover IIFE/global references found—migration is clean

Verification confirms the old IIFE/global build has been completely removed from the configuration. The outputConfigs object now only includes mjs, cjs, and browser formats (no IIFE or global entry), and the unified minified naming pattern (dist/${name}.${format}.prod.js) is consistently applied. No references to old filenames like pinia.iife.prod.js or pinia.global.prod.js exist in the codebase, package.json, or build configuration.

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

Labels

None yet

Projects

Status: 🆕 Triaging

Development

Successfully merging this pull request may close these issues.

1 participant