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

Cleanup and mimize build size #558

Merged
merged 16 commits into from
Dec 5, 2023
Merged

Cleanup and mimize build size #558

merged 16 commits into from
Dec 5, 2023

Conversation

jorg-vr
Copy link
Contributor

@jorg-vr jorg-vr commented Nov 24, 2023

I used the new webpack 5 features to separate the workers from the main package https://webpack.js.org/guides/web-workers/

The library is no longer bundled by webpack.
It provides the javascript compiled by tsc and the css compiled by tailwind.

Bundling and minimization should be done by the importer.
This allows optimization of dependencies on their end. (Eg otherwise all codemirror code was loaded twice in dodona)

I used file-loader instead of url-loader in order to not make the whole python zip inlined in javascript.

The scope of the serviceworker had to move to the root as some parts of the code are now served from /assets in dodona

To test the impact of these build changes I made a pr in dodona https://github.com/dodona-edu/dodona/pull/5204
As can be seen there, the changes here cause some required changes there.

@jorg-vr jorg-vr added the chore Repository/build/dependency maintenance label Nov 24, 2023
@jorg-vr jorg-vr self-assigned this Nov 24, 2023
@jorg-vr jorg-vr assigned jorg-vr and unassigned jorg-vr Nov 30, 2023
@jorg-vr
Copy link
Contributor Author

jorg-vr commented Nov 30, 2023

Old dodona package size:
image

New dodona package sizes:
image
The new js packages do not include the 2.4MB zipped python code inline, which explains a part of the difference, but it is still a major reduction

@jorg-vr jorg-vr marked this pull request as ready for review November 30, 2023 14:40
@jorg-vr jorg-vr requested review from bmesuere and chvp November 30, 2023 14:41
@jorg-vr jorg-vr merged commit f832a4f into main Dec 5, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Repository/build/dependency maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants