Skip to content

Feat/bridge peer dependency#22

Merged
tbinna merged 3 commits into
toolsplus:mainfrom
ppasler:feat/bridge-peer-dependency
Jul 16, 2026
Merged

Feat/bridge peer dependency#22
tbinna merged 3 commits into
toolsplus:mainfrom
ppasler:feat/bridge-peer-dependency

Conversation

@ppasler

@ppasler ppasler commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Implements #4@forge/bridge is now a peer dependency of @toolsplus/forge-trpc-link instead of a bundled direct dependency.

Why

  • Consuming Forge apps ship their own @forge/bridge (UI Kit apps get v6 via @forge/react), so the bundled ^3.3.0 adds a second, outdated copy to every frontend.
  • The package README has documented @forge/bridge as a peer dependency all along — it actually was one until e1ca542.
  • The link only uses invoke(), so the app-supplied bridge is sufficient.

Changes (3 commits)

  1. feat!@forge/bridge moved to peerDependencies of forge-trpc-link (^6.0.0, the major this package is now built and tested against); root devDependency bumped accordingly. Building against bridge 6 required adapting to its widened invoke() return type (InvokeResponse union) — this call never passes invoke metadata, so the response is always the plain body.
  2. fix — restore compatibility with @trpc/server >= 11.18: the dist/rpc deep import no longer resolves (now @trpc/server/rpc) and callTRPCProcedure requires batchIndex. Both changes stay backward compatible within the declared ^11.0.0 range.
  3. feat! — same treatment for forge-trpc-adapter: @forge/resolver moved to peerDependencies (^1.4.8 || ^2.0.0), resolving the same README/manifest mismatch (the README always documented it as a peer dependency). The adapter only derives types from Resolver['define'], stable across both majors; the workspace now builds and tests against @forge/resolver 2.

Validation

  • nx build / test / lint green across all three packages (30 tests), commitlint clean on both commits.
  • Tested end-to-end in a real Forge app with Custom UI and UI Kit modules (bridge 6.1.0, tRPC 11.18.0): tRPC roundtrips work in both UI flavors.

Notes for the maintainer

  • If you prefer wider peer ranges (e.g. >=3.3.0 for the bridge), happy to adjust — the chosen ranges reflect what is actually built and tested here.
  • In case of a squash merge, please keep the ! / BREAKING CHANGE marker in the squashed commit message so nx release produces the intended major bump.

ppasler added 3 commits July 16, 2026 06:17
@forge/bridge was declared as a regular dependency, so consuming
Forge apps on newer bridge majors (e.g. UI Kit apps on bridge v6)
get a second, outdated copy of @forge/bridge bundled into their
frontend. The link only uses invoke(), so the app-supplied bridge
is sufficient.

Declare it as a peer dependency (^6.0.0, matching the bridge major
this package is built and tested against) and bump the root
devDependency to ^6.0.0 accordingly. Building against bridge 6
required adapting to its widened invoke() return type
(InvokeResponse union): this call never passes invoke metadata, so
the response is always the plain body. The package README already
documented @forge/bridge as a peer dependency.

BREAKING CHANGE: @forge/bridge is no longer installed as a
dependency of @toolsplus/forge-trpc-link. Consumers must provide
@forge/bridge ^6.0.0 in their own app.

Closes toolsplus#4
@trpc/server 11.18.0 removed the deep import path dist/rpc and added a
required batchIndex field to ProcedureCallOptions:

- forge-trpc-link: import TRPCResponse from the exported subpath
  @trpc/server/rpc instead of @trpc/server/dist/rpc
- forge-trpc-adapter: pass batchIndex to callTRPCProcedure
- lockfile: resolve @trpc/client and @trpc/server to 11.18.0 so CI
  builds and tests against the current release

Declared ranges (^11.0.0) are unchanged.
The adapter README has always documented @forge/resolver as a peer
dependency, but the manifest declared it as a regular dependency,
bundling a second copy into consuming apps that already create their
own Resolver instance.

Declare it as a peer dependency (^1.4.8 || ^2.0.0) instead. The
adapter only derives types from Resolver['define'], which is stable
across both majors; the workspace now builds and tests against
@forge/resolver 2.

BREAKING CHANGE: @forge/resolver is no longer installed as a
dependency of @toolsplus/forge-trpc-adapter. Consumers must provide
@forge/resolver ^1.4.8 || ^2.0.0 in their own app (Forge apps using
this adapter already do).
@tbinna
tbinna merged commit d05343a into toolsplus:main Jul 16, 2026
2 checks passed
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