- Automatically detect compile packages with @seek scope (#541)
-
Playroom: Update to v0.22.0, add
playroomScope
option (#539)You can now use Playroom's new custom scope feature by providing a
playroomScope
file.EXAMPLE USAGE
sku.config.js:
module.exports = { playroomScope: './playroom/useScope.ts', };
useScope.ts:
import { useToast } from 'braid-design-system'; export default function useScope() { return { showToast: useToast(), }; }
-
Support site specific routes (#537)
Configured sites can now contain routes which are specific that site. This is useful for cross-brand applications that have different URLs.
// sku.config.js module.exports = { sites: [ { name: 'alpha', host: 'dev.alpha.com.au', routes: [ { route: '/', name: 'home' }, { route: '/details', name: 'details' }, ], }, { name: 'beta', host: 'dev.beta.com.au', routes: [ { route: '/home', name: 'home' }, { route: '/my-details', name: 'details' }, ], }, ], };
- Update to TypeScript 4 and ESLint 7 (#535)
- Allow force exiting build script (#533)
- Add tracking for CSS file types (#531)
- Add async render types (#529)
-
Add client side hot module reloading (#527)
Hot module reloading (HMR) is updating JS and CSS assets without requiring a full page refresh. This allows you to retain app state between code changes. This change introduces hot reloading to React components, treat files and CSS modules.
React fast-refresh
For fast-refresh to work there are a few gotchas to watch out. For components to succesfully hot reload, they must:
- Have a display name. Avoid using
export default
with anonymous functions. - The file must only export React components (excluding types as they are not runtime exports)
We're considering adding lint rules for these scenarios in future.
NOTE: React >16.9 is required for fast-refresh to work
In some cases a change cannot be hot reloaded, in these situations sku should fallback to performing a full page refresh. You should never need to manually refresh your browser.
If your app is not hot reloading when you would expect it to or you are being forced to manually refresh the page, please contact #sku-support.
You can disable HMR by setting
SKU_HOT=false
. - Have a display name. Avoid using
- Fix empty style tags in rendered HTML when
cspEnabled
is set totrue
(#525)
- Add ability to turn on HTTPS on the local development server with
httpsDevServer
and define express middleware with adev-middleware.js
file in the root of the SKU project. (#523)
- Playroom: Add passthrough support for
paramType
viaplayoomParamType
config option. (#517)
- Validate that there is only a single copy of react-treat (#514)
- Add contenthash to storybook/playroom assets in production mode (#512)
- Automatically identify Buildkite agents as CI (#510)
- Fix ReferenceError in compilePackages validation (#508)
- Only target internal images/svgs with loaders (#505)
-
Remove usage of
assert
in production (#503)If you use Node's
assert
library or its browser port, your assertions will now be automatically removed in production viababel-plugin-unassert
. This allows you to perform more expensive checks during development without worrying about the perfomance impacts on users.For example, let's assume you wrote the following code:
import React from 'react'; import assert from 'assert'; export const Rating = ({ rating }) => { assert(rating >= 0 && rating <= 5, 'Rating must be between 0 and 5'); return <div>...</div>; };
In production, the code above would be logically equivalent to this:
import React from 'react'; export const Rating = ({ rating }) => <div>...</div>;
-
Add Content Security Policy generation for the
script-src
directive (#502)See the Content Security Policy section of the sku docs for setup instructions.
-
Add environment arg support to
sku start
(#498)sku start
defaults to using the first environment in yourenvironments
array. You can now specify any environment via the--environment
argument, mimicking thesku serve
behaviour.$ sku start --environment production
-
Add support for
@seek/sku-telemetry
. (#495)To help improve sku, you should add this as a dev dependency:
$ yarn add --dev @seek/sku-telemetry
or
$ npm install --save-dev @seek/sku-telemetry
- Add missing dependency for
sku serve
(#490)
-
Add sku serve command (#487)
The
sku serve
command adds the abilty to view the output ofsku build
without deploying to an environment. This is helpful for:- Debugging production build only issues
- Running integration tests
- Viewing the app on legacy browsers (that require
sku build
only features) - Performance testing
Site/host routing works the same as
sku start
. However, you can set your preferred site via the--site
argument. e.g.sku serve --site seekAnz
. By default the first site is used.You can specify which environment you want to serve via the
--environment
argument. e.g.sku serve --environment production
. By default the first environment is used.Note:
sku serve
does not work for apps that use a different domain for their publicPath.
-
Introduce new dynamic route syntax (#487)
Dynamic routes should now be indicated by a
# sku character rather than
:`.Usage of
:
for dynamic routes is now deprecated and will not work with the newsku serve
command. However,sku start
andsku build
will continue to work.MIGRATION GUIDE
Update your routes in
sku.config.js
to use the new `# sku syntax.{ - routes: ['/job/:id'], + routes: ['/job/$id'], }
Warning: This will cause the affected routes to output a different folder structure. Make sure to update your web server route rules for the affected routes before releasing this change.
Please reach out to #sku-support if you have any questions.
-
Fix template formatting (#484)
This updates the template files to be in line with new linting rules
-
Fix memory leak in sku start (#486)
-
Run eslint fix on init template (#482)
This ensures correct import ordering in the template.
-
Remove deprecated react-treat re-exports from
sku/treat
(#471)BREAKING CHANGES
react-treat
APIs (useStyles
,TreatProvider
&useClassName
) can no longer be imported fromsku/treat
MIGRATION GUIDE
Update all imports of
useStyles
,TreatProvider
&useClassName
tosku/react-treat
.e.g.
-import { useStyles } from 'sku/treat'; +import { useStyles } from 'sku/react-treat';
-
Remove SSR react-hot-loader support (#472)
BREAKING CHANGE
Previously, sku featured partial setup for
react-hot-loader
v3 in SSR apps. It was not complete and still required tricky wiring code from the consumer app. Thereact-hot-loader
dependency andreact-hot-loader/patch
client entry has now been removed from sku.If you want to continue using
react-hot-loader
with sku, you'll need to usedangerouslySetWebpackConfig
to set the requiredreact-hot-loader
config. This approach is not recommended and will be very difficult to maintain.Note: We plan on looking into proper hot reload support (for static and SSR app) once the react fast-refresh project has a stable implementation for webpack.
-
Update minimum required node version to >=10.13.0 (#463)
BREAKING CHANGE
Node versions < 10.13.0 no longer supported.
-
Remove support for
.css.js
files (#470)BREAKING CHANGE
.css.js
(css-in-js-loader) files are no longer supported.MIGRATION GUIDE
Any existing
.css.js
files will need to be removed. Ideally, replace these styles with Braid components. If that's not possible you can re-create the styles using css-modules or treat files.Note: It is our understanding that there is very limited use of this feature. If you have many
.css.js
files in your project please contact #sku-support for help.
-
Update Prettier to v2 (#463)
MIGRATION GUIDE
Prettier update will require running
sku format
.The
arrowParens
option is now set toalways
.See Prettier 2.0.0 for more info on the changes.
-
Add import order linting (#477)
You can now optionally enable linting of import order by adding
orderImports: true
to your sku config. This rule supports auto-fix.WARNING
Changing import order can affect the behaviour of your application. After enabling
orderImports
, please ensure your app still works and looks as expected.Also, any existing comments (e.g.
@ts-ignore
) above imports will not be moved as part of the autofix. If your app has a lot of@ts-ignore
comments then please be very wary when applying this rule.
-
Update dependencies (#440)
See PR for more info.
-
Update all babel deps to 7.9+ (#471)
-
Update min typescript version to 3.8.3 (#471)
-
Update eslint-config-seek to v6 (#440)
MIGRATION GUIDE
Run
sku lint
to check if any new rules are breaking. Runningsku format
first will fix any auto-fixable rules. See the eslint-config-seek release notes for more info on changes. -
Improve error messages for incorrect client entries (#467)
-
Update
html-render-webpack-plugin
to v2 (#474)