Skip to content

Commit

Permalink
bump metro to minimum node 18.18
Browse files Browse the repository at this point in the history
  • Loading branch information
vzaidman committed Sep 11, 2024
1 parent c3fbacb commit 14bcb2e
Show file tree
Hide file tree
Showing 24 changed files with 28 additions and 59 deletions.
6 changes: 1 addition & 5 deletions .github/actions/yarn-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ inputs:
type: string
required: false
default: '20.x'
ignore-engines:
type: string
required: false
default: 'false'

runs:
using: "composite"
Expand All @@ -19,5 +15,5 @@ runs:
cache-dependency-path: yarn.lock
check-latest: true
- name: Install Dependencies
run: yarn install --frozen-lockfile --non-interactive --ignore-scripts ${{ inputs.ignore-engines == 'true' && '--ignore-engines' || ''}}
run: yarn install --frozen-lockfile --non-interactive --ignore-scripts
shell: bash
9 changes: 1 addition & 8 deletions .github/workflows/build-test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,11 @@ jobs:
fail-fast: false
matrix:
runs-on: ['ubuntu-latest']
node-version: ['18.0', '18.x', '20.x']
include:
- runs-on: ubuntu-latest
node-version: '18.0'
# @typescript-eslint/eslint-plugin requires node ^18.18
# but we allow yarn install to run regardless to test the package
ignore-engines: 'true'
node-version: ['18.18', '18.x', '20.x']
uses: ./.github/workflows/test.yml
with:
node-version: ${{ matrix.node-version }}
runs-on: ${{ matrix.runs-on }}
ignore-engines: ${{ matrix.ignore-engines }}

deploy:
# runs only on tag pushes
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/nightly-node-compatibility-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,11 @@ jobs:
matrix:
runs-on: ['ubuntu-latest']
node-version: [ # https://github.com/nodejs/release#release-schedule
'18.0', # minimum supported
'18.18', # minimum supported
'lts/-1', # pre-latest lts
'lts/*', # latest lts
'current' # newest
]
include:
- runs-on: ubuntu-latest
node-version: '18.0'
# @typescript-eslint/eslint-plugin requires node ^18.18
# but we allow yarn install to run regardless to test the package
ignore-engines: 'true'
uses: ./.github/workflows/test.yml
with:
node-version: ${{ matrix.node-version }}
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ on:
type: string
required: false
default: '20.x'
ignore-engines:
type: string
required: false
default: 'false'
jobs:
test:
name: "Tests [Node.js ${{ inputs.node-version }}, ${{ inputs.runs-on }}]"
Expand All @@ -23,6 +19,5 @@ jobs:
- uses: ./.github/actions/yarn-install
with:
node-version: ${{ inputs.node-version }}
ignore-engines: ${{ inputs.ignore-engines }}
- name: Run Jest Tests
run: yarn jest --ci --maxWorkers 4 --reporters=default --reporters=jest-junit --rootdir='./'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@
"license": "MIT",
"dependencies": {},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/buck-worker-tool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"cleanup-release": "test ! -e build && mv src build && mv src.real src"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-babel-register/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
},
"license": "MIT",
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-babel-transformer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"nullthrows": "^1.1.1"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
6 changes: 3 additions & 3 deletions packages/metro-cache-key/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"devDependencies": {
"metro-memory-fs": "0.80.11"
},
"engines": {
"node": ">=18"
},
"dependencies": {
"flow-enums-runtime": "^0.0.6"
},
"engines": {
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
},
"license": "MIT",
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
},
"license": "MIT",
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-file-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"fsevents": "^2.3.2"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
6 changes: 3 additions & 3 deletions packages/metro-memory-fs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"cleanup-release": "test ! -e build && mv src build && mv src.real src"
},
"license": "MIT",
"engines": {
"node": ">=18"
},
"dependencies": {
"flow-enums-runtime": "^0.0.6"
},
"engines": {
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-minify-terser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"terser": "^5.15.0"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18"
"node": ">=18.18"
},
"devDependencies": {
"metro": "0.80.11"
Expand Down
2 changes: 1 addition & 1 deletion packages/metro-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-source-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"terser": "^5.15.0"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-symbolicate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"vlq": "^1.0.0"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-transform-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"metro": "0.80.11"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-transform-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"metro-memory-fs": "0.80.11"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@
},
"license": "MIT",
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
13 changes: 2 additions & 11 deletions packages/metro/src/integration_tests/__tests__/server-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,11 @@ jest.unmock('cosmiconfig');

jest.setTimeout(60 * 1000);

// Can't set the "Connection" header in node < 18.14.1 (undici < 5.15.0): https://github.com/nodejs/undici/pull/1829,
// However in these versions "Connection" is set to "close" by default in node 18 anyway comparing with later version
const [nodeVersionMajor, nodeVersionMinor, nodeVersionPatch] =
process.versions.node.split('.').map(Number);
const canSetConnectionHeader =
nodeVersionMajor > 18 ||
(nodeVersionMajor === 18 && nodeVersionMinor > 14) ||
(nodeVersionMajor === 18 && nodeVersionMinor === 14 && nodeVersionPatch >= 1);

// Workaround for https://github.com/nodejs/node/issues/54484:
// Fetch with connection: close to prevent Node reusing connections across tests
// Fetch with {Connection: 'close'} to prevent Node reusing connections across tests
const fetchAndClose = (path: string) =>
fetch(path, {
headers: canSetConnectionHeader ? {Connection: 'close'} : {},
headers: {Connection: 'close'},
});

describe('Metro development server serves bundles via HTTP', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ob1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"flow-enums-runtime": "^0.0.6"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}

0 comments on commit 14bcb2e

Please sign in to comment.