@servicetitan/docs-uikit 31.3.2 → 31.4.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.
|
@@ -4,7 +4,7 @@ title: kendo-ui-license
|
|
|
4
4
|
|
|
5
5
|
Activates KendoReact components by installing the license key. The license key is only installed if the project depends on `@progress/kendo` components. Otherwise, this command has no effect.
|
|
6
6
|
|
|
7
|
-
**Note:** The [build](
|
|
7
|
+
**Note:** The [build](./build) command automatically detects when a project uses KendoRect components and runs this command.
|
|
8
8
|
|
|
9
9
|
Use it to install the license key separately from a build, or to override the default license key.
|
|
10
10
|
|
package/docs/startup/startup.mdx
CHANGED
|
@@ -279,7 +279,7 @@ Or you can use relative path to a file that exports an object with detailed conf
|
|
|
279
279
|
|
|
280
280
|
###### Web component config options
|
|
281
281
|
|
|
282
|
-
- `cli.web-component.branches` - Set git branch specific configs, used for publishing. See [Branch configs](#branch-configs).
|
|
282
|
+
- `cli.web-component.branches` - Set git branch specific configs, used for publishing. See [Branch configs](./mfe-publish#branch-configs).
|
|
283
283
|
- `cli.web-component.legacyRoot` - Set to opt-out of automatic batching. See [Opting-out of automatic batching](/docs/frontend/react-18#opting-out-of-automatic-batching).
|
|
284
284
|
|
|
285
285
|
See [MFE configuration](/docs/frontend/micro-frontends/#mfe-configuration) for detailed instructions on configuring MFE applications.
|
|
@@ -10,7 +10,7 @@ Use EventBus to exchange messages (aka events) between a host and MFEs, or betwe
|
|
|
10
10
|
### Providing EventBus
|
|
11
11
|
|
|
12
12
|
To use EventBus, provide an instance via `EVENT_BUS_TOKEN`.
|
|
13
|
-
[Loader](
|
|
13
|
+
[Loader](./loader) automatically passes the EventBus through to MFEs.
|
|
14
14
|
For example,
|
|
15
15
|
|
|
16
16
|
```tsx
|
|
@@ -458,32 +458,44 @@ It returns an `EVENT_BUS_TOKEN` that resolves to the specified type of EventBus.
|
|
|
458
458
|
|
|
459
459
|
#### Examples
|
|
460
460
|
|
|
461
|
-
This example declares
|
|
461
|
+
This example declares an `EventBus` that only
|
|
462
462
|
allows **"example:click"** and **"example:input"**, and that requires **"example:input"** to be sent with a string value.
|
|
463
463
|
|
|
464
|
-
|
|
464
|
+
```ts
|
|
465
|
+
import { useDependencies } from '@servicetitan/react-ioc';
|
|
466
|
+
import { EventBus } from '@servicetitan/web-components';
|
|
467
|
+
|
|
468
|
+
export interface CustomEvents {
|
|
469
|
+
'example:click': undefined;
|
|
470
|
+
'example:input': string;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
function Test() {
|
|
474
|
+
// eventBus is typed: emit() and on() allow only keys of CustomEvents and matching data
|
|
475
|
+
const [eventBus] = useDependencies<[EventBus<CustomEvents>]>(EVENT_BUS_TOKEN);
|
|
476
|
+
}
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
`typedEventBusToken` is a convenient shorthand that achieves the same result:
|
|
465
480
|
|
|
466
481
|
```ts
|
|
467
482
|
import { useDependencies } from '@servicetitan/react-ioc';
|
|
468
|
-
import {
|
|
483
|
+
import { typedEventBusToken } from '@servicetitan/web-components';
|
|
469
484
|
|
|
470
|
-
interface CustomEvents {
|
|
485
|
+
export interface CustomEvents {
|
|
471
486
|
'example:click': undefined;
|
|
472
487
|
'example:input': string;
|
|
473
488
|
}
|
|
474
489
|
|
|
475
|
-
const CUSTOM_EVENT_BUS_TOKEN = typedEventBusToken<CustomEvents>();
|
|
490
|
+
export const CUSTOM_EVENT_BUS_TOKEN = typedEventBusToken<CustomEvents>();
|
|
476
491
|
|
|
477
492
|
function Test() {
|
|
478
|
-
// eventBus is not typed: emit() and on() allow any events and data
|
|
479
|
-
const [eventBus] = useDependencies(EVENT_BUS_TOKEN);
|
|
480
|
-
|
|
481
493
|
/**
|
|
482
|
-
*
|
|
494
|
+
* eventBus is typed: emit() and on() allow only keys of CustomEvents and matching data
|
|
483
495
|
* Using CUSTOM_EVENT_BUS_TOKEN is equivalent to:
|
|
484
|
-
* useDependencies(EVENT_BUS_TOKEN
|
|
496
|
+
* useDependencies<[EventBus<CustomEvents>]>(EVENT_BUS_TOKEN)
|
|
485
497
|
*/
|
|
486
|
-
const [
|
|
498
|
+
const [eventBus] = useDependencies(CUSTOM_EVENT_BUS_TOKEN);
|
|
487
499
|
}
|
|
488
500
|
```
|
|
489
501
|
|
|
@@ -34,16 +34,16 @@ export const disconnectedCallback: HeadlessCallback = ({ eventBus }) => {
|
|
|
34
34
|
};
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
### `HeadlessCallback
|
|
37
|
+
### `HeadlessCallback`
|
|
38
38
|
|
|
39
|
-
The `HeadlessCallback<
|
|
39
|
+
The `HeadlessCallback<TMfeData = any, TEventBus extends EventBus = EventBus>` type is a function that receives an object with the below properties:
|
|
40
40
|
|
|
41
|
-
| Parameter | Type
|
|
42
|
-
| ------------ |
|
|
43
|
-
| `ldService` | `LDService`
|
|
44
|
-
| `logService` | `Log`
|
|
45
|
-
| `eventBus` | `
|
|
46
|
-
| `mfeData` | `Serializable<
|
|
41
|
+
| Parameter | Type | Description |
|
|
42
|
+
| ------------ | ------------------------ | --------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `ldService` | `LDService` | The [LaunchDarkly LDService instance](../launchdarkly-service#ldservice) passed from the Host. |
|
|
44
|
+
| `logService` | `Log` | The [Log instance](../log-service#log) passed from the Host. |
|
|
45
|
+
| `eventBus` | `TEventBus` | The [EventBus instance](./event-bus) passed from the Host, typed as `TEventBus`. |
|
|
46
|
+
| `mfeData` | `Serializable<TMfeData>` | The [data passed from the host into `HeadlessLoader`](#headless-loader-props), typed as `TMfeData`. |
|
|
47
47
|
|
|
48
48
|
## HeadlessLoader
|
|
49
49
|
|
|
@@ -59,9 +59,9 @@ export const Foo = () => {
|
|
|
59
59
|
|
|
60
60
|
### Props {#headless-loader-props}
|
|
61
61
|
|
|
62
|
-
| Name | Description
|
|
63
|
-
| :------------ |
|
|
64
|
-
| `src` | url for the MFE's package
|
|
65
|
-
| `fallbackSrc` | optional alternative url for the MFE's package (if request for src returns error)
|
|
62
|
+
| Name | Description |
|
|
63
|
+
| :------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
64
|
+
| `src` | url for the MFE's package |
|
|
65
|
+
| `fallbackSrc` | optional alternative url for the MFE's package (if request for src returns error) |
|
|
66
66
|
| `data` | additional data passed to an MFE as an object, where values are serializable, and preferably memoized ([see Loader](./loader#passing-data-from-host-to-mfe)) |
|
|
67
67
|
| `cache` | optional cache strategy for the MFE [(see Loader)](./loader#cache-strategy). Defaults to `-1`. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/docs-uikit",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.4.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": "21360511d426098c7231809ca33b13ecd11f16dd"
|
|
20
20
|
}
|