-
-
Notifications
You must be signed in to change notification settings - Fork 372
Description
It appears that all routes are being chunked and async loaded, even without the presence of the async! prefix.
I've reproduced this using preact-cli 1.4.1 here: https://github.com/ajoslin/preact-cli-issue-all-routes-chunked. Just build and serve and check the network tab, it loads both bundle and route-home.chunk. And it does a render before the home chunk is loaded.
Details
I have a prerendered homepage. Here's the process when the user visits the site:
- Index.html loads with prerendered content
- Main JS bundle loads
- Initial render is triggered without the home component downloaded
- Bundle begins downloading route-home.chunk.js
- Wait for route-home.chunk.js is loaded
- Home route chunk loads and the home content renders
Between (2) and (4), a version of the app is rendered that does not include the home route's content, because the home route's JS is still loading.
This results in a noticeable "flicker" of the home content being removed then re-appearing as soon as the initial bundle loads.
I'm not using the async! prefix when importing my home route, but it looks like the home route is being chunked anyway.