carbon-design-system / carbon-charts

:bar_chart: :chart_with_upwards_trend:⠀Robust dataviz framework implemented using D3 & typescript
https://charts.carbondesignsystem.com
Apache License 2.0
904 stars 184 forks source link

[Enhancement]: Upgrade `@carbon/styles` v1.6.0 to fix webpack `sideEffects` behavior #1405

Closed metonym closed 2 years ago

metonym commented 2 years ago

Contact Details

No response

Summary

@carbon/charts includes @carbon/styles as a direct dependency.

However, Webpack ignores CSS files from @carbon/styles version 1.4.0 if it's not specified as a direct dependency. This is because the CSS files are not included in the package sideEffects. See https://github.com/metonym/carbon-charts-svelte-exxamples/pull/2.

This issue has been fixed upstream (https://github.com/carbon-design-system/carbon/pull/11608) and is available in @carbon/styles version 1.6.0.

Justification

Unblocks usage of CSS files with Webpack.

Desired UX and success metrics

The desired effect would be to use @carbon/charts in Webpack without having to specify @carbon/styles as a direct dependency.

"Must have" functionality

See the previous section.

Specific timeline issues / requests

Not urgent, just wanted to track.

Available extra resources

I attempted to upgrade @carbon/styles in core but received many warnings on peer dependencies. I'm unsure of the protocol here and will defer to maintainers.

metonym commented 2 years ago

Nevermind.

@carbon/charts does not pin the @carbon/styles dependency, so a fresh install should automatically use the latest minor version of @carbon/styles (1.9.0).