Skip to content

Conversation

FelixMalfait
Copy link
Member

@FelixMalfait FelixMalfait commented Jun 6, 2025

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)

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Major upgrade to Node.js v22.12.0 across all packages to support ESM modules, particularly for BlocknoteJS compatibility, with changes to default serverless function runtime and dependency restructuring.

  • Upgraded base Node.js version from 18.17.1 to 22.12.0 in all Dockerfiles, package.json files, and GitHub Actions
  • Added new migration 1749205425841-UpdateServerlessFunctionDefaultRuntimeToNode22.ts to set Node 22.x as default runtime
  • Removed version 0.43 database migrations as they're no longer needed
  • Modified BlocknoteJS import in record-input-transformer.service.ts to use dynamic imports for ESM/CJS compatibility
  • Added new feature flag IS_AI_ENABLED in feature-flags.ts, leveraging Node 22's improved capabilities

27 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 8 to 10
PageDecorator,
PageDecoratorArgs,
} from '~/testing/decorators/PageDecorator';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Indentation uses 4 spaces while rest of file uses 2 spaces

Suggested change
PageDecorator,
PageDecoratorArgs,
} from '~/testing/decorators/PageDecorator';
PageDecorator,
PageDecoratorArgs,
} from '~/testing/decorators/PageDecorator';

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@twentyhq twentyhq deleted a comment from greptile-apps bot Jun 6, 2025
Copy link
Contributor

github-actions bot commented Jun 6, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:14639

This environment will automatically shut down when the PR is closed or after 5 hours.

@FelixMalfait FelixMalfait merged commit 322c8a1 into main Jun 6, 2025
13 checks passed
@FelixMalfait FelixMalfait deleted the upgrade-node-22 branch June 6, 2025 16:35
Copy link
Contributor

github-actions bot commented Jun 6, 2025

Warnings
⚠️ Changes were made to .env.example - Please make sure any new environment variables are properly documented with metadata in config-variables.ts

Generated by 🚫 dangerJS against 1214326

abdulrahmancodes pushed a commit to abdulrahmancodes/twenty that referenced this pull request Jun 10, 2025
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant