Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RNMobile] Upgrade to RN 0.66 #36328

Merged
merged 69 commits into from
Jan 3, 2022
Merged
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
bcaa4dc
Upgrade base React Native packages for 0.66.2
dcalhoun Nov 8, 2021
12a3868
Remove legacy module patches
dcalhoun Nov 2, 2021
8ddad77
Apply React Native Upgrade Helper changes
dcalhoun Nov 2, 2021
f0f700e
Apply possibly overlooked changes from React Native 0.64.0 upgrade
dcalhoun Nov 2, 2021
365d54f
Capture pod installation changes
dcalhoun Nov 2, 2021
e800fd0
Bump version of hermes we keep on the S3 mirror
hypest Nov 3, 2021
4e1359e
Utilize store definition rather than store name string
dcalhoun Nov 3, 2021
d743f3c
Remove usage of deprecated EventEmitter.removeEventListener
dcalhoun Nov 3, 2021
166f4c6
Patch react-native-modal to remove deprecated method usage
dcalhoun Nov 3, 2021
31a01f3
Fix native Android Demo app build
dcalhoun Jul 9, 2021
d4ecbc9
Disable Metro inlineRequires configuration
dcalhoun Nov 3, 2021
611e0b9
Patch @react-navigation/native to remove usage of deprecated method
dcalhoun Nov 3, 2021
0e017ce
Remove ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES setting
dcalhoun Nov 3, 2021
d419992
Use Carthage --use-xcframeworks argument
dcalhoun Nov 3, 2021
a08fbbb
Add required EventEmitter methods to address warning
dcalhoun Nov 4, 2021
76424fd
Enable LogBox to address deprecation warning
dcalhoun Nov 4, 2021
e7517e7
Patch react-native-keyboard-aware-scroll-view for deprecated method
dcalhoun Nov 4, 2021
e49849a
Fix runtime error from invoking removed method
dcalhoun Nov 4, 2021
804bd31
Remove redundant listener removal
dcalhoun Nov 4, 2021
7858fda
Remove usage of deprecated removeEventListener method
dcalhoun Nov 4, 2021
61bdb3a
Remove IPHONEOS_DEPLOYMENT_TARGET for all Pods
dcalhoun Nov 4, 2021
0c04cb2
Capture Podfile and Xcode project changes from initial build
dcalhoun Nov 8, 2021
d6cf5d7
Replace deprecated Clipboard core module
dcalhoun Nov 8, 2021
36b6acd
Capture lockfile changes from subsequent npm install
dcalhoun Nov 9, 2021
d1d9040
Fix mock of AccessibilityInfo
dcalhoun Nov 9, 2021
2495068
Capture Jest snapshot updates
dcalhoun Nov 9, 2021
ae92378
Mark mock as an ESM default export
dcalhoun Nov 10, 2021
47ba3b3
Fix illegible iOS header in Demo app
dcalhoun Nov 10, 2021
4386a46
Demote the warning to simple code comment
hypest Nov 12, 2021
77a0f02
Add global source to Gemfile
dcalhoun Nov 11, 2021
5f7372b
Remove unnecessary deprecated bundler --path argument
dcalhoun Nov 11, 2021
2a8d738
Fix non-dismissible modals caused by unnecessary height transitions
dcalhoun Nov 16, 2021
f0eacab
Fix non-dismissible modals caused by header layout transitions
dcalhoun Nov 16, 2021
58feb83
Document ignored LogBox warnings
dcalhoun Nov 17, 2021
60a7ae2
Ignore overridden layout animations warnings
dcalhoun Nov 17, 2021
134470f
Link picker dismisses iOS keyboard to ensure smooth animation
dcalhoun Aug 31, 2021
e556f8e
Merge branch 'trunk' of github.com:WordPress/gutenberg into chore/upg…
dcalhoun Nov 19, 2021
0d8acfe
Revert erroneous native editor package version bumps
dcalhoun Nov 19, 2021
4f455f2
Install Pods after erroneous version bump revert
dcalhoun Nov 19, 2021
03dc487
Revert erroneous package lock change
dcalhoun Nov 19, 2021
e2f4a14
Android: SafeArea sub can be null so, guard its removal
hypest Nov 19, 2021
790010b
Remove unnecessary test mock code
dcalhoun Nov 22, 2021
5cccd1e
Avoid state updates on unmounted LinkSettingsScreen component
dcalhoun Nov 22, 2021
e6925ee
Avoid unnecessary link removal while closing bottom sheet
dcalhoun Nov 22, 2021
9a33964
Pin react-native-url-polyfill to 1.1.2 that includes Buffer
hypest Nov 25, 2021
7e59276
Include rest of npm install changes in package-lock
hypest Nov 26, 2021
2c83ca1
Need to load the native part of the Clipboard package
hypest Nov 26, 2021
5baf759
Point the android build to the forked react-native-clipboard
hypest Nov 29, 2021
0995b7d
Point to the forked react-native-clipboard
hypest Nov 29, 2021
50ded55
Correct integrity hash for react-native-clipboard's tarball
hypest Nov 29, 2021
60d02fa
Fix up the package name reference
hypest Nov 29, 2021
bc9962e
Point to the JitPack fix commit
hypest Nov 29, 2021
c5bed15
Update React Native version ref in third-party package forks (#36983)
dcalhoun Nov 30, 2021
4d5cdfe
Merge branch 'trunk' of github.com:WordPress/gutenberg into chore/upg…
dcalhoun Nov 30, 2021
612feb4
Update third-party package forks to tag references
dcalhoun Nov 30, 2021
fdad48c
Merge branch 'trunk' of github.com:WordPress/gutenberg into chore/upg…
dcalhoun Nov 30, 2021
3b6c0fe
Merge branch 'trunk' of github.com:WordPress/gutenberg into chore/upg…
dcalhoun Dec 1, 2021
87a6473
Disable keyboard-related BottomSheet animations
dcalhoun Dec 2, 2021
eb43863
Avoid non-dismissible modals caused by unnecessary height transitions
dcalhoun Dec 6, 2021
e1b5e6e
Merge branch 'trunk' of github.com:WordPress/gutenberg into chore/upg…
dcalhoun Dec 6, 2021
b21c33a
Adjust bottom sheet max height to account for header subtraction
dcalhoun Dec 7, 2021
553f1fd
Fix BottomSheet navigation hardware back button support (#37426)
dcalhoun Dec 17, 2021
0800158
Further clarify link picker test intent
dcalhoun Dec 21, 2021
a278c95
Replace usage of deprecated React Native Clipboard module
dcalhoun Dec 21, 2021
c3307b4
Update React Native version in Gradle configuration
dcalhoun Dec 21, 2021
6d64599
Remove unused React Native Clipboard module mock
dcalhoun Dec 22, 2021
5157dec
Reinstate version ranges for react and react-dom
dcalhoun Dec 22, 2021
fa39f7d
Update outdated comments
dcalhoun Dec 22, 2021
6db04e7
Merge branch 'trunk' of github.com:WordPress/gutenberg into chore/upg…
dcalhoun Jan 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,123 changes: 615 additions & 508 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@
"lint-staged": "9.2.5",
"lodash": "4.17.21",
"make-dir": "3.0.0",
"metro-react-native-babel-preset": "0.64.0",
"metro-react-native-babel-transformer": "0.64.0",
"metro-react-native-babel-preset": "0.66.2",
"metro-react-native-babel-transformer": "0.66.2",
"mkdirp": "0.5.1",
"nock": "12.0.3",
"node-watch": "0.7.0",
Expand All @@ -195,11 +195,11 @@
"postcss-loader": "6.1.1",
"prettier": "npm:wp-prettier@2.2.1-beta-1",
"progress": "2.0.3",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-native": "0.66.2",
"react-native-url-polyfill": "1.1.2",
"react-test-renderer": "17.0.1",
"react-test-renderer": "17.0.2",
"rimraf": "3.0.2",
"rtlcss": "2.6.2",
"sass": "1.35.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ function StylePreview( { onPress, isActive, style, url } ) {

useEffect( () => {
onLayout();
Dimensions.addEventListener( 'change', onLayout );
const dimensionsChangeSubscription = Dimensions.addEventListener(
'change',
onLayout
);

return () => {
Dimensions.removeEventListener( 'change', onLayout );
dimensionsChangeSubscription.remove();
};
}, [] );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ export default function BlockTypesList( {
const [ maxWidth, setMaxWidth ] = useState();

useEffect( () => {
Dimensions.addEventListener( 'change', onLayout );
const dimensionsChangeSubscription = Dimensions.addEventListener(
'change',
onLayout
);
onLayout();
return () => {
Dimensions.removeEventListener( 'change', onLayout );
dimensionsChangeSubscription.remove();
};
}, [] );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

exports[`Audio block renders audio block error state without crashing 1`] = `
<View
accessibilityState={
Object {
"disabled": true,
}
}
accessible={true}
focusable={true}
onClick={[Function]}
Expand Down Expand Up @@ -31,6 +36,11 @@ exports[`Audio block renders audio block error state without crashing 1`] = `
}
/>
<View
accessibilityState={
Object {
"disabled": true,
}
}
accessible={true}
focusable={true}
onClick={[Function]}
Expand Down Expand Up @@ -148,6 +158,11 @@ exports[`Audio block renders audio block error state without crashing 1`] = `

exports[`Audio block renders audio file without crashing 1`] = `
<View
accessibilityState={
Object {
"disabled": true,
}
}
accessible={true}
focusable={true}
onClick={[Function]}
Expand Down Expand Up @@ -177,6 +192,11 @@ exports[`Audio block renders audio file without crashing 1`] = `
}
/>
<View
accessibilityState={
Object {
"disabled": true,
}
}
accessible={true}
focusable={true}
onClick={[Function]}
Expand Down
7 changes: 2 additions & 5 deletions packages/block-library/src/cover/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const Cover = ( {

// sync with local media store
mediaUploadSync();
AccessibilityInfo.addEventListener(
const a11yInfoChangeSubscription = AccessibilityInfo.addEventListener(
'screenReaderChanged',
setIsScreenReaderEnabled
);
Expand All @@ -126,10 +126,7 @@ const Cover = ( {

return () => {
isCurrent = false;
AccessibilityInfo.removeEventListener(
'screenReaderChanged',
setIsScreenReaderEnabled
);
a11yInfoChangeSubscription.remove();
};
}, [] );

Expand Down
3 changes: 2 additions & 1 deletion packages/block-library/src/embed/test/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
waitFor,
within,
} from 'test/helpers';
import { Clipboard, Platform } from 'react-native';
import { Platform } from 'react-native';
import Clipboard from '@react-native-clipboard/clipboard';

/**
* WordPress dependencies
Expand Down
3 changes: 2 additions & 1 deletion packages/block-library/src/file/edit.native.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/**
* External dependencies
*/
import { View, Clipboard, TouchableWithoutFeedback, Text } from 'react-native';
import { View, TouchableWithoutFeedback, Text } from 'react-native';
import Clipboard from '@react-native-clipboard/clipboard';

/**
* WordPress dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ exports[`File block renders file error state without crashing 1`] = `
}
/>
<View
accessibilityState={
Object {
"disabled": true,
}
}
accessible={true}
focusable={true}
onClick={[Function]}
Expand Down Expand Up @@ -105,11 +110,9 @@ exports[`File block renders file error state without crashing 1`] = `
<View>
Svg
<TextInput
allowFontScaling={true}
editable={false}
fontFamily="serif"
onChange={[Function]}
rejectResponderTermination={true}
scrollEnabled={false}
style={
Array [
Expand All @@ -119,7 +122,6 @@ exports[`File block renders file error state without crashing 1`] = `
undefined,
]
}
underlineColorAndroid="transparent"
value="Error"
/>
</View>
Expand Down Expand Up @@ -223,6 +225,11 @@ exports[`File block renders file without crashing 1`] = `
}
/>
<View
accessibilityState={
Object {
"disabled": true,
}
}
accessible={true}
focusable={true}
onClick={[Function]}
Expand Down
10 changes: 10 additions & 0 deletions packages/block-library/src/image/test/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ jest.mock( '@wordpress/data-controls', () => {
};
} );

/**
* Immediately invoke delayed functions. A better alternative would be using
* fake timers and test the delay itself. However, fake timers does not work
* with our custom waitFor implementation.
*/
jest.mock( 'lodash', () => {
const actual = jest.requireActual( 'lodash' );
return { ...actual, delay: ( cb ) => cb() };
} );

const apiFetchPromise = Promise.resolve( {} );
apiFetch.mockImplementation( () => apiFetchPromise );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ exports[`Missing block renders without crashing 1`] = `
accessibilityHint="Tap here to show help"
accessibilityLabel="Help button"
accessibilityRole="button"
accessibilityState={
Object {
"disabled": true,
}
}
accessible={true}
focusable={true}
onClick={[Function]}
Expand Down
7 changes: 2 additions & 5 deletions packages/block-library/src/search/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function SearchEdit( {
* properly creating accessibilityLabel text.
*/
useEffect( () => {
AccessibilityInfo.addEventListener(
const a11yInfoChangeSubscription = AccessibilityInfo.addEventListener(
'screenReaderChanged',
handleScreenReaderToggled
);
Expand All @@ -90,10 +90,7 @@ export default function SearchEdit( {
);

return () => {
AccessibilityInfo.removeEventListener(
'screenReaderChanged',
handleScreenReaderToggled
);
a11yInfoChangeSubscription.remove();
};
}, [] );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ exports[`Search Block renders block with button inside option 1`] = `
accessible={true}
>
<TextInput
allowFontScaling={true}
className="wp-block-search__input"
ellipsizeMode="tail"
fontFamily="serif"
Expand All @@ -90,7 +89,6 @@ exports[`Search Block renders block with button inside option 1`] = `
onChange={[Function]}
onFocus={[Function]}
placeholder="Optional placeholder…"
rejectResponderTermination={true}
scrollEnabled={false}
style={
Array [
Expand All @@ -102,7 +100,6 @@ exports[`Search Block renders block with button inside option 1`] = `
undefined,
]
}
underlineColorAndroid="transparent"
/>
</View>
<View
Expand Down Expand Up @@ -260,7 +257,6 @@ exports[`Search Block renders block with icon button option matches snapshot 1`]
accessible={true}
>
<TextInput
allowFontScaling={true}
className="wp-block-search__input"
ellipsizeMode="tail"
fontFamily="serif"
Expand All @@ -271,7 +267,6 @@ exports[`Search Block renders block with icon button option matches snapshot 1`]
onChange={[Function]}
onFocus={[Function]}
placeholder="Optional placeholder…"
rejectResponderTermination={true}
scrollEnabled={false}
style={
Array [
Expand All @@ -283,7 +278,6 @@ exports[`Search Block renders block with icon button option matches snapshot 1`]
undefined,
]
}
underlineColorAndroid="transparent"
/>
</View>
<View
Expand Down Expand Up @@ -323,7 +317,6 @@ exports[`Search Block renders block with label hidden matches snapshot 1`] = `
accessible={true}
>
<TextInput
allowFontScaling={true}
className="wp-block-search__input"
ellipsizeMode="tail"
fontFamily="serif"
Expand All @@ -334,7 +327,6 @@ exports[`Search Block renders block with label hidden matches snapshot 1`] = `
onChange={[Function]}
onFocus={[Function]}
placeholder="Optional placeholder…"
rejectResponderTermination={true}
scrollEnabled={false}
style={
Array [
Expand All @@ -346,7 +338,6 @@ exports[`Search Block renders block with label hidden matches snapshot 1`] = `
undefined,
]
}
underlineColorAndroid="transparent"
/>
</View>
<View
Expand Down Expand Up @@ -504,7 +495,6 @@ exports[`Search Block renders with default configuration matches snapshot 1`] =
accessible={true}
>
<TextInput
allowFontScaling={true}
className="wp-block-search__input"
ellipsizeMode="tail"
fontFamily="serif"
Expand All @@ -515,7 +505,6 @@ exports[`Search Block renders with default configuration matches snapshot 1`] =
onChange={[Function]}
onFocus={[Function]}
placeholder="Optional placeholder…"
rejectResponderTermination={true}
scrollEnabled={false}
style={
Array [
Expand All @@ -527,7 +516,6 @@ exports[`Search Block renders with default configuration matches snapshot 1`] =
undefined,
]
}
underlineColorAndroid="transparent"
/>
</View>
<View
Expand Down Expand Up @@ -676,7 +664,6 @@ exports[`Search Block renders with no-button option matches snapshot 1`] = `
accessible={true}
>
<TextInput
allowFontScaling={true}
className="wp-block-search__input"
ellipsizeMode="tail"
fontFamily="serif"
Expand All @@ -687,7 +674,6 @@ exports[`Search Block renders with no-button option matches snapshot 1`] = `
onChange={[Function]}
onFocus={[Function]}
placeholder="Optional placeholder…"
rejectResponderTermination={true}
scrollEnabled={false}
style={
Array [
Expand All @@ -699,7 +685,6 @@ exports[`Search Block renders with no-button option matches snapshot 1`] = `
undefined,
]
}
underlineColorAndroid="transparent"
/>
</View>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export const BottomSheetContext = createContext( {
// Android only: Function called to control android hardware back button functionality
// Return true if the bottom-sheet default close action shouldn't be called
onHandleHardwareButtonPress: () => {},
// Toggle full-screen styles and dimensions
setIsFullScreen: () => {},
Comment on lines +35 to +36
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A default value was added to mirror the rest of the defaults and make testing simpler.

} );

export const {
Expand Down
Loading