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

chore(deps): update dependency node to v20 #9701

Merged
merged 15 commits into from
Dec 15, 2023
Merged
2 changes: 1 addition & 1 deletion .github/workflows/check-create-redwood-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- run: yarn install
working-directory: ./.github/actions/check_create_redwood_app

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-test-project-fixture.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- run: yarn install
working-directory: ./.github/actions/check_test_project_fixture

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: 🐈 Yarn install
working-directory: ./.github/actions/detect-changes
Expand All @@ -56,7 +56,7 @@ jobs:
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: 🐈 Yarn install
working-directory: ./tasks/check
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: 🐈 Set up yarn cache
uses: ./.github/actions/set-up-yarn-cache
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: 🐈 Set up yarn cache
uses: ./.github/actions/set-up-yarn-cache
Expand Down Expand Up @@ -247,7 +247,7 @@ jobs:
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: 🐈 Set up yarn cache
uses: ./.github/actions/set-up-yarn-cache
Expand Down Expand Up @@ -450,7 +450,7 @@ jobs:
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: 🐈 Set up yarn cache
uses: ./.github/actions/set-up-yarn-cache
Expand Down Expand Up @@ -506,7 +506,7 @@ jobs:
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: 🐈 Set up yarn cache
uses: ./.github/actions/set-up-yarn-cache
Expand Down Expand Up @@ -600,7 +600,7 @@ jobs:
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: 🐈 Set up yarn cache
uses: ./.github/actions/set-up-yarn-cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: 🐈 Set up yarn cache
uses: ./.github/actions/set-up-yarn-cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: 🏷 Check git tags
run: |
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: 🐈 Set up yarn cache
uses: ./.github/actions/set-up-yarn-cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/require-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: ✅ Check milestone
uses: ./.github/actions/require-milestone
2 changes: 1 addition & 1 deletion .github/workflows/update-all-contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- run: yarn install

Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/test-project-rsa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"root": true
},
"engines": {
"node": "=18.x",
"node": "=20.x",
"yarn": ">=1.15"
},
"prisma": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"root": true
},
"engines": {
"node": "=18.x",
"node": "=20.x",
"yarn": ">=1.15"
},
"prisma": {
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/test-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"root": true
},
"engines": {
"node": "=18.x",
"node": "=20.x",
"yarn": ">=1.15"
},
"prisma": {
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path')

const packageJSON = require(path.join(__dirname, 'package.json'))

const TARGETS_NODE = '18.16'
const TARGETS_NODE = '20.10'

// Run `npx browserslist "defaults"` to see a list of target browsers.
const TARGETS_BROWSERS = ['defaults']
Expand Down
2 changes: 1 addition & 1 deletion docs/.node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.18.2
20.10.0
4 changes: 2 additions & 2 deletions docs/docs/create-redwood-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ yarn create redwood-app <your-app-name>
```

## Set up for success
Redwood requires that you're running Node version 18.0.0 or higher.
Redwood requires that you're running Node version 20 or higher.

If you're running Node version 19.0.0 or higher, you can still use Create Redwood App, but it may make your project incompatible with some deploy targets, such as AWS Lambdas.
If you're running Node version 21.0.0 or higher, you can still use Create Redwood App, but it may make your project incompatible with some deploy targets, such as AWS Lambdas.

To see what version of Node you're running, you can run the following command in your terminal:

Expand Down
16 changes: 8 additions & 8 deletions docs/docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ The `base` stage installs dependencies.
It's used as the base image for the build stages and the `console` stage.

```Dockerfile
FROM node:18-bookworm-slim as base
FROM node:20-bookworm-slim as base
```

We use a Node.js 18 image as the base image because that's the version Redwood targets.
We use a Node.js 20 image as the base image because that's the version Redwood targets.
"bookworm" is the codename for the current stable distribution of Debian (version 12).
We think it's important to pin the version of the OS just like we pin the version of Node.js.
Lastly, the "slim" variant of the `node:18-bookworm` image only includes what Node.js needs which reduces the image's size while making it more secure.
Lastly, the "slim" variant of the `node:20-bookworm` image only includes what Node.js needs which reduces the image's size while making it more secure.

:::tip Why not alpine?

Expand All @@ -92,7 +92,7 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*
```

The `node:18-bookworm-slim` image doesn't have [OpenSSL](https://www.openssl.org/), which [seems to be a bug](https://github.com/nodejs/docker-node/issues/1919).
The `node:20-bookworm-slim` image doesn't have [OpenSSL](https://www.openssl.org/), which [seems to be a bug](https://github.com/nodejs/docker-node/issues/1919).
(It was included in the "bullseye" image, the codename for Debian 11.)
On Linux, [Prisma needs OpenSSL](https://www.prisma.io/docs/reference/system-requirements#linux-runtime-dependencies).
We install it, and Python and its dependencies are there ready to be uncommented if you need them. See the [Troubleshooting](#python) section for more.
Expand Down Expand Up @@ -190,15 +190,15 @@ After the work we did in the base stage, building the api side amounts to copyin
The `api_serve` stage serves your GraphQL api and functions:

```Dockerfile
FROM node:18-bookworm-slim as api_serve
FROM node:20-bookworm-slim as api_serve

RUN apt-get update && apt-get install -y \
openssl \
# python3 make gcc \
&& rm -rf /var/lib/apt/lists/*
```

We don't start from the `base` stage, but begin anew with the `node:18-bookworm-slim` image.
We don't start from the `base` stage, but begin anew with the `node:20-bookworm-slim` image.
Since this is a production stage, it's important for it to be as small as possible.
Docker's [multi-stage builds](https://docs.docker.com/build/building/multi-stage/) enables this.

Expand Down Expand Up @@ -297,7 +297,7 @@ The key line here is the first one—this stage uses the `api_build` stage as it
### The `web_serve` stage

```Dockerfile
FROM node:18-bookworm-slim as web_serve
FROM node:20-bookworm-slim as web_serve

USER node
WORKDIR /home/node/app
Expand Down Expand Up @@ -411,7 +411,7 @@ It's because your project depends on Python and the image doesn't provide it.
It's easy to fix: just add `python3` and its dependencies (usually `make` and `gcc`):

```diff
FROM node:18-bookworm-slim as base
FROM node:20-bookworm-slim as base

RUN apt-get update && apt-get install -y \
openssl \
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/how-to/test-in-github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

services:
Expand Down Expand Up @@ -303,7 +303,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

services:
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Redwood quick start

:::info Prerequisites

- Redwood requires [Node.js](https://nodejs.org/en/) (=18.x) and [Yarn](https://yarnpkg.com/) (>=1.15)
- Redwood requires [Node.js](https://nodejs.org/en/) (=20.x) and [Yarn](https://yarnpkg.com/) (>=1.15)
- Are you on Windows? For best results, follow our [Windows development setup](how-to/windows-development-setup.md) guide

:::
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/tutorial/chapter1/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If you have an existing site created with a prior version, you'll need to upgrad

During installation, RedwoodJS checks if your system meets version requirements for Node and Yarn:

- node: "=18.x"
- node: "=20.x"
- yarn: ">=1.15"

If you're using a version of Node or Yarn that's **less** than what's required, _the installation bootstrap will result in an ERROR_. To check, please run the following from your terminal command line:
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-config/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const result = await esbuild.build({

format: 'cjs',
platform: 'node',
target: ['node18'],
target: ['node20'],

logLevel: 'info',

Expand Down
2 changes: 1 addition & 1 deletion packages/babel-config/dist.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('dist', () => {
},
"CORE_JS_VERSION": "3.33",
"RUNTIME_CORE_JS_VERSION": "7.23.5",
"TARGETS_NODE": "18.16",
"TARGETS_NODE": "20.10",
"getApiSideBabelConfigPath": [Function],
"getApiSideBabelPlugins": [Function],
"getApiSideBabelPresets": [Function],
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-config/src/__tests__/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ afterEach(() => {

describe('api', () => {
test("TARGETS_NODE hasn't unintentionally changed", () => {
expect(TARGETS_NODE).toMatchInlineSnapshot(`"18.16"`)
expect(TARGETS_NODE).toMatchInlineSnapshot(`"20.10"`)
})

describe('getApiSideBabelPresets', () => {
Expand Down Expand Up @@ -64,7 +64,7 @@ describe('api', () => {
"@babel/plugin-transform-private-methods",
],
"targets": {
"node": "18.16",
"node": "20.10",
},
"useBuiltIns": "usage",
},
Expand Down
2 changes: 0 additions & 2 deletions packages/babel-config/src/__tests__/prebuildApiFile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ describe('api prebuild ', () => {
*/
expect(list).toMatchInlineSnapshot(`
[
"es.regexp.flags",
"esnext.array.last-index",
"esnext.array.last-item",
"esnext.composite-key",
Expand Down Expand Up @@ -533,7 +532,6 @@ describe('api prebuild ', () => {
"esnext.set.union",
"esnext.string.at",
"esnext.string.code-points",
"esnext.symbol.dispose",
"esnext.symbol.observable",
"esnext.symbol.pattern-match",
"esnext.weak-map.delete-all",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-config/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
getPathsFromTypeScriptConfig,
} from './common'

export const TARGETS_NODE = '18.16'
export const TARGETS_NODE = '20.10'

export const getApiSideBabelPresets = (
{ presetEnv } = { presetEnv: false }
Expand Down
4 changes: 2 additions & 2 deletions packages/cli-packages/dataMigrate/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let result = await esbuild.build({

format: 'cjs',
platform: 'node',
target: ['node18'],
target: ['node20'],

logLevel: 'info',

Expand All @@ -44,7 +44,7 @@ result = await esbuild.build({
minify: true,

platform: 'node',
target: ['node18'],
target: ['node20'],
packages: 'external',

logLevel: 'info',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-packages/storybook/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const result = await esbuild.build({

format: 'cjs',
platform: 'node',
target: ['node18'],
target: ['node20'],

logLevel: 'info',

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# base
# ------------------------------------------------
FROM node:18-bookworm-slim as base
FROM node:20-bookworm-slim as base

RUN apt-get update && apt-get install -y \
openssl \
Expand Down Expand Up @@ -54,7 +54,7 @@ RUN yarn redwood build web --no-prerender

# serve api
# ------------------------------------------------
FROM node:18-bookworm-slim as api_serve
FROM node:20-bookworm-slim as api_serve

RUN apt-get update && apt-get install -y \
openssl \
Expand Down Expand Up @@ -88,7 +88,7 @@ CMD [ "node_modules/.bin/rw-server", "api", "--load-env-files" ]

# serve web
# ------------------------------------------------
FROM node:18-bookworm-slim as web_serve
FROM node:20-bookworm-slim as web_serve

USER node
WORKDIR /home/node/app
Expand Down
Loading
Loading