Sync latest discount function examples - #76
Open
devisscher wants to merge 1 commit into
Open
Conversation
Assisted-By: devx/c67db487-f777-4783-8b30-503062671792
devisscher
marked this pull request as ready for review
August 5, 2026 15:04
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.
Problem
discounts-reference-apphas drifted from the examples and reference material indiscount-functions-testing. The accumulated source changes include updated Function APIs and tooling, app intent links for create and edit flows, and refreshed JavaScript and Rust examples.A first regeneration also exposed two source defects that would have removed live Rust tutorial coderefs and left the generated React Router lint command unusable. Those fixes are tracked in discount-functions-testing#1438.
What this PR does
5cd46c55, plus the source fixes inShopify/discount-functions-testing#1438at8505d6cd.admin.app.intent.linkexamples for discount create and edit flows.discount-function.app-intent-linkcoderefs for JavaScript and Rust.This is generated output. Source changes belong in
discount-functions-testing; this PR does not curate the generated files by hand.Test plan
Reproduce validation
Prerequisites:
wasm32-unknown-unknowntargetshopify.app.tomlwhen running Shopify CLI buildsInstall dependencies:
Validate the React Router app:
cd examples/react-router-app env -u HOST -u PORT -u SHOPIFY_APP_URL pnpm lint env -u HOST -u PORT -u SHOPIFY_APP_URL pnpm buildExpected: lint exits 0 with no errors, and client and SSR bundles build.
Validate the mock HTTP server:
cd examples/mock-http-server pnpm buildExpected: client and SSR bundles build.
Run the JavaScript unit tests:
cd examples/javascript/default/extensions/discount-function ./node_modules/.bin/vitest run src/Expected: 7 tests pass across 2 files. The other three JavaScript examples currently contain no unit-test files.
Build each JavaScript Function from a temporary app directory containing a valid
shopify.app.toml:Repeat for
default,network-access,metafield, anddiscount-rejection.Expected: each command produces
dist/function.wasm.Test and build each Rust Function:
Expected: all four test commands and all four WASM builds pass.
Verify generated documentation contracts:
[START ...]and[END ...]tag inventories againstmain.Expected: all files parse, every tag is balanced, and no coderef tag is removed.
Local development results
Validated on 2026-08-05 at reference-app commit
e99fb28using DFT source commit8505d6cd, Node.js 22.22.0, pnpm 10.33.0, and Shopify CLI 4.5.1.no-explicit-anywarnings.cargo testcommands passed, with 6 total tests, and all fourwasm32-unknown-unknownrelease builds passed.