Version 15 of Recipe changes some under-the-hood logic in an effort to make it easier to maintain Recipe and downstream apps. This includes removing snitches
, a wrapper of stitches
, added as a way to extract configuration by aggregating styles to the head of the application during runtime or inline for server-render.
With the decision in Version 14 to move away from stitches
, snitches
would have eventually been removed with it, however it turns out snitches
is incompatible with React 18 which adds stricter hydration errors, preventing both Recipe and downstream apps from upgrading.
Removing snitches
makes upgrading to React 18 possible, however it does require some additional configuration for apps using server-side rendering (see below).
This release is a major version release and as such, will require migration steps for applications that currently use Recipe Version 14.x or below.
The following changes are considered breaking changes:
With the removal of snitches
, if your app uses server-side rendering (SSR), extracted styles from stitches
will need to be inserted directly into the html of your app.
For example, if you're using Next.js, you might add the styles as follows:
import React from 'react';import NextDocument, {Html, Head, Main, NextScript} from 'next/document';import {stitches} from '@ezcater/recipe';export default class Document extends NextDocument {render() {return (<Html lang="en"><Head><style id="stitches" dangerouslySetInnerHTML={{__html: stitches.getCssText()}} /></Head><body><Main /><NextScript /></body></Html>);}}
The following deprecations have been removed:
EzIcon
size
properties xsmall
and xlarge
have been removed. Please use small
, medium
, large
, or inherit
.EzIcon
color
properties green
and white
have been removed. Please use common.green
or common.white
.EzCarousel has a new design that now includes page buttons on desktop viewports (>= 768px
) and horizontal scrolling on mobile viewports (< 768px
). The following breaking changes have occurred as a result:
title
is now a required prop.description
prop that is used for the aria-description
of the carousel for accessibility.EzCarousel no longer uses the slidesPerPage
prop. Instead, the number of slides or cards per page for desktop viewports depends on the size of the container as follows:
> 1024px
will show 4 cards per page650px
to 1023px
will show 3 cards per page< 650px
will show 2 cards per pageonPageChange
handler now only apply to desktop viewports that have previous and next buttons.peek
and gap
props are no longer used.You can update your Recipe installation using a package manager like npm or yarn.
npm install @ezcater/recipe@latest
or
yarn upgrade @ezcater/recipe@latest