rnx-kit icon indicating copy to clipboard operation
rnx-kit copied to clipboard

The bundle includes `fabric` & `paper` React Native renderers

Open ecreeth opened this issue 3 years ago • 2 comments

What happened?

see more context https://github.com/facebook/react-native/issues/34464

Affected Package

@rnx-kit/cli

Version

0.14.2

Which platforms are you seeing this issue on?

  • [X] Android
  • [X] iOS
  • [ ] macOS
  • [X] Windows

System Information

System:
OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
CPU: (4) x64 Intel(R) Core(TM) i5-2400S CPU @ 2.50GHz
Memory: 2.41 GB / 13.64 GB
Shell: 5.1.16 - /bin/bash
Binaries:
Node: Not Found
Yarn: Not Found
npm: Not Found
Watchman: Not Found
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java: 11.0.16
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.0-rc.3 => 0.70.0-rc.3
npmGlobalPackages:
react-native: Not Found

Steps to Reproduce

  1. cd packages/test-app
  2. yarn react-native rnx-bundle --dev true
  3. Check the bundle and search for duplicate code

Like searching for:

ResponderEventPlugin.injection.injectGlobalResponderHandler`

You will see the two implementations in the bundle.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

ecreeth avatar Aug 25 '22 01:08 ecreeth

Does this also happen when you run the rn-cli?

yarn react-native bundle --entry-file src/index.ts --platform android --bundle-output dist/main.android.bundle
grep injectGlobalResponderHandler dist/main.android.bundle

Or are you saying this is a feature request?

tido64 avatar Aug 25 '22 06:08 tido64

@tido64 I'm sorry for not being able to explain well. After some more research, I noticed that it's not a bug with the CLI, but that the React Native core includes the Renderer directly and not dynamically.

Below you can find some places: (in the React Native repo)

grep -nr "/Renderer/shims/ReactNative'" Libraries/

image

One little example of this:

In the ScrollView component

Does this also happen when you run the rn-cli?

yarn react-native bundle --entry-file src/index.ts --platform android --bundle-output dist/main.android.bundle grep injectGlobalResponderHandler dist/main.android.bundle Or are you saying this is a feature request?

image

ecreeth avatar Aug 25 '22 12:08 ecreeth

That's right. You can enable/disable Fabric at runtime. I'm going to close this as it's not really an issue that our CLI should address.

tido64 avatar Aug 26 '22 08:08 tido64

This is now fixed. See https://github.com/facebook/react-native/issues/34464#issuecomment-1241208472

ecreeth avatar Sep 08 '22 20:09 ecreeth