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

Implement lazy components in login page #3328

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

josemigallas
Copy link
Contributor

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:

  • Login
  • Sign up (need invitation token)
  • Request password
  • Change password (need link after requesting new password)

@josemigallas josemigallas self-assigned this Apr 26, 2023
@@ -6,7 +6,7 @@

// Modules
"baseUrl": "./app/javascript/src",
"module": "ES6",
"module": "ES2020",
Copy link
Contributor

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.

@josemigallas josemigallas changed the title Implement React components in login page Implement lazy components in login page Apr 26, 2023
@github-actions github-actions bot added the Stale label May 11, 2023
@3scale 3scale deleted a comment from github-actions bot May 15, 2023
@github-actions github-actions bot added the Stale label May 30, 2023
@github-actions github-actions bot added the Stale label Jun 14, 2023
@github-actions github-actions bot closed this Jun 21, 2023
@mayorova mayorova deleted the implement_lazy_react_login branch October 3, 2023 10:54
@josemigallas josemigallas added on hold Waiting for or blocked by something else. and removed Stale labels Feb 13, 2024
@3scale 3scale deleted a comment from github-actions bot Feb 13, 2024
@3scale 3scale deleted a comment from github-actions bot Feb 13, 2024
@josemigallas josemigallas restored the implement_lazy_react_login branch February 13, 2024 11:36
@josemigallas josemigallas reopened this Feb 13, 2024
@github-actions github-actions bot added the Stale label Mar 15, 2024
@3scale 3scale deleted a comment from github-actions bot Mar 15, 2024
@github-actions github-actions bot added the Stale label Apr 15, 2024
@github-actions github-actions bot added the Stale label May 17, 2024
@3scale 3scale deleted a comment from github-actions bot May 17, 2024
@3scale 3scale deleted a comment from github-actions bot May 17, 2024
@github-actions github-actions bot added the Stale label Jun 17, 2024
@3scale 3scale deleted a comment from github-actions bot Jun 19, 2024
@github-actions github-actions bot added the Stale label Jul 20, 2024
@3scale 3scale deleted a comment from github-actions bot Jul 22, 2024
@github-actions github-actions bot added the Stale label Aug 22, 2024
@josemigallas josemigallas removed the Stale label Sep 2, 2024
@github-actions github-actions bot added the Stale label Oct 3, 2024
@3scale 3scale deleted a comment from github-actions bot Oct 11, 2024
@3scale 3scale deleted a comment from github-actions bot Oct 11, 2024
Copy link

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.

@github-actions github-actions bot added the Stale label Nov 11, 2024
@github-actions github-actions bot closed this Nov 26, 2024
@akostadinov akostadinov removed the Stale label Nov 26, 2024
@akostadinov akostadinov reopened this Nov 26, 2024
Copy link

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.

@github-actions github-actions bot added the Stale label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold Waiting for or blocked by something else. Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants