-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Support multiple versions of React constants #1101
Conversation
This will make it easier to change them in the future based on the version.
| function enqueueMount(fiber) { | ||
| pendingEvents.push({ | ||
| internalInstance: getOpaqueNode(fiber), | ||
| data: getDataFiber(fiber, getOpaqueNode), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now in the closure anyway.
|
Got some lingering references to |
|
In general, I think the approach to forking based on version number is fine 👍 Both |
|
Oops, I meant to delete that file. |
I inlined If there's still a |
|
Fixed |
|
Oh, great! I didn't notice that it was gone entirely, although I did see your comment about the closure and...apparently misunderstood it. Cool 👍 |
bvaughn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ++/-- line count also makes more sense now 😁
* Inline all Fiber-specific parts in attachRendererFiber This will make it easier to change them in the future based on the version. * Switch React constants by the version * Delete accidentally left file
This updates DevTools to work with constants that were changed in facebook/react#13397. Note you'll need to change
ReactVersionto16.4.3in a locally compiled ReactDOM to test the new code path.I decided to pull all constants and Fiber-specific helpers in one closure that has access to the version. We might tweak more things over time, and I think it'll be easier to update if everything is in one place.
You might find reviewing individual commits easier.