-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
iOS: Loop through RCTViewManager inheritance tree #14260
Conversation
Allows for easier extension of ViewManagers
While this is a good idea, UIManager constants is already one of the more expensive parts of bridge startup, and this increases it significantly, since every view manager inherits from RCTViewManager. Could you consider different approach, e.g. by sending the hierarchy info over to JS instead, and dynamically figuring out if the supported prop is in the inheritance chain. We should also decide whether everything inheriting from RCTViewManager makes sense. I'm sure there's plenty of views that don't want to inherit all of these props, and this doesn't give them a choice. |
@javache Yeah, Pieter, performance is also my biggest concern here. I am assuming that actual base class ( |
@shergin Yes, exactly. The idea was that the performance footprint should stay relatively similar for existing modules. Only those that does not inherit directly from E.g. from my example app, the @javache Have to admit that I haven't run a perfomance timer on this code. I've only tried to compare startup time of RNTester with and without this change. Didn't see a difference in startup time there, but it would probably be worth it to do a more precise comparison. |
All ViewManagers right now inherit from RCTViewManager, so they will also be inheritings its massive list of props (some of those won't even works, since they only apply to RCTView, and not the UIView-subclasses other view managers may vend). I would suggest splitting RCTViewManager into a RCTViewManagerBase (abstract superclass) and RCTViewManager, and have most view managers inherit from RCTViewManagerBase. |
Also, let's make sure this behaviour is consistent with the Android API's. |
@javache So... It actually means that we NEED this PR for allowing inheritance! Right? Speaking about performance, So, I propose we should make it real step by step:
So, why I am personally interested in it? Because I would love to have base manager class for our both implementations. |
|
||
Class superClass = _managerClass; | ||
while (superClass && superClass != [RCTViewManager class]) { | ||
if ([superClass isSubclassOfClass:[RCTViewManager class]]) { |
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.
I'm not sure I understand @shergin. This code will iterate through all of the superclasses of a view manager (up-to-and-including RCTViewManager), so propTypes
will be much bigger, and we'll have to send way more information to JS
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 second part of the while
condition excludes RCTViewManager
.
superClass != [RCTViewManager class]
So it shouldn't add RCTViewManager
props.
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.
So it bascially loops through the inheritance-chain, until it hits RCTViewManager
, and then breaks out. Which should make it behave as it does today, only that it supports further sub-classing of other view managers.
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.
Yeah, it worked before even without iterating over RCTViewManager! So, even it it does now, it is not intentional. I would try to optimize this iteration a bit by using some ObjC runtime functions (because we can and because we care 😄 ), but I want to have conceptual consensus before.
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.
So, how about RCTViewManager itself then? Where does that get exported?
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.
That the point. I have not idea, yet. 😄 Do you?
Okay, I will figure out. You are right, we have to know that before making this kind of changes.
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.
(Just to be clear, I am no so reckless, I plan to investigate it before landing this, I just want to have a consensus among us related to the general move.)
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.
That's my point. This diff is broken for the base case of RCTViewManager as far as I can tell.
Other than that, I agree with your strategy (save for some bikeshedding on naming), atlhough I'd change the order of operations a bit: there should be no in-between state where RCTViewManager works but warned against, since it's not supported right now and getting rid of the warning is just going to be painful (your point 4)
@javache You are right. We have to rethink whole approach. react-native/Libraries/ReactNative/requireNativeComponent.js Lines 73 to 79 in 1129c60
The right approach can be:
I can try to do it. |
Ah sorry, I understand the issue now. In that case, your approach seems better @shergin and I'll close this PR in favor of that. |
Summary: **Motivation** This is a re-worked version of #14260, by shergin's suggestion. For iOS, if you want to inherit from a native ViewManagers, your custom ViewManager will not automatically export the parents' props. So the only way to do this today, is to basically copy/paste the parent ViewManager-file, and add your own custom logic. With this PR, this is made more extensible by exporting the `baseModuleName` (i.e. the iOS `superclass` of the ViewManager), and then using that value to re-establish the inheritance relationship in `requireNativeComponent`. **Test plan** I've run this with a test project, and it works fine there. But needs more testing. Opened this PR as [per shergin's suggestion](#10946 (comment)) though, so we can discuss approach. **Discussion** * Android already supports inheritance, so this change should be compatible with that. But, not every prop available on `UIManager.RCTView.NativeProps` is actually exported by every ViewManager. So should `UIManager.RCTView.NativeProps` still be merged with `viewConfig.NativeProps`, even if the individual ViewManager does not export/use them to begin with? * Does this break other platforms? [UWP](https://github.com/Microsoft/react-native-windows)? Closes #14775 Differential Revision: D5392953 Pulled By: shergin fbshipit-source-id: 5212da616acfba50cc285e2997d183cf8b2cd09f
Summary: @public This sync includes the following changes: - **[6bf5e8598](facebook/react@6bf5e8598)**: Fix scheduler setTimeout() re-entrancy check (#14384) //<Brian Vaughn>// - **[7a48c900b](facebook/react@7a48c900b)**: Prevent a v8 deopt when profiling (#14383) //<Brian Vaughn>// - **[f00c2755b](facebook/react@f00c2755b)**: Removed unnecessary externals from Jest bundles (#14372) //<Brian Vaughn>// - **[52bea95cf](facebook/react@52bea95cf)**: Fixed scheduler setTimeout fallback (#14358) //<Brian Vaughn>// - **[1d25aa578](facebook/react@1d25aa578)**: [Fizz] New Server Rendering Infra (#14144) //<Sebastian Markbåge>// - **[f1bf28160](facebook/react@f1bf28160)**: Fix bug in cloneHook (#14364) //<Imre Osswald>// - **[16e120438](facebook/react@16e120438)**: [Fire] Add initial build infrastructure (#14359) //<Dan Abramov>// - **[d14ba87b1](facebook/react@d14ba87b1)**: Validate propTypes for lazy() and memo() and warn about invalid patterns (#14298) //<Dan Abramov>// - **[4f964f09c](facebook/react@4f964f09c)**: Adding isMemo check to react-is package (#14313) //<Jinto Jose>// - **[c2a2d8a53](facebook/react@c2a2d8a53)**: Remove useMutationEffect (#14336) //<Sophie Alpert>// - **[48f1e5b3c](facebook/react@48f1e5b3c)**: Add a null type test for memo (#14325) //<chun shang>// - **[f93f3402f](facebook/react@f93f3402f)**: Make useEffect(async) warning more verbose (#14327) //<Dan Abramov>// - **[ee3ef3a07](facebook/react@ee3ef3a07)**: Fix regression: Errors not emitted in streams (#14314) //<Pelle Wessman>// - **[33f6f5e53](facebook/react@33f6f5e53)**: Remove usage of `fbjs/lib/invariant` in ReactNativeViewConfigRegistry. (#14330) //<Christoph Nakazawa>// - **[686f1060a](facebook/react@686f1060a)**: Publish a local release (canary or stable) to NPM (#14260) //<Brian Vaughn>// - **[7475120ce](facebook/react@7475120ce)**: Prevent deopts from modifying exports object in stable builds (#14309) //<Dan Abramov>// - **[0c7189d92](facebook/react@0c7189d92)**: Fix resolution of outer props with React.memo() (#14312) //<Dan Abramov>// - **[14be29b2b](facebook/react@14be29b2b)**: Add more test coverage for nested memo() (#14311) //<Dan Abramov>// - **[dc0dd4bbf](facebook/react@dc0dd4bbf)**: Use |0 to coerce to number (#14297) //<Dan Abramov>// - **[dd8205cef](facebook/react@dd8205cef)**: List ignored types instead of included types in the stack (#14308) //<Dan Abramov>// - **[a9fdf8a32](facebook/react@a9fdf8a32)**: Warn about reassigning this.props (#14277) //<Dan Abramov>// - **[327cf0ee3](facebook/react@327cf0ee3)**: Fix support for mixing react-dom/[email protected] and react@<16.6 (#14291) //<Dan Abramov>// - **[c954efa70](facebook/react@c954efa70)**: Remove `import * as` pattern from the codebase (#14282) //<Sebastian Markbåge>// - **[ccb14e270](facebook/react@ccb14e270)**: Fix SSR useCallback in render phase (#14279) //<Dan Abramov>// - **[0e9cb3f5d](facebook/react@0e9cb3f5d)**: Clear fields on unmount of fiber to avoid memory leak (#14276) //<Dominic Gannaway>// - **[592676503](facebook/react@592676503)**: Revert "Clear memoizedState on unmount of fiber to avoid memory leak (#14218)" (#14275) //<Dominic Gannaway>// - **[9b2fb24f9](facebook/react@9b2fb24f9)**: Clear memoizedState on unmount of fiber to avoid memory leak (#14218) //<Dominic Gannaway>// - **[a22fabc2a](facebook/react@a22fabc2a)**: Reduce scheduler serialization overhead (#14249) //<Jason Miller>// - **[21d5f7d32](facebook/react@21d5f7d32)**: Wrap shorthand CSS property collision warning in feature flag (#14245) //<Andrew Clark>// - **[8feeed10d](facebook/react@8feeed10d)**: [scheduler] Remove window.postMessage fallback //<Andrew Clark>// - **[5bce0ef10](facebook/react@5bce0ef10)**: [scheduler] Post to MessageChannel instead of window (#14234) //<Andrew Clark>// - **[f55795c8e](facebook/react@f55795c8e)**: Add regression test for #14188 (#14197) //<Dan Abramov>// - **[b98adb648](facebook/react@b98adb648)**: Simplify CSS shorthand property warning (#14183) //<Sophie Alpert>// - **[f8bfd5868](facebook/react@f8bfd5868)**: fix typo //<Sebastian Markbage>// - **[961eb65b4](facebook/react@961eb65b4)**: Use unique thread ID for each partial render to access Context (#14182) //<Sebastian Markbåge>// - **[1a6ab1e9b](facebook/react@1a6ab1e9b)**: SimpleMemoComponent should warn if a ref is given (#14178) //<Sophie Alpert>// - **[8ae867e6b](facebook/react@8ae867e6b)**: Warn about conflicting style values during updates (#14181) //<Sophie Alpert>// - **[d5e1bf07d](facebook/react@d5e1bf07d)**: Renamed outdated schedule/tracing referecnes (#14177) //<Brian Vaughn>// - **[2dd4ba11e](facebook/react@2dd4ba11e)**: ESlint -> ESLint //<Andrew Clark>// - **[9cc631a53](facebook/react@9cc631a53)**: Don't run danger on bad build (#14143) //<Sophie Alpert>// - **[1034e26fe](facebook/react@1034e26fe)**: Fix typos (#14124) //<Heaven>// - **[5618da49d](facebook/react@5618da49d)**: Fix comment typo (#14156) //<Bartosz Gordon>// - **[9fb919945](facebook/react@9fb919945)**: Add global to ESLint plugin bundle config //<Andrew Clark>// - **[c174f8592](facebook/react@c174f8592)**: Add fb build of ESLint plugin (#14165) //<Andrew Clark>// - **[02e4848e3](facebook/react@02e4848e3)**: Improved suspense support in ReactDOMServer (#14161) //<Alex Taylor>// - **[4b163fe](facebook/react@4b163fee1)**: Remove errant return assignment (#14164) //<Andrew Clark>// - **[e58ecda9a](facebook/react@e58ecda9a)**: Suspense fuzz tester (#14147) //<Andrew Clark>// - **[7fd1661f8](facebook/react@7fd1661f8)**: Don't warn if an unmounted component is pinged (#14158) //<Andrew Clark>// - **[f9e9913f0](facebook/react@f9e9913f0)**: [Synchronous Suspense] Don't delete children of suspended component (#14157) //<Andrew Clark>// - **[7c560131b](facebook/react@7c560131b)**: Adding logger pri (#14155) //<Nathan Schloss>// - **[3d8bda70e](facebook/react@3d8bda70e)**: Refactor ESLint configuration to enable better IDE integration (#13914) //<Minh Nguyen>// - **[051272f20](facebook/react@051272f20)**: Use Entry in `yarn build ...` Instead of Label (#14148) //<Sebastian Markbåge>// Release Notes: [GENERAL] [FEATURE] [React] - React sync for revisions 3ff2c7c...6bf5e85 Reviewed By: bvaughn Differential Revision: D13288288 fbshipit-source-id: 89a4837a9198c53fc79306933f589ef25d8bb4b6
Summary: @public This sync includes the following changes: - **[6bf5e8598](facebook/react@6bf5e8598)**: Fix scheduler setTimeout() re-entrancy check (#14384) //<Brian Vaughn>// - **[7a48c900b](facebook/react@7a48c900b)**: Prevent a v8 deopt when profiling (#14383) //<Brian Vaughn>// - **[f00c2755b](facebook/react@f00c2755b)**: Removed unnecessary externals from Jest bundles (#14372) //<Brian Vaughn>// - **[52bea95cf](facebook/react@52bea95cf)**: Fixed scheduler setTimeout fallback (#14358) //<Brian Vaughn>// - **[1d25aa578](facebook/react@1d25aa578)**: [Fizz] New Server Rendering Infra (#14144) //<Sebastian Markbåge>// - **[f1bf28160](facebook/react@f1bf28160)**: Fix bug in cloneHook (#14364) //<Imre Osswald>// - **[16e120438](facebook/react@16e120438)**: [Fire] Add initial build infrastructure (#14359) //<Dan Abramov>// - **[d14ba87b1](facebook/react@d14ba87b1)**: Validate propTypes for lazy() and memo() and warn about invalid patterns (#14298) //<Dan Abramov>// - **[4f964f09c](facebook/react@4f964f09c)**: Adding isMemo check to react-is package (#14313) //<Jinto Jose>// - **[c2a2d8a53](facebook/react@c2a2d8a53)**: Remove useMutationEffect (#14336) //<Sophie Alpert>// - **[48f1e5b3c](facebook/react@48f1e5b3c)**: Add a null type test for memo (#14325) //<chun shang>// - **[f93f3402f](facebook/react@f93f3402f)**: Make useEffect(async) warning more verbose (#14327) //<Dan Abramov>// - **[ee3ef3a07](facebook/react@ee3ef3a07)**: Fix regression: Errors not emitted in streams (#14314) //<Pelle Wessman>// - **[33f6f5e53](facebook/react@33f6f5e53)**: Remove usage of `fbjs/lib/invariant` in ReactNativeViewConfigRegistry. (#14330) //<Christoph Nakazawa>// - **[686f1060a](facebook/react@686f1060a)**: Publish a local release (canary or stable) to NPM (#14260) //<Brian Vaughn>// - **[7475120ce](facebook/react@7475120ce)**: Prevent deopts from modifying exports object in stable builds (#14309) //<Dan Abramov>// - **[0c7189d92](facebook/react@0c7189d92)**: Fix resolution of outer props with React.memo() (#14312) //<Dan Abramov>// - **[14be29b2b](facebook/react@14be29b2b)**: Add more test coverage for nested memo() (#14311) //<Dan Abramov>// - **[dc0dd4bbf](facebook/react@dc0dd4bbf)**: Use |0 to coerce to number (#14297) //<Dan Abramov>// - **[dd8205cef](facebook/react@dd8205cef)**: List ignored types instead of included types in the stack (#14308) //<Dan Abramov>// - **[a9fdf8a32](facebook/react@a9fdf8a32)**: Warn about reassigning this.props (#14277) //<Dan Abramov>// - **[327cf0ee3](facebook/react@327cf0ee3)**: Fix support for mixing react-dom/[email protected] and react@<16.6 (#14291) //<Dan Abramov>// - **[c954efa70](facebook/react@c954efa70)**: Remove `import * as` pattern from the codebase (#14282) //<Sebastian Markbåge>// - **[ccb14e270](facebook/react@ccb14e270)**: Fix SSR useCallback in render phase (#14279) //<Dan Abramov>// - **[0e9cb3f5d](facebook/react@0e9cb3f5d)**: Clear fields on unmount of fiber to avoid memory leak (#14276) //<Dominic Gannaway>// - **[592676503](facebook/react@592676503)**: Revert "Clear memoizedState on unmount of fiber to avoid memory leak (#14218)" (#14275) //<Dominic Gannaway>// - **[9b2fb24f9](facebook/react@9b2fb24f9)**: Clear memoizedState on unmount of fiber to avoid memory leak (#14218) //<Dominic Gannaway>// - **[a22fabc2a](facebook/react@a22fabc2a)**: Reduce scheduler serialization overhead (#14249) //<Jason Miller>// - **[21d5f7d32](facebook/react@21d5f7d32)**: Wrap shorthand CSS property collision warning in feature flag (#14245) //<Andrew Clark>// - **[8feeed10d](facebook/react@8feeed10d)**: [scheduler] Remove window.postMessage fallback //<Andrew Clark>// - **[5bce0ef10](facebook/react@5bce0ef10)**: [scheduler] Post to MessageChannel instead of window (#14234) //<Andrew Clark>// - **[f55795c8e](facebook/react@f55795c8e)**: Add regression test for #14188 (#14197) //<Dan Abramov>// - **[b98adb648](facebook/react@b98adb648)**: Simplify CSS shorthand property warning (#14183) //<Sophie Alpert>// - **[f8bfd5868](facebook/react@f8bfd5868)**: fix typo //<Sebastian Markbage>// - **[961eb65b4](facebook/react@961eb65b4)**: Use unique thread ID for each partial render to access Context (#14182) //<Sebastian Markbåge>// - **[1a6ab1e9b](facebook/react@1a6ab1e9b)**: SimpleMemoComponent should warn if a ref is given (#14178) //<Sophie Alpert>// - **[8ae867e6b](facebook/react@8ae867e6b)**: Warn about conflicting style values during updates (#14181) //<Sophie Alpert>// - **[d5e1bf07d](facebook/react@d5e1bf07d)**: Renamed outdated schedule/tracing referecnes (#14177) //<Brian Vaughn>// - **[2dd4ba11e](facebook/react@2dd4ba11e)**: ESlint -> ESLint //<Andrew Clark>// - **[9cc631a53](facebook/react@9cc631a53)**: Don't run danger on bad build (#14143) //<Sophie Alpert>// - **[1034e26fe](facebook/react@1034e26fe)**: Fix typos (#14124) //<Heaven>// - **[5618da49d](facebook/react@5618da49d)**: Fix comment typo (#14156) //<Bartosz Gordon>// - **[9fb919945](facebook/react@9fb919945)**: Add global to ESLint plugin bundle config //<Andrew Clark>// - **[c174f8592](facebook/react@c174f8592)**: Add fb build of ESLint plugin (#14165) //<Andrew Clark>// - **[02e4848e3](facebook/react@02e4848e3)**: Improved suspense support in ReactDOMServer (#14161) //<Alex Taylor>// - **[4b163fe](facebook/react@4b163fee1)**: Remove errant return assignment (#14164) //<Andrew Clark>// - **[e58ecda9a](facebook/react@e58ecda9a)**: Suspense fuzz tester (#14147) //<Andrew Clark>// - **[7fd1661f8](facebook/react@7fd1661f8)**: Don't warn if an unmounted component is pinged (#14158) //<Andrew Clark>// - **[f9e9913f0](facebook/react@f9e9913f0)**: [Synchronous Suspense] Don't delete children of suspended component (#14157) //<Andrew Clark>// - **[7c560131b](facebook/react@7c560131b)**: Adding logger pri (#14155) //<Nathan Schloss>// - **[3d8bda70e](facebook/react@3d8bda70e)**: Refactor ESLint configuration to enable better IDE integration (#13914) //<Minh Nguyen>// - **[051272f20](facebook/react@051272f20)**: Use Entry in `yarn build ...` Instead of Label (#14148) //<Sebastian Markbåge>// Release Notes: [GENERAL] [FEATURE] [React] - React sync for revisions 3ff2c7c...6bf5e85 Reviewed By: bvaughn Differential Revision: D13288288 fbshipit-source-id: 89a4837a9198c53fc79306933f589ef25d8bb4b6
Summary: @public This sync includes the following changes: - **[6bf5e8598](facebook/react@6bf5e8598)**: Fix scheduler setTimeout() re-entrancy check (#14384) //<Brian Vaughn>// - **[7a48c900b](facebook/react@7a48c900b)**: Prevent a v8 deopt when profiling (#14383) //<Brian Vaughn>// - **[f00c2755b](facebook/react@f00c2755b)**: Removed unnecessary externals from Jest bundles (#14372) //<Brian Vaughn>// - **[52bea95cf](facebook/react@52bea95cf)**: Fixed scheduler setTimeout fallback (#14358) //<Brian Vaughn>// - **[1d25aa578](facebook/react@1d25aa578)**: [Fizz] New Server Rendering Infra (#14144) //<Sebastian Markbåge>// - **[f1bf28160](facebook/react@f1bf28160)**: Fix bug in cloneHook (#14364) //<Imre Osswald>// - **[16e120438](facebook/react@16e120438)**: [Fire] Add initial build infrastructure (#14359) //<Dan Abramov>// - **[d14ba87b1](facebook/react@d14ba87b1)**: Validate propTypes for lazy() and memo() and warn about invalid patterns (#14298) //<Dan Abramov>// - **[4f964f09c](facebook/react@4f964f09c)**: Adding isMemo check to react-is package (#14313) //<Jinto Jose>// - **[c2a2d8a53](facebook/react@c2a2d8a53)**: Remove useMutationEffect (#14336) //<Sophie Alpert>// - **[48f1e5b3c](facebook/react@48f1e5b3c)**: Add a null type test for memo (#14325) //<chun shang>// - **[f93f3402f](facebook/react@f93f3402f)**: Make useEffect(async) warning more verbose (#14327) //<Dan Abramov>// - **[ee3ef3a07](facebook/react@ee3ef3a07)**: Fix regression: Errors not emitted in streams (#14314) //<Pelle Wessman>// - **[33f6f5e53](facebook/react@33f6f5e53)**: Remove usage of `fbjs/lib/invariant` in ReactNativeViewConfigRegistry. (#14330) //<Christoph Nakazawa>// - **[686f1060a](facebook/react@686f1060a)**: Publish a local release (canary or stable) to NPM (#14260) //<Brian Vaughn>// - **[7475120ce](facebook/react@7475120ce)**: Prevent deopts from modifying exports object in stable builds (#14309) //<Dan Abramov>// - **[0c7189d92](facebook/react@0c7189d92)**: Fix resolution of outer props with React.memo() (#14312) //<Dan Abramov>// - **[14be29b2b](facebook/react@14be29b2b)**: Add more test coverage for nested memo() (#14311) //<Dan Abramov>// - **[dc0dd4bbf](facebook/react@dc0dd4bbf)**: Use |0 to coerce to number (#14297) //<Dan Abramov>// - **[dd8205cef](facebook/react@dd8205cef)**: List ignored types instead of included types in the stack (#14308) //<Dan Abramov>// - **[a9fdf8a32](facebook/react@a9fdf8a32)**: Warn about reassigning this.props (#14277) //<Dan Abramov>// - **[327cf0ee3](facebook/react@327cf0ee3)**: Fix support for mixing react-dom/[email protected] and react@<16.6 (#14291) //<Dan Abramov>// - **[c954efa70](facebook/react@c954efa70)**: Remove `import * as` pattern from the codebase (#14282) //<Sebastian Markbåge>// - **[ccb14e270](facebook/react@ccb14e270)**: Fix SSR useCallback in render phase (#14279) //<Dan Abramov>// - **[0e9cb3f5d](facebook/react@0e9cb3f5d)**: Clear fields on unmount of fiber to avoid memory leak (#14276) //<Dominic Gannaway>// - **[592676503](facebook/react@592676503)**: Revert "Clear memoizedState on unmount of fiber to avoid memory leak (#14218)" (#14275) //<Dominic Gannaway>// - **[9b2fb24f9](facebook/react@9b2fb24f9)**: Clear memoizedState on unmount of fiber to avoid memory leak (#14218) //<Dominic Gannaway>// - **[a22fabc2a](facebook/react@a22fabc2a)**: Reduce scheduler serialization overhead (#14249) //<Jason Miller>// - **[21d5f7d32](facebook/react@21d5f7d32)**: Wrap shorthand CSS property collision warning in feature flag (#14245) //<Andrew Clark>// - **[8feeed10d](facebook/react@8feeed10d)**: [scheduler] Remove window.postMessage fallback //<Andrew Clark>// - **[5bce0ef10](facebook/react@5bce0ef10)**: [scheduler] Post to MessageChannel instead of window (#14234) //<Andrew Clark>// - **[f55795c8e](facebook/react@f55795c8e)**: Add regression test for #14188 (#14197) //<Dan Abramov>// - **[b98adb648](facebook/react@b98adb648)**: Simplify CSS shorthand property warning (#14183) //<Sophie Alpert>// - **[f8bfd5868](facebook/react@f8bfd5868)**: fix typo //<Sebastian Markbage>// - **[961eb65b4](facebook/react@961eb65b4)**: Use unique thread ID for each partial render to access Context (#14182) //<Sebastian Markbåge>// - **[1a6ab1e9b](facebook/react@1a6ab1e9b)**: SimpleMemoComponent should warn if a ref is given (#14178) //<Sophie Alpert>// - **[8ae867e6b](facebook/react@8ae867e6b)**: Warn about conflicting style values during updates (#14181) //<Sophie Alpert>// - **[d5e1bf07d](facebook/react@d5e1bf07d)**: Renamed outdated schedule/tracing referecnes (#14177) //<Brian Vaughn>// - **[2dd4ba11e](facebook/react@2dd4ba11e)**: ESlint -> ESLint //<Andrew Clark>// - **[9cc631a53](facebook/react@9cc631a53)**: Don't run danger on bad build (#14143) //<Sophie Alpert>// - **[1034e26fe](facebook/react@1034e26fe)**: Fix typos (#14124) //<Heaven>// - **[5618da49d](facebook/react@5618da49d)**: Fix comment typo (#14156) //<Bartosz Gordon>// - **[9fb919945](facebook/react@9fb919945)**: Add global to ESLint plugin bundle config //<Andrew Clark>// - **[c174f8592](facebook/react@c174f8592)**: Add fb build of ESLint plugin (#14165) //<Andrew Clark>// - **[02e4848e3](facebook/react@02e4848e3)**: Improved suspense support in ReactDOMServer (#14161) //<Alex Taylor>// - **[4b163fe](facebook/react@4b163fee1)**: Remove errant return assignment (#14164) //<Andrew Clark>// - **[e58ecda9a](facebook/react@e58ecda9a)**: Suspense fuzz tester (#14147) //<Andrew Clark>// - **[7fd1661f8](facebook/react@7fd1661f8)**: Don't warn if an unmounted component is pinged (#14158) //<Andrew Clark>// - **[f9e9913f0](facebook/react@f9e9913f0)**: [Synchronous Suspense] Don't delete children of suspended component (#14157) //<Andrew Clark>// - **[7c560131b](facebook/react@7c560131b)**: Adding logger pri (#14155) //<Nathan Schloss>// - **[3d8bda70e](facebook/react@3d8bda70e)**: Refactor ESLint configuration to enable better IDE integration (#13914) //<Minh Nguyen>// - **[051272f20](facebook/react@051272f20)**: Use Entry in `yarn build ...` Instead of Label (#14148) //<Sebastian Markbåge>// Release Notes: [GENERAL] [FEATURE] [React] - React sync for revisions 3ff2c7c...6bf5e85 Reviewed By: bvaughn Differential Revision: D13288288 fbshipit-source-id: 89a4837a9198c53fc79306933f589ef25d8bb4b6
Summary: @public This sync includes the following changes: - **[6bf5e8598](facebook/react@6bf5e8598)**: Fix scheduler setTimeout() re-entrancy check (facebook#14384) //<Brian Vaughn>// - **[7a48c900b](facebook/react@7a48c900b)**: Prevent a v8 deopt when profiling (facebook#14383) //<Brian Vaughn>// - **[f00c2755b](facebook/react@f00c2755b)**: Removed unnecessary externals from Jest bundles (facebook#14372) //<Brian Vaughn>// - **[52bea95cf](facebook/react@52bea95cf)**: Fixed scheduler setTimeout fallback (facebook#14358) //<Brian Vaughn>// - **[1d25aa578](facebook/react@1d25aa578)**: [Fizz] New Server Rendering Infra (facebook#14144) //<Sebastian Markbåge>// - **[f1bf28160](facebook/react@f1bf28160)**: Fix bug in cloneHook (facebook#14364) //<Imre Osswald>// - **[16e120438](facebook/react@16e120438)**: [Fire] Add initial build infrastructure (facebook#14359) //<Dan Abramov>// - **[d14ba87b1](facebook/react@d14ba87b1)**: Validate propTypes for lazy() and memo() and warn about invalid patterns (facebook#14298) //<Dan Abramov>// - **[4f964f09c](facebook/react@4f964f09c)**: Adding isMemo check to react-is package (facebook#14313) //<Jinto Jose>// - **[c2a2d8a53](facebook/react@c2a2d8a53)**: Remove useMutationEffect (facebook#14336) //<Sophie Alpert>// - **[48f1e5b3c](facebook/react@48f1e5b3c)**: Add a null type test for memo (facebook#14325) //<chun shang>// - **[f93f3402f](facebook/react@f93f3402f)**: Make useEffect(async) warning more verbose (facebook#14327) //<Dan Abramov>// - **[ee3ef3a07](facebook/react@ee3ef3a07)**: Fix regression: Errors not emitted in streams (facebook#14314) //<Pelle Wessman>// - **[33f6f5e53](facebook/react@33f6f5e53)**: Remove usage of `fbjs/lib/invariant` in ReactNativeViewConfigRegistry. (facebook#14330) //<Christoph Nakazawa>// - **[686f1060a](facebook/react@686f1060a)**: Publish a local release (canary or stable) to NPM (facebook#14260) //<Brian Vaughn>// - **[7475120ce](facebook/react@7475120ce)**: Prevent deopts from modifying exports object in stable builds (facebook#14309) //<Dan Abramov>// - **[0c7189d92](facebook/react@0c7189d92)**: Fix resolution of outer props with React.memo() (facebook#14312) //<Dan Abramov>// - **[14be29b2b](facebook/react@14be29b2b)**: Add more test coverage for nested memo() (facebook#14311) //<Dan Abramov>// - **[dc0dd4bbf](facebook/react@dc0dd4bbf)**: Use |0 to coerce to number (facebook#14297) //<Dan Abramov>// - **[dd8205cef](facebook/react@dd8205cef)**: List ignored types instead of included types in the stack (facebook#14308) //<Dan Abramov>// - **[a9fdf8a32](facebook/react@a9fdf8a32)**: Warn about reassigning this.props (facebook#14277) //<Dan Abramov>// - **[327cf0ee3](facebook/react@327cf0ee3)**: Fix support for mixing react-dom/[email protected] and react@<16.6 (facebook#14291) //<Dan Abramov>// - **[c954efa70](facebook/react@c954efa70)**: Remove `import * as` pattern from the codebase (facebook#14282) //<Sebastian Markbåge>// - **[ccb14e270](facebook/react@ccb14e270)**: Fix SSR useCallback in render phase (facebook#14279) //<Dan Abramov>// - **[0e9cb3f5d](facebook/react@0e9cb3f5d)**: Clear fields on unmount of fiber to avoid memory leak (facebook#14276) //<Dominic Gannaway>// - **[592676503](facebook/react@592676503)**: Revert "Clear memoizedState on unmount of fiber to avoid memory leak (facebook#14218)" (facebook#14275) //<Dominic Gannaway>// - **[9b2fb24f9](facebook/react@9b2fb24f9)**: Clear memoizedState on unmount of fiber to avoid memory leak (facebook#14218) //<Dominic Gannaway>// - **[a22fabc2a](facebook/react@a22fabc2a)**: Reduce scheduler serialization overhead (facebook#14249) //<Jason Miller>// - **[21d5f7d32](facebook/react@21d5f7d32)**: Wrap shorthand CSS property collision warning in feature flag (facebook#14245) //<Andrew Clark>// - **[8feeed10d](facebook/react@8feeed10d)**: [scheduler] Remove window.postMessage fallback //<Andrew Clark>// - **[5bce0ef10](facebook/react@5bce0ef10)**: [scheduler] Post to MessageChannel instead of window (facebook#14234) //<Andrew Clark>// - **[f55795c8e](facebook/react@f55795c8e)**: Add regression test for facebook#14188 (facebook#14197) //<Dan Abramov>// - **[b98adb648](facebook/react@b98adb648)**: Simplify CSS shorthand property warning (facebook#14183) //<Sophie Alpert>// - **[f8bfd5868](facebook/react@f8bfd5868)**: fix typo //<Sebastian Markbage>// - **[961eb65b4](facebook/react@961eb65b4)**: Use unique thread ID for each partial render to access Context (facebook#14182) //<Sebastian Markbåge>// - **[1a6ab1e9b](facebook/react@1a6ab1e9b)**: SimpleMemoComponent should warn if a ref is given (facebook#14178) //<Sophie Alpert>// - **[8ae867e6b](facebook/react@8ae867e6b)**: Warn about conflicting style values during updates (facebook#14181) //<Sophie Alpert>// - **[d5e1bf07d](facebook/react@d5e1bf07d)**: Renamed outdated schedule/tracing referecnes (facebook#14177) //<Brian Vaughn>// - **[2dd4ba11e](facebook/react@2dd4ba11e)**: ESlint -> ESLint //<Andrew Clark>// - **[9cc631a53](facebook/react@9cc631a53)**: Don't run danger on bad build (facebook#14143) //<Sophie Alpert>// - **[1034e26fe](facebook/react@1034e26fe)**: Fix typos (facebook#14124) //<Heaven>// - **[5618da49d](facebook/react@5618da49d)**: Fix comment typo (facebook#14156) //<Bartosz Gordon>// - **[9fb919945](facebook/react@9fb919945)**: Add global to ESLint plugin bundle config //<Andrew Clark>// - **[c174f8592](facebook/react@c174f8592)**: Add fb build of ESLint plugin (facebook#14165) //<Andrew Clark>// - **[02e4848e3](facebook/react@02e4848e3)**: Improved suspense support in ReactDOMServer (facebook#14161) //<Alex Taylor>// - **[4b163fe](facebook/react@4b163fee1)**: Remove errant return assignment (facebook#14164) //<Andrew Clark>// - **[e58ecda9a](facebook/react@e58ecda9a)**: Suspense fuzz tester (facebook#14147) //<Andrew Clark>// - **[7fd1661f8](facebook/react@7fd1661f8)**: Don't warn if an unmounted component is pinged (facebook#14158) //<Andrew Clark>// - **[f9e9913f0](facebook/react@f9e9913f0)**: [Synchronous Suspense] Don't delete children of suspended component (facebook#14157) //<Andrew Clark>// - **[7c560131b](facebook/react@7c560131b)**: Adding logger pri (facebook#14155) //<Nathan Schloss>// - **[3d8bda70e](facebook/react@3d8bda70e)**: Refactor ESLint configuration to enable better IDE integration (facebook#13914) //<Minh Nguyen>// - **[051272f20](facebook/react@051272f20)**: Use Entry in `yarn build ...` Instead of Label (facebook#14148) //<Sebastian Markbåge>// Release Notes: [GENERAL] [FEATURE] [React] - React sync for revisions 3ff2c7c...6bf5e85 Reviewed By: bvaughn Differential Revision: D13288288 fbshipit-source-id: 89a4837a9198c53fc79306933f589ef25d8bb4b6
Motivation
See discussion in #10946. The motivation is to make
RCTViewManager
more extensible.If you want to inherit from a native ViewManager, your custom ViewManager will not automatically expose the parents' props. So the only way to do this today, is to basically copy/paste the parent ViewManager-file, and add your own custom logic.
With this PR, this is made more extensible by automatically looping through the parents' props, and exposing those for the child ViewManager as well.
Test plan
The test plan is the same as the other PR (#10946). I've made an simple test app which extends
RCTWebViewManager
: https://github.com/cbrevik/overrideWebviewSee RCTCustomWebViewManager.h and RCTCustomWebViewManager.m for a simple implementation.
CC @shergin (#10946 (comment))