Skip to content

Commit

Permalink
perf: change JS code target to ES2021 (#6628)
Browse files Browse the repository at this point in the history
* perf: change JS code target to ES2021

* test: update snapshot
  • Loading branch information
chenjiahan authored May 27, 2024
1 parent 483d07e commit 78b37d3
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ERROR in ./logo.svgΓ— Module build failed:╰─▢ Γ— Error: Failed to loadat Object.<anonymous>.module.exports (<PROJECT_ROOT>/tests/diagnosticsCases/module-build-failed/asset-module-build-failed/my-loader.js:2:8)at LOADER_EXECUTION (<RSPACK_ROOT>/dist/loader-runner/index.js:617:23)at runSyncOrAsync (<RSPACK_ROOT>/dist/loader-runner/index.js:618:11)at <RSPACK_ROOT>/dist/loader-runner/index.js:722:9at handleResult (<RSPACK_ROOT>/dist/loader-runner/loadLoader.js:126:5)at loadLoader (<RSPACK_ROOT>/dist/loader-runner/loadLoader.js:107:16)at iterateNormalLoaders (<RSPACK_ROOT>/dist/loader-runner/index.js:711:5)at <RSPACK_ROOT>/dist/loader-runner/index.js:538:13at new Promise (<anonymous>)at runLoaders (<RSPACK_ROOT>/dist/loader-runner/index.js:513:12)help: File was processed with this loader: '<PROJECT_ROOT>/tests/diagnosticsCases/module-build-failed/asset-module-build-failed/my-loader.js'
ERROR in ./logo.svgΓ— Module build failed:╰─▢ Γ— Error: Failed to loadat Object.<anonymous>.module.exports (<PROJECT_ROOT>/tests/diagnosticsCases/module-build-failed/asset-module-build-failed/my-loader.js:2:8)at LOADER_EXECUTION (<RSPACK_ROOT>/dist/loader-runner/index.js:617:23)at runSyncOrAsync (<RSPACK_ROOT>/dist/loader-runner/index.js:618:11)at <RSPACK_ROOT>/dist/loader-runner/index.js:722:9at handleResult (<RSPACK_ROOT>/dist/loader-runner/loadLoader.js:125:5)at loadLoader (<RSPACK_ROOT>/dist/loader-runner/loadLoader.js:106:16)at iterateNormalLoaders (<RSPACK_ROOT>/dist/loader-runner/index.js:711:5)at <RSPACK_ROOT>/dist/loader-runner/index.js:538:13at new Promise (<anonymous>)at runLoaders (<RSPACK_ROOT>/dist/loader-runner/index.js:513:12)help: File was processed with this loader: '<PROJECT_ROOT>/tests/diagnosticsCases/module-build-failed/asset-module-build-failed/my-loader.js'
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ERROR in ./lib.jsΓ— Module build failed:╰─▢ Γ— Error: Failed to loadat Object.<anonymous>.module.exports (<PROJECT_ROOT>/tests/diagnosticsCases/module-build-failed/loader-throw-error/my-loader.js:2:9)at LOADER_EXECUTION (<RSPACK_ROOT>/dist/loader-runner/index.js:617:23)at runSyncOrAsync (<RSPACK_ROOT>/dist/loader-runner/index.js:618:11)at <RSPACK_ROOT>/dist/loader-runner/index.js:722:9at handleResult (<RSPACK_ROOT>/dist/loader-runner/loadLoader.js:126:5)at loadLoader (<RSPACK_ROOT>/dist/loader-runner/loadLoader.js:107:16)at iterateNormalLoaders (<RSPACK_ROOT>/dist/loader-runner/index.js:711:5)at <RSPACK_ROOT>/dist/loader-runner/index.js:538:13at new Promise (<anonymous>)at runLoaders (<RSPACK_ROOT>/dist/loader-runner/index.js:513:12)help: File was processed with this loader: '<PROJECT_ROOT>/tests/diagnosticsCases/module-build-failed/loader-throw-error/my-loader.js'
ERROR in ./lib.jsΓ— Module build failed:╰─▢ Γ— Error: Failed to loadat Object.<anonymous>.module.exports (<PROJECT_ROOT>/tests/diagnosticsCases/module-build-failed/loader-throw-error/my-loader.js:2:9)at LOADER_EXECUTION (<RSPACK_ROOT>/dist/loader-runner/index.js:617:23)at runSyncOrAsync (<RSPACK_ROOT>/dist/loader-runner/index.js:618:11)at <RSPACK_ROOT>/dist/loader-runner/index.js:722:9at handleResult (<RSPACK_ROOT>/dist/loader-runner/loadLoader.js:125:5)at loadLoader (<RSPACK_ROOT>/dist/loader-runner/loadLoader.js:106:16)at iterateNormalLoaders (<RSPACK_ROOT>/dist/loader-runner/index.js:711:5)at <RSPACK_ROOT>/dist/loader-runner/index.js:538:13at new Promise (<anonymous>)at runLoaders (<RSPACK_ROOT>/dist/loader-runner/index.js:513:12)help: File was processed with this loader: '<PROJECT_ROOT>/tests/diagnosticsCases/module-build-failed/loader-throw-error/my-loader.js'
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
"errors": Array [],
"warnings": Array [
Object {
"message": " ⚠ Error: test push\\n β”‚ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-push.js:10:33\\n β”‚ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n β”‚ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:464:41\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:531:65\\n",
"message": " ⚠ Error: test push\\n β”‚ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-push.js:10:33\\n β”‚ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n β”‚ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:464:41\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:531:23\\n",
},
Object {
"message": " ⚠ Module parse warning:\\n ╰─▢ ⚠ Module parse failed: require.main.require() is not supported by Rspack.\\n ╭────\\n 1 β”‚ require.main.require('./file');\\n Β· ──────────────────────────────\\n ╰────\\n \\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
"errors": Array [],
"warnings": Array [
Object {
"message": " ⚠ Error: test unshift\\n β”‚ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-shift.js:13:37\\n β”‚ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n β”‚ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:464:41\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:531:65\\n",
"message": " ⚠ Error: test unshift\\n β”‚ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-shift.js:13:37\\n β”‚ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n β”‚ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:464:41\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:531:23\\n",
},
],
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
"errors": Array [],
"warnings": Array [
Object {
"message": " ⚠ Error: test splice\\n β”‚ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-splice-1.js:10:41\\n β”‚ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n β”‚ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:464:41\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:531:65\\n",
"message": " ⚠ Error: test splice\\n β”‚ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-splice-1.js:10:41\\n β”‚ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n β”‚ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:464:41\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:531:23\\n",
},
],
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
"errors": Array [],
"warnings": Array [
Object {
"message": " ⚠ Error: test splice\\n β”‚ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-splice-2.js:10:41\\n β”‚ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n β”‚ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:464:41\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:531:65\\n",
"message": " ⚠ Error: test splice\\n β”‚ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-splice-2.js:10:41\\n β”‚ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n β”‚ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:464:41\\n β”‚ at <cwd>packages/rspack/dist/Compiler.js:531:23\\n",
},
Object {
"message": " ⚠ Module parse warning:\\n ╰─▢ ⚠ Module parse failed: require.main.require() is not supported by Rspack.\\n ╭────\\n 1 β”‚ require.main.require('./file');\\n Β· ──────────────────────────────\\n ╰────\\n \\n",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"module": "CommonJS", // DO NOT CHANGE: https://github.com/web-infra-dev/rspack/pull/4650
"moduleResolution": "NodeNext",
"target": "ES2018",
"target": "ES2021",
"esModuleInterop": true,
"outDir": "dist",
"declaration": true,
Expand Down

2 comments on commit 78b37d3

@rspack-bot
Copy link

Choose a reason for hiding this comment

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

πŸ“ Benchmark detail: Open

Name Base (2024-05-27 89c6913) Current Change
10000_development-mode + exec 2.6 s Β± 33 ms 2.61 s Β± 8 ms +0.47 %
10000_development-mode_hmr + exec 731 ms Β± 9.7 ms 731 ms Β± 7.7 ms -0.04 %
10000_production-mode + exec 2.53 s Β± 15 ms 2.55 s Β± 25 ms +0.55 %
arco-pro_development-mode + exec 2.41 s Β± 46 ms 2.4 s Β± 67 ms -0.34 %
arco-pro_development-mode_hmr + exec 441 ms Β± 2.2 ms 442 ms Β± 2.9 ms +0.09 %
arco-pro_development-mode_hmr_intercept-plugin + exec 451 ms Β± 4.4 ms 453 ms Β± 2 ms +0.40 %
arco-pro_development-mode_intercept-plugin + exec 3.19 s Β± 60 ms 3.15 s Β± 67 ms -1.20 %
arco-pro_production-mode + exec 3.97 s Β± 74 ms 3.97 s Β± 76 ms -0.17 %
arco-pro_production-mode_intercept-plugin + exec 4.75 s Β± 84 ms 4.73 s Β± 51 ms -0.40 %
threejs_development-mode_10x + exec 1.96 s Β± 16 ms 1.97 s Β± 21 ms +0.61 %
threejs_development-mode_10x_hmr + exec 760 ms Β± 6.6 ms 765 ms Β± 14 ms +0.65 %
threejs_production-mode_10x + exec 5.28 s Β± 23 ms 5.3 s Β± 39 ms +0.36 %

@rspack-bot
Copy link

Choose a reason for hiding this comment

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

πŸ“ Ran ecosystem CI: Open

suite result
modernjs βœ… success
_selftest βœ… success
nx βœ… success
rspress βœ… success
rsbuild βœ… success
compat βœ… success
examples βœ… success

Please sign in to comment.