Skip to content

Add shopify/Discount app intent link snippets for React Router tutorial - #75

Open
loic-d wants to merge 3 commits into
mainfrom
loic/react-router-discount-app-intent
Open

Add shopify/Discount app intent link snippets for React Router tutorial#75
loic-d wants to merge 3 commits into
mainfrom
loic/react-router-discount-app-intent

Conversation

@loic-d

@loic-d loic-d commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the coderef source snippets for the new "Let Sidekick create and edit your discount" step in the build-ui-with-react-router tutorial. Generated from Shopify/discount-functions-testing#1408 (dev generate-reference-app), scoped to only the app-intent-link files.

Files

  • docs/reference/shopify/{javascript,rust}/shopify.extension.toml — create + edit admin.app.intent.link extensions under the discount-function.app-intent-link tag (added to the existing React Router function toml)
  • docs/reference/shopify/{javascript,rust}/create-intent-schema.json, edit-intent-schema.json, instructions.md

Details

  • create URL hardcodes YOUR_FUNCTION_ID; edit URL is /app/discount/YOUR_FUNCTION_ID/{id} (matches the app's app.discount.$functionId.$id route)
  • functionId uses matchValue; no tools.json

Related

  • Source: Shopify/discount-functions-testing#1408
  • Tutorial (coderefs): shop/world#919168

Note on scope

This is a curated diff. A full dev generate-reference-app also rewrites ~110 unrelated files (oxfmt reflow, dependency/lockfile churn, new .oxfmtrc.json/.oxlintrc.json) because main is stale vs current discount-functions-testing main. That drift is intentionally omitted here and should be handled as a separate maintenance regen.

Generated from Shopify/discount-functions-testing#1408. Adds the coderef
sources for the new 'Let Sidekick create and edit your discount' step in the
build-ui-with-react-router tutorial:

- docs/reference/shopify/{javascript,rust}/shopify.extension.toml: create + edit
  admin.app.intent.link extensions under the discount-function.app-intent-link tag
- docs/reference/shopify/{javascript,rust}/create-intent-schema.json,
  edit-intent-schema.json, instructions.md

Scoped to just these files; unrelated regen drift (formatting/deps) omitted.

Assisted-By: devx/544990ff-9f89-4bd0-8c23-777a2f097188
The {id} URL segment is filled with the discount's ID at runtime; only
the Function ID stays hardcoded. Keeps the comment implementation-agnostic.
Synced from discount-functions-testing.
Comment thread docs/reference/shopify/javascript/create-intent-schema.json Outdated
The functionId property only needs matchValue for intent disambiguation.
Drop the JSON-Schema type and description so the snippet matches the
shape we actually ship. Synced from discount-functions-testing.
"$ref": "https://extensions.shopifycdn.com/shopifycloud/schemas/v1/shopify/discount.json",
"additionalProperties": true,
"properties": {
"functionId": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we still include mapTo: param here? like in DFT

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@loic-d
loic-d requested a review from lauramann July 27, 2026 18:34

@lauramann lauramann left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just a question around whether we should still include mapTo on the intent-schema


[[extensions.targeting]]
target = "admin.app.intent.link"
# {id} receives the discount ID; the Function ID stays hardcoded.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iphipps iphipps left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great

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.

3 participants