-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove broken IIFE build #3072
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v3
Are you sure you want to change the base?
Remove broken IIFE build #3072
Conversation
✅ Deploy Preview for pinia-official canceled.
|
WalkthroughThese 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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.
Example instruction:
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. Comment |
There was a problem hiding this 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 targetsThe
browseroutput (file: 'dist/pinia.esm-browser.js', format: 'es') lines up with the newunpkg/jsdelivrentries 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
externalstill listsvueand@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
📒 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 buildPointing both
unpkgandjsdelivrtodist/pinia.esm-browser.jsmatches thebrowseroutput inrollup.config.mjsand 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 globalPiniaIIFE, 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__ === truefor 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 cleanVerification confirms the old IIFE/global build has been completely removed from the configuration. The
outputConfigsobject now only includesmjs,cjs, andbrowserformats (no IIFE or global entry), and the unified minified naming pattern (dist/${name}.${format}.prod.js) is consistently applied. No references to old filenames likepinia.iife.prod.jsorpinia.global.prod.jsexist in the codebase, package.json, or build configuration.
Pinia’s IIFE build is unusable because
@vue/devtools-apidoesn’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
✏️ Tip: You can customize this high-level summary in your review settings.