Skip to content

Comments

feat: complete ESM core implementation with 100% IIFE compatibility#3978

Draft
everyplace wants to merge 5 commits intosubscriptions-project:mainfrom
everyplace:feature/esm
Draft

feat: complete ESM core implementation with 100% IIFE compatibility#3978
everyplace wants to merge 5 commits intosubscriptions-project:mainfrom
everyplace:feature/esm

Conversation

@everyplace
Copy link
Contributor

  • Implemented .ready() promise and Passive-by-Default ESM logic.
  • Preserved Active-by-Default IIFE logic using win.SWG array augmentation.
  • Added comprehensive integration tests for ESM entry points.
  • Fixed GAA/SwG global object conflict in callSwg.
  • Reorganized ESM documentation.

- Implemented .ready() promise and Passive-by-Default ESM logic.
- Preserved Active-by-Default IIFE logic using win.SWG array augmentation.
- Added comprehensive integration tests for ESM entry points.
- Fixed GAA/SwG global object conflict in callSwg.
- Reorganized ESM documentation.
"--playEnvironment=___PLAY_ENVIRONMENT___" \
"--swgVersion=$SWG_VERSION" \
"--target=$target" \
"--esm"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the above, except with the --esm flag

@@ -50,15 +66,17 @@ function create_binaries_for_environment() {
shift 4

for variant in "" "-basic" "-gaa"; do
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same as it was before, but now just loops twice for both js and mjs

apply: 'build',
generateBundle(options, bundle) {
if (options.format !== 'iife') {
return;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This exits immediately because this isn't necessary for the esm builds.

export const ASSETS = '/assets';
export const ADS_SERVER = 'https://pubads.g.doubleclick.net';
export const EXPERIMENTS = '';
export const IS_ESM = false;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is set by vite.config.js, so during the build process this is either true or false, depending on vite's output.

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.

1 participant