Skip to content

[CDX-468] Add modern ESM build#455

Open
esezen wants to merge 2 commits into
masterfrom
cdx-468-client-js-add-modern-esm-build-issue-452
Open

[CDX-468] Add modern ESM build#455
esezen wants to merge 2 commits into
masterfrom
cdx-468-client-js-add-modern-esm-build-issue-452

Conversation

@esezen
Copy link
Copy Markdown
Contributor

@esezen esezen commented May 28, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 28, 2026 14:18
@esezen esezen requested a review from a team as a code owner May 28, 2026 14:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an ESM build output alongside the existing CommonJS + bundled browser build, and wires it into test and release workflows so the project can ship “modern” ESM artifacts (npm module entry + CDN .esm.js).

Changes:

  • Add esbuild-based ESM outputs: lib/esm/constructorio.js (for npm) and dist/esm/*.esm.js (for CDN).
  • Add a dedicated bundled-ESM test path that uses a test-only IIFE artifact for jsdom execution.
  • Update CI/workflows to run bundled ESM tests and publish the ESM bundle to the CDN.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
spec/src/utils/jsdom-global.js Selects the appropriate bundle artifact for bundled tests (legacy vs ESM variant).
spec/src/modules/quizzes.js Updates bundled quiz tests to load the correct artifact for the ESM variant.
scripts/bundle-esm.js New script producing the CDN ESM bundle in dist/esm.
scripts/build-test-iife.js New script producing a test-only IIFE bundle used for bundled ESM tests.
scripts/build-esm.js New script producing the npm ESM entrypoint under lib/esm.
package.json Adds module entry and hooks ESM builds into postcompile/postbundle; adds bundled-ESM test scripts.
.gitignore Ignores dist/test-only/ artifacts.
.github/workflows/run-tests-bundled-esm.yml New workflow running the bundled ESM test suite in CI.
.github/workflows/publish-cdn.yml Publishes the new dist/esm artifact to S3 (versioned + latest).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/bundle-esm.js
Comment thread scripts/build-test-iife.js
Comment thread scripts/build-esm.js
Comment thread package.json
constructor-claude-bedrock[bot]

This comment was marked as outdated.

Copy link
Copy Markdown

@constructor-claude-bedrock constructor-claude-bedrock Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This PR adds a modern ESM build output (lib/esm/ for npm, dist/esm/ for CDN) alongside the existing IIFE bundle, with a corresponding GitHub Actions workflow and a clever IIFE shim to keep JSDOM-based bundled tests working.

Inline comments: 7 discussions added

Overall Assessment: ⚠️ Needs Work

Comment thread scripts/bundle-esm.js
Comment thread scripts/build-esm.js
Comment thread package.json
Comment thread package.json
Comment thread .github/workflows/run-tests-bundled-esm.yml
Comment thread .github/workflows/publish-cdn.yml
Comment thread scripts/build-test-iife.js
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