-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Fix various problems #35012
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
Fix various problems #35012
Conversation
} else { | ||
throw e; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note: So we are waiting for DOMContentLoaded
until we load this chunk from the network? I think this will cause unnecessary delay and we could start this load earlier and only actually execute the code on DOMContentLoaded
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The waiting time is almost the same as the old approach : index.js
before </body></html>
.
But yes, we can start the import immediately, and only "init" in DOMContentLoaded
, it needs to make the index-domready
expose its init
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are no major benefits to this 2-chunk approach, maybe we should have all main JS in one chunk only. It's simpler design and whether the browser loads 1MB vs. 1.3MB makes no practical difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think we can merge them into one index.js
and load it in the <head>
, total size is about 2.7MB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That value seems off. In 1.24 I see much lower sizes:
If it is, which part makes the new index.js so large? #34960 (comment)
Or the size difference is caused by different packing options? production vs dev?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes likely you are seeing dev values. Dev JS is not minified:
Line 108 in 091b3e6
minimize: isProduction, |
* giteaofficial/main: [skip ci] Updated translations via Crowdin Docs/fix typo and grammar in CONTRIBUTING.md (go-gitea#35024) fix: improve english grammar and readability in locale_en-US.ini (go-gitea#35017) Add labeler config for `topic/code-linting` (go-gitea#35020) Fix various problems (go-gitea#35012) Fix the response format for `actions/workflows`. (go-gitea#35009)
Uh oh!
There was an error while loading. Please reload this page.