Skip to content

Commit 163cc85

Browse files
committed
chore(breaking): compile project to Node 10 using @babel/preset-env (#309)
* chore: compile project to Node 8.3 using @babel/preset-env * update snapshots * compile to Node 10 * adjust snapshots back * add migration docs
1 parent 5e798bc commit 163cc85

File tree

4 files changed

+391
-40
lines changed

4 files changed

+391
-40
lines changed

babel.config.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
module.exports = {
2-
presets: ['module:metro-react-native-babel-preset'],
2+
presets: [
3+
'@babel/preset-flow',
4+
'@babel/preset-react',
5+
[
6+
'@babel/preset-env',
7+
{
8+
targets: {
9+
node: '10',
10+
},
11+
bugfixes: true,
12+
},
13+
],
14+
],
15+
plugins: ['@babel/plugin-proposal-class-properties'],
316
};

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
"devDependencies": {
2222
"@babel/cli": "^7.8.4",
2323
"@babel/core": "^7.9.0",
24+
"@babel/plugin-proposal-class-properties": "^7.8.3",
25+
"@babel/preset-env": "^7.9.6",
26+
"@babel/preset-flow": "^7.9.0",
27+
"@babel/preset-react": "^7.9.4",
2428
"@callstack/eslint-config": "^10.0.0",
2529
"@release-it/conventional-changelog": "^1.1.0",
2630
"@testing-library/jest-native": "~3.1.0",
@@ -34,7 +38,6 @@
3438
"flow-bin": "^0.122.0",
3539
"flow-copy-source": "^2.0.9",
3640
"jest": "^26.0.1",
37-
"metro-react-native-babel-preset": "^0.58.0",
3841
"react": "^16.13.1",
3942
"react-native": "^0.63.0-rc.1",
4043
"react-test-renderer": "^16.13.1",

website/docs/Migration20.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ title: Migration to 2.0
55

66
This guides describes major steps involved in migrating your testing code from using React Native Testing Library version `1.x` to version `2.0`.
77

8+
## Dropping Node 8
9+
10+
Node 8 reached its EOL more than 5 months ago, so it's about time to target the library to Node 10. If you used lower version, you'll have to upgrade to v10, but we suggest using the latest LTS version.
11+
812
## WaitFor API changes
913

1014
`waitForElement` function has been renamed to `waitFor` for consistency with React Testing Library. Additionally the signature has slightly changed from:

0 commit comments

Comments
 (0)