Skip to content

fix: isolate demo bundle globals for injected demo script#435

Open
voidborne-d wants to merge 1 commit intoalibaba:mainfrom
voidborne-d:fix/demo-bundle-global-scope
Open

fix: isolate demo bundle globals for injected demo script#435
voidborne-d wants to merge 1 commit intoalibaba:mainfrom
voidborne-d:fix/demo-bundle-global-scope

Conversation

@voidborne-d
Copy link
Copy Markdown
Contributor

Summary

  • wrap the built demo bundle in an outer IIFE after Vite emits it
  • add a regression check that verifies the wrapper is present
  • keep the fix in the demo build pipeline so injected CDN/bookmarklet usage does not leak helper symbols globally

Testing

  • npm run build:demo
  • npm run test:demo-bundle

Context

Fixes the injected demo script regression reported in #426, where helper symbols from the generated bundle could collide with page-level bindings and trigger errors like Identifier 'St' has already been declared.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants