Skip to content

Commit 8ac83e8

Browse files
committed
Revert webpack config
1 parent fae3b64 commit 8ac83e8

File tree

4 files changed

+4
-178
lines changed

4 files changed

+4
-178
lines changed

development/webpack/utils/config.ts

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { join } from 'node:path';
22
import { readFileSync } from 'node:fs';
33
import { parse } from 'dotenv';
4-
import type { ReactCompilerLoaderOption } from 'react-compiler-webpack';
5-
import type { EnvironmentConfig } from 'babel-plugin-react-compiler';
64
import { setEnvironmentVariables } from '../../build/set-environment-variables';
75
import type { Variables } from '../../lib/variables';
86
import type { BuildTypesConfig, BuildType } from '../../lib/build-type';
@@ -191,116 +189,3 @@ function loadConfigVars(
191189

192190
return definitions;
193191
}
194-
195-
/**
196-
* React Compiler logger that tracks compilation statistics
197-
*/
198-
class ReactCompilerLogger {
199-
private compiledCount = 0;
200-
201-
private skippedCount = 0;
202-
203-
private errorCount = 0;
204-
205-
private compiledFiles: string[] = [];
206-
207-
private skippedFiles: string[] = [];
208-
209-
private errorFiles: string[] = [];
210-
211-
logEvent(filename: string | null, event: { kind: string; reason?: string }) {
212-
if (filename === null) {
213-
return;
214-
}
215-
switch (event.kind) {
216-
case 'CompileSuccess':
217-
this.compiledCount++;
218-
this.compiledFiles.push(filename);
219-
// console.log(`✅ Compiled: ${filename}`);
220-
break;
221-
case 'CompileSkip':
222-
this.skippedCount++;
223-
this.skippedFiles.push(filename);
224-
break;
225-
case 'CompileError':
226-
this.errorCount++;
227-
this.errorFiles.push(filename);
228-
// console.error(
229-
// `❌ React Compiler error in ${filename}: ${event.reason || 'Unknown error'}`,
230-
// );
231-
break;
232-
default:
233-
// Ignore other event types
234-
break;
235-
}
236-
}
237-
238-
getStats() {
239-
return {
240-
compiled: this.compiledCount,
241-
skipped: this.skippedCount,
242-
errors: this.errorCount,
243-
total: this.compiledCount + this.skippedCount + this.errorCount,
244-
compiledFiles: this.compiledFiles,
245-
skippedFiles: this.skippedFiles,
246-
errorFiles: this.errorFiles,
247-
};
248-
}
249-
250-
logSummary() {
251-
const stats = this.getStats();
252-
console.log('\n📊 React Compiler Statistics:');
253-
console.log(` ✅ Compiled: ${stats.compiled} files`);
254-
console.log(` ⏭️ Skipped: ${stats.skipped} files`);
255-
console.log(` ❌ Errors: ${stats.errors} files`);
256-
console.log(` 📦 Total processed: ${stats.total} files`);
257-
}
258-
}
259-
260-
// Create a singleton logger instance
261-
const reactCompilerLogger = new ReactCompilerLogger();
262-
263-
export const reactCompilerOptions = {
264-
target: '17',
265-
logger: reactCompilerLogger,
266-
gating: null,
267-
noEmit: false,
268-
compilationMode: 'all',
269-
eslintSuppressionRules: null,
270-
flowSuppressions: false,
271-
ignoreUseNoForget: false,
272-
sources: (filename) => {
273-
if (!filename.includes('/ui/')) {
274-
return false;
275-
}
276-
const excludePatterns = [
277-
'.test.',
278-
'.stories.',
279-
'.container.',
280-
'/__mocks__/',
281-
'/__snapshots__/',
282-
'/constants/',
283-
'/helpers/',
284-
'/ducks/',
285-
'/selectors/',
286-
'/store/',
287-
'/component-library/',
288-
];
289-
if (excludePatterns.some((pattern) => filename.includes(pattern))) {
290-
return false;
291-
}
292-
return true;
293-
},
294-
enableReanimatedCheck: false,
295-
environment: {} as EnvironmentConfig,
296-
dynamicGating: null,
297-
panicThreshold: 'none',
298-
customOptOutDirectives: null,
299-
} as const satisfies ReactCompilerLoaderOption;
300-
301-
/**
302-
* Get the React Compiler logger instance for accessing statistics
303-
*/
304-
export function getReactCompilerLogger(): ReactCompilerLogger {
305-
return reactCompilerLogger;
306-
}

development/webpack/webpack.config.ts

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ import rtlCss from 'postcss-rtlcss';
1818
import autoprefixer from 'autoprefixer';
1919
import discardFonts from 'postcss-discard-font-face';
2020
import type ReactRefreshPluginType from '@pmmmwh/react-refresh-webpack-plugin';
21-
import {
22-
defineReactCompilerLoaderOption,
23-
reactCompilerLoader,
24-
} from 'react-compiler-webpack';
2521
import tailwindcss from 'tailwindcss';
2622
import { loadBuildTypesConfig } from '../lib/build-type';
2723
import {
@@ -37,11 +33,7 @@ import { transformManifest } from './utils/plugins/ManifestPlugin/helpers';
3733
import { parseArgv, getDryRunMessage } from './utils/cli';
3834
import { getCodeFenceLoader } from './utils/loaders/codeFenceLoader';
3935
import { getSwcLoader } from './utils/loaders/swcLoader';
40-
import {
41-
getVariables,
42-
reactCompilerOptions,
43-
getReactCompilerLogger,
44-
} from './utils/config';
36+
import { getVariables } from './utils/config';
4537
import { ManifestPlugin } from './utils/plugins/ManifestPlugin';
4638
import { getLatestCommit } from './utils/git';
4739

@@ -218,17 +210,6 @@ if (args.progress) {
218210
const { ProgressPlugin } = require('webpack');
219211
plugins.push(new ProgressPlugin());
220212
}
221-
222-
// React Compiler statistics logger plugin
223-
plugins.push({
224-
apply(compiler) {
225-
compiler.hooks.done.tap('ReactCompilerStatsPlugin', () => {
226-
const logger = getReactCompilerLogger();
227-
logger.logSummary();
228-
});
229-
},
230-
} as WebpackPluginInstance);
231-
232213
// #endregion plugins
233214

234215
const swcConfig = { args, browsersListQuery, isDevelopment };
@@ -342,27 +323,13 @@ const config = {
342323
{
343324
test: /\.(?:ts|mts|tsx)$/u,
344325
exclude: NODE_MODULES_RE,
345-
use: [
346-
{
347-
loader: reactCompilerLoader,
348-
options: defineReactCompilerLoaderOption(reactCompilerOptions),
349-
},
350-
tsxLoader,
351-
codeFenceLoader,
352-
],
326+
use: [tsxLoader, codeFenceLoader],
353327
},
354328
// own javascript, and own javascript with jsx
355329
{
356330
test: /\.(?:js|mjs|jsx)$/u,
357331
exclude: NODE_MODULES_RE,
358-
use: [
359-
{
360-
loader: reactCompilerLoader,
361-
options: defineReactCompilerLoaderOption(reactCompilerOptions),
362-
},
363-
jsxLoader,
364-
codeFenceLoader,
365-
],
332+
use: [jsxLoader, codeFenceLoader],
366333
},
367334
// vendor javascript. We must transform all npm modules to ensure browser
368335
// compatibility.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,6 @@
682682
"process": "^0.11.10",
683683
"pumpify": "^2.0.1",
684684
"randomcolor": "^0.5.4",
685-
"react-compiler-webpack": "0.2.1",
686685
"react-devtools": "^6.1.5",
687686
"react-devtools-core": "^6.1.5",
688687
"react-syntax-highlighter": "^15.5.0",

yarn.lock

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ __metadata:
834834
languageName: node
835835
linkType: hard
836836

837-
"@babel/plugin-syntax-jsx@npm:^7.22.5, @babel/plugin-syntax-jsx@npm:^7.25.9, @babel/plugin-syntax-jsx@npm:^7.27.1, @babel/plugin-syntax-jsx@npm:^7.7.2":
837+
"@babel/plugin-syntax-jsx@npm:^7.22.5, @babel/plugin-syntax-jsx@npm:^7.25.9, @babel/plugin-syntax-jsx@npm:^7.7.2":
838838
version: 7.27.1
839839
resolution: "@babel/plugin-syntax-jsx@npm:7.27.1"
840840
dependencies:
@@ -933,17 +933,6 @@ __metadata:
933933
languageName: node
934934
linkType: hard
935935

936-
"@babel/plugin-syntax-typescript@npm:^7.27.1":
937-
version: 7.27.1
938-
resolution: "@babel/plugin-syntax-typescript@npm:7.27.1"
939-
dependencies:
940-
"@babel/helper-plugin-utils": "npm:^7.27.1"
941-
peerDependencies:
942-
"@babel/core": ^7.0.0-0
943-
checksum: 10/87836f7e32af624c2914c73cd6b9803cf324e07d43f61dbb973c6a86f75df725e12540d91fac7141c14b697aa9268fd064220998daced156e96ac3062d7afb41
944-
languageName: node
945-
linkType: hard
946-
947936
"@babel/plugin-syntax-unicode-sets-regex@npm:^7.18.6":
948937
version: 7.18.6
949938
resolution: "@babel/plugin-syntax-unicode-sets-regex@npm:7.18.6"
@@ -33496,7 +33485,6 @@ __metadata:
3349633485
react-beautiful-dnd: "npm:^13.1.1"
3349733486
react-chartjs-2: "npm:^5.2.0"
3349833487
react-compiler-runtime: "npm:19.1.0-rc.3"
33499-
react-compiler-webpack: "npm:0.2.1"
3350033488
react-devtools: "npm:^6.1.5"
3350133489
react-devtools-core: "npm:^6.1.5"
3350233490
react-dom: "npm:^17.0.2"
@@ -37661,19 +37649,6 @@ __metadata:
3766137649
languageName: node
3766237650
linkType: hard
3766337651

37664-
"react-compiler-webpack@npm:0.2.1":
37665-
version: 0.2.1
37666-
resolution: "react-compiler-webpack@npm:0.2.1"
37667-
dependencies:
37668-
"@babel/core": "npm:^7.28.4"
37669-
"@babel/plugin-syntax-jsx": "npm:^7.27.1"
37670-
"@babel/plugin-syntax-typescript": "npm:^7.27.1"
37671-
peerDependencies:
37672-
babel-plugin-react-compiler: "*"
37673-
checksum: 10/5571abebe68334969f3a40c6c21a4a6c3d8ba8a63c91348eac1209624e58e5b373609677244bbbd7480a094517c1b15f75d54400a91914728d74c9194d76775a
37674-
languageName: node
37675-
linkType: hard
37676-
3767737652
"react-devtools-core@npm:6.1.5, react-devtools-core@npm:^6.1.5":
3767837653
version: 6.1.5
3767937654
resolution: "react-devtools-core@npm:6.1.5"

0 commit comments

Comments
 (0)