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

Code split JavaScript for better web performance. #380

Closed
wants to merge 6 commits into from

Conversation

tarebyte
Copy link
Contributor

While running locally and deploying we get the following warning:

remote:        WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
remote:        This can impact web performance.
remote:        Assets:
remote:          js/877-f4a664ae73896a4f6252.js (876 KiB)
remote:          js/877-f4a664ae73896a4f6252.js.gz (261 KiB)
remote:          js/877-f4a664ae73896a4f6252.js.map.gz (931 KiB)
remote:          js/877-f4a664ae73896a4f6252.js.map.br (783 KiB)
remote:
remote:        WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
remote:        Entrypoints:
remote:          application (1.07 MiB)
remote:              js/runtime-547b132100ce15a7b64c.js
remote:              css/877-639f880b.css
remote:              js/877-f4a664ae73896a4f6252.js
remote:              css/application-0fec8172.css
remote:              js/application-14d7092f7504bd01929f.js
remote:
remote:        WARNING in webpack performance recommendations:
remote:        You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
remote:        For more info visit https://webpack.js.org/guides/code-splitting/
remote:
remote:        webpack 5.88.2 compiled with 5 warnings in 27358 ms

This PR introduces Webpack code splitting which will reduce the footprint of each *.js file. So instead of one application.js file we'll have three files rails, bootstrap, and application.

@tarebyte tarebyte changed the title Code Split our JavaScript for better web performance. Code split JavaScript for better web performance. Sep 27, 2023
@tarebyte
Copy link
Contributor Author

Deployed to staging, looks like that didn't quite fix it.

remote:        WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
remote:        This can impact web performance.
remote:        Assets:
remote:          js/13-5c704d0ba9a86e1a45eb.js (601 KiB)
remote:          js/13-5c704d0ba9a86e1a45eb.js.map.gz (623 KiB)
remote:          js/13-5c704d0ba9a86e1a45eb.js.map.br (523 KiB)
remote:
remote:        WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
remote:        Entrypoints:
remote:          application (946 KiB)
remote:              js/runtime-547b132100ce15a7b64c.js
remote:              js/755-f74dce56a5ed1d719e15.js
remote:              js/918-c84c2164d5778b49bb04.js
remote:              css/13-d599193f.css
remote:              js/13-5c704d0ba9a86e1a45eb.js
remote:              css/application-0fec8172.css
remote:              js/application-a754fae9f3776e876e6f.js

@tarebyte tarebyte closed this Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants