Feat/bridge peer dependency#22
Merged
Merged
Conversation
@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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #4 —
@forge/bridgeis now a peer dependency of@toolsplus/forge-trpc-linkinstead of a bundled direct dependency.Why
@forge/bridge(UI Kit apps get v6 via@forge/react), so the bundled^3.3.0adds a second, outdated copy to every frontend.@forge/bridgeas a peer dependency all along — it actually was one until e1ca542.invoke(), so the app-supplied bridge is sufficient.Changes (3 commits)
@forge/bridgemoved topeerDependenciesofforge-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 widenedinvoke()return type (InvokeResponseunion) — this call never passes invoke metadata, so the response is always the plain body.@trpc/server>= 11.18: thedist/rpcdeep import no longer resolves (now@trpc/server/rpc) andcallTRPCProcedurerequiresbatchIndex. Both changes stay backward compatible within the declared^11.0.0range.forge-trpc-adapter:@forge/resolvermoved topeerDependencies(^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 fromResolver['define'], stable across both majors; the workspace now builds and tests against@forge/resolver2.Validation
nxbuild / test / lint green across all three packages (30 tests), commitlint clean on both commits.Notes for the maintainer
>=3.3.0for the bridge), happy to adjust — the chosen ranges reflect what is actually built and tested here.!/BREAKING CHANGEmarker in the squashed commit message sonx releaseproduces the intended major bump.