[BREAKING CHANGE][Chore] Drop CJS builds - #9751
Conversation
2 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuipopover (1 difference)
euidatagrid (1 difference)
|
38763df to
6e81b09
Compare
1 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuidatagrid (1 difference)
|
6e81b09 to
ba8f765
Compare
1 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuidatagrid (1 difference)
|
2 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuidatagrid (2 differences)
|
There was a problem hiding this comment.
Pull request overview
This PR removes EUI’s distributable CommonJS (lib/) build output and updates packaging/docs/consumers to use the ESM (es/) output, while retaining the Jest-only CommonJS test-env/ build for consuming projects’ test environments.
Changes:
- Remove generation and publishing of the
lib/build from the EUI compile script and package metadata, and add an explicitexportsmap for ESM +test-env. - Update internal website/docusaurus consumption and docs to reference
es/andtest-env/paths instead oflib/. - Add a breaking change changelog entry describing the build output change.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| wiki/contributing-to-eui/testing/unit-testing.md | Updates guidance for consuming projects to use test-env/es test utilities. |
| wiki/consuming-eui/README.md | Updates consumer docs around test utility locations and test-env Jest mapping. |
| packages/website/src/components/homepage/header/index.tsx | Switches deep import away from lib/ to es/. |
| packages/website/docs/getting-started/working-with-emotion/migrating-from-sass.mdx | Updates deep import example from lib/ to es/. |
| packages/website/docs/getting-started/tree-shaking.mdx | Updates build output docs and deep import examples post-CJS removal. |
| packages/website/docs/getting-started/setup.mdx | Updates setup docs to reflect test-env and ESM usage. |
| packages/website/docs/components/navigation/buttons/button.mdx | Updates test matcher import paths to test-env. |
| packages/eui/src/test/README.md | Updates published test util import paths in internal test README. |
| packages/eui/scripts/compile-eui.js | Removes lib/ + optimize/lib/ compilation/copy targets. |
| packages/eui/package.json | Switches entrypoints to es/index.js, adds exports, and stops publishing lib/. |
| packages/eui/changelogs/upcoming/9751.md | Adds breaking change note for dropping the CJS build. |
| packages/eui-theme-common/package.json | Adjusts entry fields toward ESM-first resolution. |
| packages/eui-theme-borealis/package.json | Adjusts entry fields toward ESM-first resolution. |
| packages/docusaurus-theme/src/theme/Navbar/Content/index.tsx | Switches deep import away from lib/ to es/. |
| packages/docusaurus-theme/src/theme/Footer/index.tsx | Adds explicit .js extension to an ESM deep import. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0ddcf53 to
ca3895c
Compare
43ab20b to
c7aa889
Compare
|
This PR contains breaking changes. The opener of this pull request is asked to perform the following due diligence steps below, to assist EUI in our next Kibana upgrade:
|
c7aa889 to
04cb73c
Compare
💚 Build Succeeded
History
|
💚 Build Succeeded
History
|









Summary
Important
This is a BREAKING CHANGE. Until the current version:
v117.1.0, CJS is supported and consumers that need it should prioritize migrating to ESM to be able to use latest EUI. For internal Elastic projects, this is done parallel to dropping CJS builds.Closes https://github.com/elastic/eui-private/issues/553
API Changes
❗ We are dropping the
libandoptimize/liboutputs.Screenshots
N/A
Impact Assessment
Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.
Visual changes — May impact style overrides; could require visual testing. Explain and estimate impact.Impact level: 🟡 Moderate
Kibana PR: elastic/kibana#274696 (CI: 🔴)
Cloud UI PR: https://github.com/elastic/cloud-ui/pull/3746 (CI: 🟢)
Release Readiness
Figma: {link to Figma or issue}Migration guide: {steps or link, for breaking/visual changes or deprecations}(mentioned briefly in the changelog)Adoption plan (new features): {link to issue/doc or outline who will integrate this and where}QA instructions for reviewer
yarn workspaces @elastic/eui-website build:workspaces && yarn workspaces @elastic/eui-website start- it should succeed (includes all EUI dependencies + Docusaurus)Checklist before marking Ready for Review
QA: Tested light/dark modes, high contrast, mobile, Chrome/Safari/Edge/Firefox, keyboard-only, screen readerTests: Added/updated Jest, Cypress, and VRTbreaking changelabel (if applicable)Reviewer checklist