Skip to content

Commit 265b9d5

Browse files
committed
Revert "Squash: build: Speed up Webpack builds by applying thread-loader to React Compiler"
This reverts commit 63d4a6e.
1 parent 324f966 commit 265b9d5

File tree

14 files changed

+216
-704
lines changed

14 files changed

+216
-704
lines changed

.depcheckrc.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ ignores:
8282
- 'nyc' # coverage
8383
- 'core-js-pure' # polyfills
8484
- 'react-compiler-webpack' # build tool
85-
- 'thread-loader' # build tool
8685
# babel
8786
- '@babel/plugin-transform-logical-assignment-operators'
8887
- 'babel-plugin-react-compiler'

.eslintrc.base.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ module.exports = {
150150
'newlines-between': 'ignore',
151151
alphabetize: {
152152
order: 'ignore',
153+
orderImportKind: 'ignore',
153154
caseInsensitive: false,
154155
},
155156
},

development/webpack/test/loaders.codeFenceLoader.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ console.log('I am Groot.');
3232
const { promise, resolve } = Promise.withResolvers!<CallbackArgs>();
3333
const mockContext = {
3434
getOptions: () => {
35-
// Options use arrays (as serialized through thread-loader)
3635
return {
3736
features: {
38-
active: omitFeature ? [] : [featureLabel],
39-
all: [featureLabel],
37+
active: new Set(omitFeature ? [] : [featureLabel]),
38+
all: new Set([featureLabel]),
4039
},
4140
};
4241
},
@@ -92,10 +91,9 @@ console.log('I am Groot.');
9291
const features: FeatureLabels = { active: new Set(), all: new Set() };
9392
const result = getCodeFenceLoader(features);
9493

95-
// Sets are converted to arrays for JSON serialization through thread-loader
9694
assert.deepStrictEqual(result, {
9795
loader: require.resolve('../utils/loaders/codeFenceLoader'),
98-
options: { features: { active: [], all: [] } },
96+
options: { features },
9997
});
10098
});
10199
});

development/webpack/test/loaders.reactCompilerLoader.test.ts

Lines changed: 0 additions & 282 deletions
This file was deleted.

development/webpack/test/loaders.swcLoader.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { describe, it, afterEach } from 'node:test';
22
import assert from 'node:assert';
33
import { LoaderContext } from 'webpack';
4-
import swcLoader, { type SwcLoaderOptions } from '../utils/loaders/swcLoader';
5-
import { type SwcConfig } from '../utils/loaders/getSwcLoader';
4+
import swcLoader, {
5+
type SwcLoaderOptions,
6+
type SwcConfig,
7+
} from '../utils/loaders/swcLoader';
68
import { Combination, generateCases } from './helpers';
79

810
describe('swcLoader', () => {
@@ -97,10 +99,10 @@ describe('swcLoader', () => {
9799
// helpers caches `__HMR_READY__` on initialization, so we need to a new
98100
// one after we mock `process.env.__HMR_READY__`.
99101
delete require.cache[require.resolve('../utils/helpers')];
100-
delete require.cache[require.resolve('../utils/loaders/getSwcLoader')];
102+
delete require.cache[require.resolve('../utils/loaders/swcLoader')];
101103
const {
102104
getSwcLoader,
103-
}: typeof import('../utils/loaders/getSwcLoader') = require('../utils/loaders/getSwcLoader');
105+
}: typeof import('../utils/loaders/swcLoader') = require('../utils/loaders/swcLoader');
104106

105107
// note: this test isn't exhaustive of all possible `swcConfig`
106108
// properties; it is mostly intended as sanity check.

0 commit comments

Comments
 (0)