From c35630998b73ef7573bd04caf7b9b75d26223283 Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Tue, 26 Mar 2024 19:08:07 -0700 Subject: [PATCH] Keep ES6Proxy enabled in bridgeless mode (#43538) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43538 The Hermes RuntimeConfig for bridgeless accidentally force-disabled ES6Proxy, resulting in https://github.com/facebook/react-native/issues/43523 Let's remove the incorrect override. To test using RNTester, add the following change: ``` diff --git a/packages/rn-tester/js/RNTesterAppShared.js b/packages/rn-tester/js/RNTesterAppShared.js index 87cb6b69dfe..f2512d09c5a 100644 --- a/packages/rn-tester/js/RNTesterAppShared.js +++ b/packages/rn-tester/js/RNTesterAppShared.js @@ -50,6 +50,8 @@ const RNTesterApp = ({ ); const colorScheme = useColorScheme(); + new Proxy({}, {}); + const { activeModuleKey, activeModuleTitle, ``` Before this change, RNTester will get an error at start-up. After, the app loads correctly. Changelog: [General][Fixed] Correctly keep ES6Proxy for bridgeless mode Reviewed By: cortinico Differential Revision: D55045780 fbshipit-source-id: 666b99712d35622f87d42f22a4611851df67d905 --- .../ReactCommon/react/runtime/hermes/HermesInstance.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp b/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp index e5ac3cb5a8f5bd..b5ddd1eab15502 100644 --- a/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp +++ b/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp @@ -137,7 +137,6 @@ std::unique_ptr HermesInstance::createJSRuntime( .withAllocInYoung(false) .withRevertToYGAtTTI(true) .build()) - .withES6Proxy(false) .withEnableSampleProfiling(true) .withMicrotaskQueue(ReactNativeFeatureFlags::enableMicrotasks()) .withVMExperimentFlags(vmExperimentFlags);