Skip to content

chore!: migrate dev-scripts to esm - #10639

Open
lizschwab wants to merge 1 commit into
RaspberryPiFoundation:plugin-esmfrom
lizschwab:10620
Open

lizschwab wants to merge 1 commit into
RaspberryPiFoundation:plugin-esmfrom
lizschwab:10620

Conversation

@lizschwab

@lizschwab lizschwab commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #10620

Proposed Changes

  • Build script updated to output uncompressed files into separate cjs and esm directories. It also uses tsc now instead of webpack, so typescript is upgraded from peer & dev dependency to a runtime dependency.
  • Drops support for AMD/UMD
  • Replaced AMD/UMD usages such as require with ESM equivalents
  • Pulled out common tsconfig options into a base config file (this will be imported by the plugins, which can override or add additional config as needed). This gives us one place for changes like target and moduleResolution, which all of the plugins tend to update at the same time.
  • Removed 'production' mode handling in webpack config, as webpack will no longer be used in production mode; only in test and development.

Reason for Changes

Modernizing our plugins

Additional Information

These changes break build in @blockly/field-colour. We'll resolve this later, as getting everything into a working state is too many changes for one PR.

BREAKING CHANGES

  • Build no longer bundles; plugins using this script will be built without being minified.
  • UMD support has been dropped. Plugins using the build script will support CJS and ESM only.
  • Export paths have moved; previously the distribution would be at ./dist but with these changes they will be located at ./dist/cjs and ./dist/esm.
  • This package is now an ES Module.
  • Node support has been updated to 24 or higher.
  • Plugins are now compiled with tsc, which will break imports for non-js files and extensionless relative path imports in plugins using the build script.

@github-actions github-actions Bot added the PR: chore General chores (dependencies, typos, etc) label Oct 28, 2026
@lizschwab
lizschwab marked this pull request as ready for review October 28, 2026 19:25
@lizschwab
lizschwab requested a review from a team as a code owner October 28, 2026 19:25
@lizschwab
lizschwab requested review from zspriggs and removed request for a team October 28, 2026 19:25
@lizschwab

Copy link
Copy Markdown
Contributor Author

The failing check is expected

@lizschwab lizschwab changed the title chore: migrated dev-scripts to esm chore: migrate dev-scripts to esm Oct 28, 2026
@github-actions github-actions Bot added PR: chore General chores (dependencies, typos, etc) and removed PR: chore General chores (dependencies, typos, etc) labels Oct 28, 2026
@zspriggs
zspriggs requested a review from gonfunko October 30, 2026 15:38
@lizschwab lizschwab changed the title chore: migrate dev-scripts to esm chore!: migrate dev-scripts to esm Oct 30, 2026
@github-actions github-actions Bot added breaking change Used to mark a PR or issue that changes our public APIs. PR: chore General chores (dependencies, typos, etc) and removed PR: chore General chores (dependencies, typos, etc) breaking change Used to mark a PR or issue that changes our public APIs. labels Oct 30, 2026

This branch has not been deployed

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

Labels

breaking change Used to mark a PR or issue that changes our public APIs. PR: chore General chores (dependencies, typos, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants