Skip to content

[RN] Move view config registry to shims - #12569

Merged
sebmarkbage merged 2 commits into
react:masterfrom
sebmarkbage:shareviewregistry
Apr 10, 2018
Merged

sebmarkbage merged 2 commits into
react:masterfrom
sebmarkbage:shareviewregistry

Conversation

@sebmarkbage

@sebmarkbage sebmarkbage commented Apr 7, 2018

Copy link
Copy Markdown
Contributor

Builds on top of #12556

This ensures that both Fabric and RN renderers share the same view config registry since it is stateful.

I had to duplicate in the mocks for testing.

@sophiebits

Copy link
Copy Markdown
Contributor

I don't understand why it's duplicated or what difference being in the shims folder makes.

@sophiebits

Copy link
Copy Markdown
Contributor

…and that's probably why you didn't tag me as reviewer. Oops.

@sebmarkbage

Copy link
Copy Markdown
Contributor Author

Shims is the only thing we have set up that can be standalone files without being bundled. The alternative is building a new bundle that only has this file in it but I think a more likely set up is that we just move this file to RN and keep the mock so it works like all the other external deps.

@sebmarkbage

sebmarkbage commented Apr 8, 2018

Copy link
Copy Markdown
Contributor Author

There's also other reasons to put it in shims. Because we have a bunch of lint rules and stuff set up that means you can't do things like use CommonJS in normal src files. It's quite difficult to not bundle something.

@sebmarkbage

Copy link
Copy Markdown
Contributor Author

I also moved createReactNativeComponentClass since it's just an alias for the registry. It should really just move back to RN.

@bvaughn bvaughn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change looks okay to me, but why can't we just remove these from the React repo entirely now? The shims are only useful if they're in place to forward to "SECRET INTERNALS" stuff, right?

}
invariant(viewConfig, 'View config not found for name %s', name);
return viewConfig;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should just move extractEvents out of ReactNativeBridgeEventPlugin and into this file too so we can get rid of ReactNativeBridgeEventPlugin. 😄

This ensures that both Fabric and RN renderers share the same view config
registry since it is stateful.

I had to duplicate in the mocks for testing.
Since createReactNativeComponentClass is just an alias for the register
there's no need to bundle it. This file should probably just move back
to RN too.
@sebmarkbage
sebmarkbage merged commit b99d0b1 into react:master Apr 10, 2018
rhagigi pushed a commit to rhagigi/react that referenced this pull request Apr 19, 2018
* Move view config registry to shims

This ensures that both Fabric and RN renderers share the same view config
registry since it is stateful.

I had to duplicate in the mocks for testing.

* Move createReactNativeComponentClass to shims and delete internal usage

Since createReactNativeComponentClass is just an alias for the register
there's no need to bundle it. This file should probably just move back
to RN too.
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
* Move view config registry to shims

This ensures that both Fabric and RN renderers share the same view config
registry since it is stateful.

I had to duplicate in the mocks for testing.

* Move createReactNativeComponentClass to shims and delete internal usage

Since createReactNativeComponentClass is just an alias for the register
there's no need to bundle it. This file should probably just move back
to RN too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants