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

⚡️optimize bundle #2528

Merged
merged 6 commits into from
Dec 12, 2023
Merged

⚡️optimize bundle #2528

merged 6 commits into from
Dec 12, 2023

Conversation

AntoLC
Copy link
Contributor

@AntoLC AntoLC commented Dec 4, 2023

Purpose

The apps bundles size were quite big, 3 problems were identified:

  • standalone: @faker-js/faker weight about 3mo, it was bundled in the build of the standalone site
  • lti: mjs file of cunningham was not treeshaked - all the index.mjs was imported
  • lti: css was directly integrated to the the index.js

Proposal

  • faker problem: separate the tests modules from the main package of our packages
  • improve LTI webpack config to treeshake mjs files
  • extract css from packages to add it in a separate file

Improvment

Standalone main bundle: 7.37mo to 3.62mo (-50%)

Capture d'écran 2023-12-06 111151
Capture d'écran 2023-12-06 110823


LTI index bundle: 5.25mo to 3.82mo (-27%)

Capture d'écran 2023-12-06 111310

Capture d'écran 2023-12-07 105800

@AntoLC AntoLC self-assigned this Dec 4, 2023
@AntoLC AntoLC force-pushed the feature/anthony/optimize-bundle branch 8 times, most recently from d969ff1 to 652b48a Compare December 7, 2023 10:59
@AntoLC AntoLC added the critical label Dec 7, 2023
@AntoLC AntoLC marked this pull request as ready for review December 7, 2023 11:07
Copy link
Member

@kernicPanel kernicPanel left a comment

Choose a reason for hiding this comment

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

Great improvement!

@AntoLC AntoLC force-pushed the feature/anthony/optimize-bundle branch from 652b48a to fc883d9 Compare December 11, 2023 08:51
Add commands to be able to analyze the bundle size of our apps to see
which packages are taking up the most space.
@AntoLC AntoLC force-pushed the feature/anthony/optimize-bundle branch from fc883d9 to 10f187f Compare December 11, 2023 09:05
@faker-js/faker is a big package, it weights a lot in the bundle size
of our apps, and we only use it for tests.
In order to optimize the bundle size, we separate the tests modules
from the main package.
@faker-js/faker is a big package, it weights a lot in the bundle size
of our apps, and we only use it for tests.
In order to optimize the bundle size, we separate the tests modules
from the main package.
@faker-js/faker is a big package, it weights a lot in the bundle size
of our apps, and we only use it for tests.
In order to optimize the bundle size, we separate the tests modules
from the main package.
The webpack config was not set up to tree shake mjs files. In
our case, the full index.mjs of cunningham was being included
in the bundle. This commit fixes that.
We need css files and font from the Cunningham packages
to style our app, but the css was included directly in the js bundle,
which was not optimal.
The css is now in a separate file, which is loaded in the html
template. This allows the browser to cache the css file and
improves the loading time of the page.
@AntoLC AntoLC force-pushed the feature/anthony/optimize-bundle branch from 10f187f to 256d9ad Compare December 11, 2023 09:18
@AntoLC AntoLC merged commit 35a04d9 into master Dec 12, 2023
33 of 34 checks passed
@AntoLC AntoLC deleted the feature/anthony/optimize-bundle branch December 12, 2023 09:27
lunika added a commit that referenced this pull request Jun 24, 2024
Added

- Add scaleway storage configuration
- Add Peertube pipeline to VOD
- Celery task queue
- Refactor video S3 deletion
- Add thumbnail celery task
- Add shared live media celery task
- Add timed text track celery task
- Add form submission with enter key when entering a classroom
- Persist username used on classroom join

Changed

- Replace CRA by Vite (#2530)
- Replace grommet Image and Grid component (#2518)
- Optimized apps bundle (#2528)
- Launch transcoding through a celery task

Fixed

- Correctly set startime with filtering medialive logs
- Remove non existing fields in PortabilityRequestAdmin
- Correctly send xapi statement to a configured LRS
- Correctly send xapi video download statements
lunika added a commit that referenced this pull request Jun 26, 2024
Added

- Add scaleway storage configuration
- Add Peertube pipeline to VOD
- Celery task queue
- Refactor video S3 deletion
- Add thumbnail celery task
- Add shared live media celery task
- Add timed text track celery task
- Add form submission with enter key when entering a classroom
- Persist username used on classroom join

Changed

- Replace CRA by Vite (#2530)
- Replace grommet Image and Grid component (#2518)
- Optimized apps bundle (#2528)
- Launch transcoding through a celery task

Fixed

- Correctly set startime with filtering medialive logs
- Remove non existing fields in PortabilityRequestAdmin
- Correctly send xapi statement to a configured LRS
- Correctly send xapi video download statements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants