Published by seek-oss-ci about 4 years ago
Published by seek-oss-ci about 4 years ago
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:
export default
with anonymous functions.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
.
Published by seek-oss-ci over 4 years ago
cspEnabled
is set to true
(#525)Published by seek-oss-ci over 4 years ago
httpsDevServer
and define express middleware with a dev-middleware.js
file in the root of the SKU project. (#523)Published by seek-oss-ci over 4 years ago
paramType
via playoomParamType
config option. (#517)Published by seek-oss-ci over 4 years ago
Published by seek-oss-ci over 4 years ago
Published by seek-oss-ci over 4 years ago
Published by seek-oss-ci over 4 years ago
Published by seek-oss-ci over 4 years ago
Published by seek-oss-ci over 4 years ago
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 via babel-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.
Published by seek-oss-ci over 4 years ago
Add environment arg support to sku start
(#498)
sku start
defaults to using the first environment in your environments
array. You can now specify any environment via the --environment
argument, mimicking the sku serve
behaviour.
$ sku start --environment production
Published by seek-oss-ci over 4 years ago
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
Published by seek-oss-ci over 4 years ago
sku serve
(#490)Published by seek-oss-ci over 4 years ago
Add sku serve command (#487)
The sku serve
command adds the abilty to view the output of sku build
without deploying to an environment. This is helpful for:
sku build
only features)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 new sku serve
command. However, sku start
and sku 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.
Published by seek-oss-ci over 4 years ago
Published by seek-oss-ci over 4 years ago
Run eslint fix on init template (#482)
This ensures correct import ordering in the template.
Published by seek-oss-ci over 4 years ago
Remove deprecated react-treat re-exports from sku/treat
(#471)
BREAKING CHANGES
react-treat
APIs (useStyles
, TreatProvider
& useClassName
) can no longer be imported from sku/treat
MIGRATION GUIDE
Update all imports of useStyles
, TreatProvider
& useClassName
to sku/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. The react-hot-loader
dependency and react-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 use dangerouslySetWebpackConfig
to set the required react-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 to always
.
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. Running sku 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)