Skip to content

[BREAKING CHANGE][Chore] Drop CJS builds - #9751

Draft
weronikaolejniczak wants to merge 9 commits into
elastic:mainfrom
weronikaolejniczak:chore/drop-cjs
Draft

[BREAKING CHANGE][Chore] Drop CJS builds#9751
weronikaolejniczak wants to merge 9 commits into
elastic:mainfrom
weronikaolejniczak:chore/drop-cjs

Conversation

@weronikaolejniczak

@weronikaolejniczak weronikaolejniczak commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

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 lib and optimize/lib outputs.

Screenshots

N/A

Impact Assessment

Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.

  • 🔴 Breaking changes — What will break? How many usages in Kibana/Cloud UI are impacted?
  • 💅 Visual changes — May impact style overrides; could require visual testing. Explain and estimate impact.
  • 🧪 Test impact — May break functional or snapshot tests (e.g., HTML structure, class names, default values).
  • 🔧 Hard to integrate — If changes require substantial updates to Kibana, please stage the changes and link them here.

Impact level: 🟡 Moderate
Kibana PR: elastic/kibana#274696 (CI: 🔴)
Cloud UI PR: https://github.com/elastic/cloud-ui/pull/3746 (CI: 🟢)

Release Readiness

QA instructions for reviewer

  • Run yarn workspaces @elastic/eui-website build:workspaces && yarn workspaces @elastic/eui-website start - it should succeed (includes all EUI dependencies + Docusaurus)
  • EUI CI is green
  • Kibana CI is green
  • Cloud UI CI is green

Checklist before marking Ready for Review

Reviewer checklist

  • Approved Impact Assessment — Acceptable to merge given the consumer impact.
  • Approved Release Readiness — Docs, Figma, and migration info are sufficient to ship.

@weronikaolejniczak weronikaolejniczak changed the title [BREAKING[Chore] Chore/drop cjs [BREAKING][Chore] Drop CJS builds Jun 23, 2026
@weronikaolejniczak weronikaolejniczak self-assigned this Jun 23, 2026
@weronikaolejniczak weronikaolejniczak added skip-vrt Skips Visual Regression Testing job in CI (clearly state why you're using it in your PR) and removed skip-vrt Skips Visual Regression Testing job in CI (clearly state why you're using it in your PR) labels Jun 23, 2026
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
2 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euipopover (1 difference)

StoryBeforeAfterDiff
playground desktop

euidatagrid (1 difference)

StoryBeforeAfterDiff
additional controls options desktop

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
1 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (1 difference)

StoryBeforeAfterDiff
compact desktop

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
1 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (1 difference)

StoryBeforeAfterDiff
additional controls options desktop

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
2 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (2 differences)

StoryBeforeAfterDiff
compact desktop
additional controls options desktop

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 explicit exports map for ESM + test-env.
  • Update internal website/docusaurus consumption and docs to reference es/ and test-env/ paths instead of lib/.
  • 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.

Comment thread packages/eui/changelogs/upcoming/9751.md Outdated
Comment thread packages/eui-theme-common/package.json Outdated
Comment thread packages/eui-theme-borealis/package.json Outdated
Comment thread wiki/consuming-eui/README.md Outdated
Comment thread packages/website/docs/getting-started/tree-shaking.mdx
@weronikaolejniczak weronikaolejniczak changed the title [BREAKING][Chore] Drop CJS builds [BREAKING CHANGE][Chore] Drop CJS builds Jul 20, 2026
@weronikaolejniczak
weronikaolejniczak force-pushed the chore/drop-cjs branch 3 times, most recently from 0ddcf53 to ca3895c Compare July 21, 2026 14:52
@weronikaolejniczak weronikaolejniczak added the breaking change PRs with breaking changes. (Don't delete - used for automation) label Jul 22, 2026
@github-actions

Copy link
Copy Markdown

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:

  • If this PR contains prop/API changes:
    • Search through Kibana for <EuiComponent usages (example search)
    • In the PR description or in a PR comment, include a count or list with the number of component usages in Kibana that will need to be updated (if that amount is "none", include that information as well)
  • If this PR contains CSS changes:
    • Search through Kibana for the changed EUI selectors, e.g. .euiComponent (example search)
    • In the PR description or in a PR comment, include a count or list with the number of custom CSS overrides in Kibana that will need to be updated (if that amount is "none", include that information as well)
  • 🔍 Tip: When searching through Kibana, consider excluding **/target, **/*.snap, **/*.storyshot files to reduce noise and only look at source code usages
  • ⚠️ For extremely risky changes, the EUI team should potentially consider the following precautions:
    • Using a pre-release release candidate to test Kibana CI ahead of time
    • Using kibana-a-la-carte for manual QA, and to give other Kibana teams a staging server to quickly test against

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @weronikaolejniczak

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @weronikaolejniczak

@weronikaolejniczak
weronikaolejniczak marked this pull request as ready for review July 27, 2026 14:28
@weronikaolejniczak
weronikaolejniczak requested a review from a team as a code owner July 27, 2026 14:28
@weronikaolejniczak
weronikaolejniczak marked this pull request as draft July 27, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change PRs with breaking changes. (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants