Flight 5.11.0
For the 5.11.0 release we did a lot of housekeeping in the template. This means that a shop initialized at 5.11.0 have some differences to earlier shops. We've also introduced some new features and fix some bugs that also requires changes in the template.
New updated README.md
The old README.md contained a lot of information that was not relevant. Feel free to replace your README.md with this version
Fix cart tracking issues
In previous versions there's been some issues with sending multiple events when changing contents of the cart. This has been fixed in 5.11.0, but also requires a change in your CartFragment.gql
.
Add this field to your cart fragment:
fragment Cart on Cart {
__optimistic @client
// rest of your query
}
See cartFragment.gql
.
Load images eagerly
We've changed the default behaviour to load images eagerly in some cases, for improved page scores. This requires changes in a few different files: src/components/CategoryPage/ProductCard.js
, src/components/CategoryPage/ProductGrid.js
and/or src/components/CategoryPage/ProductGridWindow.js
. See this diff.
Multi product list support
Support for having multiple product lists has now been added and if you are
using a ProductListProvider
in your Shop.js
you need to do a few changes.
The easiest option is to simply copy the contents of the ProductList
folder
into your own project.
If you have a lot of customized code related to product lists, at least make
sure you are updating ProductLists.gql
(see
file)
to include the new queries and import and use them in productListQueries.js
(see
file):
import * as ProductListQueries from "./ProductLists.gql";
export const productListQueries = {
createList: ProductListQueries.CreateProductList, // New!
deleteList: ProductListQueries.DeleteProductList, // New!
all: ProductListQueries.ProductLists, // New!
query: ProductListQueries.ProductList,
productsQuery: ProductListQueries.ProductsFromProductList,
add: ProductListQueries.AddToProductList,
login: ProductListQueries.MergeProductLists,
update: ProductListQueries.UpdateProductListItem,
remove: ProductListQueries.RemoveFromProductList,
};
Variant selection bug fix
There was a bug in the template where a variant would not be selectable in some cases where there's a lot of variants. See this diff to fix this in your shop.
Restructuring
There's been some restructuring to make the template a bit cleaner. You don't have to implement these changes, but might want to do so.