mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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.0',
|
||||
};
|
||||
|
||||
@@ -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.0",
|
||||
};
|
||||
});
|
||||
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.0
|
||||
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.0");
|
||||
}
|
||||
|
||||
@@ -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.0";
|
||||
} 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',
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
+7
-11
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "react-native",
|
||||
"private": true,
|
||||
"version": "1000.0.0",
|
||||
"version": "0.64.0-rc.0",
|
||||
"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,10 +77,6 @@
|
||||
"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"
|
||||
},
|
||||
@@ -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",
|
||||
@@ -157,4 +153,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"
|
||||
|
||||
@@ -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
|
||||
|
||||
+28
-28
@@ -35,46 +35,46 @@ success "Preparing version $PACKAGE_VERSION"
|
||||
|
||||
repo_root=$(pwd)
|
||||
|
||||
rm -rf android
|
||||
./gradlew :ReactAndroid:installArchives || error "Couldn't generate artifacts"
|
||||
# rm -rf android
|
||||
# ./gradlew :ReactAndroid:installArchives || error "Couldn't generate artifacts"
|
||||
|
||||
success "Generated artifacts for Maven"
|
||||
# success "Generated artifacts for Maven"
|
||||
|
||||
npm install
|
||||
|
||||
success "Killing any running packagers"
|
||||
lsof -i :8081 | grep LISTEN
|
||||
lsof -i :8081 | grep LISTEN | /usr/bin/awk '{print $2}' | xargs kill
|
||||
# success "Killing any running packagers"
|
||||
# lsof -i :8081 | grep LISTEN
|
||||
# lsof -i :8081 | grep LISTEN | /usr/bin/awk '{print $2}' | xargs kill
|
||||
|
||||
info "Start the packager in another terminal by running 'npm start' from the root"
|
||||
info "and then press any key."
|
||||
info ""
|
||||
read -n 1
|
||||
# info "Start the packager in another terminal by running 'npm start' from the root"
|
||||
# info "and then press any key."
|
||||
# info ""
|
||||
# read -n 1
|
||||
|
||||
./gradlew :packages:rn-tester:android:app:installJscDebug || error "Couldn't build RNTester Android"
|
||||
# ./gradlew :packages:rn-tester:android:app:installJscDebug || error "Couldn't build RNTester Android"
|
||||
|
||||
info "Press any key to run RNTester in an already running Android emulator/device"
|
||||
info ""
|
||||
read -n 1
|
||||
adb shell am start -n com.facebook.react.uiapp/.RNTesterActivity
|
||||
# info "Press any key to run RNTester in an already running Android emulator/device"
|
||||
# info ""
|
||||
# read -n 1
|
||||
# adb shell am start -n com.facebook.react.uiapp/.RNTesterActivity
|
||||
|
||||
success "Installing CocoaPods dependencies"
|
||||
rm -rf packages/rn-tester/Pods
|
||||
(cd packages/rn-tester && pod install)
|
||||
# success "Installing CocoaPods dependencies"
|
||||
# rm -rf packages/rn-tester/Pods
|
||||
# (cd packages/rn-tester && pod install)
|
||||
|
||||
info "Press any key to open the workspace in Xcode, then build and test manually."
|
||||
info ""
|
||||
read -n 1
|
||||
# info "Press any key to open the workspace in Xcode, then build and test manually."
|
||||
# info ""
|
||||
# read -n 1
|
||||
|
||||
open "packages/rn-tester/RNTesterPods.xcworkspace"
|
||||
# open "packages/rn-tester/RNTesterPods.xcworkspace"
|
||||
|
||||
info "When done testing RNTester app on iOS and Android press any key to continue."
|
||||
info ""
|
||||
read -n 1
|
||||
# info "When done testing RNTester app on iOS and Android press any key to continue."
|
||||
# info ""
|
||||
# read -n 1
|
||||
|
||||
success "Killing packager"
|
||||
lsof -i :8081 | grep LISTEN
|
||||
lsof -i :8081 | grep LISTEN | /usr/bin/awk '{print $2}' | xargs kill
|
||||
# success "Killing packager"
|
||||
# lsof -i :8081 | grep LISTEN
|
||||
# lsof -i :8081 | grep LISTEN | /usr/bin/awk '{print $2}' | xargs kill
|
||||
|
||||
npm pack
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "17.0.1",
|
||||
"react-native": "1000.0.0"
|
||||
"react-native": "0.64.0-rc.0"
|
||||
},
|
||||
"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"
|
||||
|
||||
@@ -4757,10 +4757,10 @@ metro-babel-register@0.58.0:
|
||||
core-js "^2.2.2"
|
||||
escape-string-regexp "^1.0.5"
|
||||
|
||||
metro-babel-register@0.63.0:
|
||||
version "0.63.0"
|
||||
resolved "https://registry.yarnpkg.com/metro-babel-register/-/metro-babel-register-0.63.0.tgz#8e196535d4c77ff3103a681e8217f8661f5850c9"
|
||||
integrity sha512-y1XBXtHX3Wp25a5+Yfx0oxmjDR4aIzjOy5ywfRaz+2GLUkT6JngRQ2inyQ66wWDj8fjifPpH74j8vf7LGfyICQ==
|
||||
metro-babel-register@0.64.0:
|
||||
version "0.64.0"
|
||||
resolved "https://registry.yarnpkg.com/metro-babel-register/-/metro-babel-register-0.64.0.tgz#1a2d23f68da8b8ee42e78dca37ad21a5f4d3647d"
|
||||
integrity sha512-Kf6YvE3kIRumGnjK0Q9LqGDIdnsX9eFGtNBmBuCVDuB9wGGA/5CgX8We8W7Y44dz1RGTcHJRhfw5iGg+pwC3aQ==
|
||||
dependencies:
|
||||
"@babel/core" "^7.0.0"
|
||||
"@babel/plugin-proposal-class-properties" "^7.0.0"
|
||||
@@ -4779,13 +4779,14 @@ metro-babel-transformer@0.58.0:
|
||||
"@babel/core" "^7.0.0"
|
||||
metro-source-map "0.58.0"
|
||||
|
||||
metro-babel-transformer@0.63.0:
|
||||
version "0.63.0"
|
||||
resolved "https://registry.yarnpkg.com/metro-babel-transformer/-/metro-babel-transformer-0.63.0.tgz#0fe7dd2d58fba8a64917d431ba0dcbbdd874f076"
|
||||
integrity sha512-u8s6wKua9G0P/uLcw6hwPA1RCTKwlauvxMUoceci8HrK6FQyZamYbAM4fGxMSgjb2ogqKG7oGfBneTIrAn9HvA==
|
||||
metro-babel-transformer@0.64.0:
|
||||
version "0.64.0"
|
||||
resolved "https://registry.yarnpkg.com/metro-babel-transformer/-/metro-babel-transformer-0.64.0.tgz#a21f8a989a5ea60c1109456e21bd4d9374194ea0"
|
||||
integrity sha512-itZaxKTgmKGEZWxNzbSZBc22NngrMZzoUNuU92aHSTGkYi2WH4XlvzEHsstmIKHMsRVKl75cA+mNmgk4gBFJKw==
|
||||
dependencies:
|
||||
"@babel/core" "^7.0.0"
|
||||
metro-source-map "0.63.0"
|
||||
metro-source-map "0.64.0"
|
||||
nullthrows "^1.1.1"
|
||||
|
||||
metro-cache@0.58.0:
|
||||
version "0.58.0"
|
||||
@@ -4878,10 +4879,10 @@ metro-react-native-babel-preset@0.58.0:
|
||||
"@babel/template" "^7.0.0"
|
||||
react-refresh "^0.4.0"
|
||||
|
||||
metro-react-native-babel-preset@0.63.0:
|
||||
version "0.63.0"
|
||||
resolved "https://registry.yarnpkg.com/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.63.0.tgz#bc67d4d251ac72f30b7f3d92a069aea825577751"
|
||||
integrity sha512-iTM6V/hzqTd2dg0LHtD4f/TU+d4A7MFiMPUmIYDb0OZmCq6avfcxHQTXk/ZNbAr+eRoN/owx9OIkjt/CvG4vUA==
|
||||
metro-react-native-babel-preset@0.64.0:
|
||||
version "0.64.0"
|
||||
resolved "https://registry.yarnpkg.com/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.64.0.tgz#76861408681dfda3c1d962eb31a8994918c976f8"
|
||||
integrity sha512-HcZ0RWQRuJfpPiaHyFQJzcym+/dDIVUPwUAXWoub/C4GkGu+mPjp8vqK6g0FxokCnnI2TK0gZTza2IDfiNNscQ==
|
||||
dependencies:
|
||||
"@babel/core" "^7.0.0"
|
||||
"@babel/plugin-proposal-class-properties" "^7.0.0"
|
||||
@@ -4923,16 +4924,17 @@ metro-react-native-babel-preset@0.63.0:
|
||||
"@babel/template" "^7.0.0"
|
||||
react-refresh "^0.4.0"
|
||||
|
||||
metro-react-native-babel-transformer@0.63.0:
|
||||
version "0.63.0"
|
||||
resolved "https://registry.yarnpkg.com/metro-react-native-babel-transformer/-/metro-react-native-babel-transformer-0.63.0.tgz#527e1e5ef7b63512189a5b5bb4cb06d1fdb57815"
|
||||
integrity sha512-HbyGvCoGJZ2WrstyTgHg05O5UOYgkatRLpalAnhHjPt+1Wr0Z3vr33SesibHRlnT5ETUBZME+txukcnN9eSdIA==
|
||||
metro-react-native-babel-transformer@0.64.0:
|
||||
version "0.64.0"
|
||||
resolved "https://registry.yarnpkg.com/metro-react-native-babel-transformer/-/metro-react-native-babel-transformer-0.64.0.tgz#eafef756972f20efdc51bd5361d55f8598355623"
|
||||
integrity sha512-K1sHO3ODBFCr7uEiCQ4RvVr+cQg0EHQF8ChVPnecGh/WDD8udrTq9ECwB0dRfMjAvlsHtRUlJm6ZSI8UPgum2w==
|
||||
dependencies:
|
||||
"@babel/core" "^7.0.0"
|
||||
babel-preset-fbjs "^3.3.0"
|
||||
metro-babel-transformer "0.63.0"
|
||||
metro-react-native-babel-preset "0.63.0"
|
||||
metro-source-map "0.63.0"
|
||||
metro-babel-transformer "0.64.0"
|
||||
metro-react-native-babel-preset "0.64.0"
|
||||
metro-source-map "0.64.0"
|
||||
nullthrows "^1.1.1"
|
||||
|
||||
metro-react-native-babel-transformer@^0.58.0:
|
||||
version "0.58.0"
|
||||
@@ -4952,10 +4954,10 @@ metro-resolver@0.58.0, metro-resolver@^0.58.0:
|
||||
dependencies:
|
||||
absolute-path "^0.0.0"
|
||||
|
||||
metro-runtime@0.63.0:
|
||||
version "0.63.0"
|
||||
resolved "https://registry.yarnpkg.com/metro-runtime/-/metro-runtime-0.63.0.tgz#7cb397eb45b5f605886251cd2ccd40d0b9ad7a97"
|
||||
integrity sha512-iE3B2zFQBtSomz73extpfS/qvd4iEc2zbCEnytThPBtHY9g/pBTeR+sVqVlkG2Vl3sVXgxKx+Pq0QXuLz1ipLg==
|
||||
metro-runtime@0.64.0:
|
||||
version "0.64.0"
|
||||
resolved "https://registry.yarnpkg.com/metro-runtime/-/metro-runtime-0.64.0.tgz#cdaa1121d91041bf6345f2a69eb7c2fb289eff7b"
|
||||
integrity sha512-m7XbWOaIOeFX7YcxUhmnOi6Pg8EaeL89xyZ+quZyZVF1aNoTr4w8FfbKxvijpjsytKHIZtd+43m2Wt5JrqyQmQ==
|
||||
|
||||
metro-source-map@0.58.0:
|
||||
version "0.58.0"
|
||||
@@ -4970,16 +4972,17 @@ metro-source-map@0.58.0:
|
||||
source-map "^0.5.6"
|
||||
vlq "^1.0.0"
|
||||
|
||||
metro-source-map@0.63.0:
|
||||
version "0.63.0"
|
||||
resolved "https://registry.yarnpkg.com/metro-source-map/-/metro-source-map-0.63.0.tgz#bbfdfd2ce317dcccb7d52999d30bdbca69c8086c"
|
||||
integrity sha512-gDa91b9jeZJfzV3f9tq4++AEicrX95+cnvkpXx1f5X+VktQYDUhoTJ/WSCYAZOwoeE1+QC3+TfKpFKWNs1Siqw==
|
||||
metro-source-map@0.64.0:
|
||||
version "0.64.0"
|
||||
resolved "https://registry.yarnpkg.com/metro-source-map/-/metro-source-map-0.64.0.tgz#4310e17c3d4539c6369688022494ad66fa4d39a1"
|
||||
integrity sha512-OCG2rtcp5cLEGYvAbfkl6mEc0J2FPRP4/UCEly+juBk7hawS9bCBMBfhJm/HIsvY1frk6nT2Vsl1O8YBbwyx2g==
|
||||
dependencies:
|
||||
"@babel/traverse" "^7.0.0"
|
||||
"@babel/types" "^7.0.0"
|
||||
invariant "^2.2.4"
|
||||
metro-symbolicate "0.63.0"
|
||||
ob1 "0.63.0"
|
||||
metro-symbolicate "0.64.0"
|
||||
nullthrows "^1.1.1"
|
||||
ob1 "0.64.0"
|
||||
source-map "^0.5.6"
|
||||
vlq "^1.0.0"
|
||||
|
||||
@@ -4994,13 +4997,14 @@ metro-symbolicate@0.58.0:
|
||||
through2 "^2.0.1"
|
||||
vlq "^1.0.0"
|
||||
|
||||
metro-symbolicate@0.63.0:
|
||||
version "0.63.0"
|
||||
resolved "https://registry.yarnpkg.com/metro-symbolicate/-/metro-symbolicate-0.63.0.tgz#c099605f38a1ff1857712f49d15e7eab743bcc7d"
|
||||
integrity sha512-bJtz+hpHNHtUib9OUzxj/wShRm6p3qG0MtkLJKzWPe9SwxeGUH1mV0IUec4cgJL9csQ2iPMB00OknVH8K1eDaw==
|
||||
metro-symbolicate@0.64.0:
|
||||
version "0.64.0"
|
||||
resolved "https://registry.yarnpkg.com/metro-symbolicate/-/metro-symbolicate-0.64.0.tgz#405c21438ab553c29f6841da52ca76ee87bb06ac"
|
||||
integrity sha512-qIi+YRrDWnLVmydj6gwidYLPaBsakZRibGWSspuXgHAxOI3UuLwlo4dpQ73Et0gyHjI7ZvRMRY8JPiOntf9AQQ==
|
||||
dependencies:
|
||||
invariant "^2.2.4"
|
||||
metro-source-map "0.63.0"
|
||||
metro-source-map "0.64.0"
|
||||
nullthrows "^1.1.1"
|
||||
source-map "^0.5.6"
|
||||
through2 "^2.0.1"
|
||||
vlq "^1.0.0"
|
||||
@@ -5435,10 +5439,10 @@ ob1@0.58.0:
|
||||
resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.58.0.tgz#484a1e9a63a8b79d9ea6f3a83b2a42110faac973"
|
||||
integrity sha512-uZP44cbowAfHafP1k4skpWItk5iHCoRevMfrnUvYCfyNNPPJd3rfDCyj0exklWi2gDXvjlj2ObsfiqP/bs/J7Q==
|
||||
|
||||
ob1@0.63.0:
|
||||
version "0.63.0"
|
||||
resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.63.0.tgz#2f34b178b5918028a0d76072a7b155b91f9cb6bd"
|
||||
integrity sha512-y7AtRIuISHuA5sc0Alcw/Cj2azU1ruuAmJIKSKk//IryxmHtmyA/M5DFcmpDAisaIB255bBt/P9aqc8jr1ocsg==
|
||||
ob1@0.64.0:
|
||||
version "0.64.0"
|
||||
resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.64.0.tgz#f254a55a53ca395c4f9090e28a85483eac5eba19"
|
||||
integrity sha512-CO1N+5dhvy+MoAwxz8+fymEUcwsT4a+wHhrHFb02LppcJdHxgcBWviwEhUwKOD2kLMQ7ijrrzybOqpGcqEtvpQ==
|
||||
|
||||
object-assign@^4.1.0, object-assign@^4.1.1:
|
||||
version "4.1.1"
|
||||
|
||||
Reference in New Issue
Block a user