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

Add hasScuFromHooks to mangle #4627

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add hasScuFromHooks to mangle #4627

wants to merge 1 commit into from

Conversation

JoviDeCroock
Copy link
Member

I've been hammering on a good way to allow for us to check the version of Preact in signals, however there hasn't really been a good one. I've come to terms with just checking whether we have _scuFromHooks so we can ship preactjs/signals#630.

The main reason why checking this is enough is that 10.12 - 10.24 would not benefit from sCU in signals being wiser either way. This because we weren't calling it either way, that got fixed in 10.25.0 by #4560.

This PR will allow us to check this.__f and when it's present in the sCU we know that we are dealing with a state settled update so we can avoid use the check introduced in preactjs/signals#630 and when we don't have this we'll leverage the old code path.

@coveralls
Copy link

Coverage Status

coverage: 99.618%. remained the same
when pulling 48098e9 on mangle-has-scu
into 1226aae on main.

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.

3 participants