@servicetitan/docs-uikit 22.21.0 → 23.0.0
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/docs/eslint-config.mdx +13 -0
- package/docs/react-ioc.mdx +64 -0
- package/docs/startup.mdx +13 -4
- package/docs/web-components.mdx +8 -0
- package/package.json +2 -2
package/docs/eslint-config.mdx
CHANGED
|
@@ -2,8 +2,21 @@
|
|
|
2
2
|
title: ESLint & Stylelint configurations
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
+
import Admonition from '@theme/Admonition';
|
|
6
|
+
import { VersionHistory, Changes } from '@site/src/components/version-history';
|
|
7
|
+
|
|
5
8
|
`@servicetitan/eslint-config` and `@servicetitan/stylelint-config` packages contain core lint rule sets which should be used in ServiceTitan web projects.
|
|
6
9
|
|
|
10
|
+
<VersionHistory>
|
|
11
|
+
<Changes forVersion="23.0.0">
|
|
12
|
+
<Admonition type="caution">
|
|
13
|
+
Upgrades <code>@typescript-eslint/eslint-plugin</code> from version v5.x to v6. Because
|
|
14
|
+
every new major version of <code>typescript-eslint</code> includes improvements and
|
|
15
|
+
changes to existing rules, expect to see new lint errors in your project.
|
|
16
|
+
</Admonition>
|
|
17
|
+
</Changes>
|
|
18
|
+
</VersionHistory>
|
|
19
|
+
|
|
7
20
|
## Usage
|
|
8
21
|
|
|
9
22
|
### ESLint
|
package/docs/react-ioc.mdx
CHANGED
|
@@ -4,6 +4,28 @@ title: React IoC
|
|
|
4
4
|
|
|
5
5
|
`@servicetitan/react-ioc` is an implementation of [InversifyJS](https://github.com/inversify/InversifyJS) for react applications, it uses Context API of React 16 to manage containers.
|
|
6
6
|
|
|
7
|
+
import Admonition from '@theme/Admonition';
|
|
8
|
+
import { VersionHistory, Changes } from '@site/src/components/version-history';
|
|
9
|
+
|
|
10
|
+
<VersionHistory>
|
|
11
|
+
<Changes forVersion="v23.0.0">
|
|
12
|
+
<Admonition type="caution" title="Breaking changes">
|
|
13
|
+
<p>
|
|
14
|
+
Changed second argument of <code>provide</code> method to an object with
|
|
15
|
+
<code>loadingFallback</code> and <code>errorFallback</code> properties.
|
|
16
|
+
</p>
|
|
17
|
+
<p>
|
|
18
|
+
Renamed <code>fallback</code> property of the <code>Provider</code> component to{' '}
|
|
19
|
+
<code>loadingFallback</code> and added <code>errorFallback</code> property.
|
|
20
|
+
</p>
|
|
21
|
+
<p>
|
|
22
|
+
Removed ability to use <code>useValue</code> with <code>instances</code>.
|
|
23
|
+
</p>
|
|
24
|
+
</Admonition>
|
|
25
|
+
See <a href="https://github.com/servicetitan/uikit/releases/tag/v23.0.0">Release Notes</a>
|
|
26
|
+
</Changes>
|
|
27
|
+
</VersionHistory>
|
|
28
|
+
|
|
7
29
|
## Features
|
|
8
30
|
|
|
9
31
|
- Supports hierarchical Dependency Injection
|
|
@@ -159,3 +181,45 @@ const App = provide({ singletons: [{ provide: LOGGER_TOKEN, useClass: Logger }]
|
|
|
159
181
|
</ErrorBoundary>
|
|
160
182
|
));
|
|
161
183
|
```
|
|
184
|
+
|
|
185
|
+
#### Reusing a service
|
|
186
|
+
|
|
187
|
+
You can use the inherit option to reuse existing services that are already provided. In this case, service is only created if it is not already provided in a parent container.
|
|
188
|
+
|
|
189
|
+
```tsx
|
|
190
|
+
class SomeStore {}
|
|
191
|
+
|
|
192
|
+
class SomeOtherStore {}
|
|
193
|
+
|
|
194
|
+
const App = provide({
|
|
195
|
+
singletons: [
|
|
196
|
+
{ provide: SomeStore, useClass: SomeOtherStore, inherit: true },
|
|
197
|
+
{ provide: SomeOtherStore, inherit: true },
|
|
198
|
+
],
|
|
199
|
+
})(() => <div />);
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
#### Service initialization
|
|
203
|
+
|
|
204
|
+
If a service inherits from Store, react-ioc calls the optional `initialize` method before rendering content and calls `dispose` after unbind. Also, you can pass a loading fallback that will be rendered during initialization.
|
|
205
|
+
|
|
206
|
+
```tsx
|
|
207
|
+
import { Spinner } from '@servicetitan/design-system';
|
|
208
|
+
import { Store } from '@servicetitan/react-ioc';
|
|
209
|
+
|
|
210
|
+
class SomeStore extends Store {
|
|
211
|
+
constructor() {
|
|
212
|
+
super();
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
async initialize() {
|
|
216
|
+
// do some initialization
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
dispose() {
|
|
220
|
+
// implement disposal
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const App = provide({ singletons: [SomeStore] }, { loadingFallback: <Spinner /> })(() => <div />);
|
|
225
|
+
```
|
package/docs/startup.mdx
CHANGED
|
@@ -5,7 +5,18 @@ title: Startup
|
|
|
5
5
|
import Admonition from '@theme/Admonition';
|
|
6
6
|
import { VersionHistory, Changes } from '@site/src/components/version-history';
|
|
7
7
|
|
|
8
|
+
[@servicetitan/startup](https://github.com/servicetitan/uikit/tree/master/packages/startup) is a command-line interface (CLI) to create multi-package Lerna projects with the support of TypeScript Project References and React. It offers a modern build setup with no configuration.
|
|
9
|
+
|
|
8
10
|
<VersionHistory>
|
|
11
|
+
<Changes forVersion="23.0.0">
|
|
12
|
+
<Admonition type="caution">
|
|
13
|
+
Upgraded <code>Jest</code> from version v27.x to v29.
|
|
14
|
+
The largest breaking change is that v29 changed the default snapshot format.
|
|
15
|
+
To update old snapshots, run <code>npm run test -- --updateSnapshot</code>.
|
|
16
|
+
<br/>
|
|
17
|
+
See <a href="https://jest-archive-august-2023.netlify.app/docs/28.x/upgrading-to-jest28">Upgrading from v27 to v28</a> and <a href="https://jestjs.io/docs/upgrading-to-jest29">Upgrading from v28 to v29</a> for a list changes.
|
|
18
|
+
</Admonition>
|
|
19
|
+
</Changes>
|
|
9
20
|
<Changes forVersion="22.20.0">
|
|
10
21
|
Added <code>--experimental-bundlers</code> option to <code>build</code> command
|
|
11
22
|
</Changes>
|
|
@@ -20,13 +31,13 @@ import { VersionHistory, Changes } from '@site/src/components/version-history';
|
|
|
20
31
|
</Changes>
|
|
21
32
|
<Changes forVersion="v22.16.0">
|
|
22
33
|
<Admonition type="warning" title="Deprecated">
|
|
23
|
-
This version contains a critical bug that was introduced in v22.15.0 and fixed in v22.17.0. Update to v22.17.0 or later as soon
|
|
34
|
+
This version contains a critical bug that was introduced in v22.15.0 and fixed in v22.17.0. Update to v22.17.0 or later as soon as possible.
|
|
24
35
|
</Admonition>
|
|
25
36
|
Added @servicetitan/testing-library to the <code>startup init</code> template
|
|
26
37
|
</Changes>
|
|
27
38
|
<Changes forVersion="v22.15.0">
|
|
28
39
|
<Admonition type="warning" title="Deprecated">
|
|
29
|
-
This version contains a critical bug that was introduced in v22.15.0 and fixed in v22.17.0. Update to v22.17.0 or later as soon
|
|
40
|
+
This version contains a critical bug that was introduced in v22.15.0 and fixed in v22.17.0. Update to v22.17.0 or later as soon as possible.
|
|
30
41
|
</Admonition>
|
|
31
42
|
Runs all commands with 8GB of memory by default.
|
|
32
43
|
</Changes>
|
|
@@ -75,8 +86,6 @@ import { VersionHistory, Changes } from '@site/src/components/version-history';
|
|
|
75
86
|
|
|
76
87
|
</VersionHistory>
|
|
77
88
|
|
|
78
|
-
[@servicetitan/startup](https://github.com/servicetitan/uikit/tree/master/packages/startup) is a command-line interface (CLI) to create multi-package Lerna projects with the support of TypeScript Project References and React. It offers a modern build setup with no configuration.
|
|
79
|
-
|
|
80
89
|
## Why use this package?
|
|
81
90
|
|
|
82
91
|
#### Less to learn
|
package/docs/web-components.mdx
CHANGED
|
@@ -2,10 +2,18 @@
|
|
|
2
2
|
title: Web Components
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
+
import Admonition from '@theme/Admonition';
|
|
5
6
|
import { VersionHistory, Changes } from '@site/src/components/version-history';
|
|
6
7
|
|
|
7
8
|
<VersionHistory>
|
|
9
|
+
<Changes forVersion="v22.21.1">
|
|
10
|
+
Fixed a bug where the `Loader` component would error if an MFE's metadata.json contains a dependency of `web-components` with a version that is a semver range.
|
|
11
|
+
</Changes>
|
|
8
12
|
<Changes forVersion="v22.21.0">
|
|
13
|
+
<Admonition type="warning" title="Deprecated">
|
|
14
|
+
This version contains a critical bug that was introduced in v22.21.0 and fixed in v22.21.1. Update to v22.21.1 or later as soon as possible.
|
|
15
|
+
</Admonition>
|
|
16
|
+
Provided a more guaranteed check for an MFE's ability to re-render when passed MFE data changes.
|
|
9
17
|
Added context for MFEMetadata, which includes the shadowDom and portalShadowDom.
|
|
10
18
|
</Changes>
|
|
11
19
|
<Changes forVersion="v22.16.0">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/docs-uikit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"cli": {
|
|
17
17
|
"webpack": false
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "45876ed36415ad78d3ec4ef3783d6df1430504d3"
|
|
20
20
|
}
|