Releases: seek-oss/sku
[email protected]
Minor Changes
-
Add experimental
renderToStringAsync
parameter inrenderApp
(#1050)The new
renderToStringAsync
method can be called instead of React DOM'srenderToString
. It is an asynchronous function, but once awaited should return the same result.This new function won't error when hitting suspended components during a static render, instead it'll wait for all suspended boundaries to resolve.
Note:
react-dom
is now an optional peer dependency for use in this function. All known uses of static rendering usereact-dom
and shouldn't need to make a change.The function is being provided to enable teams to trial the behaviour, but is not encouraged for production use.
-import { renderToString } from 'react-dom/server'; const skuRender: Render<RenderContext> = { - renderApp: ({ SkuProvider, environment }) => { + renderApp: async ({ SkuProvider, environment, renderToStringAsync }) => { - const appHtml = renderToString( + const appHtml = await renderToStringAsync( <SkuProvider> <App environment={environment as ClientContext['environment']} /> </SkuProvider>, ); return { appHtml, }; }, // ... };
This new feature is experimental, and is likely to change in implementation or may be removed completely.
Patch Changes
-
Disable
babel-loader
cache compression (#1060)sku
applications tend to transpile many modules and upload all cache files as a single compressed file. This makes compressing each individual cache file superfluous, so this feature has been disabled. -
Adds "Chrome" and "Edge" as fallback browser names for reusing existing tabs, improving compatibility with different Chromium browser versions which may use abbreviated browser names. (#1061)
[email protected]
[email protected]
[email protected]
[email protected]
Minor Changes
-
Widen support for reusing existing browser tab to more Chromium browsers. (#1036)
start
andstart-ssr
scripts would previously only reuse an existing tab in Google Chrome.
This change adds support for the following Chromium browsers:- Google Chrome,
- Google Chrome Canary,
- Microsoft Edge,
- Brave Browser,
- Vivaldi,
- Chromium,
- Arc.
A tab will be reused if:
- The OS is macOS,
- The user's default browser is a supported Chromium browser,
- The user has an existing tab open in a supported Chromium browser with the exact same URL.
If any of the above is not true, a new tab will be created in the user's default browser.
[email protected]
Patch Changes
- Fixes a bug preventing
.mdx
files from loading in Storybook when usingsku
'swebpackFinal
Storybook configuration (#1032)
[email protected]
Patch Changes
-
Fix incorrect path in ignore files when running
sku init
(#1028)sku generates ignore files (e.g.
.eslintignore
) for the project.
When ran as part ofsku init
, the current working directory (CWD) would sometimes be incorrect.
It should now give the same result assku configure
.This change includes a refactor to how the webpack target directory is set in ignore files.
[email protected]
Patch Changes
-
Replace
sku/config/jest
entrypoint withsku/jest-preset
(#1024)BREAKING CHANGE FOR CUSTOM JEST CONFIG:
This breaking change will only affect a very small number of projects that have a custom Jest configuration/wish to debug tests in their IDE, and it is intended to be a quick fix/improvement for a feature released in
[email protected]
. Therefore, it's not being released as a major version.The
sku/config/jest
entrypoint has been removed in favor of a newsku/jest-preset
entrypoint. Thesku/jest-preset
module is a better way to expose a jest preset, rather than a relative path (the previous implementation), as it works even ifsku
is hoisted to a parentnode_modules
directory.MIGRATION GUIDE:
// jest.config.js - const { preset } = require('sku/config/jest'); /** @type {import('jest').Config} */ module.exports = { // If you've already migrated to sku v13 - preset, // If you're still on sku v12.x - preset: 'sku/config/jest', + preset: 'sku', };
[email protected]
Patch Changes
- Add
pnpm-lock.yaml
to.prettierignore
and.eslintignore
(#1021)
[email protected]
Major Changes
-
Export jest preset path (#984)
BREAKING CHANGE:
The jest preset is now accessible via a relative path rather than pointing to a module. This may affect users that require a jest config for debugging tests in their IDE. See the testing documentation for more information.
MIGRATION GUIDE:
// jest.config.js + const { preset } = require('sku/config/jest'); /** @type {import('jest').Config} */ module.exports = { - preset: 'sku/config/jest', + preset, };
-
Update default supported browsers (#1000)
sku
applications and libraries now default to supporting more recent browser versions:Browser Oldest supported version Chrome 84 Edge 84 Safari 14.1 Firefox 63 Samsung Internet 14.0 BREAKING CHANGE:
Production builds will now contain code that may not be compatible with older browser versions. If your application still needs to support older browsers, you can configure a custom browserslist query via the [
supportedBrowsers
] configuration option in your sku config. -
Remove Storybook-related features from
sku
(#996)BREAKING CHANGE
All Storybook-related features have been removed from
sku
. Sku no longer installs Storybook dependencies, configures Storybook, provides Storybook CLI commands, or re-exports Storybook APIs. If you are using Storybook, you will need to install Storybook dependencies yourself. Seesku
's Storybook documentation for more information.MIGRATION GUIDE:
Update your
sku
configThe following
sku
configuration options have been removed:storybookAddons
storybookPort
storybookStoryStore
storybookTarget
Please remove these properties from your sku configuration file, but keep the values around for use later in the migration.
Update your ignore files
Sku no longer manages certain Storybook-related ignore file entries.
Runsku configure
to update your ignore files:pnpm exec sku configure
You will need to re-add your
storybookTarget
value (from the previous step) to your.prettierignore
,.eslintignore
, and.gitignore
files.Install Storybook dependencies
sku
was previously installing Storybook v7 dependencies for you. The first command below will install the latest (v8) Storybook dependencies.If you wish to stay on Storybook v7 for the time being, use the second command below.
NOTE: Consumers that still depend on the deprecated
storiesOf
API will need to stay on Storybook v7 until they migrate away from this API.# Storybook v8 pnpm install -D storybook @storybook/react @storybook/react-webpack5 @storybook/addon-webpack5-compiler-babel
# Storybook v7 pnpm install -D storybook@^7.6.17 @storybook/react@^7.6.17 @storybook/react-webpack5@^7.6.17
Configure Storybook
Sku no longer configures your Storybook main configuration file for you. To migrate to a minimal,
sku
-compatible Storybook configuration, first locate your.storybook/main.js
file.// .storybook/main.js - Old configuration /** THIS FILE IS GENERATED BY SKU, MANUAL CHANGES WILL BE DISCARDED **/ import storybookConfig from 'sku/config/storybook'; export default { ...storybookConfig };
Rename this file to
.storybook/main.ts
and replace its contents with the following, making adjustments as necessary for your project:// .storybook/main.ts - New configuration import { babel, webpackFinal } from 'sku/config/storybook'; import type { StorybookConfig } from '@storybook/react-webpack5'; export default { stories: ['../src/**/*.stories.tsx'], features: { // Required for Storybook v7 if using the `storiesOf` API. // If you set `storybookStoryStore: false` in your sku config, you will want this. storyStoreV7: false, }, framework: { name: '@storybook/react-webpack5', options: { builder: { fsCache: true, // For faster startup times after the first `storybook dev` }, }, }, addons: [ // Copy addons from your `storybookAddons` sku config here '@storybook/addon-webpack5-compiler-babel', // Required for Storybook >=8.0.0 ], babel, webpackFinal, } satisfies StorybookConfig;
See
sku
's Storybook documentation for more information on configuring Storybook.Update
package.json
scriptsThe
sku
CLI no longer provides thesku storybook
andsku build-storybook
commands. Please migrate to the official Storybook CLI:// package.json { "scripts": { - "storybook": "sku storybook", // Replace 8081 with your previously configured `storybookPort`, // if you configured one and wish to keep it + "storybook": "storybook dev --port 8081", - "build:storybook": "sku build-storybook" // Replace `dist-storybook` with your previously configured `storybookTarget`, // if you configured one and wish to keep it + "build:storybook": "storybook build --output-dir dist-storybook" } }
Update Storybook imports
sku
no longer re-exports Storybook APIs under thesku/@storybook/react
entrypoint. Please update your imports to use the official Storybook package:// MyComponent.stories.tsx -import type { Meta } from 'sku/@storybook/react'; +import type { Meta } from '@storybook/react';
-
Remove LESS style support (#1005)
BREAKING CHANGE:
LESS style support has been removed.
MIGRATION GUIDE:
Please migrate all styles defined in
.less
files to Vanilla Extract styles.*.less.d.ts
files are no longer git-ignored and should be deleted. Reach out in#sku-support
if you need help with this migration. -
Target
sku
's minimum supported node version when building the server entry (#1006)BREAKING CHANGE
When building the server entry, the output code was previously transpiled to be compatible with a relatively old version of Node.js. This change updates the version to mirror sku's minimum supported Node.js version (18.20.0 at time of writing). SSR users should ensure their server's Node.js runtime is up-to-date with the minimum supported version.
-
Drop support for Node.js versions below 18.20.0 (#986)
BREAKING CHANGE:
The minimum supported Node.js version is now 18.20.0. Consumers must upgrade to Node.js v18.20.0 or later.
-
Remove support for
orderImports
config option (#1014)BREAKING CHANGE:
orderImports
is now always enabled and has been removed from the configuration options.MIGRATION GUIDE
To reduce the number of changes when migrating to
sku
v13 you may choose to enableorderImports
and runsku format
before upgrading.Remove
orderImports
fromsku.config.ts
:// sku.config.ts import { type SkuConfig } from 'sku'; export default { - orderImports: false, - orderImports: true, } satisfies SkuConfig;
Then run
sku format
.Note: Changing import order can affect the behaviour of your application. After running
sku format
, please ensure your app still works and looks as expected. Additionally,@ts-ignore
comments above imports will not be moved as part of the autofix. These comments will need be moved manually. -
Remove support for the
env
config property (#980)BREAKING CHANGE:
Support for the
env
config property has been removed. This config property was deprecated in sku v7.0.0 in favour of theenvironments
property. Please see the sku v7 migration guide for more information. -
sourceMapsProd
is nowtrue
by default (#979)BREAKING CHANGE:
sourceMapsProd
is nowtrue
by default. To enable the previous behaviour, setsourceMapsProd: false
in your sku config:// sku.config.ts import type { SkuConfig } from 'sku'; export default { sourceMapsProd: false, } satisfies SkuConfig;
NOTE: Production source maps can increase memory usage during builds to the point where the Nod...