sku 11.4.0 → 11.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # sku
2
2
 
3
+ ## 11.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Update deps ([#692](https://github.com/seek-oss/sku/pull/692))
8
+
9
+ ## 11.4.2
10
+
11
+ ### Patch Changes
12
+
13
+ - Allow `:` to be used in dynamic paths again. ([#687](https://github.com/seek-oss/sku/pull/687))
14
+
15
+ Previously, dynamic paths were declared using the standard `:param` syntax, but this had been deprecated in favour of `$param`.
16
+
17
+ This has now been updated to allow for both.
18
+ This should allow `sku serve` to work for projects using colon syntax.
19
+
20
+ ## 11.4.1
21
+
22
+ ### Patch Changes
23
+
24
+ - init: Refresh the next steps page ([#688](https://github.com/seek-oss/sku/pull/688))
25
+
26
+ Uplift the design (subjective) of the next steps page and add links to more useful content for fresh projects. Includes `Vocab` and slack channels for support and release announcements.
27
+
28
+ - React 18 support ([#688](https://github.com/seek-oss/sku/pull/688))
29
+
3
30
  ## 11.4.0
4
31
 
5
32
  ### Minor Changes
@@ -60,11 +60,11 @@ Example client entry
60
60
 
61
61
  ```js
62
62
  import React from 'react';
63
- import { hydrate } from 'react-dom';
63
+ import { hydrateRoot } from 'react-dom/client';
64
64
 
65
65
  import App from './App';
66
66
 
67
67
  export default () => {
68
- hydrate(<App />, document.getElementById('app'));
68
+ hydrateRoot(document.getElementById('app')!, <App />);
69
69
  };
70
70
  ```
@@ -37,7 +37,7 @@ module.exports = {
37
37
  // render.js
38
38
  import React from 'react';
39
39
  import { renderToString } from 'react-dom/server';
40
- import { StaticRouter } from 'react-router-dom';
40
+ import { StaticRouter } from 'react-router-dom/server';
41
41
 
42
42
  import App from './App';
43
43
 
@@ -45,7 +45,7 @@ export default {
45
45
  renderApp: ({ SkuProvider, route }) => {
46
46
  return renderToString(
47
47
  <SkuProvider>
48
- <StaticRouter location={route} context={{}}>
48
+ <StaticRouter location={route}>
49
49
  <App />
50
50
  </StaticRouter>
51
51
  </SkuProvider>,
@@ -73,17 +73,17 @@ export default {
73
73
  ```js
74
74
  // client.js
75
75
  import React from 'react';
76
- import { hydrate } from 'react-dom';
76
+ import { hydrateRoot } from 'react-dom/client';
77
77
  import { BrowserRouter } from 'react-router-dom';
78
78
 
79
79
  import App from './App';
80
80
 
81
81
  export default () => {
82
- hydrate(
82
+ hydrateRoot(
83
+ document.getElementById('app')!,
83
84
  <BrowserRouter>
84
85
  <App />
85
86
  </BrowserRouter>,
86
- document.getElementById('app'),
87
87
  );
88
88
  };
89
89
  ```
@@ -91,16 +91,16 @@ export default () => {
91
91
  ```js
92
92
  // App.js
93
93
  import React, { Fragment } from 'react';
94
- import { Route } from 'react-router-dom';
94
+ import { Routes, Route } from 'react-router-dom';
95
95
  import loadable from 'sku/@loadable/component';
96
96
 
97
97
  const Home = loadable(() => import('./handlers/Home'));
98
98
  const Details = loadable(() => import('./handlers/Details'));
99
99
 
100
100
  export default ({ site }) => (
101
- <Fragment>
102
- <Route path="/" exact component={Home} />
103
- <Route path="/details" exact component={Details} />
104
- </Fragment>
101
+ <Routes>
102
+ <Route path="/" element={<Home />} />
103
+ <Route path="/details" element={<Details />} />
104
+ </Routes>
105
105
  );
106
106
  ```
@@ -102,13 +102,13 @@ export default {
102
102
  ```js
103
103
  // client.js
104
104
  import React from 'react';
105
- import { hydrate } from 'react-dom';
105
+ import { hydrateRoot } from 'react-dom/client';
106
106
 
107
107
  import App from './App';
108
108
 
109
109
  // Pass the site variable from `provideClientContext` to the top level component
110
110
  export default ({ site }) =>
111
- hydrate(<App site={site} />, document.getElementById('app'));
111
+ hydrateRoot(document.getElementById('app')!, <App site={site} />);
112
112
  ```
113
113
 
114
114
  ### Loading the theme
@@ -117,15 +117,22 @@ Now the site is available in our `App` component, we use `BraidLoadableProvider`
117
117
 
118
118
  ```js
119
119
  // App.js
120
- import React from 'react';
120
+ import React, { ReactNode } from 'react';
121
+
122
+ import { BraidProvider } from 'braid-design-system';
123
+ import loadable from 'sku/@loadable/component';
121
124
 
122
- import { BraidLoadableProvider } from 'braid-design-system';
125
+ const BraidTheme = loadable.lib((props: { themeName }) =>
126
+ import(`braid-design-system/themes/${props.themeName}`),
127
+ );
123
128
 
124
129
  export default ({ site }) => {
125
- return (
126
- <BraidLoadableProvider themeName={site}>
127
- <MyPage />
128
- </BraidLoadableProvider>
129
- );
130
- };
130
+ <BraidTheme themeName={site}>
131
+ {({ default: theme }) => (
132
+ <BraidProvider theme={theme}>
133
+ <MyPage />
134
+ </BraidProvider>
135
+ )}
136
+ </BraidTheme>
137
+ );
131
138
  ```
@@ -145,16 +145,16 @@ Client entry
145
145
 
146
146
  ```js
147
147
  import React from 'react';
148
- import { hydrate } from 'react-dom';
148
+ import { hydrateRoot } from 'react-dom/client';
149
149
 
150
150
  import App from './App';
151
151
 
152
152
  export default ({ site, analyticsEnabled, appLength }) => {
153
153
  console.log('HTML source length', appLength);
154
154
 
155
- hydrate(
155
+ hydrateRoot(
156
+ document.getElementById('app')!,
156
157
  <App site={site} analytics={analyticsEnabled} />,
157
- document.getElementById('app'),
158
158
  );
159
159
  };
160
160
  ```
package/docs/package.json CHANGED
@@ -8,6 +8,6 @@
8
8
  "author": "SEEK",
9
9
  "license": "MIT",
10
10
  "devDependencies": {
11
- "docsify-cli": "^4.3.0"
11
+ "docsify-cli": "^4.4.4"
12
12
  }
13
13
  }