From 578a6cc80995971aba832f5db6008a1c8ce9c1f9 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 11 Feb 2026 13:41:32 -0300 Subject: [PATCH 01/13] chore: update Meteor and package versions to latest stable releases 3.4 --- apps/meteor/.meteor/packages | 20 ++++++++++---------- apps/meteor/.meteor/release | 2 +- apps/meteor/.meteor/versions | 28 ++++++++++++++-------------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/apps/meteor/.meteor/packages b/apps/meteor/.meteor/packages index 000e897aa4ce5..ae135743d8e07 100644 --- a/apps/meteor/.meteor/packages +++ b/apps/meteor/.meteor/packages @@ -8,33 +8,33 @@ rocketchat:livechat rocketchat:streamer rocketchat:version -accounts-base@3.1.2 +accounts-base@3.2.0 accounts-facebook@1.3.4 accounts-google@1.4.1 accounts-meteor-developer@1.5.1 accounts-oauth@1.4.6 -accounts-password@3.2.1 +accounts-password@3.2.2 accounts-twitter@1.5.2 google-oauth@1.4.5 oauth@3.0.2 oauth2@1.3.3 -check@1.4.4 +check@1.5.0 ddp-rate-limiter@1.2.2 rate-limit@1.1.2 email@3.1.2 meteor-base@1.5.2 ddp-common@1.4.4 -webapp@2.0.7 +webapp@2.1.0 -mongo@2.1.4 +mongo@2.2.0 reload@1.3.2 service-configuration@1.3.5 session@1.2.2 -shell-server@0.6.2 +shell-server@0.7.0 dispatch:run-as-user ostrio:cookies @@ -51,11 +51,11 @@ tracker@1.3.4 reactive-dict@1.3.2 reactive-var@1.0.13 -babel-compiler@7.12.2 -standard-minifier-css@1.9.3 +babel-compiler@7.13.0 +standard-minifier-css@1.10.0 dynamic-import@0.7.4 -ecmascript@0.16.13 -typescript@5.6.6 +ecmascript@0.17.0 +typescript@5.9.3 autoupdate@2.0.1 diff --git a/apps/meteor/.meteor/release b/apps/meteor/.meteor/release index 4876d6ff64c16..703a72252657a 100644 --- a/apps/meteor/.meteor/release +++ b/apps/meteor/.meteor/release @@ -1 +1 @@ -METEOR@3.3.2 +METEOR@3.4 diff --git a/apps/meteor/.meteor/versions b/apps/meteor/.meteor/versions index 29f3113919760..2ac8a9e595859 100644 --- a/apps/meteor/.meteor/versions +++ b/apps/meteor/.meteor/versions @@ -1,19 +1,19 @@ -accounts-base@3.1.2 +accounts-base@3.2.0 accounts-facebook@1.3.4 accounts-google@1.4.1 accounts-meteor-developer@1.5.1 accounts-oauth@1.4.6 -accounts-password@3.2.1 +accounts-password@3.2.2 accounts-twitter@1.5.2 allow-deny@2.1.0 autoupdate@2.0.1 -babel-compiler@7.12.2 +babel-compiler@7.13.0 babel-runtime@1.5.2 base64@1.0.13 binary-heap@1.0.12 -boilerplate-generator@2.0.2 +boilerplate-generator@2.1.0 callback-hook@1.6.1 -check@1.4.4 +check@1.5.0 core-runtime@1.0.0 ddp@1.4.2 ddp-client@3.1.1 @@ -23,7 +23,7 @@ ddp-server@3.1.2 diff-sequence@1.1.3 dispatch:run-as-user@1.1.1 dynamic-import@0.7.4 -ecmascript@0.16.13 +ecmascript@0.17.0 ecmascript-runtime@0.8.3 ecmascript-runtime-client@0.12.3 ecmascript-runtime-server@0.11.1 @@ -41,16 +41,16 @@ id-map@1.2.0 inter-process-messaging@0.1.2 localstorage@1.2.1 logging@1.3.6 -meteor@2.1.1 +meteor@2.2.0 meteor-base@1.5.2 meteor-developer-oauth@1.3.3 meteorhacks:inject-initial@1.0.5 minifier-css@2.0.1 -minimongo@2.0.4 +minimongo@2.0.5 modern-browsers@0.2.3 modules@0.20.3 modules-runtime@0.13.2 -mongo@2.1.4 +mongo@2.2.0 mongo-decimal@0.2.0 mongo-dev-server@1.1.1 mongo-id@1.0.9 @@ -63,7 +63,7 @@ ostrio:cookies@2.7.2 promise@1.0.0 random@1.2.2 rate-limit@1.1.2 -react-fast-refresh@0.2.9 +react-fast-refresh@0.3.0 reactive-dict@1.3.2 reactive-var@1.0.13 reload@1.3.2 @@ -76,15 +76,15 @@ routepolicy@1.1.2 service-configuration@1.3.5 session@1.2.2 sha@1.0.10 -shell-server@0.6.2 +shell-server@0.7.0 socket-stream-client@0.6.1 -standard-minifier-css@1.9.3 +standard-minifier-css@1.10.0 tracker@1.3.4 twitter-oauth@1.3.4 -typescript@5.6.6 +typescript@5.9.3 underscore@1.6.4 url@1.3.5 -webapp@2.0.7 +webapp@2.1.0 webapp-hashing@1.1.2 zodern:caching-minifier@0.5.0 zodern:standard-minifier-js@5.3.1 From d87c0a1579a6a3f0cd85a9b8bafa918de0cffeea Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Wed, 18 Feb 2026 15:37:54 -0300 Subject: [PATCH 02/13] Fix docker build --- .github/actions/build-docker/action.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/actions/build-docker/action.yml b/.github/actions/build-docker/action.yml index 12bd993c665da..250e16b367c46 100644 --- a/.github/actions/build-docker/action.yml +++ b/.github/actions/build-docker/action.yml @@ -82,8 +82,6 @@ runs: swc_arch='arm64' fi - find /tmp/build/bundle/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc -type d -name 'core-*' -not -name "*linux-${swc_arch}-gnu*" -exec rm -rf {} + - find /tmp/build/bundle/programs/server/npm/node_modules/@img -type d -name 'sharp-*' -not -name "*-linuxmusl-${swc_arch}" -exec rm -rf {} + find /tmp/build/bundle/programs/server/npm/node_modules/@napi-rs -type d -name 'pinyin-linux-*' -not -name "*-linux-${swc_arch}-*" -exec rm -rf {} + From aebadd4da8143f167016f4d3d573db22ce10795b Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Wed, 18 Feb 2026 16:58:04 -0300 Subject: [PATCH 03/13] Comment out other removals on build --- .github/actions/build-docker/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/build-docker/action.yml b/.github/actions/build-docker/action.yml index 250e16b367c46..9284fc43a1cda 100644 --- a/.github/actions/build-docker/action.yml +++ b/.github/actions/build-docker/action.yml @@ -82,13 +82,13 @@ runs: swc_arch='arm64' fi - find /tmp/build/bundle/programs/server/npm/node_modules/@img -type d -name 'sharp-*' -not -name "*-linuxmusl-${swc_arch}" -exec rm -rf {} + + # find /tmp/build/bundle/programs/server/npm/node_modules/@img -type d -name 'sharp-*' -not -name "*-linuxmusl-${swc_arch}" -exec rm -rf {} + - find /tmp/build/bundle/programs/server/npm/node_modules/@napi-rs -type d -name 'pinyin-linux-*' -not -name "*-linux-${swc_arch}-*" -exec rm -rf {} + + # find /tmp/build/bundle/programs/server/npm/node_modules/@napi-rs -type d -name 'pinyin-linux-*' -not -name "*-linux-${swc_arch}-*" -exec rm -rf {} + - find /tmp/build/bundle/programs/server/npm/node_modules/@esbuild -type d -name 'linux-*' -not -name "*-${swc_arch}" -exec rm -rf {} + + # find /tmp/build/bundle/programs/server/npm/node_modules/@esbuild -type d -name 'linux-*' -not -name "*-${swc_arch}" -exec rm -rf {} + - find /tmp/build/bundle/programs/server/npm/node_modules/@rocket.chat/apps-engine/node_modules/@esbuild -type d -name 'linux-*' -not -name "*-${swc_arch}" -exec rm -rf {} + + # find /tmp/build/bundle/programs/server/npm/node_modules/@rocket.chat/apps-engine/node_modules/@esbuild -type d -name 'linux-*' -not -name "*-${swc_arch}" -exec rm -rf {} + fi if [[ "${{ inputs.publish-image }}" == 'true' ]]; then From 3fa60aab7ebf705766fd118a72ab9741c72d30ce Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 7 Apr 2026 15:51:58 -0300 Subject: [PATCH 04/13] fix: replace meteor/babel-compiler with @babel/core for integration script compilation babel-compiler is now devOnly in Meteor 3.4, causing runtime crash: TypeError: Cannot read properties of undefined (reading 'Babel') Co-Authored-By: Claude Opus 4.6 (1M context) --- .../server/lib/validateOutgoingIntegration.ts | 7 ++++--- .../methods/incoming/addIncomingIntegration.ts | 12 ++++++++---- .../methods/incoming/updateIncomingIntegration.ts | 13 ++++++++----- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts index fabe8cae7688d..acc8258d194ce 100644 --- a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts @@ -1,7 +1,7 @@ import type { IUser, INewOutgoingIntegration, IOutgoingIntegration, IUpdateOutgoingIntegration } from '@rocket.chat/core-typings'; import { Subscriptions, Users, Rooms } from '@rocket.chat/models'; import { pick } from '@rocket.chat/tools'; -import { Babel } from 'meteor/babel-compiler'; +import { transformSync } from '@babel/core'; import { Match } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -179,13 +179,14 @@ export const validateOutgoingIntegration = async function ( integration.script.trim() !== '' ) { try { - const babelOptions = Object.assign(Babel.getDefaultOptions({ runtime: false }), { + const result = transformSync(integration.script, { + presets: ['@babel/preset-env'], compact: true, minified: true, comments: false, }); - integrationData.scriptCompiled = Babel.compile(integration.script, babelOptions).code; + integrationData.scriptCompiled = result?.code ?? undefined; integrationData.scriptError = undefined; } catch (e) { integrationData.scriptCompiled = undefined; diff --git a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts index a64e0c40c7afe..5292dffd5b242 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts @@ -3,7 +3,7 @@ import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Integrations, Subscriptions, Users, Rooms } from '@rocket.chat/models'; import { Random } from '@rocket.chat/random'; import { removeEmpty } from '@rocket.chat/tools'; -import { Babel } from 'meteor/babel-compiler'; +import { transformSync } from '@babel/core'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; @@ -111,10 +111,14 @@ export const addIncomingIntegration = async (userId: string, integration: INewIn integration.script.trim() !== '' ) { try { - let babelOptions = Babel.getDefaultOptions({ runtime: false }); - babelOptions = _.extend(babelOptions, { compact: true, minified: true, comments: false }); + const result = transformSync(integration.script, { + presets: ['@babel/preset-env'], + compact: true, + minified: true, + comments: false, + }); - integrationData.scriptCompiled = Babel.compile(integration.script, babelOptions).code; + integrationData.scriptCompiled = result?.code ?? undefined; delete integrationData.scriptError; } catch (e) { integrationData.scriptCompiled = undefined; diff --git a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts index 9e63ce5473b86..cfdd542a68e13 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts @@ -2,9 +2,8 @@ import type { IIntegration, INewIncomingIntegration, IUpdateIncomingIntegration import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Integrations, Subscriptions, Users, Rooms } from '@rocket.chat/models'; import { wrapExceptions } from '@rocket.chat/tools'; -import { Babel } from 'meteor/babel-compiler'; +import { transformSync } from '@babel/core'; import { Meteor } from 'meteor/meteor'; -import _ from 'underscore'; import { addUserRolesAsync } from '../../../../../server/lib/roles/addUserRoles'; import { hasAllPermissionAsync, hasPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; @@ -90,10 +89,14 @@ export const updateIncomingIntegration = async ( if (integration.scriptEnabled === true && integration.script && integration.script.trim() !== '') { try { - let babelOptions = Babel.getDefaultOptions({ runtime: false }); - babelOptions = _.extend(babelOptions, { compact: true, minified: true, comments: false }); + const result = transformSync(integration.script, { + presets: ['@babel/preset-env'], + compact: true, + minified: true, + comments: false, + }); - scriptCompiled = Babel.compile(integration.script, babelOptions).code; + scriptCompiled = result?.code ?? undefined; scriptError = undefined; await Integrations.updateOne( { _id: integrationId }, From 1adb48809657c1bd6cca88c46bffd0d2e9fac7ee Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 7 Apr 2026 16:09:24 -0300 Subject: [PATCH 05/13] fix: correct import order for @babel/core to satisfy eslint import/order Co-Authored-By: Claude Opus 4.6 (1M context) --- .../app/integrations/server/lib/validateOutgoingIntegration.ts | 2 +- .../server/methods/incoming/addIncomingIntegration.ts | 2 +- .../server/methods/incoming/updateIncomingIntegration.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts index acc8258d194ce..e5800a90f73d9 100644 --- a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts @@ -1,7 +1,7 @@ +import { transformSync } from '@babel/core'; import type { IUser, INewOutgoingIntegration, IOutgoingIntegration, IUpdateOutgoingIntegration } from '@rocket.chat/core-typings'; import { Subscriptions, Users, Rooms } from '@rocket.chat/models'; import { pick } from '@rocket.chat/tools'; -import { transformSync } from '@babel/core'; import { Match } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; diff --git a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts index 5292dffd5b242..c9cd7384da12f 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts @@ -1,9 +1,9 @@ +import { transformSync } from '@babel/core'; import type { INewIncomingIntegration, IIncomingIntegration } from '@rocket.chat/core-typings'; import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Integrations, Subscriptions, Users, Rooms } from '@rocket.chat/models'; import { Random } from '@rocket.chat/random'; import { removeEmpty } from '@rocket.chat/tools'; -import { transformSync } from '@babel/core'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; diff --git a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts index cfdd542a68e13..f98198a993993 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts @@ -1,8 +1,8 @@ +import { transformSync } from '@babel/core'; import type { IIntegration, INewIncomingIntegration, IUpdateIncomingIntegration } from '@rocket.chat/core-typings'; import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Integrations, Subscriptions, Users, Rooms } from '@rocket.chat/models'; import { wrapExceptions } from '@rocket.chat/tools'; -import { transformSync } from '@babel/core'; import { Meteor } from 'meteor/meteor'; import { addUserRolesAsync } from '../../../../../server/lib/roles/addUserRoles'; From 5643ef59cba493d8ddac68bb0c8fe73265e4e42f Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 7 Apr 2026 16:32:21 -0300 Subject: [PATCH 06/13] fix: remove babel-compiler from .meteor/packages babel-compiler is devOnly in Meteor 3.4, so listing it in .meteor/packages causes a runtime reference to Package['babel-compiler'] in the bundle while the package is stripped from production builds. ecmascript already pulls it in as a build dependency. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/meteor/.meteor/packages | 1 - apps/meteor/.meteor/versions | 1 - 2 files changed, 2 deletions(-) diff --git a/apps/meteor/.meteor/packages b/apps/meteor/.meteor/packages index 073dd39d95a21..757831b7a1bea 100644 --- a/apps/meteor/.meteor/packages +++ b/apps/meteor/.meteor/packages @@ -50,7 +50,6 @@ tracker@1.3.4 reactive-dict@1.3.2 reactive-var@1.0.13 -babel-compiler@7.13.0 standard-minifier-css@1.10.0 dynamic-import@0.7.4 ecmascript@0.17.0 diff --git a/apps/meteor/.meteor/versions b/apps/meteor/.meteor/versions index d83c4802bcf32..6186a69487c10 100644 --- a/apps/meteor/.meteor/versions +++ b/apps/meteor/.meteor/versions @@ -7,7 +7,6 @@ accounts-password@3.2.2 accounts-twitter@1.5.2 allow-deny@2.1.0 autoupdate@2.0.1 -babel-compiler@7.13.0 babel-runtime@1.5.2 base64@1.0.13 binary-heap@1.0.12 From e26cdae18d752718726b414aefbe7473f6fa9322 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 7 Apr 2026 16:52:33 -0300 Subject: [PATCH 07/13] fix: move @babel/core and @babel/preset-env to runtime dependencies These packages are needed at runtime to compile integration scripts, so they must be in dependencies (not devDependencies) for Meteor to include them in the production bundle. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/meteor/.meteor/versions | 1 + apps/meteor/package.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/meteor/.meteor/versions b/apps/meteor/.meteor/versions index 6186a69487c10..d83c4802bcf32 100644 --- a/apps/meteor/.meteor/versions +++ b/apps/meteor/.meteor/versions @@ -7,6 +7,7 @@ accounts-password@3.2.2 accounts-twitter@1.5.2 allow-deny@2.1.0 autoupdate@2.0.1 +babel-compiler@7.13.0 babel-runtime@1.5.2 base64@1.0.13 binary-heap@1.0.12 diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 6522f63828742..74c98893060b3 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -69,6 +69,8 @@ "@aws-sdk/client-s3": "^3.862.0", "@aws-sdk/lib-storage": "^3.862.0", "@aws-sdk/s3-request-presigner": "^3.862.0", + "@babel/core": "~7.28.6", + "@babel/preset-env": "~7.28.6", "@babel/runtime": "~7.28.6", "@bugsnag/js": "~7.20.2", "@bugsnag/plugin-react": "~7.19.0", @@ -311,8 +313,6 @@ }, "devDependencies": { "@axe-core/playwright": "^4.10.2", - "@babel/core": "~7.28.6", - "@babel/preset-env": "~7.28.6", "@babel/preset-react": "~7.27.1", "@babel/register": "~7.28.6", "@faker-js/faker": "~8.0.2", From 259a10787b49234cf84041b0876552fb18648231 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 7 Apr 2026 17:23:00 -0300 Subject: [PATCH 08/13] fix: import @babel/preset-env directly instead of by string name Meteor's module system doesn't resolve string-based preset names at runtime. Import the preset module directly so it gets bundled. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../app/integrations/server/lib/validateOutgoingIntegration.ts | 3 ++- .../server/methods/incoming/addIncomingIntegration.ts | 3 ++- .../server/methods/incoming/updateIncomingIntegration.ts | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts index e5800a90f73d9..55bf78dd18bf2 100644 --- a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts @@ -1,4 +1,5 @@ import { transformSync } from '@babel/core'; +import presetEnv from '@babel/preset-env'; import type { IUser, INewOutgoingIntegration, IOutgoingIntegration, IUpdateOutgoingIntegration } from '@rocket.chat/core-typings'; import { Subscriptions, Users, Rooms } from '@rocket.chat/models'; import { pick } from '@rocket.chat/tools'; @@ -180,7 +181,7 @@ export const validateOutgoingIntegration = async function ( ) { try { const result = transformSync(integration.script, { - presets: ['@babel/preset-env'], + presets: [presetEnv], compact: true, minified: true, comments: false, diff --git a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts index c9cd7384da12f..f3dda30189d67 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts @@ -1,4 +1,5 @@ import { transformSync } from '@babel/core'; +import presetEnv from '@babel/preset-env'; import type { INewIncomingIntegration, IIncomingIntegration } from '@rocket.chat/core-typings'; import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Integrations, Subscriptions, Users, Rooms } from '@rocket.chat/models'; @@ -112,7 +113,7 @@ export const addIncomingIntegration = async (userId: string, integration: INewIn ) { try { const result = transformSync(integration.script, { - presets: ['@babel/preset-env'], + presets: [presetEnv], compact: true, minified: true, comments: false, diff --git a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts index f98198a993993..eeece3100ce35 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts @@ -1,4 +1,5 @@ import { transformSync } from '@babel/core'; +import presetEnv from '@babel/preset-env'; import type { IIntegration, INewIncomingIntegration, IUpdateIncomingIntegration } from '@rocket.chat/core-typings'; import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Integrations, Subscriptions, Users, Rooms } from '@rocket.chat/models'; @@ -90,7 +91,7 @@ export const updateIncomingIntegration = async ( if (integration.scriptEnabled === true && integration.script && integration.script.trim() !== '') { try { const result = transformSync(integration.script, { - presets: ['@babel/preset-env'], + presets: [presetEnv], compact: true, minified: true, comments: false, From ad3db2bff64d93c3ba573c5875b261246f933f98 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 7 Apr 2026 17:37:53 -0300 Subject: [PATCH 09/13] fix: add ts-expect-error for @babel/preset-env missing type declarations Co-Authored-By: Claude Opus 4.6 (1M context) --- .../app/integrations/server/lib/validateOutgoingIntegration.ts | 1 + .../server/methods/incoming/addIncomingIntegration.ts | 1 + .../server/methods/incoming/updateIncomingIntegration.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts index 55bf78dd18bf2..6029440e31128 100644 --- a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts @@ -1,4 +1,5 @@ import { transformSync } from '@babel/core'; +// @ts-expect-error: @babel/preset-env has no type declarations import presetEnv from '@babel/preset-env'; import type { IUser, INewOutgoingIntegration, IOutgoingIntegration, IUpdateOutgoingIntegration } from '@rocket.chat/core-typings'; import { Subscriptions, Users, Rooms } from '@rocket.chat/models'; diff --git a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts index f3dda30189d67..687bccf1c0dc7 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts @@ -1,4 +1,5 @@ import { transformSync } from '@babel/core'; +// @ts-expect-error: @babel/preset-env has no type declarations import presetEnv from '@babel/preset-env'; import type { INewIncomingIntegration, IIncomingIntegration } from '@rocket.chat/core-typings'; import type { ServerMethods } from '@rocket.chat/ddp-client'; diff --git a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts index eeece3100ce35..066b783b72177 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts @@ -1,4 +1,5 @@ import { transformSync } from '@babel/core'; +// @ts-expect-error: @babel/preset-env has no type declarations import presetEnv from '@babel/preset-env'; import type { IIntegration, INewIncomingIntegration, IUpdateIncomingIntegration } from '@rocket.chat/core-typings'; import type { ServerMethods } from '@rocket.chat/ddp-client'; From 87e1f08edd1e42cfafb645cb97893d44e0f54b7a Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 7 Apr 2026 18:36:21 -0300 Subject: [PATCH 10/13] revert: restore .github/actions/build-docker/action.yml to develop state Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/actions/build-docker/action.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/actions/build-docker/action.yml b/.github/actions/build-docker/action.yml index 6044a263ef39c..1bc8542e20464 100644 --- a/.github/actions/build-docker/action.yml +++ b/.github/actions/build-docker/action.yml @@ -82,13 +82,15 @@ runs: swc_arch='arm64' fi - # find /tmp/build/bundle/programs/server/npm/node_modules/@img -type d -name 'sharp-*' -not -name "*-linuxmusl-${swc_arch}" -exec rm -rf {} + + find /tmp/build/bundle/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc -type d -name 'core-*' -not -name "*linux-${swc_arch}-gnu*" -exec rm -rf {} + - # find /tmp/build/bundle/programs/server/npm/node_modules/@napi-rs -type d -name 'pinyin-linux-*' -not -name "*-linux-${swc_arch}-*" -exec rm -rf {} + + find /tmp/build/bundle/programs/server/npm/node_modules/@img -type d -name 'sharp-*' -not -name "*-linuxmusl-${swc_arch}" -exec rm -rf {} + - # find /tmp/build/bundle/programs/server/npm/node_modules/@esbuild -type d -name 'linux-*' -not -name "*-${swc_arch}" -exec rm -rf {} + + find /tmp/build/bundle/programs/server/npm/node_modules/@napi-rs -type d -name 'pinyin-linux-*' -not -name "*-linux-${swc_arch}-*" -exec rm -rf {} + - # find /tmp/build/bundle/programs/server/npm/node_modules/@rocket.chat/apps-engine/node_modules/@esbuild -type d -name 'linux-*' -not -name "*-${swc_arch}" -exec rm -rf {} + + find /tmp/build/bundle/programs/server/npm/node_modules/@esbuild -type d -name 'linux-*' -not -name "*-${swc_arch}" -exec rm -rf {} + + + find /tmp/build/bundle/programs/server/npm/node_modules/@rocket.chat/apps-engine/node_modules/@esbuild -type d -name 'linux-*' -not -name "*-${swc_arch}" -exec rm -rf {} + fi if [[ "${{ inputs.publish-image }}" == 'true' ]]; then From 862daaf922a8dc45f5e60e5549b2503c578088d5 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 7 Apr 2026 18:42:01 -0300 Subject: [PATCH 11/13] fix: remove babel-compiler swc cleanup from docker build babel-compiler is no longer in the production bundle (devOnly in Meteor 3.4), so the swc-core cleanup path no longer exists. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/actions/build-docker/action.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/actions/build-docker/action.yml b/.github/actions/build-docker/action.yml index 1bc8542e20464..a11733027bae5 100644 --- a/.github/actions/build-docker/action.yml +++ b/.github/actions/build-docker/action.yml @@ -82,8 +82,6 @@ runs: swc_arch='arm64' fi - find /tmp/build/bundle/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc -type d -name 'core-*' -not -name "*linux-${swc_arch}-gnu*" -exec rm -rf {} + - find /tmp/build/bundle/programs/server/npm/node_modules/@img -type d -name 'sharp-*' -not -name "*-linuxmusl-${swc_arch}" -exec rm -rf {} + find /tmp/build/bundle/programs/server/npm/node_modules/@napi-rs -type d -name 'pinyin-linux-*' -not -name "*-linux-${swc_arch}-*" -exec rm -rf {} + From 3739214eb8444bb8c764ca170c47313c00147dde Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 8 Apr 2026 16:08:51 -0300 Subject: [PATCH 12/13] Apply suggestions from code review Co-authored-by: Guilherme Gazzo --- .../app/integrations/server/lib/validateOutgoingIntegration.ts | 1 + .../server/methods/incoming/addIncomingIntegration.ts | 1 + .../server/methods/incoming/updateIncomingIntegration.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts index 6029440e31128..e888154adda06 100644 --- a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts @@ -188,6 +188,7 @@ export const validateOutgoingIntegration = async function ( comments: false, }); + // TODO: Webhook Integration Editor should inform the user if the script is compiled successfully integrationData.scriptCompiled = result?.code ?? undefined; integrationData.scriptError = undefined; } catch (e) { diff --git a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts index 687bccf1c0dc7..fb95dfacaa51e 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts @@ -120,6 +120,7 @@ export const addIncomingIntegration = async (userId: string, integration: INewIn comments: false, }); + // TODO: Webhook Integration Editor should inform the user if the script is compiled successfully integrationData.scriptCompiled = result?.code ?? undefined; delete integrationData.scriptError; } catch (e) { diff --git a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts index 066b783b72177..11dd8eafa5781 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts @@ -98,6 +98,7 @@ export const updateIncomingIntegration = async ( comments: false, }); + // TODO: Webhook Integration Editor should inform the user if the script is compiled successfully scriptCompiled = result?.code ?? undefined; scriptError = undefined; await Integrations.updateOne( From 185b68f5068e0bd1ef32fefd0cf88a128fbe9a59 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 8 Apr 2026 16:24:44 -0300 Subject: [PATCH 13/13] fix: add @types/babel__preset-env and remove ts-expect-error comments Co-Authored-By: Claude Opus 4.6 (1M context) --- .../server/lib/validateOutgoingIntegration.ts | 1 - .../server/methods/incoming/addIncomingIntegration.ts | 1 - .../server/methods/incoming/updateIncomingIntegration.ts | 1 - apps/meteor/package.json | 1 + yarn.lock | 8 ++++++++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts index e888154adda06..d4b1a68af5796 100644 --- a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts @@ -1,5 +1,4 @@ import { transformSync } from '@babel/core'; -// @ts-expect-error: @babel/preset-env has no type declarations import presetEnv from '@babel/preset-env'; import type { IUser, INewOutgoingIntegration, IOutgoingIntegration, IUpdateOutgoingIntegration } from '@rocket.chat/core-typings'; import { Subscriptions, Users, Rooms } from '@rocket.chat/models'; diff --git a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts index fb95dfacaa51e..3a7a48835a427 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts @@ -1,5 +1,4 @@ import { transformSync } from '@babel/core'; -// @ts-expect-error: @babel/preset-env has no type declarations import presetEnv from '@babel/preset-env'; import type { INewIncomingIntegration, IIncomingIntegration } from '@rocket.chat/core-typings'; import type { ServerMethods } from '@rocket.chat/ddp-client'; diff --git a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts index 11dd8eafa5781..5ce2ffd4496aa 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts @@ -1,5 +1,4 @@ import { transformSync } from '@babel/core'; -// @ts-expect-error: @babel/preset-env has no type declarations import presetEnv from '@babel/preset-env'; import type { IIntegration, INewIncomingIntegration, IUpdateIncomingIntegration } from '@rocket.chat/core-typings'; import type { ServerMethods } from '@rocket.chat/ddp-client'; diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 3ee440401cd31..62c902ab2b334 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -334,6 +334,7 @@ "@testing-library/user-event": "~14.6.1", "@types/adm-zip": "^0.5.7", "@types/archiver": "~6.0.4", + "@types/babel__preset-env": "^7.10.0", "@types/bad-words": "^3.0.3", "@types/bcrypt": "^5.0.2", "@types/body-parser": "^1.19.6", diff --git a/yarn.lock b/yarn.lock index fdab5e3202e81..2beab8dce4d86 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10071,6 +10071,7 @@ __metadata: "@testing-library/user-event": "npm:~14.6.1" "@types/adm-zip": "npm:^0.5.7" "@types/archiver": "npm:~6.0.4" + "@types/babel__preset-env": "npm:^7.10.0" "@types/bad-words": "npm:^3.0.3" "@types/bcrypt": "npm:^5.0.2" "@types/body-parser": "npm:^1.19.6" @@ -13703,6 +13704,13 @@ __metadata: languageName: node linkType: hard +"@types/babel__preset-env@npm:^7.10.0": + version: 7.10.0 + resolution: "@types/babel__preset-env@npm:7.10.0" + checksum: 10/7d4d12758d89708afe327079d7d7580e8af3292295f087b8a9a48e12ac1d90aadc18ac3bc00f9b0cbc8778f3ce9fe778801d4d49b7691a75e3f13a901b69fd07 + languageName: node + linkType: hard + "@types/babel__template@npm:*": version: 7.4.1 resolution: "@types/babel__template@npm:7.4.1"