mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d197e95893 | ||
|
|
cda29d2124 | ||
|
|
e2be26a68f | ||
|
|
9f0f8a5345 | ||
|
|
0117077b95 | ||
|
|
017dc45c62 | ||
|
|
f7d0b83492 | ||
|
|
65003d7436 | ||
|
|
727d755441 | ||
|
|
e79ecb5122 | ||
|
|
9f49f8a0f1 | ||
|
|
68110d4ab3 | ||
|
|
0f5fb5ebc0 | ||
|
|
fb2991e3e7 | ||
|
|
06fedcd32d | ||
|
|
2313d45da9 |
@@ -789,13 +789,15 @@ workflows:
|
||||
run_unit_tests: true
|
||||
requires:
|
||||
- setup_ios
|
||||
- test_ios:
|
||||
name: test_ios_unit_frameworks_hermes
|
||||
use_hermes: true
|
||||
use_frameworks: true
|
||||
run_unit_tests: true
|
||||
requires:
|
||||
- setup_ios
|
||||
# Hermes doesn't support dynamic frameworks right now.
|
||||
# The following configuration will fail.
|
||||
# - test_ios:
|
||||
# name: test_ios_unit_frameworks_hermes
|
||||
# use_hermes: true
|
||||
# use_frameworks: true
|
||||
# run_unit_tests: true
|
||||
# requires:
|
||||
# - setup_ios
|
||||
# - test_ios:
|
||||
# name: test_ios_detox
|
||||
# run_detox_tests: true
|
||||
|
||||
@@ -33,6 +33,7 @@ const ActionSheetIOS = {
|
||||
* - `destructiveButtonIndex` (int or array of ints) - index or indices of destructive buttons in `options`
|
||||
* - `title` (string) - a title to show above the action sheet
|
||||
* - `message` (string) - a message to show below the title
|
||||
* - `disabledButtonIndices` (array of numbers) - a list of button indices which should be disabled
|
||||
*
|
||||
* The 'callback' function takes one parameter, the zero-based index
|
||||
* of the selected item.
|
||||
@@ -49,6 +50,7 @@ const ActionSheetIOS = {
|
||||
+anchor?: ?number,
|
||||
+tintColor?: ColorValue | ProcessedColorValue,
|
||||
+userInterfaceStyle?: string,
|
||||
+disabledButtonIndices?: Array<number>,
|
||||
|},
|
||||
callback: (buttonIndex: number) => void,
|
||||
) {
|
||||
|
||||
@@ -25,6 +25,7 @@ export interface Spec extends TurboModule {
|
||||
+anchor?: ?number,
|
||||
+tintColor?: ?number,
|
||||
+userInterfaceStyle?: ?string,
|
||||
+disabledButtonIndices?: Array<number>,
|
||||
|},
|
||||
callback: (buttonIndex: number) => void,
|
||||
) => void;
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
* @generated by scripts/bump-oss-version.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @generated by scripts/bump-oss-version.js
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
exports.version = {
|
||||
major: 0,
|
||||
minor: 0,
|
||||
minor: 64,
|
||||
patch: 0,
|
||||
prerelease: null,
|
||||
prerelease: 'rc.1',
|
||||
};
|
||||
|
||||
@@ -21,11 +21,11 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^(void){
|
||||
__rnVersion = @{
|
||||
RCTVersionMajor: @(0),
|
||||
RCTVersionMinor: @(0),
|
||||
RCTVersionPatch: @(0),
|
||||
RCTVersionPrerelease: [NSNull null],
|
||||
};
|
||||
RCTVersionMajor: @(0),
|
||||
RCTVersionMinor: @(64),
|
||||
RCTVersionPatch: @(0),
|
||||
RCTVersionPrerelease: @"rc.1",
|
||||
};
|
||||
});
|
||||
return __rnVersion;
|
||||
}
|
||||
|
||||
@@ -73,9 +73,15 @@ RCT_EXPORT_METHOD(showActionSheetWithOptions
|
||||
NSArray<NSString *> *buttons = RCTConvertOptionalVecToArray(options.options(), ^id(NSString *element) {
|
||||
return element;
|
||||
});
|
||||
NSArray<NSNumber *> *disabledButtonIndices;
|
||||
NSInteger cancelButtonIndex =
|
||||
options.cancelButtonIndex() ? [RCTConvert NSInteger:@(*options.cancelButtonIndex())] : -1;
|
||||
NSArray<NSNumber *> *destructiveButtonIndices;
|
||||
if (options.disabledButtonIndices()) {
|
||||
disabledButtonIndices = RCTConvertVecToArray(*options.disabledButtonIndices(), ^id(double element) {
|
||||
return @(element);
|
||||
});
|
||||
}
|
||||
if (options.destructiveButtonIndices()) {
|
||||
destructiveButtonIndices = RCTConvertVecToArray(*options.destructiveButtonIndices(), ^id(double element) {
|
||||
return @(element);
|
||||
@@ -98,6 +104,7 @@ RCT_EXPORT_METHOD(showActionSheetWithOptions
|
||||
@"destructiveButtonIndices" : destructiveButtonIndices,
|
||||
@"anchor" : anchor,
|
||||
@"tintColor" : tintColor,
|
||||
@"disabledButtonIndices" : disabledButtonIndices,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -132,6 +139,17 @@ RCT_EXPORT_METHOD(showActionSheetWithOptions
|
||||
index++;
|
||||
}
|
||||
|
||||
if (disabledButtonIndices) {
|
||||
for (NSNumber *disabledButtonIndex in disabledButtonIndices) {
|
||||
if ([disabledButtonIndex integerValue] < buttons.count) {
|
||||
[alertController.actions[[disabledButtonIndex integerValue]] setEnabled:false];
|
||||
} else {
|
||||
RCTLogError(@"Index %@ from `disabledButtonIndices` is out of bounds. Maximum index value is %@.", @([disabledButtonIndex integerValue]), @(buttons.count - 1));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
alertController.view.tintColor = tintColor;
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
|
||||
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_NAME=1000.0.0-master
|
||||
VERSION_NAME=0.64.0-rc.1
|
||||
GROUP=com.facebook.react
|
||||
|
||||
POM_NAME=ReactNative
|
||||
|
||||
@@ -73,12 +73,12 @@ if (JavaVersion.current().isJava8Compatible()) {
|
||||
|
||||
afterEvaluate { project ->
|
||||
|
||||
task androidJavadoc(type: Javadoc) {
|
||||
task androidJavadoc(type: Javadoc, dependsOn: generateReleaseBuildConfig) {
|
||||
source = android.sourceSets.main.java.srcDirs
|
||||
classpath += files(android.bootClasspath)
|
||||
classpath += files(project.getConfigurations().getByName("compile").asList())
|
||||
classpath += files("$buildDir/generated/source/buildConfig/release")
|
||||
include("**/*.java")
|
||||
exclude("**/ReactBuildConfig.java")
|
||||
}
|
||||
|
||||
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ import java.util.Map;
|
||||
public class ReactNativeVersion {
|
||||
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
|
||||
"major", 0,
|
||||
"minor", 0,
|
||||
"minor", 64,
|
||||
"patch", 0,
|
||||
"prerelease", null);
|
||||
"prerelease", "rc.1");
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ namespace facebook::react {
|
||||
|
||||
constexpr struct {
|
||||
int32_t Major = 0;
|
||||
int32_t Minor = 0;
|
||||
int32_t Minor = 64;
|
||||
int32_t Patch = 0;
|
||||
std::string_view Prerelease = "";
|
||||
std::string_view Prerelease = "rc.1";
|
||||
} ReactNativeVersion;
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
@@ -131,7 +131,7 @@ module.exports = {
|
||||
'DatePickerIOS-merged',
|
||||
'DatePickerIOS has been merged with DatePickerAndroid and will be removed in a future release. ' +
|
||||
"It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/datetimepicker',
|
||||
'See https://github.com/react-native-datetimepicker/datetimepicker',
|
||||
);
|
||||
return require('./Libraries/Components/DatePicker/DatePickerIOS');
|
||||
},
|
||||
@@ -158,8 +158,8 @@ module.exports = {
|
||||
warnOnce(
|
||||
'maskedviewios-moved',
|
||||
'MaskedViewIOS has been extracted from react-native core and will be removed in a future release. ' +
|
||||
"It can now be installed and imported from '@react-native-community/masked-view' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/react-native-masked-view',
|
||||
"It can now be installed and imported from '@react-native-masked-view/masked-view' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-masked-view/react-native-masked-view',
|
||||
);
|
||||
return require('./Libraries/Components/MaskedView/MaskedViewIOS');
|
||||
},
|
||||
@@ -170,8 +170,8 @@ module.exports = {
|
||||
warnOnce(
|
||||
'picker-moved',
|
||||
'Picker has been extracted from react-native core and will be removed in a future release. ' +
|
||||
"It can now be installed and imported from '@react-native-community/picker' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/react-native-picker',
|
||||
"It can now be installed and imported from '@react-native-picker/picker' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-picker/react-native-picker',
|
||||
);
|
||||
return require('./Libraries/Components/Picker/Picker');
|
||||
},
|
||||
@@ -180,8 +180,8 @@ module.exports = {
|
||||
warnOnce(
|
||||
'pickerios-moved',
|
||||
'PickerIOS has been extracted from react-native core and will be removed in a future release. ' +
|
||||
"It can now be installed and imported from '@react-native-community/picker' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/react-native-picker',
|
||||
"It can now be installed and imported from '@react-native-picker/picker' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-picker/react-native-picker',
|
||||
);
|
||||
return require('./Libraries/Components/Picker/PickerIOS');
|
||||
},
|
||||
@@ -194,7 +194,7 @@ module.exports = {
|
||||
'progress-bar-android-moved',
|
||||
'ProgressBarAndroid has been extracted from react-native core and will be removed in a future release. ' +
|
||||
"It can now be installed and imported from '@react-native-community/progress-bar-android' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/progress-bar-android',
|
||||
'See https://github.com/react-native-progress-view/progress-bar-android',
|
||||
);
|
||||
return require('./Libraries/Components/ProgressBarAndroid/ProgressBarAndroid');
|
||||
},
|
||||
@@ -204,7 +204,7 @@ module.exports = {
|
||||
'progress-view-ios-moved',
|
||||
'ProgressViewIOS has been extracted from react-native core and will be removed in a future release. ' +
|
||||
"It can now be installed and imported from '@react-native-community/progress-view' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/progress-view',
|
||||
'See https://github.com/react-native-progress-view/progress-view',
|
||||
);
|
||||
return require('./Libraries/Components/ProgressViewIOS/ProgressViewIOS');
|
||||
},
|
||||
@@ -226,7 +226,7 @@ module.exports = {
|
||||
'segmented-control-ios-moved',
|
||||
'SegmentedControlIOS has been extracted from react-native core and will be removed in a future release. ' +
|
||||
"It can now be installed and imported from '@react-native-community/segmented-control' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/segmented-control',
|
||||
'See https://github.com/react-native-segmented-control/segmented-control',
|
||||
);
|
||||
return require('./Libraries/Components/SegmentedControlIOS/SegmentedControlIOS');
|
||||
},
|
||||
@@ -235,7 +235,7 @@ module.exports = {
|
||||
'slider-moved',
|
||||
'Slider has been extracted from react-native core and will be removed in a future release. ' +
|
||||
"It can now be installed and imported from '@react-native-community/slider' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/react-native-slider',
|
||||
'See https://github.com/callstack/react-native-slider',
|
||||
);
|
||||
return require('./Libraries/Components/Slider/Slider');
|
||||
},
|
||||
@@ -300,8 +300,8 @@ module.exports = {
|
||||
warnOnce(
|
||||
'async-storage-moved',
|
||||
'AsyncStorage has been extracted from react-native core and will be removed in a future release. ' +
|
||||
"It can now be installed and imported from '@react-native-community/async-storage' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/async-storage',
|
||||
"It can now be installed and imported from '@react-native-async-storage/async-storage' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-async-storage/async-storage',
|
||||
);
|
||||
return require('./Libraries/Storage/AsyncStorage');
|
||||
},
|
||||
@@ -313,7 +313,7 @@ module.exports = {
|
||||
'clipboard-moved',
|
||||
'Clipboard has been extracted from react-native core and will be removed in a future release. ' +
|
||||
"It can now be installed and imported from '@react-native-community/clipboard' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/clipboard',
|
||||
'See https://github.com/react-native-clipboard/clipboard',
|
||||
);
|
||||
return require('./Libraries/Components/Clipboard/Clipboard');
|
||||
},
|
||||
@@ -322,7 +322,7 @@ module.exports = {
|
||||
'DatePickerAndroid-merged',
|
||||
'DatePickerAndroid has been merged with DatePickerIOS and will be removed in a future release. ' +
|
||||
"It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/datetimepicker',
|
||||
'See https://github.com/react-native-datetimepicker/datetimepicker',
|
||||
);
|
||||
return require('./Libraries/Components/DatePickerAndroid/DatePickerAndroid');
|
||||
},
|
||||
@@ -350,7 +350,7 @@ module.exports = {
|
||||
'ImagePickerIOS has been extracted from react-native core and will be removed in a future release. ' +
|
||||
"Please upgrade to use either '@react-native-community/react-native-image-picker' or 'expo-image-picker'. " +
|
||||
"If you cannot upgrade to a different library, please install the deprecated '@react-native-community/image-picker-ios' package. " +
|
||||
'See https://github.com/react-native-community/react-native-image-picker-ios',
|
||||
'See https://github.com/rnc-archive/react-native-image-picker-ios',
|
||||
);
|
||||
return require('./Libraries/Image/ImagePickerIOS');
|
||||
},
|
||||
@@ -393,7 +393,7 @@ module.exports = {
|
||||
'pushNotificationIOS-moved',
|
||||
'PushNotificationIOS has been extracted from react-native core and will be removed in a future release. ' +
|
||||
"It can now be installed and imported from '@react-native-community/push-notification-ios' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/push-notification-ios',
|
||||
'See https://github.com/react-native-push-notification-ios/push-notification-ios',
|
||||
);
|
||||
return require('./Libraries/PushNotificationIOS/PushNotificationIOS');
|
||||
},
|
||||
@@ -512,7 +512,7 @@ if (__DEV__) {
|
||||
false,
|
||||
'ART has been removed from React Native. ' +
|
||||
"It can now be installed and imported from '@react-native-community/art' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/art',
|
||||
'See https://github.com/react-native-art/art',
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -551,7 +551,7 @@ if (__DEV__) {
|
||||
false,
|
||||
'WebView has been removed from React Native. ' +
|
||||
"It can now be installed and imported from 'react-native-webview' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/react-native-webview',
|
||||
'See https://github.com/react-native-webview/react-native-webview',
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -564,7 +564,7 @@ if (__DEV__) {
|
||||
false,
|
||||
'NetInfo has been removed from React Native. ' +
|
||||
"It can now be installed and imported from '@react-native-community/netinfo' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/react-native-netinfo',
|
||||
'See https://github.com/react-native-netinfo/react-native-netinfo',
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -577,7 +577,7 @@ if (__DEV__) {
|
||||
false,
|
||||
'CameraRoll has been removed from React Native. ' +
|
||||
"It can now be installed and imported from '@react-native-community/cameraroll' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/react-native-cameraroll',
|
||||
'See https://github.com/react-native-cameraroll/react-native-cameraroll',
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -604,7 +604,7 @@ if (__DEV__) {
|
||||
false,
|
||||
'ImageEditor has been removed from React Native. ' +
|
||||
"It can now be installed and imported from '@react-native-community/image-editor' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/react-native-image-editor',
|
||||
'See https://github.com/callstack/react-native-image-editor',
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -617,7 +617,7 @@ if (__DEV__) {
|
||||
false,
|
||||
'TimePickerAndroid has been removed from React Native. ' +
|
||||
"It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/datetimepicker',
|
||||
'See https://github.com/react-native-datetimepicker/datetimepicker',
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -630,7 +630,7 @@ if (__DEV__) {
|
||||
false,
|
||||
'ToolbarAndroid has been removed from React Native. ' +
|
||||
"It can now be installed and imported from '@react-native-community/toolbar-android' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/toolbar-android',
|
||||
'See https://github.com/react-native-toolbar-android/toolbar-android',
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -643,7 +643,7 @@ if (__DEV__) {
|
||||
false,
|
||||
'ViewPagerAndroid has been removed from React Native. ' +
|
||||
"It can now be installed and imported from '@react-native-community/viewpager' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/react-native-viewpager',
|
||||
'See https://github.com/callstack/react-native-viewpager',
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -656,7 +656,7 @@ if (__DEV__) {
|
||||
false,
|
||||
'CheckBox has been removed from React Native. ' +
|
||||
"It can now be installed and imported from '@react-native-community/checkbox' instead of 'react-native'. " +
|
||||
'See https://github.com/react-native-community/react-native-checkbox',
|
||||
'See https://github.com/react-native-checkbox/react-native-checkbox',
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
+11
-14
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "react-native",
|
||||
"private": true,
|
||||
"version": "1000.0.0",
|
||||
"version": "0.64.0-rc.1",
|
||||
"bin": "./cli.js",
|
||||
"description": "A framework for building native apps using React",
|
||||
"license": "MIT",
|
||||
@@ -17,6 +16,7 @@
|
||||
"!template/node_modules",
|
||||
"!template/package-lock.json",
|
||||
"!template/yarn.lock",
|
||||
"android",
|
||||
"cli.js",
|
||||
"flow",
|
||||
"flow-typed",
|
||||
@@ -77,18 +77,14 @@
|
||||
"test-ios-e2e": "detox test -c ios.sim.release packages/rn-tester/e2e",
|
||||
"test-ios": "./scripts/objc-test.sh test"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/!(eslint-config-react-native-community)",
|
||||
"repo-config"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"react": "17.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/create-cache-key-function": "^26.5.0",
|
||||
"@react-native-community/cli": "^4.13.0",
|
||||
"@react-native-community/cli-platform-android": "^4.13.0",
|
||||
"@react-native-community/cli-platform-ios": "^4.13.0",
|
||||
"@react-native-community/cli": "^5.0.1-alpha.0",
|
||||
"@react-native-community/cli-platform-android": "^5.0.1-alpha.0",
|
||||
"@react-native-community/cli-platform-ios": "^5.0.1-alpha.0",
|
||||
"@react-native/assets": "1.0.0",
|
||||
"@react-native/normalize-color": "1.0.0",
|
||||
"@react-native/polyfills": "1.0.0",
|
||||
@@ -99,10 +95,10 @@
|
||||
"hermes-engine": "~0.7.0",
|
||||
"invariant": "^2.2.4",
|
||||
"jsc-android": "^245459.0.0",
|
||||
"metro-babel-register": "0.63.0",
|
||||
"metro-react-native-babel-transformer": "0.63.0",
|
||||
"metro-runtime": "0.63.0",
|
||||
"metro-source-map": "0.63.0",
|
||||
"metro-babel-register": "0.64.0",
|
||||
"metro-react-native-babel-transformer": "0.64.0",
|
||||
"metro-runtime": "0.64.0",
|
||||
"metro-source-map": "0.64.0",
|
||||
"nullthrows": "^1.1.1",
|
||||
"pretty-format": "^26.5.2",
|
||||
"promise": "^8.0.3",
|
||||
@@ -111,6 +107,7 @@
|
||||
"react-refresh": "^0.4.0",
|
||||
"regenerator-runtime": "^0.13.2",
|
||||
"scheduler": "^0.20.1",
|
||||
"shelljs": "^0.8.4",
|
||||
"stacktrace-parser": "^0.1.3",
|
||||
"use-subscription": "^1.0.0",
|
||||
"whatwg-fetch": "^3.0.0",
|
||||
@@ -157,4 +154,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-codegen",
|
||||
"version": "0.0.5",
|
||||
"version": "0.0.6",
|
||||
"description": "⚛️ Code generation tools for React Native",
|
||||
"homepage": "https://github.com/facebook/react-native/tree/master/packages/react-native-codegen",
|
||||
"repository": {
|
||||
|
||||
@@ -11,9 +11,41 @@ THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOUR
|
||||
set -e
|
||||
set -u
|
||||
|
||||
pushd "$THIS_DIR/../.." >/dev/null
|
||||
CODEGEN_DIR="$THIS_DIR/../.."
|
||||
|
||||
yarn install 2> >(grep -v '^warning' 1>&2)
|
||||
yarn run build
|
||||
rm -rf "${CODEGEN_DIR:?}/lib" "${CODEGEN_DIR:?}/node_modules"
|
||||
|
||||
popd >/dev/null
|
||||
# Fallback to npm if yarn is not available
|
||||
if [ -x "$(command -v yarn)" ]; then
|
||||
YARN_OR_NPM=$(command -v yarn)
|
||||
else
|
||||
YARN_OR_NPM=$(command -v npm)
|
||||
fi
|
||||
YARN_BINARY="${YARN_BINARY:-$YARN_OR_NPM}"
|
||||
|
||||
if [[ ${FBSOURCE_ENV:-0} -eq 1 ]]; then
|
||||
# Custom FB-specific setup
|
||||
pushd "$CODEGEN_DIR" >/dev/null
|
||||
|
||||
"$YARN_BINARY" install 2> >(grep -v '^warning' 1>&2)
|
||||
# Note: Within FBSOURCE_ENV, this has to explicitly run build.
|
||||
"$YARN_BINARY" run build
|
||||
|
||||
popd >/dev/null
|
||||
else
|
||||
# Run yarn install in a separate tmp dir to avoid conflict with the rest of the repo.
|
||||
# Note: OSS-only.
|
||||
TMP_DIR=$(mktemp -d)
|
||||
|
||||
cp -R "$CODEGEN_DIR/." "$TMP_DIR"
|
||||
|
||||
pushd "$TMP_DIR" >/dev/null
|
||||
|
||||
# Note: this automatically runs build as well.
|
||||
"$YARN_BINARY" install 2> >(grep -v '^warning' 1>&2)
|
||||
|
||||
popd >/dev/null
|
||||
|
||||
mv "$TMP_DIR/lib" "$TMP_DIR/node_modules" "$CODEGEN_DIR"
|
||||
rm -rf "$TMP_DIR"
|
||||
fi
|
||||
|
||||
@@ -65,7 +65,7 @@ pre_install do |installer|
|
||||
if ENV['USE_CODEGEN'] != '0'
|
||||
prefix_path = "../.."
|
||||
codegen_path = "../../packages/react-native-codegen"
|
||||
system("(cd #{codegen_path} && yarn install && yarn run build)")
|
||||
system("./#{codegen_path}/scripts/oss/build.sh") or raise "Could not build react-native-codegen package"
|
||||
codegen_pre_install(installer, {path:prefix_path, codegen_path:codegen_path})
|
||||
end
|
||||
end
|
||||
|
||||
@@ -528,6 +528,6 @@ SPEC CHECKSUMS:
|
||||
Yoga: 69ef0b2bba5387523f793957a9f80dbd61e89631
|
||||
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
|
||||
|
||||
PODFILE CHECKSUM: 497dba59a3312b3cb22d518b96672409db90460d
|
||||
PODFILE CHECKSUM: cd671238f92c51cd349a1c778fd089994174b101
|
||||
|
||||
COCOAPODS: 1.10.0
|
||||
|
||||
@@ -25,6 +25,7 @@ const ScreenshotManager = NativeModules.ScreenshotManager;
|
||||
const BUTTONS = ['Option 0', 'Option 1', 'Option 2', 'Delete', 'Cancel'];
|
||||
const DESTRUCTIVE_INDEX = 3;
|
||||
const CANCEL_INDEX = 4;
|
||||
const DISABLED_BUTTON_INDICES = [1, 2];
|
||||
|
||||
type Props = $ReadOnly<{||}>;
|
||||
type State = {|clicked: string|};
|
||||
@@ -138,6 +139,37 @@ class ActionSheetAnchorExample extends React.Component<
|
||||
};
|
||||
}
|
||||
|
||||
class ActionSheetDisabledExample extends React.Component<Props, State> {
|
||||
state = {
|
||||
clicked: 'none',
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<Text onPress={this.showActionSheet} style={style.button}>
|
||||
Click to show the ActionSheet
|
||||
</Text>
|
||||
<Text>Clicked button: {this.state.clicked}</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
showActionSheet = () => {
|
||||
ActionSheetIOS.showActionSheetWithOptions(
|
||||
{
|
||||
options: BUTTONS,
|
||||
cancelButtonIndex: CANCEL_INDEX,
|
||||
destructiveButtonIndex: DESTRUCTIVE_INDEX,
|
||||
disabledButtonIndices: DISABLED_BUTTON_INDICES,
|
||||
},
|
||||
buttonIndex => {
|
||||
this.setState({clicked: BUTTONS[buttonIndex]});
|
||||
},
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
class ShareActionSheetExample extends React.Component<
|
||||
$FlowFixMeProps,
|
||||
$FlowFixMeState,
|
||||
@@ -316,6 +348,12 @@ exports.examples = [
|
||||
return <ActionSheetAnchorExample />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Show Action Sheet with disabled buttons',
|
||||
render(): React.Element<any> {
|
||||
return <ActionSheetDisabledExample />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Show Share Action Sheet',
|
||||
render(): React.Element<any> {
|
||||
|
||||
@@ -25,7 +25,7 @@ RN_DIR=$(cd "$THIS_DIR/.." && pwd)
|
||||
CODEGEN_DIR=$(cd "$RN_DIR/packages/react-native-codegen" && pwd)
|
||||
OUTPUT_DIR="${1:-$RN_DIR/Libraries/FBReactNativeSpec/FBReactNativeSpec}"
|
||||
SCHEMA_FILE="$RN_DIR/schema-native-modules.json"
|
||||
YARN_BINARY="${YARN_BINARY:-yarn}"
|
||||
YARN_BINARY="${YARN_BINARY:-$(command -v yarn)}"
|
||||
|
||||
describe () {
|
||||
printf "\\n\\n>>>>> %s\\n\\n\\n" "$1"
|
||||
|
||||
+28
-6
@@ -126,12 +126,34 @@ if (nightlyBuild) {
|
||||
releaseVersion = tagsWithVersion[tagsWithVersion.length - 1].slice(1);
|
||||
}
|
||||
|
||||
// -------- Generating Android Artifacts with JavaDoc
|
||||
if (exec('./gradlew :ReactAndroid:installArchives').code) {
|
||||
echo('Could not generate artifacts');
|
||||
exit(1);
|
||||
const buildAndroid = (rebuildOnError) => {
|
||||
// -------- Generating Android Artifacts with JavaDoc
|
||||
if (exec('./gradlew :ReactAndroid:installArchives').code) {
|
||||
echo('Could not generate artifacts.');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
const aarLocation = `android/com/facebook/react/react-native/${releaseVersion}/react-native-${releaseVersion}.aar`;
|
||||
|
||||
// -------- Check if Android artifact contains all the files
|
||||
const {stdout: aarContent} = exec(`unzip -l ${aarLocation} | grep libfbjni.so`);
|
||||
if ((aarContent.match(/libfbjni.so/g) || []).length === 4) {
|
||||
echo(`Artifacts validated, continuing.`);
|
||||
return;
|
||||
}
|
||||
|
||||
// -------- Temporary fix for broken Android artifact is to build with Gradle once again
|
||||
if (rebuildOnError) {
|
||||
echo(`${aarLocation} is missing contents. Rebuilding with Gradle again in an effort to try to fix it.`);
|
||||
buildAndroid(false);
|
||||
} else {
|
||||
echo(`${aarLocation} is missing contents. Rebuilding did not fix the issue.`);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
buildAndroid(true);
|
||||
|
||||
// undo uncommenting javadoc setting
|
||||
exec('git checkout ReactAndroid/gradle.properties');
|
||||
|
||||
@@ -157,8 +179,8 @@ artifacts.forEach(name => {
|
||||
const tagFlag = nightlyBuild
|
||||
? '--tag nightly'
|
||||
: releaseVersion.indexOf('-rc') === -1
|
||||
? ''
|
||||
: '--tag next';
|
||||
? ''
|
||||
: '--tag next';
|
||||
|
||||
// use otp from envvars if available
|
||||
const otpFlag = otp ? `--otp ${otp}` : '';
|
||||
|
||||
@@ -63,7 +63,7 @@ def use_react_native! (options={})
|
||||
|
||||
if hermes_enabled
|
||||
pod 'React-Core/Hermes', :path => "#{prefix}/"
|
||||
pod 'hermes-engine'
|
||||
pod 'hermes-engine', '~> 0.7.1'
|
||||
pod 'libevent', :podspec => "#{prefix}/third-party-podspecs/libevent.podspec"
|
||||
end
|
||||
end
|
||||
@@ -111,14 +111,18 @@ end
|
||||
|
||||
# Pre Install processing for Native Modules
|
||||
def codegen_pre_install(installer, options={})
|
||||
# Path to React Native
|
||||
prefix = options[:path] ||= "../node_modules/react-native"
|
||||
codegen_path = options[:codegen_path] ||= "../node_modules/react-native-codegen"
|
||||
|
||||
# Path to react-native-codegen
|
||||
codegen_path = options[:codegen_path] ||= "#{prefix}/../react-native-codegen"
|
||||
|
||||
# Handle Core Modules
|
||||
Dir.mktmpdir do |dir|
|
||||
native_module_spec_name = "FBReactNativeSpec"
|
||||
schema_file = dir + "/schema-#{native_module_spec_name}.json"
|
||||
srcs_dir = "#{prefix}/Libraries"
|
||||
schema_generated = system("node #{codegen_path}/lib/cli/combine/combine-js-to-schema-cli.js #{schema_file} #{srcs_dir}")
|
||||
specs_generated = system("node #{prefix}/scripts/generate-native-modules-specs-cli.js ios #{schema_file} #{srcs_dir}/#{native_module_spec_name}/#{native_module_spec_name}")
|
||||
schema_generated = system("node #{codegen_path}/lib/cli/combine/combine-js-to-schema-cli.js #{schema_file} #{srcs_dir}") or raise "Could not generate Native Module schema"
|
||||
specs_generated = system("node #{prefix}/scripts/generate-native-modules-specs-cli.js ios #{schema_file} #{srcs_dir}/#{native_module_spec_name}/#{native_module_spec_name}") or raise "Could not generate code for #{native_module_spec_name}"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "17.0.1",
|
||||
"react-native": "1000.0.0"
|
||||
"react-native": "0.64.0-rc.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.4",
|
||||
@@ -20,9 +20,9 @@
|
||||
"babel-jest": "^25.1.0",
|
||||
"eslint": "^6.5.1",
|
||||
"jest": "^25.1.0",
|
||||
"metro-react-native-babel-preset": "^0.63.0",
|
||||
"react-test-renderer": "17.0.1",
|
||||
"react-native-codegen": "0.0.4"
|
||||
"metro-react-native-babel-preset": "^0.64.0",
|
||||
"react-native-codegen": "^0.0.6",
|
||||
"react-test-renderer": "17.0.1"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "react-native"
|
||||
|
||||
Reference in New Issue
Block a user