Skip to content

[iOS] Turbo module: Fixes dictionary stripped out when value is null #51103

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<e9a109fd77667dd0cb945ef6ef9737f2>>
* @generated SignedSource<<cac0bb7b4f25d369550064d60b8f48f6>>
*/

/**
Expand Down Expand Up @@ -162,6 +162,12 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun enableMainQueueModulesOnIOS(): Boolean = accessor.enableMainQueueModulesOnIOS()

/**
* Enable NSNull conversion when handling module arguments on iOS
*/
@JvmStatic
public fun enableModuleArgumentNSNullConversionIOS(): Boolean = accessor.enableModuleArgumentNSNullConversionIOS()

/**
* Parse CSS strings using the Fabric CSS parser instead of ViewConfig processing
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<1a5cd689229d4e0c31070123045e84da>>
* @generated SignedSource<<14ab91360bebaf87ddd21db7de901d42>>
*/

/**
Expand Down Expand Up @@ -42,6 +42,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var enableLayoutAnimationsOnAndroidCache: Boolean? = null
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
private var enableMainQueueModulesOnIOSCache: Boolean? = null
private var enableModuleArgumentNSNullConversionIOSCache: Boolean? = null
private var enableNativeCSSParsingCache: Boolean? = null
private var enableNetworkEventReportingCache: Boolean? = null
private var enableNewBackgroundAndBorderDrawablesCache: Boolean? = null
Expand Down Expand Up @@ -267,6 +268,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

override fun enableModuleArgumentNSNullConversionIOS(): Boolean {
var cached = enableModuleArgumentNSNullConversionIOSCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.enableModuleArgumentNSNullConversionIOS()
enableModuleArgumentNSNullConversionIOSCache = cached
}
return cached
}

override fun enableNativeCSSParsing(): Boolean {
var cached = enableNativeCSSParsingCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<c39d0c1834797b3309b4fc5ce814280c>>
* @generated SignedSource<<be5b2c2478f2c8fe61766f1b0e01d378>>
*/

/**
Expand Down Expand Up @@ -72,6 +72,8 @@ public object ReactNativeFeatureFlagsCxxInterop {

@DoNotStrip @JvmStatic public external fun enableMainQueueModulesOnIOS(): Boolean

@DoNotStrip @JvmStatic public external fun enableModuleArgumentNSNullConversionIOS(): Boolean

@DoNotStrip @JvmStatic public external fun enableNativeCSSParsing(): Boolean

@DoNotStrip @JvmStatic public external fun enableNetworkEventReporting(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<7f357475254104729cc7910c14e1c1fb>>
* @generated SignedSource<<6ffb759acef327fcf5e636c45d582b95>>
*/

/**
Expand Down Expand Up @@ -67,6 +67,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi

override fun enableMainQueueModulesOnIOS(): Boolean = false

override fun enableModuleArgumentNSNullConversionIOS(): Boolean = true

override fun enableNativeCSSParsing(): Boolean = false

override fun enableNetworkEventReporting(): Boolean = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<14cd1a58bd153dedda045a72c1494caa>>
* @generated SignedSource<<dce5453cd5fff3afb47e56335bf63443>>
*/

/**
Expand Down Expand Up @@ -46,6 +46,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var enableLayoutAnimationsOnAndroidCache: Boolean? = null
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
private var enableMainQueueModulesOnIOSCache: Boolean? = null
private var enableModuleArgumentNSNullConversionIOSCache: Boolean? = null
private var enableNativeCSSParsingCache: Boolean? = null
private var enableNetworkEventReportingCache: Boolean? = null
private var enableNewBackgroundAndBorderDrawablesCache: Boolean? = null
Expand Down Expand Up @@ -293,6 +294,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

override fun enableModuleArgumentNSNullConversionIOS(): Boolean {
var cached = enableModuleArgumentNSNullConversionIOSCache
if (cached == null) {
cached = currentProvider.enableModuleArgumentNSNullConversionIOS()
accessedFeatureFlags.add("enableModuleArgumentNSNullConversionIOS")
enableModuleArgumentNSNullConversionIOSCache = cached
}
return cached
}

override fun enableNativeCSSParsing(): Boolean {
var cached = enableNativeCSSParsingCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<593b1d64dc31038140032a6b0a439700>>
* @generated SignedSource<<acd1d6bf6c9d0f396eb2abc983093d71>>
*/

/**
Expand Down Expand Up @@ -67,6 +67,8 @@ public interface ReactNativeFeatureFlagsProvider {

@DoNotStrip public fun enableMainQueueModulesOnIOS(): Boolean

@DoNotStrip public fun enableModuleArgumentNSNullConversionIOS(): Boolean

@DoNotStrip public fun enableNativeCSSParsing(): Boolean

@DoNotStrip public fun enableNetworkEventReporting(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<d74dc8182a14fddbd7118149298515bd>>
* @generated SignedSource<<b11650946b8961533c2d581919ad7beb>>
*/

/**
Expand Down Expand Up @@ -171,6 +171,12 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}

bool enableModuleArgumentNSNullConversionIOS() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableModuleArgumentNSNullConversionIOS");
return method(javaProvider_);
}

bool enableNativeCSSParsing() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableNativeCSSParsing");
Expand Down Expand Up @@ -441,6 +447,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableMainQueueModulesOnIOS(
return ReactNativeFeatureFlags::enableMainQueueModulesOnIOS();
}

bool JReactNativeFeatureFlagsCxxInterop::enableModuleArgumentNSNullConversionIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS();
}

bool JReactNativeFeatureFlagsCxxInterop::enableNativeCSSParsing(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableNativeCSSParsing();
Expand Down Expand Up @@ -668,6 +679,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enableMainQueueModulesOnIOS",
JReactNativeFeatureFlagsCxxInterop::enableMainQueueModulesOnIOS),
makeNativeMethod(
"enableModuleArgumentNSNullConversionIOS",
JReactNativeFeatureFlagsCxxInterop::enableModuleArgumentNSNullConversionIOS),
makeNativeMethod(
"enableNativeCSSParsing",
JReactNativeFeatureFlagsCxxInterop::enableNativeCSSParsing),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<a5ab0022f6a01bd6e929d36d9d87db10>>
* @generated SignedSource<<0e589a2a6041ffafcf7d2a7b67639719>>
*/

/**
Expand Down Expand Up @@ -96,6 +96,9 @@ class JReactNativeFeatureFlagsCxxInterop
static bool enableMainQueueModulesOnIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool enableModuleArgumentNSNullConversionIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool enableNativeCSSParsing(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<88fdbea2f97f628187164a47a9737da0>>
* @generated SignedSource<<18fbe55eaefa17a3432b199121dedc62>>
*/

/**
Expand Down Expand Up @@ -114,6 +114,10 @@ bool ReactNativeFeatureFlags::enableMainQueueModulesOnIOS() {
return getAccessor().enableMainQueueModulesOnIOS();
}

bool ReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS() {
return getAccessor().enableModuleArgumentNSNullConversionIOS();
}

bool ReactNativeFeatureFlags::enableNativeCSSParsing() {
return getAccessor().enableNativeCSSParsing();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<a4123bc6f44835c022a1a5238908674c>>
* @generated SignedSource<<c47af8c08fd28df8f937a2f24caf037d>>
*/

/**
Expand Down Expand Up @@ -149,6 +149,11 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool enableMainQueueModulesOnIOS();

/**
* Enable NSNull conversion when handling module arguments on iOS
*/
RN_EXPORT static bool enableModuleArgumentNSNullConversionIOS();

/**
* Parse CSS strings using the Fabric CSS parser instead of ViewConfig processing
*/
Expand Down
Loading
Loading