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

Fix UNSAFE_* lifecycles being overwritten #1946

Merged
merged 2 commits into from
Sep 27, 2019
Merged

Conversation

marvinhagemeister
Copy link
Member

This was caused by transpilers overwriting our patched property when inheritance was in play. It's based on the assumption that having both the prefixed UNSAFE_* and the unprefixed lifecycle hook is invalid.

Fixes #1941
Adds +29 B to compat.

@coveralls
Copy link

coveralls commented Sep 24, 2019

Coverage Status

Coverage increased (+0.0008%) to 99.767% when pulling 0bd9f56 on unsafe-descr into 07962d0 on master.

Copy link
Member

@developit developit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with 1 nit

compat/src/index.js Outdated Show resolved Hide resolved
@JoviDeCroock
Copy link
Member

JoviDeCroock commented Sep 27, 2019

Are we okay with merging this and doing the optimisation as a separate PR?

/CC: @developit @marvinhagemeister

This was caused by transpilers overwriting our patched property.
@marvinhagemeister marvinhagemeister merged commit 870cf60 into master Sep 27, 2019
@marvinhagemeister marvinhagemeister deleted the unsafe-descr branch September 27, 2019 19:30
developit added a commit that referenced this pull request Sep 4, 2020
JoviDeCroock pushed a commit that referenced this pull request Sep 13, 2020
* Optimizations for compat

* Use native DOM Event methods instead of patching Event.

* Found a smaller+faster fix for #1941 / #1946 🎉

* Fix test failures (forgot to apply normalizedProps)

* Fix className aliasing order. Note: this removes the forced priority bump from `className` and instead uses object property order.

* Fix <select multiple> array value

* Fix onChange normalization

* Fix lifecycle assignment in loose mode transpiled classes

* Select class/className purely based on property order

* defaultValue fixes

* Normalize onChange to onInput for <input type=range>, but not in IE11 which fires continuous change events for range inputs.

* size tweaks

* Optimization + clarifying comments for defaultValue

* Optimizations for <select multiple> array value

* little size optimization for render() clearing

* Backport golf from v10
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.

Preact@10.0.0-rc.3 preact/compat not calling UNSAFE* functions
4 participants