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.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@shopify/cli-hydrogen@8.1.0
Minor Changes
Support Vite projects in
h2 debug cpu
command. (#2124) by @frandioxThe
h2 preview
command now supports--build
and--watch
flags to preview the project using the build process instead of Vite's dev process. (#2100) by @frandioxPatch Changes
Update remix to v2.9.2 (#2135) by @michenly
The CLI now tries to add optimizable dependencies to Vite's ssr.optimizeDeps.include automatically. (#2106) by @frandiox
Fix Hydrogen upgrade notification when running the dev command. (#2120) by @frandiox
Hide non actionable warning about ts-node. (#2123) by @frandiox
Updated internal CLI dependencies to
3.60.0
. (#2087) by @isaacroldanUpdated dependencies [
27e51abf
]:@shopify/create-hydrogen@4.3.10
Patch Changes
Update remix to v2.9.2 (#2135) by @michenly
Updated dependencies [
32d4c33e
,27e51abf
,7b838beb
,ca4cf045
,5a554b2e
,608389d6
,65239c76
]:@shopify/hydrogen@2024.4.3
Patch Changes
Add the
useOptimisticCart()
hook. This hook takes the cart object as a parameter, and processes all pending cart actions, locally mutating the cart with optimistic state. An optimistic cart makes cart actions immediately render in the browser while the action syncs to the server. This increases the perceived performance of the application. (#2069) by @blittleExample usage:
The problem with this code is that it can feel slow. If a new item is added to the cart, it won't render until the server action completes and the client revalidates the root loader with the new cart data.
If we update the cart implementation with a new
useOptimisticCart()
hook, Hydrogen can take the pending add to cart action, and apply it locally with the existing cart data:This works automatically with the
CartForm.ACTIONS.LinesUpdate
andCartForm.ACTIONS.LinesRemove
. To make it work withCartForm.Actions.LinesAdd
, update theCartForm
to include theselectedVariant
:Sometimes line items need to render differently when they have yet to process on the server. A new isOptimistic flag is added to each line item:
Adds type support for the script-src-elem directive for CSPs (#2105) by @altonchaney
Fix
storefrontRedirect
to strip trailing slashes when querying for redirects. Resolves #2090 (#2110) by @blittleImprove errors when a CJS dependency needs to be added to Vite's ssr.optimizeDeps.include. (#2106) by @frandiox
Improve VariantSelector to return variant object in option values. Thank you @NabeelAhmed1721 by @blittle
Fix: Use exiting
id_token
during Customer Account API token refresh because it does not get return in the API. (#2103) by @juanpprietoUpdated dependencies [
73716c88
]:@shopify/hydrogen-react@2024.4.3
Patch Changes
@shopify/mini-oxygen@3.0.3
Patch Changes
skeleton@2024.4.5
Patch Changes
Update remix to v2.9.2 (#2135) by @michenly
Update the skeleton template to use React state in the aside dialogs (#2088) by @blittle
Updated dependencies [
fe82119f
,32d4c33e
,8eea75ec
,27e51abf
,f29c9085
,7b838beb
,ca4cf045
,5a554b2e
,27e51abf
,608389d6
,9dfd1cfe
,7def3e9f
,65239c76
]: