Skip to content

v0.11.0

Compare
Choose a tag to compare
@metonym metonym released this 23 Mar 22:06
· 24 commits to main since this release

This release is a complete rewrite of the library, necessitated because the Svelte ecosystem has evolved so greatly in the past couple of years. For example, previously, the optimizeCss plugin was not compatible with SvelteKit v1.

The plugin has been rewritten to work with Vite-based setups (i.e., SvelteKit) along with Rollup and Webpack. The approach to remove unused Carbon selectors has been overhauled as well to eliminate potential false positives. This is essential because carbon-components-svelte advertises usage of pre-compiled CSS StyleSheets and should have a solution to optimize the production bundle size.

Breaking Changes

  • Remove all preprocessors except for optimizeImports. Although certain preprocessors are intriguing concepts (elements), removing them was done to narrow the scope of the library. We may revisit this later down the road when the end developer experience can be assured.
  • optimizeImports: drop support for carbon-icons-svelte version 10, carbon-pictograms-svelte version 10.
  • Rewrite optimizeCss plugin from scratch; it's now offered as a Vite/Rollup/Webpack plugin. carbon-components-svelte@0.85.0 or greater is required.

Using optimizeCss can now greatly reduce the bundled Carbon CSS. See examples for common setups, including SvelteKit, Vite, Rollup, and Webpack.

Optimized index-CU4gbKFa.css
- Before: 606.26 kB
+ After:   53.22 kB (-91.22%)