Releases: Shopify/hydrogen-v1
v0.7.0
Hydrogen v0.7.0 includes a number of bug fixes, a new response.redirect()
API, and other various improvements.
Important: Read the upgrade guide below for migrating your existing Hydrogen apps to v0.7.0.
What's Changed
- feat: format CLI output with prettier by @cartogram in Shopify/hydrogen#222
- feat: CLI display if file changed by @cartogram in Shopify/hydrogen#219
- fix: default to retry: false in react-query by @jplhomer in Shopify/hydrogen#234
- Fix: Prevent error when store has no products by @ThomasAndrewMacLean in Shopify/hydrogen#232
- fix: starter template media gallery error when handling videos by @scottdixon in Shopify/hydrogen#226
- VSCode extensions > Add prettier + eslint by @rafaelstz in Shopify/hydrogen#218
- docs: add shield.io badges to primary readme by @Eastonco in Shopify/hydrogen#216
- feat: eslint rule no effects on server by @cartogram in Shopify/hydrogen#220
- Adding devcontainer by @rafaelstz in Shopify/hydrogen#164
- fix(#243): fix graphiql by running graphiql middleware before vite by @blittle in Shopify/hydrogen#248
- feat: add windows to our CI test build by @blittle in Shopify/hydrogen#212
- feat: allow custom Model3D poster by @scottdixon in Shopify/hydrogen#225
- refactor: remove Intl polyfill by @frandiox in Shopify/hydrogen#262
- Implement server redirects by @frandiox in https://github.com/Shopify/hydrogen/pull/172
- fix: ensure to call waitUntil with proper "this" if present by @maxshirshin in Shopify/hydrogen#265
- Add support for file reference metafield by @cathryngriffiths in Shopify/hydrogen#208
- fix: warn and ignore reserved properties in server state by @frandiox in Shopify/hydrogen#241
- fix: middleware import by @frandiox in Shopify/hydrogen#271
- fix: workaround for sourcemap warnings by @frandiox in Shopify/hydrogen#277
- docs: add docs for response.redirect() by @jplhomer in Shopify/hydrogen#274
- Misc CLI improvements to support the
check
command by @cartogram in Shopify/hydrogen#266 - docs: Model3d poster props by @scottdixon in Shopify/hydrogen#275
- fix: update variantID to variantId by @Eastonco in Shopify/hydrogen#217
- Add 404 link to footer by @mynameisadamf in Shopify/hydrogen#257
New response.redirect()
API
You can perform redirects on initial SSR page loads by calling response.redirect(url: string, code?: number)
.
Read the docs about response.redirect
Note: This will only work with initial SSR page responses. Subsequent SPA-style navigations are not yet supported with redirects.
Upgrade guide
If you have an existing Hydrogen app:
First, yarn add @shopify/hydrogen
or NPM equivalent to get the latest version
Next, update your server.js
file to use the named export of Hydrogen Middleware:
-const hydrogenMiddleware = require('@shopify/hydrogen/middleware').default;
+const {hydrogenMiddleware} = require('@shopify/hydrogen/middleware');
In your pages/products/[handle].server.jsx
and any other place where you're using ProductProviderFragment
, add the new required variable $includeReferenceMetafieldDetails
:
const QUERY = gql`
query product(
$country: CountryCode
$handle: String!
+ $includeReferenceMetafieldDetails: Boolean = true
# ...
Finally, update any locations where you're using <AddToCartButton>
or <SelectedVariantAddToCartButton>
to use variantId
instead of variantID
:
-<AddToCartButton variantID={selectedVariant.id} />
+<AddToCartButton variantId={selectedVariant.id} />
New Contributors
- @ThomasAndrewMacLean made their first contribution in Shopify/hydrogen#232
- @scottdixon made their first contribution in Shopify/hydrogen#226
- @rafaelstz made their first contribution in Shopify/hydrogen#218
- @maxshirshin made their first contribution in Shopify/hydrogen#265
Full Changelog: Shopify/hydrogen@v0.6.4...v0.7.0
v0.6.4
What's Changed
- chore: improve Stackblitz publishing flow by @jplhomer in Shopify/hydrogen#203
- fix(#201): normalize POSIX separators to support windows by @blittle in Shopify/hydrogen#204
- chore: request more repros in bug reports by @jplhomer in Shopify/hydrogen#210
- docs(readme): center title and add href to logo by @Eastonco in Shopify/hydrogen#197
- fix(dev): fix scroll to top on app first load by @sahilmob in Shopify/hydrogen#213
- chore: fix changelog by @blittle in Shopify/hydrogen#214
- fix: new lines in hydration response by @frandiox in Shopify/hydrogen#199
- fix: run Hydrogen middleware after Vite handles static assets by @frandiox in Shopify/hydrogen#198
New Contributors
- @Eastonco made their first contribution in Shopify/hydrogen#197
- @sahilmob made their first contribution in Shopify/hydrogen#213
Full Changelog: Shopify/hydrogen@v0.6.3...v0.6.4
v0.6.3
What's Changed
- fix: add trailing slash to user components glob by @frandiox in Shopify/hydrogen#196
Full Changelog: Shopify/hydrogen@v0.6.2...v0.6.3
v0.6.2
What's Changed
- chore: add note about dev preview by @jplhomer in Shopify/hydrogen#146
- fix: where react props can be null, yet still technically an "object" by @blittle in Shopify/hydrogen#152
- fix: changelog by @blittle in Shopify/hydrogen#154
- feat: Support explicit root in the CLI by @cartogram in Shopify/hydrogen#150
- fix: Don't generate docs without flag by @cartogram in Shopify/hydrogen#157
- fix: ESLint config fixes by @cartogram in Shopify/hydrogen#147
- feat: Pass instantiated Debug logger to cli command Env by @cartogram in Shopify/hydrogen#148
- feat: Lint changelogs for "Keep a changelog" semantics by @cartogram in Shopify/hydrogen#156
- [Hydrogen reference docs]: Specify
/hydrogen
repo in comments by @mcvinci in Shopify/hydrogen#165 - fix: delay writing error response until headers are set by @frandiox in Shopify/hydrogen#144
- Fix client component imports and duplicated files/contexts in browser by @frandiox in Shopify/hydrogen#7
- chore: remove more logs that I missed by @jplhomer in https://github.com/Shopify/hydrogen/pull/159
- Remove
CartProvider
from theBuyNowButton
by @cathryngriffiths in Shopify/hydrogen#151 - feat: Adds tophat script by @cartogram in Shopify/hydrogen#153
- fix: hide CLI docs for shopify.dev by @cartogram in Shopify/hydrogen#174
- chore: tell linter to ignore auto-gen types file which is super noisy by @jplhomer in Shopify/hydrogen#180
- fix: eliminate use of client component re-exports by @jplhomer in Shopify/hydrogen#181
- [Starter] Fix Safari Product Image Gallery by @benwolfram in Shopify/hydrogen#162
- feat: bump Vite deps to latest version by @jplhomer in Shopify/hydrogen#191
- [Hydrogren reference docs]: Re-organize and refine React Server Component docs by @mcvinci in Shopify/hydrogen#193
- fix: should not use switch outside a router by @frandiox in Shopify/hydrogen#168
- [Hydrogen reference docs]: Regenerate docs by @mcvinci in Shopify/hydrogen#194
Full Changelog: Shopify/hydrogen@v0.6.1...v0.6.2
How to Upgrade Your Template
This release contains changes to the starter template that fix some general issues. If you already have a project created, follow these steps to upgrade:
- Move
Money
from server to client components. - Move
LocalizationProvider
fromApp.server.jsx
toLayout.server.jsx
. - Remove client component re-exports since these are no longer needed.
v0.6.1
What's Changed
- [Hydrogen reference docs]: Updates by @mcvinci in Shopify/hydrogen#137
- fix: LocalizationProvider in a Suspense boundary by @jplhomer in Shopify/hydrogen#145
- fix: optimize
@headlessui/react
by @frandiox
Full Changelog: Shopify/hydrogen@v0.6.0...v0.6.1
v0.6.0
Introducing Hydrogen: our new React-based web development framework to build custom storefronts powered by Shopify
HELLO_HYDROGEN.mp4
Create innovative shopping experiences bringing the best out of the intersection between commerce, UX, and dev experience.
At Shopify Unite 2021, we shared a preview of Hydrogen. Today, the developer preview of Hydrogen is available. We’d love for you to try it out and help make it better by giving us your feedback.
⚡ Experiment on StackBlitz: https://hydrogen.new
🚀 Explore Hydrogen and start building with us today: https://shopify.dev/custom-storefronts/hydrogen
🎁 Give us the gift of feedback.
📍 Check out Hydrogen examples on Github.
New Contributors
- @cartogram made their first contribution in Shopify/hydrogen#8
- @frandiox made their first contribution in Shopify/hydrogen#10
- @cathryngriffiths made their first contribution in Shopify/hydrogen#33
- @mcvinci made their first contribution in Shopify/hydrogen#103
- @travispamaral made their first contribution in Shopify/hydrogen#104
- @blittle made their first contribution in Shopify/hydrogen#108
- @jplhomer made their first contribution in Shopify/hydrogen#118
- @wizardlyhel made their first contribution in Shopify/hydrogen#112
- @mediumjones made their first contribution in Shopify/hydrogen#126
Full Changelog: https://github.com/Shopify/hydrogen/commits/v0.6.0