-
Notifications
You must be signed in to change notification settings - Fork 378
[ci] release 2023-04 #797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ci] release 2023-04 #797
Conversation
|
|
||
| ## 5.0.0 | ||
|
|
||
| ### Patch Changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a major change to 5.0.0 - should we describe why it is a major change, not a patch change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering also why this got bumped to a major. Seems the way peerDependencies are handled in changesets: https://github.com/changesets/changesets/blob/main/docs/decisions.md#the-versioning-of-peer-dependencies.
Although I'm wondering on evaluating the need of peer dependencies for cli-hydrogen. Originally were added for the virtual routes, but maybe they can be removed. @frandiox wdyt?
"peerDependencies": {
"@remix-run/react": "^1.15.0",
"@shopify/hydrogen-react": "^2023.1.8",
"@shopify/remix-oxygen": "^1.0.5"
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe @cartogram knows why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yeah, it's just for the virtual-routes. It looks like 2 of them can be made devDependencies because they are just used for types. However, @remix-run/react should probably be there since it's used for things like useLoaderData 🤔
However, better if we keep them as peerDependencies and somehow force the changeset to be minor. Is that possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could force the changeset to be minor.
Main thing is:
- Minor update to
cli-hydrogenmeans dependencies would not get notified that they need to update peer-dependencies if they have automatic minor updates. - Major update to
cli-hydrogenwould notify them.
frehner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also curious if the package-lock.json will be updated as part of this, and if so, will that have to be manually updated too?
| ### Patch Changes | ||
|
|
||
| - Updated dependencies [[`82b6af7`](https://github.com/Shopify/hydrogen/commit/82b6af71cafe1f88c24630178e61cd09e5a59f5e)]: | ||
| - @shopify/hydrogen-react@2024.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will have to be updated manually I assume?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah!
| @@ -1,5 +1,11 @@ | |||
| # @shopify/hydrogen-react | |||
|
|
|||
| ## 2024.0.0 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually updated, too?
packages/hydrogen-react/CHANGELOG.md
Outdated
|
|
||
| ### Major Changes | ||
|
|
||
| - Release 2023-04 by [@lordofthecactus](https://github.com/lordofthecactus) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have release notes / changes? Including info on breaking changes in our library and any significant changes in the SFAPI?
| { | ||
| "name": "@shopify/hydrogen-react", | ||
| "version": "2023.1.8", | ||
| "version": "2024.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually updated, too
| @@ -1,5 +1,16 @@ | |||
| # @shopify/hydrogen | |||
|
|
|||
| ## 2024.0.0 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually updated, too
| @@ -1 +1 @@ | |||
| export const LIB_VERSION = '2023.1.7'; | |||
| export const LIB_VERSION = '2024.0.0'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually updated, too
templates/demo-store/CHANGELOG.md
Outdated
| ### Patch Changes | ||
|
|
||
| - Updated dependencies [[`82b6af7`](https://github.com/Shopify/hydrogen/commit/82b6af71cafe1f88c24630178e61cd09e5a59f5e)]: | ||
| - @shopify/hydrogen@2024.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually updated, too
| "@shopify/cli-hydrogen": "^4.1.0", | ||
| "@shopify/hydrogen": "^2023.1.7", | ||
| "@shopify/cli-hydrogen": "^5.0.0", | ||
| "@shopify/hydrogen": "^2024.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually updated, too
| "@shopify/cli-hydrogen": "^4.1.0", | ||
| "@shopify/hydrogen": "^2023.1.7", | ||
| "@shopify/cli-hydrogen": "^5.0.0", | ||
| "@shopify/hydrogen": "^2024.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually updated, too
| "@shopify/cli-hydrogen": "^4.1.0", | ||
| "@shopify/hydrogen": "^2023.1.7", | ||
| "@shopify/cli-hydrogen": "^5.0.0", | ||
| "@shopify/hydrogen": "^2024.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually updated, too
3fa8aa0 to
fd647b8
Compare
fd647b8 to
c14dde6
Compare
|
Released with #754 since there were changes |
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 2023-04, this PR will be updated.
Releases
@shopify/hydrogen@2024.0.0
Major Changes
Releases 2023-04 (#797) by @github-actions
Adds a new
Imagecomponent, replacing the existing one. While your existing implementation won't break, propswidthsandloaderOptionsare now deprecated disregarded, with a newaspectRatioprop added. (#787) by @benjaminsehlMigrating to the new
ImageThe new
Imagecomponent is responsive by default, and requires less configuration to ensure the right image size is being rendered on all screen sizes.Before
After
Note that
widthsandloaderOptionshave now been deprecated, declaringwidthis no longer necessary, and we’ve added anaspectRatioprop:widthsis now calculated automatically based on a newsrcSetOptionsprop (see below for details).loaderOptionshas been removed in favour of declaringcropandsrcas props.widthandheightshould only be set as props if rendering a fixed image size, withwidthotherwise defaulting to100%, and the loader calculating each dynamically.aspectRatiois calculated automatically usingdata.widthanddata.height(if available) — but if you want to present an image with an aspect ratio other than what was uploaded, you can set using the formatInt/Int(e.g.3/2, see MDN docs for more info, note that you must use the fraction style of declaring aspect ratio, decimals are not supported); if you've set anaspectRatio, we will default the crop to becrop: center(in the example above we've specified this to useleftinstead).Examples
Basic Usage
This would use all default props, which if exhaustively declared would be the same as typing:
An alternative way to write this without using
datawould be to use thesrc,alt, andaspectRatioprops. For example:Assuming
datahad the following shape:{ "url": "https://cdn.shopify.com/s/files/1/0551/4566/0472/products/Main.jpg", "altText": "alt text", "width": "4000", "height": "4000" }All three above examples would result in the following HTML:
Fixed-size Images
When using images that are meant to be a fixed size, like showing a preview image of a product in the cart, instead of using
aspectRatio, you'll instead declarewidthandheightmanually with fixed values. For example:Instead of generating 15 images for a broad range of screen sizes,
Imagewill instead only generate 3, for various screen pixel densities (1x, 2x, and 3x). The above example would result in the following HTML:If you don't want to have a fixed aspect ratio, and instead respect whatever is returned from your query, the following syntax can also be used:
Which would result in the same HTML as above, however the generated URLs inside the
srcandsrcsetattributes would not haveheightorcropparameters appended to them, and the generatedaspect-ratioinstylewould be4000 / 4000(if using the samedatavalues as our original example).Custom Loaders
If your image isn't coming from the Storefront API, but you still want to take advantage of the
Imagecomponent, you can pass a customloaderprop, provided the CDN you're working with supports URL-based transformations.The
loaderis a function which expects aparamsargument of the following type:Here is an example of using
Imagewith a custom loader function:If your CDN happens to support the same semantics as Shopify (URL params of
width,height, andcrop) — the default loader will work a non-Shopifysrcattribute.An example output might look like:
https://mycdn.com/image.jpeg?width=100&height=100&crop=centerAdditional changes
Added the
srcSetOptionsprop used to create the image URLs used insrcset. It’s an object with the following keys and defaults:Added an export for
IMAGE_FRAGMENT, which can be imported from Hydrogen and used in any Storefront API query, which will fetch the required fields needed by the component.Added an export for
shopifyLoaderfor using Storefront API responses in conjunction with alternative frameworks that already have their ownImagecomponent, like Next.jsPatch Changes
82b6af7,361879e]:@shopify/hydrogen-react@2024.0.0
Major Changes
Releases 2023-04 (#797) by @github-actions
Adds a new
Imagecomponent, replacing the existing one. While your existing implementation won't break, propswidthsandloaderOptionsare now deprecated disregarded, with a newaspectRatioprop added. (#787) by @benjaminsehlMigrating to the new
ImageThe new
Imagecomponent is responsive by default, and requires less configuration to ensure the right image size is being rendered on all screen sizes.Before
After
Note that
widthsandloaderOptionshave now been deprecated, declaringwidthis no longer necessary, and we’ve added anaspectRatioprop:widthsis now calculated automatically based on a newsrcSetOptionsprop (see below for details).loaderOptionshas been removed in favour of declaringcropandsrcas props.widthandheightshould only be set as props if rendering a fixed image size, withwidthotherwise defaulting to100%, and the loader calculating each dynamically.aspectRatiois calculated automatically usingdata.widthanddata.height(if available) — but if you want to present an image with an aspect ratio other than what was uploaded, you can set using the formatInt/Int(e.g.3/2, see MDN docs for more info, note that you must use the fraction style of declaring aspect ratio, decimals are not supported); if you've set anaspectRatio, we will default the crop to becrop: center(in the example above we've specified this to useleftinstead).Examples
Basic Usage
This would use all default props, which if exhaustively declared would be the same as typing:
An alternative way to write this without using
datawould be to use thesrc,alt, andaspectRatioprops. For example:Assuming
datahad the following shape:{ "url": "https://cdn.shopify.com/s/files/1/0551/4566/0472/products/Main.jpg", "altText": "alt text", "width": "4000", "height": "4000" }All three above examples would result in the following HTML:
Fixed-size Images
When using images that are meant to be a fixed size, like showing a preview image of a product in the cart, instead of using
aspectRatio, you'll instead declarewidthandheightmanually with fixed values. For example:Instead of generating 15 images for a broad range of screen sizes,
Imagewill instead only generate 3, for various screen pixel densities (1x, 2x, and 3x). The above example would result in the following HTML:If you don't want to have a fixed aspect ratio, and instead respect whatever is returned from your query, the following syntax can also be used:
Which would result in the same HTML as above, however the generated URLs inside the
srcandsrcsetattributes would not haveheightorcropparameters appended to them, and the generatedaspect-ratioinstylewould be4000 / 4000(if using the samedatavalues as our original example).Custom Loaders
If your image isn't coming from the Storefront API, but you still want to take advantage of the
Imagecomponent, you can pass a customloaderprop, provided the CDN you're working with supports URL-based transformations.The
loaderis a function which expects aparamsargument of the following type:Here is an example of using
Imagewith a custom loader function:If your CDN happens to support the same semantics as Shopify (URL params of
width,height, andcrop) — the default loader will work a non-Shopifysrcattribute.An example output might look like:
https://mycdn.com/image.jpeg?width=100&height=100&crop=centerAdditional changes
Added the
srcSetOptionsprop used to create the image URLs used insrcset. It’s an object with the following keys and defaults:Added an export for
IMAGE_FRAGMENT, which can be imported from Hydrogen and used in any Storefront API query, which will fetch the required fields needed by the component.Added an export for
shopifyLoaderfor using Storefront API responses in conjunction with alternative frameworks that already have their ownImagecomponent, like Next.js@shopify/cli-hydrogen@5.0.0
Patch Changes
Fix the
check routescommand to match optional segments. (#774) by @frandioxUpdated dependencies [
82b6af7,361879e]:@shopify/create-hydrogen@4.1.1
Patch Changes
2039a4a]:demo-store@0.2.1
Patch Changes
2039a4a,82b6af7,361879e]: