Skip to content

RHSTOR-7462: Upgrade style-loader to 4.0.0 #2138

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@
"sass": "^1.89.0",
"sass-loader": "^16.0.5",
"semver": "^7.7.2",
"style-loader": "^3.3.4",
"style-loader": "^4.0.0",
"swr": "2.3.3",
"thread-loader": "^4.0.4",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't remove the thread-loader: it'll cause build issues in our CI environment.
If any, style-loader should be removed as it's only for development purposes.

@SanjalKatiyar @bipuladh what about replacing style-loader with mini-css-extract-plugin?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't remove the thread-loader: it'll cause build issues in our CI environment.

AFAIU removing it shouldn't cause issues in CI env. Earlier "thread-loader" was being used with empty "options" (options: {}), in which case it was over utilising the resources. Removing it entirely might cause a slightly slower build time, but no errors.

If any, style-loader should be removed as it's only for development purposes.

I was not aware that: This loader is primarily meant for development. The default settings are not safe for production environments. So, shifting to mini-css-extract-plugin seems like a good idea !!

Copy link
Collaborator

@alfonsomthd alfonsomthd Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SanjalKatiyar The improvements I made on that PR were to prevent build errors/timeouts so removing it will imply either consuming more resources (thus having errors like 137) or facing more timeouts.

Copy link
Collaborator

@SanjalKatiyar SanjalKatiyar Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember, but wasn't that because "thread-loader" was consuming as much resources as it can get for parallel processing (that's why we were limiting worker pool count in the CI env).

If we don't use "thread-loader" at all, we won't be in that situation anymore. However, theoretically build time would increase.

Anyway, I can understand "style-loader" has other issues, so yeah we should remove it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right: my point is that removing the thread-loader will likely cause CI timeouts and slower builds (but keeping it while removing its config will cause resource consumption errors like 137) so let's keep it with the current config.

"ts-loader": "^9.5.2",
"tsx": "^4.19.4",
"typesafe-actions": "^5.1.0",
Expand Down
15 changes: 1 addition & 14 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const resolveLocale = (dirName: string, ns: string) =>
const NODE_ENV = (process.env.NODE_ENV ||
'development') as webpack.Configuration['mode'];
const PLUGIN = process.env.PLUGIN;
const OPENSHIFT_CI = process.env.OPENSHIFT_CI;
//const OPENSHIFT_CI = process.env.OPENSHIFT_CI;
const IS_PRODUCTION = NODE_ENV === 'production';

if (PLUGIN === undefined) {
Expand Down Expand Up @@ -85,19 +85,6 @@ const config: webpack.Configuration & DevServerConfiguration = {
exclude: /(build|dist)/, // Ignore shared build folder.
use: [
{ loader: 'cache-loader' },
{
loader: 'thread-loader',
options: {
...(!IS_PRODUCTION
? { poolTimeout: Infinity, poolRespawn: false }
: OPENSHIFT_CI
? {
workers: 4,
workerNodeArgs: ['--max-old-space-size=1024'],
}
: {}),
},
},
{ loader: 'style-loader' },
{
loader: 'css-loader',
Expand Down
28 changes: 4 additions & 24 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9921,11 +9921,6 @@ [email protected]:
resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13"
integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==

json-parse-better-errors@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9"
integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==

json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d"
Expand Down Expand Up @@ -10132,11 +10127,6 @@ listr2@^3.8.3:
through "^2.3.8"
wrap-ansi "^7.0.0"

loader-runner@^4.1.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1"
integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==

loader-runner@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384"
Expand Down Expand Up @@ -12904,10 +12894,10 @@ strnum@^1.0.5:
resolved "https://registry.yarnpkg.com/strnum/-/strnum-1.0.5.tgz#5c4e829fe15ad4ff0d20c3db5ac97b73c9b072db"
integrity sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==

style-loader@^3.3.4:
version "3.3.4"
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.4.tgz#f30f786c36db03a45cbd55b6a70d930c479090e7"
integrity sha512-0WqXzrsMTyb8yjZJHDqwmnwRJvhALK9LfRtRc6B4UTWe8AijYLZYZ9thuJTZc2VfQWINADW/j+LiJnfy2RoC1w==
style-loader@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-4.0.0.tgz#0ea96e468f43c69600011e0589cb05c44f3b17a5"
integrity sha512-1V4WqhhZZgjVAVJyt7TdDPZoPBPNHbekX4fWnCJL1yQukhCeZhJySUL+gL9y6sNdN95uEOS83Y55SqHcP7MzLA==

style-search@^0.1.0:
version "0.1.0"
Expand Down Expand Up @@ -13209,16 +13199,6 @@ thingies@^1.20.0:
resolved "https://registry.yarnpkg.com/thingies/-/thingies-1.21.0.tgz#e80fbe58fd6fdaaab8fad9b67bd0a5c943c445c1"
integrity sha512-hsqsJsFMsV+aD4s3CWKk85ep/3I9XzYV/IXaSouJMYIoDlgyi11cBhsqYe9/geRfB0YIikBQg6raRaM+nIMP9g==

thread-loader@^4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/thread-loader/-/thread-loader-4.0.4.tgz#954141f6ce6c472b513737252b4729ecad2e4902"
integrity sha512-tXagu6Hivd03wB2tiS1bqvw345sc7mKei32EgpYpq31ZLes9FN0mEK2nKzXLRFgwt3PsBB0E/MZDp159rDoqwg==
dependencies:
json-parse-better-errors "^1.0.2"
loader-runner "^4.1.0"
neo-async "^2.6.2"
schema-utils "^4.2.0"

throttleit@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c"
Expand Down