Skip to content

Commit 8c16667

Browse files
authored
Revert "fix: temporarily disable inline enum optimization (#5960)" (#5974)
1 parent 04a3230 commit 8c16667

File tree

11 files changed

+76
-78
lines changed

11 files changed

+76
-78
lines changed

packages/core/src/plugins/basic.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ export const pluginBasic = (): RsbuildPlugin => ({
9696
chain.experiments({
9797
...chain.get('experiments'),
9898
lazyBarrel: true,
99-
// TODO: enable
100-
inlineEnum: false,
99+
inlineEnum: true,
101100
typeReexportsPresence: true,
102101
rspackFuture: {
103102
bundlerInfo: {

packages/core/src/plugins/swc.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ function getDefaultSwcConfig({
9898
rspackExperiments: {
9999
collectTypeScriptInfo: {
100100
typeExports: true,
101-
// TODO: enable
102-
exportedEnum: false,
101+
exportedEnum: true,
103102
},
104103
},
105104
};

packages/core/tests/__snapshots__/basic.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`plugin-basic > should apply basic config correctly in development 1`] =
55
"context": "<ROOT>/packages/core/tests",
66
"devtool": "cheap-module-source-map",
77
"experiments": {
8-
"inlineEnum": false,
8+
"inlineEnum": true,
99
"lazyBarrel": true,
1010
"rspackFuture": {
1111
"bundlerInfo": {
@@ -53,7 +53,7 @@ exports[`plugin-basic > should apply basic config correctly in production 1`] =
5353
"context": "<ROOT>/packages/core/tests",
5454
"devtool": false,
5555
"experiments": {
56-
"inlineEnum": false,
56+
"inlineEnum": true,
5757
"lazyBarrel": true,
5858
"rspackFuture": {
5959
"bundlerInfo": {

packages/core/tests/__snapshots__/builder.test.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exports[`should use Rspack as the default bundler > apply Rspack correctly 1`] =
1111
},
1212
"experiments": {
1313
"asyncWebAssembly": true,
14-
"inlineEnum": false,
14+
"inlineEnum": true,
1515
"lazyBarrel": true,
1616
"rspackFuture": {
1717
"bundlerInfo": {
@@ -178,7 +178,7 @@ exports[`should use Rspack as the default bundler > apply Rspack correctly 1`] =
178178
},
179179
"rspackExperiments": {
180180
"collectTypeScriptInfo": {
181-
"exportedEnum": false,
181+
"exportedEnum": true,
182182
"typeExports": true,
183183
},
184184
},
@@ -236,7 +236,7 @@ exports[`should use Rspack as the default bundler > apply Rspack correctly 1`] =
236236
},
237237
"rspackExperiments": {
238238
"collectTypeScriptInfo": {
239-
"exportedEnum": false,
239+
"exportedEnum": true,
240240
"typeExports": true,
241241
},
242242
},

packages/core/tests/__snapshots__/default.test.ts.snap

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly 1`] = `
1111
},
1212
"experiments": {
1313
"asyncWebAssembly": true,
14-
"inlineEnum": false,
14+
"inlineEnum": true,
1515
"lazyBarrel": true,
1616
"rspackFuture": {
1717
"bundlerInfo": {
@@ -178,7 +178,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly 1`] = `
178178
},
179179
"rspackExperiments": {
180180
"collectTypeScriptInfo": {
181-
"exportedEnum": false,
181+
"exportedEnum": true,
182182
"typeExports": true,
183183
},
184184
},
@@ -236,7 +236,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly 1`] = `
236236
},
237237
"rspackExperiments": {
238238
"collectTypeScriptInfo": {
239-
"exportedEnum": false,
239+
"exportedEnum": true,
240240
"typeExports": true,
241241
},
242242
},
@@ -523,7 +523,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when prod
523523
},
524524
"experiments": {
525525
"asyncWebAssembly": true,
526-
"inlineEnum": false,
526+
"inlineEnum": true,
527527
"lazyBarrel": true,
528528
"rspackFuture": {
529529
"bundlerInfo": {
@@ -690,7 +690,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when prod
690690
},
691691
"rspackExperiments": {
692692
"collectTypeScriptInfo": {
693-
"exportedEnum": false,
693+
"exportedEnum": true,
694694
"typeExports": true,
695695
},
696696
},
@@ -748,7 +748,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when prod
748748
},
749749
"rspackExperiments": {
750750
"collectTypeScriptInfo": {
751-
"exportedEnum": false,
751+
"exportedEnum": true,
752752
"typeExports": true,
753753
},
754754
},
@@ -1063,7 +1063,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when targe
10631063
},
10641064
"experiments": {
10651065
"asyncWebAssembly": true,
1066-
"inlineEnum": false,
1066+
"inlineEnum": true,
10671067
"lazyBarrel": true,
10681068
"rspackFuture": {
10691069
"bundlerInfo": {
@@ -1198,7 +1198,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when targe
11981198
},
11991199
"rspackExperiments": {
12001200
"collectTypeScriptInfo": {
1201-
"exportedEnum": false,
1201+
"exportedEnum": true,
12021202
"typeExports": true,
12031203
},
12041204
},
@@ -1252,7 +1252,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when targe
12521252
},
12531253
"rspackExperiments": {
12541254
"collectTypeScriptInfo": {
1255-
"exportedEnum": false,
1255+
"exportedEnum": true,
12561256
"typeExports": true,
12571257
},
12581258
},
@@ -1494,7 +1494,7 @@ exports[`tools.rspack > should match snapshot 1`] = `
14941494
},
14951495
"experiments": {
14961496
"asyncWebAssembly": true,
1497-
"inlineEnum": false,
1497+
"inlineEnum": true,
14981498
"lazyBarrel": true,
14991499
"rspackFuture": {
15001500
"bundlerInfo": {
@@ -1669,7 +1669,7 @@ exports[`tools.rspack > should match snapshot 1`] = `
16691669
},
16701670
"rspackExperiments": {
16711671
"collectTypeScriptInfo": {
1672-
"exportedEnum": false,
1672+
"exportedEnum": true,
16731673
"typeExports": true,
16741674
},
16751675
},
@@ -1727,7 +1727,7 @@ exports[`tools.rspack > should match snapshot 1`] = `
17271727
},
17281728
"rspackExperiments": {
17291729
"collectTypeScriptInfo": {
1730-
"exportedEnum": false,
1730+
"exportedEnum": true,
17311731
"typeExports": true,
17321732
},
17331733
},

packages/core/tests/__snapshots__/environments.test.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,7 @@ exports[`environment config > tools.rspack / bundlerChain can be configured in e
13521352
"devtool": "eval-source-map",
13531353
"experiments": {
13541354
"asyncWebAssembly": true,
1355-
"inlineEnum": false,
1355+
"inlineEnum": true,
13561356
"lazyBarrel": true,
13571357
"rspackFuture": {
13581358
"bundlerInfo": {
@@ -1519,7 +1519,7 @@ exports[`environment config > tools.rspack / bundlerChain can be configured in e
15191519
},
15201520
"rspackExperiments": {
15211521
"collectTypeScriptInfo": {
1522-
"exportedEnum": false,
1522+
"exportedEnum": true,
15231523
"typeExports": true,
15241524
},
15251525
},
@@ -1577,7 +1577,7 @@ exports[`environment config > tools.rspack / bundlerChain can be configured in e
15771577
},
15781578
"rspackExperiments": {
15791579
"collectTypeScriptInfo": {
1580-
"exportedEnum": false,
1580+
"exportedEnum": true,
15811581
"typeExports": true,
15821582
},
15831583
},
@@ -1804,7 +1804,7 @@ exports[`environment config > tools.rspack / bundlerChain can be configured in e
18041804
"devtool": "eval",
18051805
"experiments": {
18061806
"asyncWebAssembly": true,
1807-
"inlineEnum": false,
1807+
"inlineEnum": true,
18081808
"lazyBarrel": true,
18091809
"rspackFuture": {
18101810
"bundlerInfo": {
@@ -1939,7 +1939,7 @@ exports[`environment config > tools.rspack / bundlerChain can be configured in e
19391939
},
19401940
"rspackExperiments": {
19411941
"collectTypeScriptInfo": {
1942-
"exportedEnum": false,
1942+
"exportedEnum": true,
19431943
"typeExports": true,
19441944
},
19451945
},
@@ -1993,7 +1993,7 @@ exports[`environment config > tools.rspack / bundlerChain can be configured in e
19931993
},
19941994
"rspackExperiments": {
19951995
"collectTypeScriptInfo": {
1996-
"exportedEnum": false,
1996+
"exportedEnum": true,
19971997
"typeExports": true,
19981998
},
19991999
},

0 commit comments

Comments
 (0)