@servicetitan/docs-uikit 22.21.0 → 23.1.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.
@@ -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
@@ -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,19 @@ 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
+ Added <code>--code-coverage</code> option to <code>build</code> command
20
+ </Changes>
9
21
  <Changes forVersion="22.20.0">
10
22
  Added <code>--experimental-bundlers</code> option to <code>build</code> command
11
23
  </Changes>
@@ -20,13 +32,13 @@ import { VersionHistory, Changes } from '@site/src/components/version-history';
20
32
  </Changes>
21
33
  <Changes forVersion="v22.16.0">
22
34
  <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 an possible.
35
+ 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
36
  </Admonition>
25
37
  Added @servicetitan/testing-library to the <code>startup init</code> template
26
38
  </Changes>
27
39
  <Changes forVersion="v22.15.0">
28
40
  <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 an possible.
41
+ 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
42
  </Admonition>
31
43
  Runs all commands with 8GB of memory by default.
32
44
  </Changes>
@@ -75,8 +87,6 @@ import { VersionHistory, Changes } from '@site/src/components/version-history';
75
87
 
76
88
  </VersionHistory>
77
89
 
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
90
  ## Why use this package?
81
91
 
82
92
  #### Less to learn
@@ -121,6 +131,7 @@ Runs package in the development mode. Applications will be hosted on sequential
121
131
  - `--ignore <glob>` - Exclude packages with names matching the given glob.
122
132
  - `--esbuild` - Use [esbuild-loader](https://github.com/privatenumber/esbuild-loader) to process TypeScript files instead of ts-loader.
123
133
  - `--experimental-bundlers` - Use experimental build optimizations (alternative loaders and bundlers)
134
+ - `--code-coverage` - Add [instrumentation](https://github.com/JS-DevTools/coverage-istanbul-loader) to bundled code in order to collect code coverage
124
135
 
125
136
  ### build
126
137
 
@@ -134,6 +145,7 @@ Build packages for production to the `dist/bundle` folders. It bundles them in p
134
145
  - `--stat` - Generate bundle report with [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer). Starting `v22.3.0` works for [MFEs](/docs/frontend/micro-frontends) too.
135
146
  - `--esbuild` - Use [esbuild-loader](https://github.com/privatenumber/esbuild-loader) to process TypeScript files instead of ts-loader.
136
147
  - `--experimental-bundlers` - Use experimental build optimizations (alternative loaders and bundlers)
148
+ - `--code-coverage` - Add [instrumentation](https://github.com/JS-DevTools/coverage-istanbul-loader) to bundled code in order to collect code coverage
137
149
 
138
150
  ### test
139
151
 
@@ -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": "22.21.0",
3
+ "version": "23.1.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": "729b7ca4eb38c323ac538a73573cadd54a4ff839"
19
+ "gitHead": "7267270e54cdb3a2926f61feb4939d057e82adb3"
20
20
  }