Skip to content
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

(chore) Switch to using SwcMinifyWebpackPlugin #826

Closed
wants to merge 1 commit into from

Conversation

ibacher
Copy link
Member

@ibacher ibacher commented Nov 30, 2023

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.

For changes to apps

If applicable

  • My work includes tests or is validated by existing tests.
  • I have updated the esm-framework mock to reflect any API changes I have made.

Summary

Switches from using Terser (default) to SwcMinifyWebpackPlugin, which runs SWC's minifier.

The main goal here is to reduce memory consumption in builds.

Screenshots

Related Issue

Other

Copy link
Contributor

Size Change: +43.6 kB (+2%)

Total Size: 2.65 MB

ℹ️ View Unchanged
Filename Size Change
packages/apps/esm-devtools-app/dist/68.js 4.7 kB +33 B (+1%)
packages/apps/esm-devtools-app/dist/735.js 2.72 kB +86 B (+3%)
packages/apps/esm-devtools-app/dist/889.js 107 kB +60 B (0%)
packages/apps/esm-devtools-app/dist/988.js 288 B +6 B (+2%)
packages/apps/esm-devtools-app/dist/main.js 3.38 kB +432 B (+15%) ⚠️
packages/apps/esm-devtools-app/dist/openmrs-esm-devtools-app.js 3.43 kB +397 B (+13%) ⚠️
packages/apps/esm-implementer-tools-app/dist/263.js 6.68 kB +21 B (0%)
packages/apps/esm-implementer-tools-app/dist/285.js 69.1 kB +8.32 kB (+14%) ⚠️
packages/apps/esm-implementer-tools-app/dist/319.js 630 B -3 B (0%)
packages/apps/esm-implementer-tools-app/dist/329.js 11.1 kB +1.09 kB (+11%) ⚠️
packages/apps/esm-implementer-tools-app/dist/426.js 1.67 kB +10 B (+1%)
packages/apps/esm-implementer-tools-app/dist/460.js 735 B 0 B
packages/apps/esm-implementer-tools-app/dist/56.js 3.06 kB -8 B (0%)
packages/apps/esm-implementer-tools-app/dist/560.js 9.68 kB +77 B (+1%)
packages/apps/esm-implementer-tools-app/dist/574.js 560 B 0 B
packages/apps/esm-implementer-tools-app/dist/587.js 2.85 kB +35 B (+1%)
packages/apps/esm-implementer-tools-app/dist/620.js 126 kB -35 B (0%)
packages/apps/esm-implementer-tools-app/dist/625.js 562 B 0 B
packages/apps/esm-implementer-tools-app/dist/727.js 33.2 kB +310 B (+1%)
packages/apps/esm-implementer-tools-app/dist/735.js 2.72 kB +90 B (+3%)
packages/apps/esm-implementer-tools-app/dist/757.js 560 B 0 B
packages/apps/esm-implementer-tools-app/dist/788.js 43.1 kB +241 B (+1%)
packages/apps/esm-implementer-tools-app/dist/807.js 559 B 0 B
packages/apps/esm-implementer-tools-app/dist/833.js 681 B 0 B
packages/apps/esm-implementer-tools-app/dist/889.js 107 kB +59 B (0%)
packages/apps/esm-implementer-tools-app/dist/main.js 81.6 kB +8.72 kB (+12%) ⚠️
packages/apps/esm-implementer-tools-app/dist/openmrs-esm-implementer-tools-app.js 3.67 kB +368 B (+11%) ⚠️
packages/apps/esm-login-app/dist/111.js 1.21 kB -13 B (-1%)
packages/apps/esm-login-app/dist/126.js 2.61 kB +109 B (+4%)
packages/apps/esm-login-app/dist/173.js 1.21 kB -13 B (-1%)
packages/apps/esm-login-app/dist/224.js 255 B -1 B (0%)
packages/apps/esm-login-app/dist/236.js 272 B 0 B
packages/apps/esm-login-app/dist/240.js 364 B 0 B
packages/apps/esm-login-app/dist/263.js 6.67 kB +19 B (0%)
packages/apps/esm-login-app/dist/272.js 261 B -3 B (-1%)
packages/apps/esm-login-app/dist/319.js 690 B -2 B (0%)
packages/apps/esm-login-app/dist/336.js 234 B 0 B
packages/apps/esm-login-app/dist/370.js 27.3 kB +68 B (0%)
packages/apps/esm-login-app/dist/460.js 782 B 0 B
packages/apps/esm-login-app/dist/539.js 298 B 0 B
packages/apps/esm-login-app/dist/56.js 3.06 kB -9 B (0%)
packages/apps/esm-login-app/dist/574.js 609 B 0 B
packages/apps/esm-login-app/dist/625.js 600 B 0 B
packages/apps/esm-login-app/dist/627.js 253 B -4 B (-2%)
packages/apps/esm-login-app/dist/63.js 16.5 kB +21 B (0%)
packages/apps/esm-login-app/dist/644.js 305 B 0 B
packages/apps/esm-login-app/dist/673.js 285 B +1 B (0%)
packages/apps/esm-login-app/dist/735.js 2.72 kB +88 B (+3%)
packages/apps/esm-login-app/dist/757.js 696 B -2 B (0%)
packages/apps/esm-login-app/dist/788.js 43.1 kB +239 B (+1%)
packages/apps/esm-login-app/dist/807.js 961 B 0 B
packages/apps/esm-login-app/dist/812.js 26.3 kB +3.76 kB (+17%) ⚠️
packages/apps/esm-login-app/dist/833.js 727 B 0 B
packages/apps/esm-login-app/dist/889.js 107 kB +59 B (0%)
packages/apps/esm-login-app/dist/main.js 58.3 kB +4.72 kB (+9%) 🔍
packages/apps/esm-login-app/dist/openmrs-esm-login-app.js 3.71 kB +389 B (+12%) ⚠️
packages/apps/esm-offline-tools-app/dist/102.js 81.5 kB +226 B (0%)
packages/apps/esm-offline-tools-app/dist/193.js 58.5 kB +3.4 kB (+6%) 🔍
packages/apps/esm-offline-tools-app/dist/263.js 6.68 kB +19 B (0%)
packages/apps/esm-offline-tools-app/dist/319.js 1.13 kB -6 B (-1%)
packages/apps/esm-offline-tools-app/dist/460.js 1.32 kB 0 B
packages/apps/esm-offline-tools-app/dist/56.js 3.06 kB -8 B (0%)
packages/apps/esm-offline-tools-app/dist/574.js 1.04 kB 0 B
packages/apps/esm-offline-tools-app/dist/625.js 1.04 kB 0 B
packages/apps/esm-offline-tools-app/dist/63.js 16.5 kB +22 B (0%)
packages/apps/esm-offline-tools-app/dist/735.js 2.72 kB +88 B (+3%)
packages/apps/esm-offline-tools-app/dist/757.js 1.2 kB -1 B (0%)
packages/apps/esm-offline-tools-app/dist/788.js 43.1 kB +239 B (+1%)
packages/apps/esm-offline-tools-app/dist/807.js 1.1 kB 0 B
packages/apps/esm-offline-tools-app/dist/833.js 1.22 kB 0 B
packages/apps/esm-offline-tools-app/dist/889.js 107 kB +60 B (0%)
packages/apps/esm-offline-tools-app/dist/main.js 140 kB +4.05 kB (+3%)
packages/apps/esm-offline-tools-app/dist/openmrs-esm-offline-tools-app.js 3.65 kB +367 B (+11%) ⚠️
packages/apps/esm-primary-navigation-app/dist/262.js 15.3 kB +1.98 kB (+15%) ⚠️
packages/apps/esm-primary-navigation-app/dist/263.js 6.68 kB +19 B (0%)
packages/apps/esm-primary-navigation-app/dist/319.js 198 B -2 B (-1%)
packages/apps/esm-primary-navigation-app/dist/460.js 217 B 0 B
packages/apps/esm-primary-navigation-app/dist/574.js 183 B 0 B
packages/apps/esm-primary-navigation-app/dist/625.js 184 B 0 B
packages/apps/esm-primary-navigation-app/dist/63.js 16.5 kB +24 B (0%)
packages/apps/esm-primary-navigation-app/dist/735.js 18.8 kB +73 B (0%)
packages/apps/esm-primary-navigation-app/dist/757.js 207 B -2 B (-1%)
packages/apps/esm-primary-navigation-app/dist/788.js 43.1 kB +239 B (+1%)
packages/apps/esm-primary-navigation-app/dist/807.js 235 B 0 B
packages/apps/esm-primary-navigation-app/dist/833.js 210 B 0 B
packages/apps/esm-primary-navigation-app/dist/889.js 107 kB +58 B (0%)
packages/apps/esm-primary-navigation-app/dist/960.js 2.73 kB +89 B (+3%)
packages/apps/esm-primary-navigation-app/dist/main.js 36.5 kB +2.8 kB (+8%) 🔍
packages/apps/esm-primary-navigation-app/dist/openmrs-esm-primary-navigation-app.js 3.59 kB +364 B (+11%) ⚠️
packages/framework/esm-api/dist/openmrs-esm-api.js 9.75 kB 0 B
packages/framework/esm-breadcrumbs/dist/openmrs-esm-breadcrumbs.js 2.66 kB 0 B
packages/framework/esm-config/dist/openmrs-esm-module-config.js 7.87 kB 0 B
packages/framework/esm-dynamic-loading/dist/openmrs-esm-dynamic-loading.js 2.12 kB 0 B
packages/framework/esm-error-handling/dist/openmrs-esm-error-handling.js 894 B 0 B
packages/framework/esm-extensions/dist/openmrs-esm-extensions.js 8.05 kB 0 B
packages/framework/esm-feature-flags/dist/openmrs-esm-feature-flags.js 1.67 kB 0 B
packages/framework/esm-framework/dist/146.openmrs-esm-framework.js 6.69 kB +2 B (0%)
packages/framework/esm-framework/dist/455.openmrs-esm-framework.js 4.79 kB +224 B (+5%) 🔍
packages/framework/esm-framework/dist/530.openmrs-esm-framework.js 2.9 kB -19 B (-1%)
packages/framework/esm-framework/dist/645.openmrs-esm-framework.js 9.39 kB +82 B (+1%)
packages/framework/esm-framework/dist/710.openmrs-esm-framework.js 6.42 kB -60 B (-1%)
packages/framework/esm-framework/dist/735.openmrs-esm-framework.js 2.75 kB +93 B (+3%)
packages/framework/esm-framework/dist/788.openmrs-esm-framework.js 43.2 kB +224 B (+1%)
packages/framework/esm-framework/dist/openmrs-esm-framework.js 373 kB -721 B (0%)
packages/framework/esm-globals/dist/openmrs-esm-globals.js 756 B 0 B
packages/framework/esm-offline/dist/openmrs-esm-offline.js 34.4 kB 0 B
packages/framework/esm-react-utils/dist/openmrs-esm-react-utils.js 15.2 kB 0 B
packages/framework/esm-state/dist/openmrs-esm-state.js 888 B 0 B
packages/framework/esm-styleguide/dist/openmrs-esm-styleguide.js 19.1 kB -110 B (-1%)
packages/framework/esm-utils/dist/openmrs-esm-utils.js 11 kB 0 B
packages/shell/esm-app-shell/dist/25018673bc6f380f.js 6.03 kB 0 B
packages/shell/esm-app-shell/dist/498a8af91d44612e.js 4.1 kB 0 B
packages/shell/esm-app-shell/dist/966c4dfec919951f.js 1.58 kB 0 B
packages/shell/esm-app-shell/dist/openmrs.adefbb15f59ef03e.js 332 kB 0 B
packages/shell/esm-app-shell/dist/service-worker.js 60.4 kB 0 B
packages/tooling/openmrs/dist/cli.js 3.09 kB 0 B
packages/tooling/openmrs/dist/commands/assemble.js 2.73 kB 0 B
packages/tooling/openmrs/dist/commands/build.js 1.66 kB 0 B
packages/tooling/openmrs/dist/commands/debug.js 579 B 0 B
packages/tooling/openmrs/dist/commands/develop.js 1.86 kB 0 B
packages/tooling/openmrs/dist/commands/index.js 438 B 0 B
packages/tooling/openmrs/dist/commands/start.js 848 B 0 B
packages/tooling/openmrs/dist/index.js 517 B 0 B
packages/tooling/openmrs/dist/runner.js 870 B 0 B
packages/tooling/openmrs/dist/utils/config.js 726 B 0 B
packages/tooling/openmrs/dist/utils/debugger.js 529 B 0 B
packages/tooling/openmrs/dist/utils/dependencies.js 639 B 0 B
packages/tooling/openmrs/dist/utils/helpers.js 393 B 0 B
packages/tooling/openmrs/dist/utils/importmap.js 3.25 kB 0 B
packages/tooling/openmrs/dist/utils/index.js 444 B 0 B
packages/tooling/openmrs/dist/utils/logger.js 234 B 0 B
packages/tooling/openmrs/dist/utils/npmConfig.js 854 B 0 B
packages/tooling/openmrs/dist/utils/untar.js 721 B 0 B
packages/tooling/openmrs/dist/utils/variables.js 192 B 0 B
packages/tooling/openmrs/dist/utils/webpack.js 276 B 0 B
packages/tooling/webpack-config/dist/index.js 3.63 kB +48 B (+1%)

compressed-size-action

@denniskigen
Copy link
Member

Might it be worthwhile to try and use TerserWebpackPlugin's swc mode first before switching from Terser altogether, @ibacher?

@ibacher
Copy link
Member Author

ibacher commented Dec 5, 2023

@denniskigen Well, I have no real desire to switch from using Terser per se. This was just to see if we could pare back the memory usage. Since that was the goal, it made sense to drop Terser altogether, because Terser spawns a worker per available CPU, which would lead to an increased number of Node processes, and hence, memory consumption. It doesn't seem like this switch was meaningfully different though.

@ibacher ibacher closed this Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants