Skip to content

docs(getting-started): add the v4 to v5 upgrade guide - #826

Merged
acasazza merged 1 commit into
mainfrom
docs/upgrading-from-v4
Sep 1, 2026
Merged

docs(getting-started): add the v4 to v5 upgrade guide#826
acasazza merged 1 commit into
mainfrom
docs/upgrading-from-v4

Conversation

@acasazza

@acasazza acasazza commented Sep 1, 2026

Copy link
Copy Markdown
Member

Adds packages/docs/src/stories/getting-started/008.upgrading-from-v4.mdx, a Storybook page walking through the move from v4 to v5. It shows up eighth under Getting Started, after Hooks package.

What it covers

The page leads with the fact that no export was removed from the public API in v5, so the upgrade can be done in two stages: get the app running on v5 first, clear the deprecation warnings later.

Then the four changes that genuinely break a v4 app:

change
React 19 peer range moved >=18.0.0>=19.0.0; compiled with the React Compiler targeting 19
Deep imports the 20 subpath export patterns are gone, replaced by a single root entry
<CommerceLayer> endpoint and domain removed — the organization is derived from the token; new optional interceptors
Sibling packages a direct dependency on core-components / react-hooks-components shadows the transitive one and leaves two incompatible copies in the tree

Followed by the full table of the 15 deprecated containers and their standalone replacements, split between straight renames (<OrderContainer><Order>) and the ones that dissolve by moving their props onto the children. <AddressesContainer> and <PlaceOrderContainer> get their own before/after examples.

What it deliberately does not do

The concept behind dropping containers is already in 005.containers.mdx, and the two new packages are documented in 006.core.mdx and 007.hooks.mdx. This page links to all three instead of restating them — it contributes the complete migration table, which none of them has.

Verification

  • pnpm build && pnpm docs:build both pass, which is the Netlify path
  • The page appears eighth under Getting Started in the generated index.json
  • The four internal links were checked against the real story ids from /index.json, not guessed
  • Read back rendered in the browser: tables, <Source> blocks and both callouts render correctly

One fix during authoring worth noting: <span type="warning"> is styled as a full-width block callout by the theme, so it cannot be used inline — it was splitting a sentence around an orange box. Inline markers are plain (breaking) text now, and the two remaining <span> blocks are standalone.

Content sourced from

git diff v4.29.7..main, the deprecation JSDoc on each container, and tsdown.config.ts for the build formats. Every claim in the table was read off the code rather than recalled — including that both CJS and ESM are still shipped, so v5 is not ESM-only.

Covers the four changes that actually break a v4 app — the React 19 peer
bump, the removal of the 20 subpath exports in favour of a single root
entry, `<CommerceLayer>` losing `endpoint` and `domain` now that the
organization is derived from the token, and the sibling packages, where a
direct dependency on core-components or react-hooks-components shadows the
transitive one and leaves two incompatible copies in the tree.

Then the full table of the 15 deprecated containers and their standalone
replacements, split between straight renames and the ones that dissolve by
moving their props onto the children. `<AddressesContainer>` gets its own
example, since its props split across two forms.

No export was removed from the public API in v5, so the guide leads with
the two-stage upgrade: get the app running first, clear the deprecation
warnings later. The concept behind the container removal already lives in
`005.containers.mdx`, so this page links there rather than restating it,
and the same for the core and hooks package pages.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@acasazza acasazza added the documentation Improvements or additions to documentation label Sep 1, 2026
@acasazza acasazza self-assigned this Sep 1, 2026
@netlify

netlify Bot commented Sep 1, 2026

Copy link
Copy Markdown

Deploy Preview for commercelayer-react-components ready!

Name Link
🔨 Latest commit 3966b59
🔍 Latest deploy log https://app.netlify.com/projects/commercelayer-react-components/deploys/6a96a82220cdd90008daa810
😎 Deploy Preview https://deploy-preview-826--commercelayer-react-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pfferrari pfferrari left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💯

@acasazza
acasazza merged commit f63bf91 into main Sep 1, 2026
6 checks passed
@acasazza
acasazza deleted the docs/upgrading-from-v4 branch September 1, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants