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

Create a most minimal bootstrap javascript entry point. #9

Open
3 tasks
momesana opened this issue Mar 12, 2024 · 0 comments
Open
3 tasks

Create a most minimal bootstrap javascript entry point. #9

momesana opened this issue Mar 12, 2024 · 0 comments
Assignees

Comments

@momesana
Copy link
Owner

momesana commented Mar 12, 2024

Rationale
The idea is to have a most minimal entry point to already be in a react context and lazily start bootstrapping the actual app. This is important for apps where the actual bundle grows in time and might take more than a few seconds to load. While the app hasn't loaded yet any errors (also fetch errors) will lead to a blank page and the user is wondering why he is staring at a blank content.

Therefore we'd like to achieve these things:

  • load the most basic bootstrapping environment that has only react and a react errror boundary to display possible erros when lazy loading the app. Also This must be wrapped in supsense with suspense using a loading indicator as a fallback. Keep in mind that again we don't use things like styled-components here as we'd like to keep the size of the entry point to a minimum. With this in place the loading can be showin in react and also errors will be displayed using the minimal error boundary. The user won't see a blank page in case of errors (unless the main bundle couldn't be fetched or caused an error).

In spirit, this is the render initial route as soon as possible aspect of the PRPL pattern.

DoD:

  • entry point of the app is the minimal bootstraping file bootstrap.tsx
  • entry bundle (main bundle) must be as small as humanly possible. This must be verified using our bundle analyzer. Set maxEntryPointSize to a reasonably small value and show a warning if it has been exceedd (see the performance setting in the webpack docs: https://webpack.js.org/configuration/performance/)
  • entry bundle lazyloads src/index.tsx which again lazyloads src/App.tsx.
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

No branches or pull requests

2 participants