Repository navigation
Conversation
wire/codec.ts imported the eager schemas shim, so every import of client or server built the 2025-11-25 schemas. Read them through the lazy factory. Co-authored-by: ochafik <ochafik@anthropic.com>
|
@modelcontextprotocol/client
@modelcontextprotocol/codemod
@modelcontextprotocol/core
@modelcontextprotocol/server
@modelcontextprotocol/server-legacy
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
1 task done
This branch has not been deployed
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.
Importing
clientorserverbuilds all the 2025-11-25 wire schemas up front again. This reads them through the lazy factory instead. Draft, as a basis for discussion; independent of other PRs.Motivation and Context
wire/rev2025-11-25/schemas.tssays runtime modules must importbuildSchemas, because importing the shim makes construction eager. Since #2820,wire/codec.tsimports the shim forisCoreRequestReceivedBy.Effect of the fix: importing
clientin Node goes from about 161 ms to 152 ms (median of 31 runs), and browser bundles lose about 4 kB minified.How Has This Been Tested?
New
lazySchemas.test.tsasserts that importing the package calls neither schema factory. It fails onmainand passes here. The core-internal, client and server suites show no new failures, using unlocked dependencies; two tests fail there with and without this change.Breaking Changes
None.
Types of changes
Additional context
No changeset: the eager import has not been released.
Generated by Claude Code