-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Devdocs: Use Webpack Loader to load READMEs #35833
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Webpack Runtime (~36161 bytes added 📈 [gzipped])
Webpack runtime for loading modules. It is included in the HTML page as an inline script. Is downloaded and parsed every time the app is loaded. Sections (~8774 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~2 bytes removed 📉 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
c30ca23
to
42e1293
Compare
#36167 should hopefully unblock this |
aa7d802
to
398359f
Compare
Builds seem to be failing on calypso.live and CircleCI. @ockham have you looked at those? |
Adding 36k of zipped js to the manifest, which is inlined in each entrypoint, probably isn't ideal. Is that actually happening, or is that a reporting ghost? |
Yes, that really happens, because we have plenty of new webpack chunks for each README file. Good argument for making devdocs a completely separate app with its own webpack build and chunk structure. Separate entrypoint is not enough, as all entrypoints share the manifest and they all influence the shared chunks optimization. |
We can split up the manifests per entrypoint, which might buy us some time... Doesn't break apart the optimization of chunk splits though. |
398359f
to
80a642a
Compare
Closing in favor of #38784. |
Preparation for #35809.
Merge #36167 before this PR.
I think this is in the spirit of the previous architecture, but leverages modern technologies better: We continue to load and render those individual READMEs, and can even serve them over the network, thanks to Webpack's lazy loading feature.
Changes proposed in this Pull Request
Testing instructions
http://calypso.localhost:3000/devdocs/design/button
, and verify that the README is rendered correctly at the bottom of the page (compare to https://wpcalypso.wordpress.com/devdocs/design/button).http://calypso.localhost:3000/devdocs/docs/guide/index.md
, also still work.TODO
Fix
http://calypso.localhost:3000/devdocs/.github/CONTRIBUTING.md
. Probably broken because of the hidden.github
directory 🙁Update: Looks like we might be able to just move it to
docs/
and it'll still be used by GitHub! 🎉(Source)
I guess I'll file a separate PR. Update: #36167