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

Update Tooltip.tsx to fix react-dom-server leaking into client bundle #196

Closed
wants to merge 2 commits into from

Conversation

xHomu
Copy link
Contributor

@xHomu xHomu commented Aug 1, 2023

react-dom-server is leaking into the client bundle because it's used in eactly one place in Tooltip.tsx:

image

Removing it cut about 70kb off the bundle:

image

@pogseal Making this a PR first, since I don't know whether this would break any tooltips in use atm.

@pogseal
Copy link
Contributor

pogseal commented Aug 1, 2023

So this is used to render JSX in a tooltip where it would typically load a string. I believe it's used in some places like the character showcase. Though 70kb is a good amount, I wonder if can dynamic import or find a lighter tooltip library.

@xHomu
Copy link
Contributor Author

xHomu commented Aug 1, 2023

@pogseal looks like lazily worked. Is there a page to test against?

@pogseal
Copy link
Contributor

pogseal commented Aug 1, 2023

Cool, hovering over any of the stats on the character showcase should work.

@xHomu
Copy link
Contributor Author

xHomu commented Aug 1, 2023

Mhm, not working right, don't merge yet.

@xHomu
Copy link
Contributor Author

xHomu commented Aug 1, 2023

lazy import react-dom/server doesn't work. Have to take a different approach.

@xHomu xHomu closed this Aug 1, 2023
@xHomu xHomu mentioned this pull request Aug 1, 2023
@xHomu xHomu deleted the react-server-dom-leaking branch August 4, 2023 05:29
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

Successfully merging this pull request may close these issues.

2 participants