Skip to content

feat(compat): IsomorphicHeaders/FetchLike/RequestInfo deprecated type aliases#1905

Draft
felixweinberger wants to merge 1 commit intomainfrom
fweinberger/v2-bc-type-aliases
Draft

feat(compat): IsomorphicHeaders/FetchLike/RequestInfo deprecated type aliases#1905
felixweinberger wants to merge 1 commit intomainfrom
fweinberger/v2-bc-type-aliases

Conversation

@felixweinberger
Copy link
Copy Markdown
Contributor

Part of the v2 backwards-compatibility series — see reviewer guide.

v2 moved to Web-standard Headers/Request. This re-exports the v1 type names as @deprecated aliases.

Motivation and Context

v2 moved to Web-standard Headers/Request. This re-exports the v1 type names as @deprecated aliases.

v1 vs v2 pattern & evidence

v1 pattern:

`const h: IsomorphicHeaders = req.headers`

v2-native:

`const h: Headers = req.headers`

Evidence: Low volume but zero-cost to shim.

How Has This Been Tested?

  • Import-compiles test
  • Integration: validated bump-only against 5 OSS repos via the v2-bc-integration validation branch
  • pnpm typecheck:all && pnpm lint:all && pnpm test:all green

Breaking Changes

None — additive @deprecated shim. Removed in v3.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added or updated documentation as needed

Additional context

Stacks on: none

@felixweinberger felixweinberger added the v2-bc v2 backwards-compatibility series label Apr 15, 2026
@felixweinberger felixweinberger added this to the v2.0.0-bc milestone Apr 15, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 15, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@1905

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@1905

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@1905

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@1905

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@1905

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@1905

commit: b49482b

…rphicHeaders, RequestInfo)

Adds @deprecated type aliases to core/public for smoother v1→v2 migration:
- ResourceTemplate → ResourceTemplateType (the spec-derived data type)
- IsomorphicHeaders → Headers (standard web type)
- RequestInfo → Request (standard web type)

FetchLike retains its v1 name and was already re-exported.

Server's ResourceTemplate helper class intentionally shadows the deprecated
type alias via named-export-wins-over-export-star ES module semantics; the
import/export lint rule is suppressed at those two sites with an explanatory
comment.
@felixweinberger felixweinberger force-pushed the fweinberger/v2-bc-type-aliases branch from e316e7d to b49482b Compare April 16, 2026 09:37
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 16, 2026

🦋 Changeset detected

Latest commit: b49482b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@modelcontextprotocol/core Patch
@modelcontextprotocol/client Patch
@modelcontextprotocol/server Patch
@modelcontextprotocol/node Patch
@modelcontextprotocol/express Patch
@modelcontextprotocol/fastify Patch
@modelcontextprotocol/hono Patch

Not sure what this means? Click here to learn what changesets are.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2-bc v2 backwards-compatibility series

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant