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

preact/compat tree shakability #3295

Closed
samouri opened this issue Oct 27, 2021 · 3 comments
Closed

preact/compat tree shakability #3295

samouri opened this issue Oct 27, 2021 · 3 comments

Comments

@samouri
Copy link

samouri commented Oct 27, 2021

summary

I noticed that when importing from preact/compat, much more is pulled in than expected. For example, when bundling code like this:

import { forwardRef } from 'preact/compat';

It creates ~2x greater binary size than directly copy/pasting the necessary function.

I've created a minimal reproduction here: https://github.com/samouri/preact-shakability

@senpro-ingwersenk
Copy link

Originally posted in 2021, still open and apparently still a problem?

Is someone working on this?

@rschristian
Copy link
Member

rschristian commented Aug 22, 2024

As the "after X" tag indicates, it's something we probably can't safely change in Preact X.

It's something we'd like to address in the future, at least in part (some of compat will always be unshakable in all likelihood), but there's nothing anyone can change about this now.

@JoviDeCroock
Copy link
Member

Going to close this as a duplicate of #1529

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants