Skip to content

Remove deprecated subTopic from webhooks#2948

Open
cdarne wants to merge 4 commits intomainfrom
cdarne/remove-subtopic-from-webhooks
Open

Remove deprecated subTopic from webhooks#2948
cdarne wants to merge 4 commits intomainfrom
cdarne/remove-subtopic-from-webhooks

Conversation

@cdarne
Copy link
Copy Markdown

@cdarne cdarne commented Dec 2, 2025

Summary

Removes the deprecated subTopic field from all webhook types, handlers, validation, registration, and context objects across @shopify/shopify-api, @shopify/shopify-app-remix, and @shopify/shopify-app-react-router. The subTopic feature was deprecated in API version 2024-04 and fully removed in 2024-07 — apps should use webhook filters instead.

This is a major version bump for all three packages.

Related to: https://github.com/shop/issues-event-foundations/issues/128
Related PR: https://github.com/Shopify/shopify-dev/pull/65578

Changes

@shopify/shopify-api

  • Remove ShopifyHeader.SubTopic enum value from lib/types.ts
  • Remove subTopic from WEBHOOK_HEADER_NAMES map in lib/webhooks/types.ts
  • Remove subTopic parameter from WebhookHandlerFunction signature
  • Remove subTopic from BaseWebhookHandler and WebhooksWebhookFields interfaces
  • Remove subTopic header extraction in validate.tscheckWebhooksHeaders()
  • Remove subTopic destructuring and callback argument in process.ts
  • Remove subTopic from GraphQL mutation building in register.ts
  • Remove subTopic section from addHandlers.md reference docs
  • Remove HTTP_HANDLER_WITH_SUBTOPIC test fixture, subtopic-specific tests, and assertWebhookRegistrationRequest subTopic parameter

@shopify/shopify-app-remix & @shopify/shopify-app-react-router

  • Remove subTopic from the webhook Context interface (field + JSDoc)
  • Remove subTopic: check.subTopic || undefined from authenticateWebhookFactory

Changeset

  • Major version bump for all three packages with comprehensive migration guide covering handler signatures, registration changes, and Remix/React Router webhook context

Testing

Automated

  • Build passes: npx turbo run build --filter=@shopify/shopify-api --filter=@shopify/shopify-app-remix --filter=@shopify/shopify-app-react-router
  • No remaining subTopic/SubTopic/sub_topic references in *.ts files (only unrelated pubSubTopic)
  • No conflict markers remain

Manual Testing Steps

  1. Verify webhook registration works without subTopic parameter
  2. Verify webhook processing calls handler callback with correct arity (no subTopic arg)
  3. Verify authenticate.webhook() context in Remix/React Router no longer exposes subTopic

Breaking Changes

Package Bump Breaking Change
@shopify/shopify-api MAJOR WebhookHandlerFunction signature drops subTopic parameter; BaseWebhookHandler.subTopic removed; ShopifyHeader.SubTopic removed
@shopify/shopify-app-remix MAJOR subTopic removed from webhook context type
@shopify/shopify-app-react-router MAJOR subTopic removed from webhook context type

Migration: Replace subTopic usage with webhook filters. See the changeset for detailed before/after examples.

@cdarne cdarne requested a review from a team as a code owner December 2, 2025 20:22
@cdarne cdarne force-pushed the cdarne/remove-subtopic-from-webhooks branch from 737ac05 to 93ea394 Compare February 16, 2026 17:01
@cdarne cdarne force-pushed the cdarne/remove-subtopic-from-webhooks branch from 93ea394 to bfb32ce Compare March 10, 2026 19:15
cdarne and others added 4 commits March 19, 2026 10:29
The webhook subTopic feature was deprecated in API version 2024-04 and
fully removed in 2024-07. This commit removes all traces of subTopic
from the codebase.

Changes:
- Remove ShopifyHeader.SubTopic enum value
- Remove subTopic from WebhookHandlerFunction, BaseWebhookHandler, and
  WebhookFields types
- Remove subTopic validation and processing logic
- Remove subTopic from GraphQL mutation building
- Remove subTopic from Remix and React Router webhook context
- Remove related tests and documentation

Related to: shop/issues-event-foundations#128
Related PR: Shopify/shopify-dev#65578

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Change version bump from minor to major
- Add comprehensive migration guide to changeset
- Add clarifying comment to validate.ts
Verifies the context parameter is correctly received at position 6
after the subTopic parameter was removed from the callback signature.
@cdarne cdarne force-pushed the cdarne/remove-subtopic-from-webhooks branch from bfb32ce to c8c5188 Compare March 20, 2026 01:18
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.

1 participant