Compare commits

...
Author SHA1 Message Date
grabbou d197e95893 [0.64.0-rc.1] Bump version numbers 2020-11-25 12:48:36 +01:00
Michał Pierzchała cda29d2124 chore: Bump CLI to ^5.0.1-alpha.0 (#30420)
Summary:
Upgrading CLI to latest. This diff is intended to be cherry-picked to 0.64.

cc grabbou kelset alloy

[Internal] [Changed] - Bump CLI to ^5.0.1-alpha.0

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

Test Plan: None

Reviewed By: MichaReiser

Differential Revision: D25063261

Pulled By: cpojer

fbshipit-source-id: e1788fd40db2b00daaf888e7b2afaf708ade5451
2020-11-25 12:16:04 +01:00
grabbou e2be26a68f fix: android artifacts in publish-npm.js 2020-11-25 12:06:21 +01:00
Mike Grabowski 9f0f8a5345 chore: revert changes to test-manual-e2e.sh 2020-11-24 17:10:04 +01:00
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 600 additions and 4031 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.1',
};
+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.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 -1
View File
@@ -1,4 +1,4 @@
VERSION_NAME=1000.0.0-master
VERSION_NAME=0.64.0-rc.1
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.1");
}
+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.1";
} 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',
);
},
});
+11 -14
View File
@@ -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 -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"
+28 -6
View File
@@ -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}` : '';
+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
+4 -4
View File
@@ -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"
+399 -3946
View File
File diff suppressed because it is too large Load Diff