Repository navigation
feat!: ship the CSS as esm/index.css instead of injecting it - #337
Merged
Merged
Conversation
BREAKING CHANGE: the library no longer injects its CSS into the page. Import it once in the entry point of your application: import '@mll-lab/react-components/esm/index.css'; 🤖 Generated with Claude Code
There was a problem hiding this comment.
🔵 Needs a closer look
The breaking CSS-distribution change requires style and Jest checks against a packed tarball in both consumers, but those merge prerequisites remain pending and cannot be verified from this repository snapshot.
No open issues 🎉
What changed in this PR
Replaces automatic CSS injection with separately shipped stylesheets, allowing consumers to keep library styles out of jsdom tests.
Changes:
- Extracts CSS to
esm/index.cssandcjs/index.csswith stable filenames. - Disables CSS URL processing to preserve antd’s gradient references.
- Documents the required stylesheet import in the application entry point.
| File | Description |
|---|---|
rollup.config.js |
Configures CSS extraction, stable asset names, and preservation of CSS URLs. |
README.md |
Adds instructions for explicitly importing the stylesheet. |
Review effort: Max
spawnia
marked this pull request as ready for review
October 28, 2026 20:27
|
🎉 This PR is included in version 21.0.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
mic-web
approved these changes
Oct 29, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 29, 2026
# [21.0.0](v20.9.0...v21.0.0) (2026-10-29) * feat!: ship the CSS as esm/index.css instead of injecting it ([#337](#337)) ([440080e](440080e)) ### BREAKING CHANGES * the library no longer injects its CSS into the page. Import it once in the entry point of your application: import '@mll-lab/react-components/esm/index.css'; 🤖 Generated with Claude Code
|
🎉 This PR is included in version 21.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Importing the library injects about 900 KB of antd CSS into the page.
In jsdom, every
getComputedStylethen matches all those rules, which makes the jest suites of consumers 2–3× slower.The build now writes the CSS to
esm/index.cssandcjs/index.css.Consumers import it once in their application entry, which tests never load:
The Empty image no longer references a bundled JS file
antd's Empty styles use
fill: url('#linearGradient-1').rollup-plugin-stylesresolved that fragment to a JS file of antd.The injected CSS inlined it as
data:application/javascript;base64,…, and extract mode emitted it asesm/assets/index-*.js.url: falseleaves the reference as written.The only other
url()is a data URI, which needs no processing.For agents 🤖: both consumers pass on integration with 21.0.0-alpha.1, merge to publish 21.0.0
Checked locally:
yarn build, thenesm/index.cssexists,esm/index.jsandcjs/index.jscontain neither[class^=mll-ant-]nor the style-injectcreateElement("style").Storybook keeps loading
src/antd.lessthrough less-loader, unchanged.Consumers on
21.0.0-alpha.1, deployed to their integration environments:mll-antrules once, before antd 3's own CSS.url('#linearGradient-1'), so nemo moves to Vite in the same merge request. A page with library components renders pixel-identical before and after.Next: merge, semantic-release publishes 21.0.0 from the
BREAKING CHANGE:footer.Then switch both consumers from the alpha to 21.0.0 and merge them.