Upgrade to Node22 (#12488)

BlocknoteJS requires an ESM module where our server is CJS, this forced
us to pin the server-util version, which led us to force the resolution
of several packages, leading to bugs downstream.

From Node 22.12 Node supports requiring ESM modules (available from Node
22.0 with a flag). So I upgrade the module.
I picked Node 22 and not Node 23 or Node 24 because 22 is the LTS and we
don't plan to change node versions frequently.

If you remain on Node 18, things should still mostly work, except if you
edit a Rich Text field.

I also starting changing the default runtime for Serverless Functions
which isn't directly related. This means new serverless functions will
be created on Node 22, but we will still need another PR to migrate
existing serverless functions before September (end of support by AWS).

(In this PR I also remove the upgrade commands from 0.43 since they rely
on Blocknote and I didn't want to have to deal with this)

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Félix Malfait
2025-06-06 18:35:30 +02:00
committed by GitHub
parent 0188b66280
commit 322c8a1852
39 changed files with 1882 additions and 3146 deletions

View File

@ -7,7 +7,6 @@ TAG=latest
#REDIS_URL=redis://redis:6379
SERVER_URL=http://localhost:3000
SIGN_IN_PREFILLED=false
# Use openssl rand -base64 32 for each secret
# APP_SECRET=replace_me_with_a_random_string

View File

@ -1,4 +1,4 @@
FROM node:18.17.1-alpine as twenty-website-build
FROM node:22-alpine as twenty-website-build
WORKDIR /app
@ -23,7 +23,7 @@ COPY ./packages/twenty-ui /app/packages/twenty-ui
COPY ./packages/twenty-website /app/packages/twenty-website
RUN npx nx build twenty-website
FROM node:18.17.1-alpine as twenty-website
FROM node:22-alpine as twenty-website
WORKDIR /app/packages/twenty-website

View File

@ -1,5 +1,5 @@
# Base image for common dependencies
FROM node:18.17.1-alpine as common-deps
FROM node:22-alpine as common-deps
WORKDIR /app
@ -49,7 +49,7 @@ RUN npx nx build twenty-front
# Final stage: Run the application
FROM node:18.17.1-alpine as twenty
FROM node:22-alpine as twenty
# Used to run healthcheck in docker
RUN apk add --no-cache curl jq