Skip to content

Split up monaco's language chunks #12401

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

Merged
merged 3 commits into from
Aug 2, 2020
Merged

Conversation

silverwind
Copy link
Member

This should speed up monaco's loading time by splitting the current 3.71MB chunk monaco.js into 63 individual files named 1 to 63.js in the output directory. There seems to be no way to get a better file naming scheme unfortunately. I opted to exclude those files in the webpack output for brevity.

(This is a exact revival of #12193)

This should speed up monaco's loading time by splitting the current
3.71MB chunk monaco.js into 63 individual files named 1 to 63.js in
the output directory. There seems to be no way to get a better file
naming scheme unfortunately. I opted to exclude those files in the
webpack output for brevity.
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Aug 1, 2020
@lunny
Copy link
Member

lunny commented Aug 2, 2020

Didn't monaco support load by language asynchronize?

@silverwind
Copy link
Member Author

silverwind commented Aug 2, 2020

Yes it does load async but we inhibited efficient loading previously by combining the language chunks into one, forcing it to load the big 4MB file initially which had bundled all the language files into it. With this change, it will initially load the 2.2MB file and then dynamically load the smaller per-languague files (those just with numbers in the name) on-demand and this is also the recommended way.

You can see this happening in the devtools, for example when editing a JS file:

image

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Aug 2, 2020
@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Aug 2, 2020
@zeripath
Copy link
Contributor

zeripath commented Aug 2, 2020

make lg-tm work

@zeripath
Copy link
Contributor

zeripath commented Aug 2, 2020

make lg-tm work already?

@zeripath zeripath merged commit 4d9f59a into go-gitea:master Aug 2, 2020
@silverwind silverwind deleted the monacospeed branch August 2, 2020 14:46
@lafriks lafriks added this to the 1.13.0 milestone Aug 3, 2020
@lafriks lafriks added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Aug 3, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants