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

[docs] Add cache to avoid unnecessary jsx dynamic import and theme getting #43139

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

Vxee
Copy link
Contributor

@Vxee Vxee commented Aug 1, 2024

…mport and theme getting

@mui-bot
Copy link

mui-bot commented Aug 1, 2024

Netlify deploy preview

https://deploy-preview-43139--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against c45e63d

@Vxee
Copy link
Contributor Author

Vxee commented Aug 1, 2024

@siriwatknp I added a cache to avoid every time the components mount will load the jsx asserts and get theme seting from window again. It is an enhancement for #42879.

@Vxee Vxee changed the title [docs]: add globalInjectThemeCache to avoid unnecessary jsx dynamic i… [docs]: add cache to avoid unnecessary jsx dynamic i… Aug 1, 2024
@Vxee Vxee changed the title [docs]: add cache to avoid unnecessary jsx dynamic i… [docs] Add cache to avoid unnecessary jsx dynamic i… Aug 1, 2024
@Vxee Vxee changed the title [docs] Add cache to avoid unnecessary jsx dynamic i… [docs] Add cache to avoid unnecessary jsx dynamic import and theme getting Aug 1, 2024
@alexfauquette alexfauquette added the scope: docs-infra Specific to the docs-infra product label Aug 2, 2024
@alexfauquette
Copy link
Member

With that modification, you will need to refresh the page to update the applied theme. Otherwise, I don't see how you can get a different globalInjectThemeCache

@Vxee
Copy link
Contributor Author

Vxee commented Aug 4, 2024

@alexfauquette Yes, only refresh the page can update the theme, I think the inject theme will not change frequently.

@Vxee
Copy link
Contributor Author

Vxee commented Aug 12, 2024

@siriwatknp Can you help to review this PR?

@Vxee
Copy link
Contributor Author

Vxee commented Aug 17, 2024

@mnajdova Can you help to review this?

@alexfauquette alexfauquette merged commit f62954b into mui:next Aug 19, 2024
19 of 20 checks passed
@Vxee
Copy link
Contributor Author

Vxee commented Aug 20, 2024

@alexfauquette Thanks. Do you now when will use the next branch to deploy the document site again? I want to verify my function.

@alexfauquette
Copy link
Member

I want to verify my function.

You can already test on https://deploy-preview-43139--material-ui.netlify.app/

Notice the format https://deploy-preview-<PR number>--material-ui.netlify.app/

@Vxee
Copy link
Contributor Author

Vxee commented Sep 7, 2024

@alexfauquette I have verified my function, and it is working! I have created anothor MR to update the jsx name exposed in window. It should be jsxRutime.

After that, I will create a public chrome extension, so it can be used by everyone.
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants