Add a new option to control element comparison#1120
Closed
theKashey wants to merge 5 commits intopreactjs:masterfrom
Closed
Add a new option to control element comparison#1120theKashey wants to merge 5 commits intopreactjs:masterfrom
theKashey wants to merge 5 commits intopreactjs:masterfrom
Conversation
Author
|
New version of React-Hot-Loader with partial Preact support was released. |
src/vdom/index.js
Outdated
| * @private | ||
| */ | ||
| export function areComponentsEqual(component1, component2) { | ||
| return options.areComponentsEqual |
Member
There was a problem hiding this comment.
One could remove the if check here by making it the default implementation for options.areComponentsEqual
Author
There was a problem hiding this comment.
Pro - speed matters
Cons - you will be unable to revert configuration. Not a big deal, but could be nasty.
Author
There was a problem hiding this comment.
Probably one if here is way faster than one more function call you are asking for.
Author
There was a problem hiding this comment.
@marvinhagemeister - you were right.
My variant is 4x times slower than yours, and yours are equal to the base line.
Author
|
Obsolete |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Just adding an option (to pair
vnode) to hook element comparison. Required by #1007Another option is to use @arqex's code - master...arqex:master with setComponentComparator function. It is just a matter of taste.
Looking forward to make Preact quite 🔥[loadable]
(😕I did not found tests for vnode, and did not add my ones next to them 😭)