-
Notifications
You must be signed in to change notification settings - Fork 74
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
Implement lazy components in login page #3328
base: master
Are you sure you want to change the base?
Conversation
@@ -6,7 +6,7 @@ | |||
|
|||
// Modules | |||
"baseUrl": "./app/javascript/src", | |||
"module": "ES6", | |||
"module": "ES2020", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not much into this. I just noticed some online recommendation for node 14 settings:
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"lib": ["ES2020"],
"module": "ES2020",
"moduleResolution": "node",
"target": "ES2020"
}
}
But then I read docs https://www.typescriptlang.org/docs/handbook/esm-node.html
So I guess that might be backward incompatible to change module type. Just throwing it out here. I guess you have considered these already.
This PR is stale because it has not received activity for more than 30 days. Remove stale label or comment or this will be closed in 15 days. |
What this PR does / why we need it:
Some pages may contain a couple of components but not show all of them. For instance the login page has a different component for every sub-page: password change, request new password, sign in and sign up. Each of these components have their own pack file, plus the one for login.
Lazy components are declared in the code but not imported (loaded) until they're actually needed. Therefore, with this approach we can combine all 5 packs into one and the browser will only request the proper component according to the sub-page the user is in.
HOWEVER, this may not need so important performance-wise, since the component in used will always be rendered. Lazy components are the most useful when it can't be ensured a component will be used or not. In the login page this is known.
Which issue(s) this PR fixes
Generic-performance-issue-N
Verification steps
Check the following pages: