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

Don't eagerly load all JS assets #3929

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mary-ext
Copy link
Contributor

@mary-ext mary-ext commented May 9, 2024

Realized that Bluesky is currently eagerly loading all languages and some code that was meant to be lazily-loaded, then noticed that Expo? Webpack? generates an asset-manifest.json which contains the actual entrypoint scripts to put on the HTML file.

Anyway, that saved time from having to figure out plugins like webpack-assets-manifest which is what I was about to pull beforehand.

image

(top: this PR, bottom: main.bsky.dev)

This pull request shaves ~2 MB of JS assets and some precious processing time spent during initial page load. It's still not ideal, but better than where we were before.

@mary-ext
Copy link
Contributor Author

mary-ext commented May 9, 2024

#3925 pulls in react-image-crop which requires us to import a CSS file. Thankfully it seems that the manifest adds in CSS files into the entrypoint array. Additionally, that would mean we can also move styling off the <style> element in web/index.html and bskyweb/templates/base.html (and also minify them!). I'll do these in a separate pull request if interested.

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.

None yet

1 participant