-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Update to node 16 and npm 8 via nvm
and updated many node packages
#10439
Conversation
"@storybook/addon-a11y": "^6.5.9", | ||
"@storybook/addon-essentials": "^6.5.9", | ||
"@storybook/addon-react-native-web": "0.0.18", | ||
"@storybook/addon-react-native-web": "0.0.19--canary.37.cb55428.0", |
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.
Hack: This is a PR, but PR has been open for quite some time.
"react-native-clean-project": "^4.0.0-alpha4.0", | ||
"react-native-flipper": "^0.146.1", | ||
"react-native-flipper": "https://gitpkg.now.sh/facebook/flipper/react-native/react-native-flipper?9cacc9b59402550eae866e0e81e5f0c2f8203e6b", |
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.
Hack: This was merged a few hours before I made this PR, I assume it will land soon-ish.
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.
According to their GitHub, this should land in 0.160.0
but I haven't seen it hit the npm registry yet.
GitHub actions are finally happy. I will work on cleaning this up some more, then open it up for review once it's clean! |
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.
LGTM and tests well on all platforms!
@@ -31,7 +31,7 @@ jobs: | |||
if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) }} | |||
runs-on: ubuntu-latest | |||
steps: | |||
- uses: Expensify/App/.github/actions/composite/setupNode@main | |||
- uses: Expensify/App/.github/actions/composite/setupNode@andrew-npm-8 |
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.
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 think the idea is that we want to lock it to a branch, but we cannot lock it to main
until this PR is merged. Using local files would work, but it wouldn't lock it to a commit.
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.
Then I would say lock to a commit instead of the branch name. But I got it.
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.
👍 aside from Rajat's comment!
We should change the PR title and more details as a lot of things are changed on this PR. |
nvm
and updated many node packages
Updated, let me know if you think it's missing anything more! |
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.
No blockers, LGTM 👍
}) | ||
)); | ||
])('updateAndroidVersion("%s", "%s")', (versionName, versionCode, expected) => { | ||
updateAndroidVersion(versionName, versionCode).then(() => { |
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.
NAB because I don't think we've standardized on this, but generally .then
goes on the next line from what I've seen
@@ -25,9 +25,6 @@ export default function () { | |||
// Setup Flipper plugins when on dev | |||
if (__DEV__) { | |||
require('flipper-plugin-bridgespy-client'); | |||
const RNAsyncStorageFlipper = require('rn-async-storage-flipper').default; |
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 is this not needed anymore?
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.
- It was breaking due to peer dependencies and the library not being maintained
- I believe @marcaaron said this was a debugging tool that is not used anymore
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.
It might be used by some (but I haven't used it in a long time). There are workarounds to this package e.g. if you need to know the contents of AsyncStorage you can always log out values. Might be interesting to do our own Flipper plugin for Onyx at some point 🤔
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.
npm install worked well for me after adding the correct node version
@@ -7,7 +7,6 @@ install! 'cocoapods', :deterministic_uuids => false | |||
target 'NewExpensify' do | |||
permissions_path = '../node_modules/react-native-permissions/ios' | |||
|
|||
pod 'Plaid', '~> 2.3.1' |
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.
Is this auto-linked in a newer version?
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.
Yes correct. I don't know the history behind why we added this, but I think we should rely on auto linking all pod libraries unless there is a specific version breaking for us.
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.
IIRC the history is just that the Plaid react native package required manual linking.
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 don't understand their documentation.. It says it uses auto linking, so we shouldn't need to add it to the Podfile manually.
Plaid 2.5.1 is installed via autolinking and can be seen in the Podfile.lock: https://github.com/Expensify/App/pull/10439/files#diff-b7d85c35701918f25c9b2c418249f9b66fd9b067676e295a9eff493b73ee1752R231
"engines": { | ||
"node": "16.15.1", | ||
"npm": "8.11.0" | ||
}, |
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.
This produces error when the node and npm version does not match exactly. Developer has to use the exact version. Maybe, we are fine with 16.x
and 8.x
.
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 think the error is intentional and we want to use the exact version to avoid any harder to debug errors. It should be easy to install and change the version of node if you use nvm.
🚀 Deployed to staging by @AndrewGable in version: 1.1.89-0 🚀
|
Details
Update to Node 16 and npm 8, there were quite a few updates that needed to be applied due to the peer dependency changes in npm 7. In npm 7 peer dependencies are installed by default, which creates a much stricter way of installing peer dependencies. For example,
react-native-web
upgraded to React 18, so now all other packages needed to be upgraded to use React 18.This caused us to need to upgrade all of these packages:
@onfido/react-native-sdk
- React 18@pieter-pot/react-native-fast-image
- React 18@react-native-community/cameraroll
- React 18react-dom
- React 18react-pdf
- React 18react-plaid-link
- React 18@storybook/addon-react-native-web
- React 18@welldone-software/why-did-you-render
- React 18babel-plugin-react-native-web
-react-native-web
upgradeeslint-plugin-jsx-a11y
- Wasn't installed previouslyreact-native-flipper
- React 18/ RN upgradern-async-storage-flipper
- Removed, I verified with @marcaaron this was OK.tests/unit/nativeVersionUpdaterTest.js
- Changes to Node 16 updated function return typeFixed Issues
$ #10331
Tests
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)QA Steps
Screenshots
Web
Desktop
iOS
Android