-
Notifications
You must be signed in to change notification settings - Fork 58
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
Upgrade React Native 0.71.11
#5874
Conversation
…encies This upgrade is needed to support React Native version `0.71.11`.
# Conflicts: # gutenberg
This fixes an issue related to the UUID library when running tests. Without this change, we get the following error: ``` /gutenberg-mobile/gutenberg/node_modules/uuid/dist/esm-browser/index.js:1 ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export { default as v1 } from './v1.js'; ^^^^^^ SyntaxError: Unexpected token 'export' 3 | */ 4 | import fastDeepEqual from 'fast-deep-equal/es6'; > 5 | import { v4 as uuid } from 'uuid'; | ^ 6 | 7 | /** 8 | * WordPress dependencies ```
Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job! |
// Workaround for Jest not having ESM support yet | ||
// Reference: https://t.ly/9ap_ | ||
uuid: require.resolve( 'uuid' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From reviewing the URL in this comment, my understanding is that we can remove this workaround when we upgrade to uuid@9
. Is that accurate? It would likely be beneficial to note this in the inline comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, true. I haven't tested this myself, but based on the comments that seems the case. I'll update the inline comment to reflect this. Thanks 🙇 !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried using uuid
version 9.x but I still had to use this workaround to address the issue. There might be something else producing the issue, especially as it's not happening in Gutenberg unit tests which I assume we use an older version uuid
🤔 .
src/test/videopress/edit.js
Outdated
// Mock request reponses | ||
setupApiFetch( generateFetchMocks() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this now required due to the RN upgrade? Does this relate to facebook/react-native#34659?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it looks related to that change. Without this change, the tests fail with the following error:
TypeError: Cannot read property 'then' of undefined
53 | method: 'POST',
54 | body: fetchParams.body,
> 55 | } ).then( response => {
| ^
56 | const { metadata_token } = response;
57 | if ( ! metadata_token ) {
58 | console.warn( 'Token is not achievable' ); // eslint-disable-line no-console
I understand that when Promise
was polyfilled in Jest tests, we didn't need to explicitly mock API responses (i.e. api-fetch
library).
Capture result of `bundle exec pod install` within the `ios-xcframework` directory. while the XCFramework is not currently used for WordPress iOS integration, this is required to resolve CI failures.
* Add util to generate VideoPress privacy settings for tests * Mock VideoPress check ownership API request * Update VideoPress edit test cases Instead of using a constant for the block HTML, now we generate the HTML via the `generateBlockHTML` util. * Use different fetch mocks in VideoPress edit test cases This is needed to keep the same block attributes set via the block HTML generation. Extract fetch mock metadata to a constant * Update VideoPress description setting placeholder query * Update VideoPress test snapshots The only change is that the video is now public when setting a caption. This has no impact in the testing logic. * Update src/test/videopress/local-helpers/utils.js Fixes the JSDoc type of `isVideoPrivate` and `isSitePrivate` params. Co-authored-by: David Calhoun <[email protected]> * Fix value used to generate privacy setting in `generatePrivacySettings` * Remove unneeded metadata on fetch mocks --------- Co-authored-by: David Calhoun <[email protected]>
This reverts commit 0cdf825.
* build: Update Gutenberg ref * build: Capture package-lock.json changes The result of running: ``` rm -rf ./node_modules && npm install ``` * Update Gutenberg ref * Update a11y id queries for Android E2E tests --------- Co-authored-by: David Calhoun <[email protected]>
* Update Gutenberg reference * Update script for generating React-Codegen The method we used to generate React-Codegen (get_react_codegen_spec) was moved to a different file in newer versions of React Native. We need to update the script for generating it accordingly. * Update third-party podspecs to target 0.71.11 * Update FBReactNativeSpec.podspec.json with hash * Apply bundle changes * Manually add React-bridging.podspec.json The file was automatically deleted via the generate-podspecs.sh script. It has been manually added as a temporary measure, to enable further testing. * Revert "Manually add React-bridging.podspec.json" This reverts commit 9707305. * Update list of dependencies in Podfile for iOS * Add tag to Hermes podspec to workaround error This is intended as a temporary workaround, we should implement a more robust fix before merging. * Update dependency versions in Podfile.lock * [Temporary] Add React Native as a dependency * Revert "[Temporary] Add React Native as a dependency" This reverts commit 21a4fbe. * Update Gutenberg ref * Update Gutenberg ref * Update Gutenberg ref * Disable hermes when generating codegen podspec * Generate third-party podspecs * Update FBReactNativeSpec podspec --------- Co-authored-by: Carlos Garcia <[email protected]>
# Conflicts: # bundle/ios/App.js # bundle/ios/App.js.map # gutenberg
# Conflicts: # gutenberg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved via WordPress/gutenberg#51303 (review).
For posterity, noting that #5973 needs to be merged in for the tests to pass, and to avoid the issue with crashing on iOS.
# Conflicts: # gutenberg
With this change, the most up-to-date details for the XPATH are now in place.
This commit significantly simplifies the XPath used to identify the column block's appender button in the Android application. Previous long and potentially unstable XPath has been replaced with a more concise and reliable one, reducing the dependence on the complete UI hierarchy and improving the maintainability and stability of the automation script.
RN upgrade: Fix test suite 1 errors
…into upgrade/react-native-0.71.8
We decided to go with Hermes, so we no longer need to mention that we are still deciding.
Related PRs
To test:
Follow testing instructions from WordPress/gutenberg#51303.
PR submission checklist: