Repository navigation
feat: Product releaseDate - #1438
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit d811f24:
|
tlgimenes
marked this pull request as ready for review
August 15, 2022 17:15
eduardoformiga
approved these changes
Aug 15, 2022
1 task
lariciamota
added a commit
that referenced
this pull request
Oct 2, 2026
…-LD (#3508) ## What Puts `StoreProduct.releaseDate` back to the raw value Intelligent Search returns. The ISO 8601 normalization added in #3465 now runs only where the PDP builds its `application/ld+json`. | | Before (4.7.0 – 4.8.x) | After | |---|---|---| | `StoreProduct.releaseDate` (GraphQL) | `"2026-03-23"` | `"1774224000000"`, as returned upstream (same as before 4.7.0) | | PDP JSON-LD `releaseDate` | `"2026-03-23"` | `"2026-03-23"`, unchanged | ## Why #3465 (SO-666) needed an ISO date in the structured data, but it did the normalization in the API resolver. That changed the field's format for everyone who reads it, and store customizations that parse the epoch-ms value broke. Search & Recommendation reported this as a bug against FS 4.8.0, related feature ELOR-5408. The change first shipped in 4.7.0. The JSON-LD is the only consumer that needs ISO, and it is built in `@faststore/core`, so the conversion now lives there. ## Changes - **`@faststore/api`**: the resolver returns `releaseDate ?? ''` again, and `utils/releaseDate.ts` is removed. The schema description no longer says ISO 8601, because upstream doesn't guarantee that format. The type stays `String!`. - **`@faststore/core`**: the normalizer moves to `src/utils/productJsonLd.ts` as `toProductJsonLdReleaseDate`, next to `toProductJsonLdOffer`. `p.tsx` applies it only to `ProductJsonLd`. Its behavior is unchanged: epoch ms or seconds and ISO strings become a UTC calendar day, and empty or unparseable input gives `''`. - **Generated**: `__generated__/schema.ts` and `@generated/graphql.ts` were regenerated with codegen. Only the description text changed. ## Notes for review - **Behavior change**: this reverts the format change from 4.7.0. A store that already adapted to ISO on 4.7 or 4.8 gets epoch ms again. That seems unlikely, since the ISO format was out for about a month and the epoch format had been the contract since #1438, but it should go in the changelog. - **Hotfix to `main`**: this targets `main` directly, following the precedent of #3437 (4.5.1), so it ships as **4.9.1** without waiting for the next `dev → main` graduation. It should be back-merged into `dev` afterwards. There are no 4.7.x/4.8.x maintenance branches, so stores on 4.7 or 4.8 get the fix by bumping to 4.9.1. ## Testing - `packages/api`: the resolver tests pass (25). The new `releaseDate` tests check that epoch ms and ISO values come through unchanged and that null or undefined give `''`. - `packages/core`: `productJsonLd.test.ts` and `productJsonLdRendering.test.tsx` pass (37). This includes the 13 normalizer cases that moved over from the API. - `tsc --noEmit` reports no errors in `src` for either package, and Biome is clean. - [ ] Render the reported SKU through `ci/codesandbox`. Check that a customization reading `releaseDate` gets epoch ms and that the JSON-LD still passes the Google Rich Results Test. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Improvements** * Product data now returns catalog-provided release dates unchanged, or an empty string when no value is available. * Structured product metadata converts interpretable release dates to UTC dates and omits missing or invalid dates. * Structured metadata supports release dates provided as epoch milliseconds, epoch seconds, or ISO 8601 strings. * Empty product identifiers are omitted from structured metadata. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch was successfully 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.
What's the purpose of this pull request?
This PR is a one liner that returns the product's release date using schema.org's field on Product entity. This should fix this issue
Starters Deploy Preview
I tried adding this to gatsby too, however, gatsby library does not accept releaseDate as input
References