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

Move to pure TS package to reduce bundle size #89

Merged
merged 30 commits into from
Apr 14, 2023
Merged

Conversation

spaenleh
Copy link
Member

@spaenleh spaenleh commented Apr 11, 2023

In this PR:

  • export this package as a pure TS package. Only transpilation step is through tsc with tsc-alias to resolve absolute paths to relative paths
  • use vitejs as the bundler for component tests
  • use default import on second level for mui icons
  • remove unused dependencies (react-csv, ...)
  • externalized dependencies like "react-i18next" and "@emotion/react" to remove bundle duplication and issues with duplicated contexts

Issues:

  • the TS package is still transpiled to commonJS, because CRA and MUI can't handle handle ESM correctly.

The resulting bundle size for builder is currently around 1.2Mb versus 2.17Mb for the current main version.
Before:
Capture d’écran 2023-04-12 à 17 45 11
After:
Capture d’écran 2023-04-12 à 17 41 52

@spaenleh spaenleh requested a review from pyphilia April 11, 2023 11:23
@spaenleh spaenleh self-assigned this Apr 11, 2023
@spaenleh spaenleh added build Build and developer operations chore Generic task or chore labels Apr 11, 2023
@spaenleh spaenleh force-pushed the test-reduce-bundle branch from 54fe43e to a54d378 Compare April 12, 2023 08:22
@spaenleh spaenleh force-pushed the test-reduce-bundle branch 2 times, most recently from ade4df5 to c3d6d9c Compare April 12, 2023 09:38
@spaenleh spaenleh force-pushed the test-reduce-bundle branch from c3d6d9c to 6194f97 Compare April 12, 2023 09:42
@spaenleh spaenleh force-pushed the test-reduce-bundle branch from 0853a2b to 39c3268 Compare April 12, 2023 11:31
@spaenleh spaenleh force-pushed the test-reduce-bundle branch from 736ecab to 466c300 Compare April 12, 2023 14:18
@spaenleh spaenleh requested a review from codeofmochi April 12, 2023 15:29
@spaenleh spaenleh changed the title Reduce bundle size Move to pure TS package to reduce bundle size Apr 12, 2023
Copy link
Contributor

@pyphilia pyphilia left a comment

Choose a reason for hiding this comment

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

LGTM 🍽️

index.html Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@spaenleh spaenleh merged commit 0b07b36 into main Apr 14, 2023
@spaenleh spaenleh deleted the test-reduce-bundle branch April 14, 2023 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build and developer operations chore Generic task or chore v1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants