Skip to content

feat(apps): apps-engine split, flip the switch#40186

Draft
d-gubert wants to merge 11 commits intofeat/apps-engine-split--pr2b-dynamic-import-mapfrom
feat/apps-engine-split--pr2c-flip-the-switch
Draft

feat(apps): apps-engine split, flip the switch#40186
d-gubert wants to merge 11 commits intofeat/apps-engine-split--pr2b-dynamic-import-mapfrom
feat/apps-engine-split--pr2c-flip-the-switch

Conversation

@d-gubert
Copy link
Copy Markdown
Member

@d-gubert d-gubert commented Apr 16, 2026

  • refactor(apps): point AppsEngine facade and IAppServerOrchestrator to local server/ paths
  • refactor(meteor): migrate apps-engine/server/ imports to @rocket.chat/apps/server/
  • refactor(meteor): migrate apps-engine/client/ imports to @rocket.chat/apps/client/
  • refactor(core-services): migrate apps-engine/server/ imports to @rocket.chat/apps
  • refactor(apps-engine): promote cross-boundary types to definition layer
  • refactor(apps-engine): remove server, client, deno-runtime and scripts
  • refactor(apps): source room options and OAuth2Client from apps-engine definition

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Related to the "Apps-Engine split" stack:

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 16, 2026

⚠️ No Changeset found

Latest commit: 57bc3b7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ac2bb63a-f23b-47fe-bda8-72f67a8e74d1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented Apr 16, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@d-gubert d-gubert force-pushed the feat/apps-engine-split--pr2b-dynamic-import-map branch from 969ce6b to af58d57 Compare April 22, 2026 20:09
@d-gubert d-gubert force-pushed the feat/apps-engine-split--pr2c-flip-the-switch branch from 1cc12df to c9af208 Compare April 22, 2026 20:22
@d-gubert d-gubert force-pushed the feat/apps-engine-split--pr2b-dynamic-import-map branch from af58d57 to 68964e4 Compare April 27, 2026 22:26
@d-gubert d-gubert force-pushed the feat/apps-engine-split--pr2c-flip-the-switch branch 2 times, most recently from f45a000 to b39d06f Compare April 27, 2026 23:46
@d-gubert d-gubert closed this Apr 28, 2026
@d-gubert d-gubert reopened this Apr 28, 2026
@d-gubert
Copy link
Copy Markdown
Member Author

@copilot check the errors and fix them https://github.com/RocketChat/Rocket.Chat/actions/runs/25027766915/job/73302665636?pr=40186

Make atomic commits, don't just commit every file at once.

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

@copilot check the errors and fix them https://github.com/RocketChat/Rocket.Chat/actions/runs/25027766915/job/73302665636?pr=40186

Make atomic commits, don't just commit every file at once.

Fixed in commits 1e661b3 and 2eff423.

The build was failing because the cleanup commit (07f4d9f) that stripped @rocket.chat/apps-engine down to the definition layer missed deleting some stale files from src/client/ and src/server/. These files (AppsEngineUIClient, AppsEngineUIHost, AppManager, various accessors/bridges/managers/storage files, etc.) had already been moved to @rocket.chat/apps, but their copies in @rocket.chat/apps-engine were left behind with broken imports (their dependencies had been removed).

The fix is split into two atomic commits:

  1. 1e661b3 – removes stale src/client/ files
  2. 2eff423 – removes stale src/server/ files

The package now only contains src/definition/ and src/lib/ as intended.

@d-gubert
Copy link
Copy Markdown
Member Author

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

@copilot new errors https://github.com/RocketChat/Rocket.Chat/actions/runs/25028284158/job/73313245886

Fixed in commit b4986b5.

GetMessagesSortableFields is a runtime const array, but the previous refactor accidentally imported and re-exported it via import type / export type, making it unavailable as a value. RoomRead.ts uses it at runtime (Array.includes, Array.join), causing TS1362.

Fixed by importing it as a value in RoomBridge.ts and exporting it normally (export { GetMessagesSortableFields }) while keeping the other purely-type exports as export type.

d-gubert and others added 8 commits April 28, 2026 12:21
… local server/ paths

These files previously re-exported AppManager, AppBridges, and
AppMetadataStorage from @rocket.chat/apps-engine/server/. Now that
server/ lives in this package, the imports are updated to local paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…/apps/server/

Hard-cut all import paths from `@rocket.chat/apps-engine/server/*` to
`@rocket.chat/apps/server/*` across apps/meteor. Covers bridges, storage,
managers, marketplace, and service files (50 files, purely mechanical rename).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…/apps/client/

Hard-cut all import paths from `@rocket.chat/apps-engine/client/*` to
`@rocket.chat/apps/client/*` across apps/meteor (5 files).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…et.chat/apps

IAppsEngineService imported IGetAppsFilter and IAppStorageItem from
@rocket.chat/apps-engine/server/ — server internals that now live in
@rocket.chat/apps. Update imports and swap the devDependency accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
OAuth2Client, IExternalComponentRoomInfo/UserInfo, and the room query
option types (GetMessagesOptions, GetRoomsFilters, GetRoomsOptions) were
defined in server/ or client/ but were imported by definition/ files.
Move them into the definition layer so the public API is self-contained.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Strip @rocket.chat/apps-engine down to the definition layer only.
All runtime code (AppManager, bridges, compiler, deno-runtime, etc.)
has already been moved to @rocket.chat/apps in previous commits.

Updates package.json, tsconfig.json, and turbo.json to reflect the
narrower scope (definition/**  and lib/** outputs only).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… definition

GetMessagesOptions, GetRoomsFilters, GetRoomsOptions, and
GetMessagesSortableFields are now canonical in
@rocket.chat/apps-engine/definition/rooms/IGetMessagesOptions —
import them from there and re-export for downstream consumers.

OAuth2Client is now canonical in
@rocket.chat/apps-engine/definition/oauth2/OAuth2Client — replace the
duplicate copy with a re-export.

Also add typesVersions to @rocket.chat/apps/package.json so that
consumers using moduleResolution: "node" can resolve ./server/* and
./client/* subpath imports without needing node16/bundler resolution.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI and others added 3 commits April 28, 2026 12:21
These files were already moved to @rocket.chat/apps/src/client but were
not deleted from apps-engine in the previous cleanup commit. They caused
TypeScript build errors because their dependencies (constants, utils,
definition sub-files) had been removed.

Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
These files were already moved to @rocket.chat/apps/src/server but were
not deleted from apps-engine in the previous cleanup commit. They caused
TypeScript build errors because many of their dependencies (bridges,
managers, errors, storage types, etc.) had been removed from apps-engine.

Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
GetMessagesSortableFields is a runtime const array, not just a type.
The previous refactor accidentally imported and re-exported it via
'import type' / 'export type', making it unavailable as a value.
This caused TS1362 errors in RoomRead.ts where it is used at runtime
(Array.includes and Array.join calls).

Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
@d-gubert d-gubert force-pushed the feat/apps-engine-split--pr2c-flip-the-switch branch from b4986b5 to 57bc3b7 Compare April 28, 2026 15:21
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.

2 participants