Skip to content

Commit

Permalink
Remove deprecated CheckBox module. (#801)
Browse files Browse the repository at this point in the history
* Update default Podfile to not depend on a path (facebook#28572)

Summary:
Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`.

While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native.

https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9

Unfortunately, due to the way Ruby works, this completely hides the path away from the users.

Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues.

With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself.

https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10

This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native.

As a result, we don't have to change the paths here whether we're running monorepo or not.

## Changelog

[IOS] [INTERNAL] - Always provide an explicit path to React Native
Pull Request resolved: facebook#28572

Differential Revision: D20945194

Pulled By: TheSavior

fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27

* Upgrade Prettier in Xplat to version 1.19.1

Summary:
Upgrades Prettier in Xplat to 1.19.1
Ignores upgrading packages on already on versions greater than 1.19.1

Changelog: [Internal]

allow-large-files
bypass-lint

(Note: this ignores all push blocking failures!)

Reviewed By: gkz, cpojer

Differential Revision: D20879147

fbshipit-source-id: 0deee7ac941e91e1c3c3a1e7d3d3ed20de1d657d

* Stop using get_fbobjc_enable_exception_lang_compiler_flags_DEPRECATED in xplat

Summary:
Old deprecated function.

Changelog: [Internal]

Reviewed By: nlutsenko

Differential Revision: D20148856

fbshipit-source-id: 79d6fb97824b059e50f67ff5a0b4c38ec7a19469

* Add ProGuard rule for hermes (facebook#28571)

Summary:
This adds a ProGuard for `hermes` rule so it does not have to be added by users manually.
facebook#28270

## 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
-->

[Android] [Added] - ProGuard rule for hermes
Pull Request resolved: facebook#28571

Test Plan:
1. Create a project with/without hermes.
2. Enable proguard.

Reviewed By: cpojer

Differential Revision: D20947095

Pulled By: hramos

fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d

* Move CheckBox JS files to FB Internal

Summary:
Move CheckBox JS files to FB internal

## Changelog:
[General] [Removed] This diff removes the CheckBox export from React Native. Internally, we are requiring CheckBox directly now and externally people will have to use the community maintained module.

Reviewed By: cpojer

Differential Revision: D20910775

fbshipit-source-id: 809e135dc3f68911ac0a004e6eafa8488f0d5327

* Remove CheckBox from docsList.js

Co-authored-by: Mike Grabowski <grabbou@gmail.com>
Co-authored-by: George Zahariev <gkz@fb.com>
Co-authored-by: Scott Wolchok <swolchok@fb.com>
Co-authored-by: Radek Czemerys <radko93@gmail.com>
Co-authored-by: Lauren Tan <laurentan@fb.com>
  • Loading branch information
6 people committed Jul 14, 2021
1 parent 47047d0 commit 6ed2964
Show file tree
Hide file tree
Showing 43 changed files with 165 additions and 651 deletions.
5 changes: 4 additions & 1 deletion IntegrationTests/AsyncStorageTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ function testMerge() {
}

function testOptimizedMultiGet() {
let batch = [[KEY_1, VAL_1], [KEY_2, VAL_2]];
let batch = [
[KEY_1, VAL_1],
[KEY_2, VAL_2],
];
let keys = batch.map(([key, value]) => key);
AsyncStorage.multiSet(batch, err1 => {
// yes, twice on purpose
Expand Down
4 changes: 1 addition & 3 deletions Libraries/Animated/src/NativeAnimatedHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,7 @@ function validateTransform(
configs.forEach(config => {
if (!TRANSFORM_WHITELIST.hasOwnProperty(config.property)) {
throw new Error(
`Property '${
config.property
}' is not supported by native animated module`,
`Property '${config.property}' is not supported by native animated module`,
);
}
});
Expand Down
60 changes: 50 additions & 10 deletions Libraries/Animated/src/__tests__/AnimatedNative-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,19 @@ describe('Native Animated', () => {
expect(additionConnectionCalls.length).toBe(2);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
additionCall[1].input[0],
{type: 'value', value: 1, offset: 0},
{
type: 'value',
value: 1,
offset: 0,
},
);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
additionCall[1].input[1],
{type: 'value', value: 2, offset: 0},
{
type: 'value',
value: 2,
offset: 0,
},
);
});

Expand Down Expand Up @@ -391,11 +399,19 @@ describe('Native Animated', () => {
expect(subtractionConnectionCalls.length).toBe(2);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
subtractionCall[1].input[0],
{type: 'value', value: 2, offset: 0},
{
type: 'value',
value: 2,
offset: 0,
},
);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
subtractionCall[1].input[1],
{type: 'value', value: 1, offset: 0},
{
type: 'value',
value: 1,
offset: 0,
},
);
});

Expand Down Expand Up @@ -425,11 +441,19 @@ describe('Native Animated', () => {
expect(multiplicationConnectionCalls.length).toBe(2);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
multiplicationCall[1].input[0],
{type: 'value', value: 2, offset: 0},
{
type: 'value',
value: 2,
offset: 0,
},
);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
multiplicationCall[1].input[1],
{type: 'value', value: 1, offset: 0},
{
type: 'value',
value: 1,
offset: 0,
},
);
});

Expand Down Expand Up @@ -459,11 +483,19 @@ describe('Native Animated', () => {
expect(divisionConnectionCalls.length).toBe(2);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
divisionCall[1].input[0],
{type: 'value', value: 4, offset: 0},
{
type: 'value',
value: 4,
offset: 0,
},
);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
divisionCall[1].input[1],
{type: 'value', value: 2, offset: 0},
{
type: 'value',
value: 2,
offset: 0,
},
);
});

Expand Down Expand Up @@ -491,7 +523,11 @@ describe('Native Animated', () => {
expect(moduloConnectionCalls.length).toBe(1);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
moduloCall[1].input,
{type: 'value', value: 4, offset: 0},
{
type: 'value',
value: 4,
offset: 0,
},
);
});

Expand Down Expand Up @@ -588,7 +624,11 @@ describe('Native Animated', () => {
expect(diffClampConnectionCalls.length).toBe(1);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
diffClampCall[1].input,
{type: 'value', value: 2, offset: 0},
{
type: 'value',
value: 2,
offset: 0,
},
);
});

Expand Down
16 changes: 14 additions & 2 deletions Libraries/BatchedBridge/__tests__/MessageQueue-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,25 @@ describe('MessageQueue', function() {
});

it('should throw when calling the same callback twice', () => {
queue.enqueueNativeCall(0, 1, [], () => {}, () => {});
queue.enqueueNativeCall(
0,
1,
[],
() => {},
() => {},
);
queue.__invokeCallback(1, []);
expect(() => queue.__invokeCallback(1, [])).toThrow();
});

it('should throw when calling both success and failure callback', () => {
queue.enqueueNativeCall(0, 1, [], () => {}, () => {});
queue.enqueueNativeCall(
0,
1,
[],
() => {},
() => {},
);
queue.__invokeCallback(1, []);
expect(() => queue.__invokeCallback(0, [])).toThrow();
});
Expand Down
4 changes: 1 addition & 3 deletions Libraries/Blob/URL.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ export class URL {
if (BLOB_URL_PREFIX === null) {
throw new Error('Cannot create URL for blob!');
}
return `${BLOB_URL_PREFIX}${blob.data.blobId}?offset=${
blob.data.offset
}&size=${blob.size}`;
return `${BLOB_URL_PREFIX}${blob.data.blobId}?offset=${blob.data.offset}&size=${blob.size}`;
}

static revokeObjectURL(url: string) {
Expand Down
5 changes: 1 addition & 4 deletions Libraries/Components/ActivityIndicator/ActivityIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ const ActivityIndicator = (props: Props, forwardedRef?: any) => {
return (
<View
onLayout={onLayout}
style={StyleSheet.compose(
styles.container,
style,
)}>
style={StyleSheet.compose(styles.container, style)}>
{Platform.OS === 'android' ? (
// $FlowFixMe Flow doesn't know when this is the android component
<PlatformActivityIndicator {...nativeProps} {...androidProps} />
Expand Down
74 changes: 0 additions & 74 deletions Libraries/Components/CheckBox/AndroidCheckBoxNativeComponent.js

This file was deleted.

0 comments on commit 6ed2964

Please sign in to comment.