Repoint saved Elastic Path commerce bindings for 0.4.0 - #442
Open
field123 wants to merge 4 commits into
Open
Conversation
The upstream merge renumbered 257-add-code-component-subtree-prefetching-config to 258 but kept the original alongside it, so check-bundle-migrations rejects every change under bundle-migrations/ with "Invalid migration index" and no new migration can be committed. The file is byte-identical to its 258 copy, which still runs, and it was never the tail of the sorted list, so no bundle has ever been stamped with its name. Closes #413
@elasticpath/plasmic-ep-commerce-elastic-path 0.4.0 publishes Elastic Path's own
product and cart response shapes instead of the Shopify-lineage normalization it
inherited (ADR-0002), so every saved binding into the old shape resolves to
nothing. Migrating server-side removes the window between the platform repoint
landing and the projects being fixed.
Rewrites the deterministic renames only. Paths whose replacement needs a
judgement call — price.value and the cart totals that were bare numbers, path,
$ctx.cartData — are left alone and collected into a worklist logged with the
project id, so the manual pass is generated rather than hunted for.
Reads bundle.map directly rather than unbundling. A data token on a page's Open
Graph image leaves a bare ObjectPath where the model allows only String,
ImageAssetRef or TemplatedString, so unbundling such a project throws; a bundled
migration keeps it loadable.
Expressions are free-form JavaScript, so the rewrite skips string literals,
comments and template-literal text, recurses into ${} interpolations, stops at
computed access, and is idempotent.
Migrating a production storefront export surfaced five old-shape reads the 0.4.0 runbook did not list: the two search-hit fields beside _highlightedName, _score, and currentProduct.extensions, which moved to Elastic Path's own attributes.extensions. All are reported rather than rewritten. Import passes an entity carrying neither projectId nor pkgId, so the worklist logged no owner at all; it falls back to the entity id.
Collaborator
Author
|
Deploy ordering: do not deploy this ahead of the 0.4.0 publish and the platform repoint. Order: publish 0.4.0 → move both pins → deploy 259. |
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.
0.4.0 publishes Elastic Path's own product and cart response shapes instead of the Shopify-lineage normalization the package inherited (ADR-0002), so every saved binding into the old shape resolves to nothing. Migration 259 repoints them server-side on project load, which removes the window between the platform repoint landing and the projects being fixed.
Rewrites only the deterministic renames. Paths whose replacement needs a judgement call are left alone and collected into a worklist logged with the project id, so the manual pass is generated rather than hunted for:
price.valueand the cart totals that were bare numbers,path,$ctx.cartData, the search-hit fields, andcurrentProduct.extensions.Reads
bundle.mapdirectly rather than unbundling. A data token on a page's Open Graph image leaves a bareObjectPathwhere the model allows onlyString,ImageAssetReforTemplatedString, so unbundling such a project throws; a bundled migration keeps it loadable. That schema gap is upstream's and still open.Expressions are free-form JavaScript, so the rewrite skips string literals, comments and template-literal text, recurses into
${}interpolations, stops at computed access, and is idempotent.Also drops
257-add-code-component-subtree-prefetching-config.ts. The upstream merge renumbered it to 258 but kept the original, socheck-bundle-migrationsrejected every change underbundle-migrations/and no new migration could be committed. It is byte-identical to its 258 copy, which still runs, and was never the tail of the sorted list, so no bundle carries its name. Closes #413.Verified against a production storefront export (
iso-storefront, 6,960 instances, stamped 257): 4 bindings repointed, 6 worklist entries, and the rewritten paths render real Elastic Path data in Studio. The 90 checked-in bundles change only their version stamp.