Compare commits

...
Author SHA1 Message Date
Mike Grabowski 0117077b95 [0.64.0-rc.0] Bump version numbers 2020-11-23 16:41:42 +01:00
Luke Walczak 017dc45c62 Add possibility to disable buttons in action sheet ios (#28979)
Summary:
_**Fixed**_ version of [the previous PR](https://github.com/facebook/react-native/pull/28792) after reverting [changes](https://github.com/facebook/react-native/commit/c8d678abcf93fd3f6daf4bebfdf25937995c1fdf#commitcomment-39299254)

----

I've noticed that currently there is no option to disable button within the `ActionSheetIOS`. It can be really useful and decided to extend the API to support that functionality.

I added a new option called `disabledButtonsIndices` to `ActionSheetIOS` which is an array of button indices which should be disabled.

`ActionSheetIOS` documentation - PR https://github.com/facebook/react-native-website/pull/1898

## Changelog

[iOS] [Added] - Add disableButtonsIndices option to ActionSheetIOS component

Pull Request resolved: https://github.com/facebook/react-native/pull/28979

Test Plan:
1. Run the `RNTester`
2. Choose `ActionSheetIOS`
3. Check the fourth example `Show Action Sheet with disabled buttons`
4. `Option 1` and `Option 2` should be disabled

screenshot | gif
 --- | ---
<img width="493" alt="Screenshot 2020-04-30 at 15 16 22" src="https://user-images.githubusercontent.com/22746080/80739025-1ec52780-8b16-11ea-8b1c-30bb40ad8c99.png"> | <img src="https://user-images.githubusercontent.com/22746080/80739043-24227200-8b16-11ea-8bcb-af25eb57baac.gif" width="493" />

Reviewed By: sammy-SC

Differential Revision: D21727497

Pulled By: PeteTheHeat

fbshipit-source-id: 749b6c623eb8a44fe2bd96829ce89be5310e2368
2020-11-23 13:34:14 +01:00
Jesse Katsumata f7d0b83492 chore: updated url of deprecated modules (#30422)
Summary:
Part of https://github.com/react-native-community/releases/issues/207

Migrate warnings in index.js to point to new lean core repos

NOTE: some npm modules has been transferred to new nom namespace, such as `react-native-picker/picker` `react-native-async-storage/async-storage` `react-native-masked-view/masked-view`.
Some lean core repo has been transferred to new repo, but its npm namespace remains the same. ex: clipboard module exists in react-native-clipboard/clipboard repo, but npm package name is still `react-native-community/clipboard` (they're planned to be migrated in the future)

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Changed] - Migrate warnings in index.js to point to new lean core repos

Pull Request resolved: https://github.com/facebook/react-native/pull/30422

Test Plan:
- Updated repo URL can be accessed
- Updated npm package can be installed

Reviewed By: rickhanlonii

Differential Revision: D25077750

Pulled By: cpojer

fbshipit-source-id: b736ea449835bdf3d2a2f85e5c86e5253b90db78
2020-11-23 13:30:58 +01:00
Héctor Ramos 65003d7436 Use react-native-codegen@0.0.6 in new app template
Summary:
Use pre-built react-native-codegen library from npm in the iOS app template.
Built react-native-codegen from source when used with RNTester.
Published react-native-codegen@0.0.6.

Changelog:
[iOS][Added] - Use react-native-codegen in iOS app template
[Internal] - Bump react-native-codegen: 0.0.6

Reviewed By: fkgozali

Differential Revision: D25128036

fbshipit-source-id: f294c23b9b911aae6f404edc01b62426fb578477
2020-11-23 13:28:44 +01:00
Mike Grabowski 727d755441 fix: pin hermes-engine to 0.7.x 2020-11-21 14:17:56 +01:00
Dulmandakh e79ecb5122 fix android npm (#30452) 2020-11-21 21:43:58 +09:00
Nick Gerleman 9f49f8a0f1 Fix :ReactAndroid:androidJavadoc task (#30417)
Summary:
Fixes https://github.com/facebook/react-native/issues/30415

This is a quick and dirty fix to unblock publish, of excluding a class from Javadoc generation that is importing a class current build logic cannot handle. This is not a long-term fix for the issue.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Fixed] - Fix :ReactAndroid:androidJavadoc task

Pull Request resolved: https://github.com/facebook/react-native/pull/30417

Test Plan: Tested that the task now completes locally.

Reviewed By: lunaleaps

Differential Revision: D25041282

Pulled By: fkgozali

fbshipit-source-id: f774ab30a09db473178e2a51c77860e4985dd8e3
2020-11-18 12:46:42 +01:00
Kevin Gozali 68110d4ab3 Use codegen from source in default iOS template apps
Summary:
Add the `react-native-codegen` source to the `react-native` npm package.
Instead of using `react-native-codegen` from npm, the iOS app template will now build the package from source. Doing so removes the need to carefully time `react-native-codegen` npm releases to oss `react-native` releases, as the codegen and the oss release will be cut at the same time.

Changelog: [Internal] - Removed react-native-codegen dependency from iOS app template

Reviewed By: TheSavior

Differential Revision: D24904655

fbshipit-source-id: a07932bc748e2afb9359de584181bcb9dd0810ea
2020-11-18 12:46:34 +01:00
Kevin Gozali 0f5fb5ebc0 Android OSS: fixed unbound variable error for codegen build script
Summary:
If $FBSOURCE_ENV isn't set, this failed with `/root/react-native/packages/react-native-codegen/android/../scripts/oss/build.sh: line 20: FBSOURCE_ENV: unbound variable`.

This commit fixes https://app.circleci.com/pipelines/github/facebook/react-native/7080/workflows/5cf18a1f-e6d2-4648-8217-d42e9a61fef1/jobs/176451

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24912950

fbshipit-source-id: 113e3dd7f78c75fc3adea0b21c9e38910be8c065
2020-11-18 12:46:26 +01:00
Janic Duplessis fb2991e3e7 Build rn-codegen in a temporary directory (#30292)
Summary:
When running yarn install from the codegen directory it will reinstall all dependencies for the react-native workspace inside the react-native package. In my case this caused issues with metro because it would now have 2 copies of it (node_modules/metro and node_modules/react-native/node_modules/metro).

To avoid this copy the react-native-codegen source in a temporary directory and yarn install from there, then copy the built files back.

## Changelog

[Internal] - Build rn-codegen in a temporary directory

Pull Request resolved: https://github.com/facebook/react-native/pull/30292

Test Plan: Tested the script in an app with codegen enabled. Fresh install with rn-codegen not built, made sure no extra modules are installed under node_modules/react-native/node_modules.

Reviewed By: yungsters

Differential Revision: D24893216

Pulled By: fkgozali

fbshipit-source-id: 2c372b755632ea6f50ad5d4562248612b349a9a6
2020-11-18 12:46:17 +01:00
Micha Reiser 06fedcd32d Upgrade metro to 0.64.0
Summary:
Upgrade metro to 0.64.0

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D24753886

fbshipit-source-id: af679ec912c5cd8049a998d045ce8a75bf30e5d3
2020-11-18 12:46:08 +01:00
Mike Grabowski 2313d45da9 chore: ignore broken Hermes job 2020-11-04 12:58:15 +01:00
22 changed files with 240 additions and 143 deletions
+9 -7
View File
@@ -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;
+4 -4
View File
@@ -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',
};
+5 -5
View File
@@ -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 -1
View File
@@ -1,4 +1,4 @@
VERSION_NAME=1000.0.0-master
VERSION_NAME=0.64.0-rc.0
GROUP=com.facebook.react
POM_NAME=ReactNative
+2 -2
View File
@@ -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) {
@@ -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");
}
+2 -2
View File
@@ -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
+26 -26
View File
@@ -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
View File
@@ -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 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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> {
+1 -1
View File
@@ -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"
+8 -4
View File
@@ -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
View File
@@ -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
+4 -4
View File
@@ -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"
+43 -39
View File
@@ -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"