Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency css-loader to v7 #4612

Merged
merged 7 commits into from
Jun 3, 2024

Conversation

cultureamp-renovate[bot]
Copy link
Contributor

@cultureamp-renovate cultureamp-renovate bot commented Apr 7, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
css-loader ^6.11.0 -> ^7.1.1 age adoption passing confidence

Release Notes

webpack-contrib/css-loader (css-loader)

v7.1.1

Compare Source

v7.1.0

Compare Source

Features
  • added the getJSON option to output CSS modules mapping (#​1577) (af834b4)

v7.0.0

Compare Source

⚠ BREAKING CHANGES
  • The modules.namedExport option is true by default if you enable the esModule option

Migration guide:

Before:

import style from "./style.css";

console.log(style.myClass);

After:

import * as style from "./style.css";

console.log(style.myClass);

To restore 6.x behavior, please use:

module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/i,
        loader: "css-loader",
        options: {
          modules: {
            namedExport: false,
            exportLocalsConvention: 'as-is',
            //
            // or, if you prefer camelcase style
            //
            // exportLocalsConvention: 'camel-case-only'
          },
        },
      },
    ],
  },
};
  • The modules.exportLocalsConvention has the value as-is when the modules.namedExport option is true and you don't specify a value
  • Minimum supported webpack version is 5.27.0
  • Minimum supported Node.js version is 18.12.0
Features
  • The modules.namedExports option works fine with any modules.exportLocalsConvention values (f96a110)
  • Added dashed variants for the modules.exportLocalsConvention options (40e1668)

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

Copy link

changeset-bot bot commented Apr 7, 2024

🦋 Changeset detected

Latest commit: 0c84b0b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mcwinter07 mcwinter07 marked this pull request as ready for review May 5, 2024 23:59
@mcwinter07 mcwinter07 requested a review from a team as a code owner May 5, 2024 23:59
Base automatically changed from renovate/rollup to main May 8, 2024 01:55
@cultureamp-renovate
Copy link
Contributor Author

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@gyfchong gyfchong changed the base branch from main to renovate/rollup May 22, 2024 01:55
@gyfchong
Copy link
Contributor

Base automatically changed from renovate/rollup to main May 22, 2024 05:03
@HeartSquared HeartSquared force-pushed the renovate/update/css-loader-7.x branch 2 times, most recently from 5e812da to cef5265 Compare May 28, 2024 07:40
@HeartSquared HeartSquared force-pushed the renovate/update/css-loader-7.x branch from cef5265 to 9ab978b Compare May 28, 2024 07:42
Copy link
Contributor

github-actions bot commented May 28, 2024

✨ Here is your branch preview! ✨

Last updated for commit 0c84b0b: Merge branch 'main' into renovate/update/css-loader-7.x

@mcwinter07
Copy link
Contributor

I've discovered that the the underlying issue cause some of the CSS to not be present int he DOM is due to us having a mix of class name conventions in our code.

With the update [exportLocalsConvention](https://webpack.js.org/loaders/css-loader/#exportlocalsconvention) defaults to camel case, where as in some of our components, i.e: Text.module.scss, we have kebab case styles.

Screenshot 2024-06-03 at 11 55 49 am

As we can see, there variants that have kebab classes like extra-small will have the styles omitted from the build.

Screenshot 2024-06-03 at 11 26 31 am

The solution to this is adding the flag exportLocalsConvention: "as-is", to our loader rules, which results in an expected render.

Screenshot 2024-06-03 at 11 50 44 am

@mcwinter07
Copy link
Contributor

Calling out a good point @HeartSquared raised, it would be better to have class names that follow a single convention, ie: camel case, but maybe we release this as a fix first in case there are implication of folks who may be targeting our classes in things like classNameOverride

@mcwinter07 mcwinter07 force-pushed the renovate/update/css-loader-7.x branch from 9ab978b to 276dba4 Compare June 3, 2024 04:38
@gyfchong gyfchong merged commit 6941b2b into main Jun 3, 2024
17 checks passed
@gyfchong gyfchong deleted the renovate/update/css-loader-7.x branch June 3, 2024 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants