Skip to content

Commit

Permalink
chore: bump up style-loader version to v4 (#6490)
Browse files Browse the repository at this point in the history
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [style-loader](https://togithub.com/webpack-contrib/style-loader) | [`^3.3.4` -> `^4.0.0`](https://renovatebot.com/diffs/npm/style-loader/3.3.4/4.0.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/style-loader/4.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/style-loader/4.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/style-loader/3.3.4/4.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/style-loader/3.3.4/4.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>webpack-contrib/style-loader (style-loader)</summary>

### [`v4.0.0`](https://togithub.com/webpack-contrib/style-loader/blob/HEAD/CHANGELOG.md#400-2024-04-08)

[Compare Source](https://togithub.com/webpack-contrib/style-loader/compare/v3.3.4...v4.0.0)

##### ⚠ BREAKING CHANGES

-   minimum supported webpack version is `5.27.0`
-   minimum support Node.js version is `18.12.0`
-   the `insert` option can only be a selector or the path to the module

Migration:

Before:

**webpack.config.js**

```js
module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/i,
        use: [
          {
            loader: "style-loader",
            options: {
              injectType: "styleTag",
              styleTagTransform: function (css, style) {
                // Do something ...
                style.innerHTML = `${css}.modify{}\n`;

                document.head.appendChild(style);
              },
            },
          },
          "css-loader",
        ],
      },
    ],
  },
};
```

After:

**insert-function.js**

```js
function insert(css, style) {
  var parent = options.target || document.head;

  parent.appendChild(element);
}

module.exports = insert;
```

**webpack.config.js**

```js
module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/i,
        use: [
          {
            loader: "style-loader",
            options: {
              insert: require.resolve("./insert.js"),
            },
          },
          "css-loader",
        ],
      },
    ],
  },
};
```

-   the `styleTagTransform` option can only be the path to the module

Migration:

Before:

**webpack.config.js**

```js
module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/i,
        use: [
          {
            loader: "style-loader",
            options: {
              injectType: "styleTag",
              styleTagTransform: function (css, style) {
                // Do something ...
                style.innerHTML = `${css}.modify{}\n`;

                document.head.appendChild(style);
              },
            },
          },
          "css-loader",
        ],
      },
    ],
  },
};
```

After:

**style-tag-transform-function.js**

```js
function styleTagTransform(css, style) {
  // Do something ...
  style.innerHTML = `${css}.modify{}\n`;

  document.head.appendChild(style);
}

module.exports = styleTagTransform;
```

**webpack.config.js**

```js
module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/i,
        use: [
          {
            loader: "style-loader",
            options: {
              styleTagTransform: require.resolve("./style-tag-transform-function.js"),
            },
          },
          "css-loader",
        ],
      },
    ],
  },
};
```

##### Bug Fixes

-   css experiments logic ([#&#8203;617](https://togithub.com/webpack-contrib/style-loader/issues/617)) ([8b9fc97](https://togithub.com/webpack-contrib/style-loader/commit/8b9fc976628341d3e33b77b5eb4b6ebad009fd19))

##### [3.3.3](https://togithub.com/webpack-contrib/style-loader/compare/v3.3.2...v3.3.3) (2023-05-19)

##### Bug Fixes

-   compatibility with built-in CSS support ([#&#8203;605](https://togithub.com/webpack-contrib/style-loader/issues/605)) ([9636f58](https://togithub.com/webpack-contrib/style-loader/commit/9636f5805407734f587a87e69dd048e5cc7f1021))

##### [3.3.2](https://togithub.com/webpack-contrib/style-loader/compare/v3.3.1...v3.3.2) (2023-03-13)

##### Bug Fixes

-   noop in environment without DOM API ([#&#8203;597](https://togithub.com/webpack-contrib/style-loader/issues/597)) ([03d3df3](https://togithub.com/webpack-contrib/style-loader/commit/03d3df3c363484c18a1e9a5e468a7600ea1322f3))

##### [3.3.1](https://togithub.com/webpack-contrib/style-loader/compare/v3.3.0...v3.3.1) (2021-10-21)

##### Bug Fixes

-   small perf improvement ([#&#8203;544](https://togithub.com/webpack-contrib/style-loader/issues/544)) ([610524e](https://togithub.com/webpack-contrib/style-loader/commit/610524ef6266c27e147d3c0003e7825b08f17454))

</details>

---

### 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.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/toeverything/AFFiNE).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5In0=-->
  • Loading branch information
renovate[bot] committed Apr 9, 2024
1 parent 803b17a commit 891ab6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tools/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"postcss-loader": "^8.1.0",
"raw-loader": "^4.0.2",
"source-map-loader": "^5.0.0",
"style-loader": "^3.3.4",
"style-loader": "^4.0.0",
"swc-loader": "^0.2.6",
"terser-webpack-plugin": "^5.3.10",
"thread-loader": "^4.0.2",
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ __metadata:
postcss-loader: "npm:^8.1.0"
raw-loader: "npm:^4.0.2"
source-map-loader: "npm:^5.0.0"
style-loader: "npm:^3.3.4"
style-loader: "npm:^4.0.0"
swc-loader: "npm:^0.2.6"
terser-webpack-plugin: "npm:^5.3.10"
thread-loader: "npm:^4.0.2"
Expand Down Expand Up @@ -33489,12 +33489,12 @@ __metadata:
languageName: node
linkType: hard

"style-loader@npm:^3.3.4":
version: 3.3.4
resolution: "style-loader@npm:3.3.4"
"style-loader@npm:^4.0.0":
version: 4.0.0
resolution: "style-loader@npm:4.0.0"
peerDependencies:
webpack: ^5.0.0
checksum: 10/2dd2a77d4fc689e1f73836ed7653830cb4e628af0b2979dcf6f31524c72bf44fca4bac8aebe62df95a5f9be19bea18f952a2cfcaaeff32c524c4402226d9c58f
webpack: ^5.27.0
checksum: 10/93f25b7e70cfca9d1d8427170384262b59a5b0e84e7191a5a26636a77799caeed46d9a3e45ee7b9afa0f69176e3b98d5a6c5e81593ff1fd0946f1c5682fd2a68
languageName: node
linkType: hard

Expand Down

0 comments on commit 891ab6a

Please sign in to comment.