@servicetitan/docs-uikit 38.3.1 → 39.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.
@@ -3,6 +3,14 @@ title: BREAKING CHANGES
3
3
  sidebar_position: 0
4
4
  ---
5
5
 
6
+ ## v39.0.0
7
+
8
+ ### [@servicetitan/launchdarkly-service](./launchdarkly-service.mdx)
9
+
10
+ - `LDProvider`'s `context` prop is now required and no longer defaults to an anonymous user. Pass a real `LDContext`, or `null` to defer client initialization until one is available.
11
+
12
+ Previously, omitting `context` initialized the LaunchDarkly client with an anonymous user context. Now, omitting it is a type error. Pass `null` to defer initialization and rendering children until the context is available (for example, until after login).
13
+
6
14
  ## v38.0.0
7
15
 
8
16
  ### [@servicetitan/ajax-handlers](./ajax-handlers)
@@ -87,13 +87,14 @@ Shared uikit skills for ServiceTitan repos.
87
87
 
88
88
  #### Skills
89
89
 
90
- | Name | Description |
91
- | :---------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------ |
92
- | `check-shai-hulud` | Scan a developer machine for indicators of compromise from the 2026-05-19 Mini Shai-Hulud npm supply chain attack |
93
- | `check-supply-chain` | Scan a developer machine for signs of npm supply chain compromise; routes to wave-specific skills such as `check-shai-hulud` |
94
- | `fix-cancelable-requests` | Find and fix Axios call sites that don't handle cancellation errors, in repos that use `initAjaxHandlers` from `@servicetitan/ajax-handlers` |
95
- | `migrating-to-typescript-6` | Apply the mechanical TypeScript 6 fixes after upgrading to `@servicetitan/startup` >= 37.0.0, and report remaining type errors for manual resolution |
96
- | `running-startup-commands` | Run tests, lint, and builds via the `startup` CLI in projects that depend on `@servicetitan/startup` |
97
- | `spell-check` | Check for spelling errors in code changes |
98
- | `switching-to-pnpm` | Migrate a project from npm to pnpm (see [migration guide](/docs/frontend/switching-to-pnpm)) |
99
- | `updating-mfe-check-workflow` | Diagnose and fix `mfe-check-shared-dependencies` workflow failures after the FAR-1776 reusable-workflow rewrite (validates each `mfe-path`/`host-path`) |
90
+ | Name | Description |
91
+ | :------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
92
+ | `check-shai-hulud` | Scan a developer machine for indicators of compromise from the 2026-05-19 Mini Shai-Hulud npm supply chain attack |
93
+ | `check-supply-chain` | Scan a developer machine for signs of npm supply chain compromise; routes to wave-specific skills such as `check-shai-hulud` |
94
+ | `fix-cancelable-requests` | Find and fix Axios call sites that don't handle cancellation errors, in repos that use `initAjaxHandlers` from `@servicetitan/ajax-handlers` |
95
+ | `migrating-to-npm-trusted-publishing` | Migrate a GitHub Actions publish workflow to npm trusted publishing (OIDC), or troubleshoot OIDC publish failures (see [migration guide](/docs/frontend/npm#github-actions)) |
96
+ | `migrating-to-typescript-6` | Apply the mechanical TypeScript 6 fixes after upgrading to `@servicetitan/startup` >= 37.0.0, and report remaining type errors for manual resolution |
97
+ | `running-startup-commands` | Run tests, lint, and builds via the `startup` CLI in projects that depend on `@servicetitan/startup` |
98
+ | `spell-check` | Check for spelling errors in code changes |
99
+ | `switching-to-pnpm` | Migrate a project from npm to pnpm (see [migration guide](/docs/frontend/switching-to-pnpm)) |
100
+ | `updating-mfe-check-workflow` | Diagnose and fix `mfe-check-shared-dependencies` workflow failures after the FAR-1776 reusable-workflow rewrite (validates each `mfe-path`/`host-path`) |
@@ -34,12 +34,12 @@ and automatically [provides a store](#use-flags-in-mobx-store) that allows flag
34
34
 
35
35
  #### Props
36
36
 
37
- | Name | Type | Description |
38
- | :---------------------- | :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
39
- | `clientSideID` | `string` | The client-side ID that authorizes the client to connect to a particular LaunchDarkly project. The [getValueForEnvironment](./web-components/get-value-for-environment) helper provides a convenient way to map Monolith environments to the corresponding client-side ID. |
40
- | `projectName` | `string` | The name of the LaunchDarkly project, for logs and error messages. |
41
- | `context` | `object` | (Optional) Context for targeting rules. Defaults to anonymous user. Use LaunchDarkly's [`identify`](https://docs.launchdarkly.com/sdk/features/identify) method to change the context after initialization. |
42
- | `waitForInitialization` | `boolean` | (Optional) Whether or not to wait until flags values are available before rendering children. Defaults to `true`. |
37
+ | Name | Type | Description |
38
+ | :---------------------- | :----------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
39
+ | `clientSideID` | `string` | The client-side ID that authorizes the client to connect to a particular LaunchDarkly project. The [getValueForEnvironment](./web-components/get-value-for-environment) helper provides a convenient way to map Monolith environments to the corresponding client-side ID. |
40
+ | `projectName` | `string` | The name of the LaunchDarkly project, for logs and error messages. |
41
+ | `context` | `object` \| `null` | Context for targeting rules. Pass `null` to defer client initialization and rendering children until a real context is available (for example, before a user has logged in). Use LaunchDarkly's [`identify`](https://docs.launchdarkly.com/sdk/features/identify) method to change the context after initialization. |
42
+ | `waitForInitialization` | `boolean` | (Optional) Whether or not to wait until flags values are available before rendering children. Defaults to `true`. |
43
43
 
44
44
  To configure additional [`LDOptions`](https://launchdarkly.github.io/js-client-sdk/interfaces/LDOptions.html) (for example, inspectors that forward flag evaluations to Datadog RUM), pass them to [`LDServiceProvider`](#ldserviceprovider) at the host level. They apply to every nested `LDProvider`.
45
45
 
@@ -63,8 +63,17 @@ For example, to provide feature flags for the TitanAdvisor project, create a `Ti
63
63
  import { LDProvider } from '@servicetitan/launchdarkly-service';
64
64
  import { getValueForEnvironment } from '@servicetitan/web-components'
65
65
  import { FC, PropsWithChildren, useMemo } from 'react';
66
+ import { LDContext } from 'launchdarkly-js-client-sdk';
66
67
 
67
- export const TitanAdvisorLDProvider: FC<PropsWithChildren> = ({ children }) => {
68
+ interface TitanAdvisorLDProviderProps {
69
+ // Pass `null` until the current user is known (e.g. before login completes).
70
+ userId: string | null;
71
+ }
72
+
73
+ export const TitanAdvisorLDProvider: FC<PropsWithChildren<TitanAdvisorLDProviderProps>> = ({
74
+ children,
75
+ userId,
76
+ }) => {
68
77
  const clientSideID = useMemo(() => {
69
78
  return getValueForEnvironment({
70
79
  dev: '669fe6e5cc97eb103be7a620',
@@ -80,8 +89,10 @@ export const TitanAdvisorLDProvider: FC<PropsWithChildren> = ({ children }) => {
80
89
  return children;
81
90
  }
82
91
 
92
+ const context: LDContext | null = userId ? { kind: 'user', key: userId } : null;
93
+
83
94
  return (
84
- <LDProvider clientSideID={clientSideID} projectName="TitanAdvisor">
95
+ <LDProvider clientSideID={clientSideID} projectName="TitanAdvisor" context={context}>
85
96
  {children}
86
97
  </LDProvider>
87
98
  );
@@ -94,11 +105,14 @@ Then, to provide those flags globally to the entire TitanAdvisor MFE, wrap the M
94
105
  import { FC, StrictMode } from 'react';
95
106
 
96
107
  import { TitanAdvisorLDProvider } from './titan-advisor-ld-provider';
108
+ import { useCurrentUserId } from './use-current-user-id';
97
109
 
98
110
  export const App: FC = () => {
111
+ const userId = useCurrentUserId();
112
+
99
113
  return (
100
114
  <StrictMode>
101
- <TitanAdvisorLDProvider>
115
+ <TitanAdvisorLDProvider userId={userId}>
102
116
  {...}
103
117
  </TitanAdvisorLDProvider>
104
118
  </StrictMode>
@@ -114,8 +128,10 @@ const ComponentUnwrapped: FC<ComponentProps> = props => {};
114
128
 
115
129
  // Export wrapped Component
116
130
  export const Component: FC<ComponentProps> = props => {
131
+ const userId = useCurrentUserId();
132
+
117
133
  return (
118
- <TitanAdvisorLDProvider>
134
+ <TitanAdvisorLDProvider userId={userId}>
119
135
  <ComponentUnwrapped {...props} />
120
136
  </TitanAdvisorLDProvider>
121
137
  );
@@ -144,9 +160,9 @@ export const HostApp: FC = () => {
144
160
 
145
161
  #### Props
146
162
 
147
- | Name | Type | Description |
148
- | :------------ | :-------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
149
- | `application` | `LDApplication` | (Optional) Application and version details to provide to LaunchDarkly. |
163
+ | Name | Type | Description |
164
+ | :------------ | :------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
165
+ | `application` | `LDApplication` | (Optional) Application and version details to provide to LaunchDarkly. |
150
166
  | `options` | `Omit<LDOptions, 'application'>` | (Optional) Default [`LDOptions`](https://launchdarkly.github.io/js-client-sdk/interfaces/LDOptions.html) applied to every [`LDProvider`](#ldprovider) within the host. Set [`application`](#application) via the dedicated prop. |
151
167
 
152
168
  #### LDApplication
@@ -185,7 +201,7 @@ export interface LDService {
185
201
 
186
202
  export interface ClientConfig {
187
203
  clientSideID: string;
188
- context?: LDContext;
204
+ context: LDContext;
189
205
  options?: LDOptions;
190
206
  }
191
207
  ```
@@ -194,11 +210,11 @@ export interface ClientConfig {
194
210
 
195
211
  Returns an `LDClient` instance configured with the following parameters.
196
212
 
197
- | Name | Type | Description |
198
- | :------------- | :---------- | :------------------------------------------------------------------ |
199
- | `clientSideID` | `string` | The LaunchDarkly client-side ID. |
200
- | `context` | `object` | (Optional) Context for targeting rules. Defaults to anonymous user. |
201
- | `options` | `LDOptions` | (Optional) LaunchDarkly initialization options. |
213
+ | Name | Type | Description |
214
+ | :------------- | :---------- | :---------------------------------------------- |
215
+ | `clientSideID` | `string` | The LaunchDarkly client-side ID. |
216
+ | `context` | `object` | Context for targeting rules. |
217
+ | `options` | `LDOptions` | (Optional) LaunchDarkly initialization options. |
202
218
 
203
219
  #### application
204
220
 
@@ -291,8 +307,8 @@ import { createDatadogInspector } from '@servicetitan/launchdarkly-service/datad
291
307
 
292
308
  #### Options
293
309
 
294
- | Name | Type | Description |
295
- | :----- | :------- | :--------------------------------------------------------------------------------------------------- |
310
+ | Name | Type | Description |
311
+ | :----- | :------- | :---------------------------------------------------------------------------------------------------- |
296
312
  | `name` | `string` | (Optional) Inspector name reported in LaunchDarkly logs. Defaults to `datadog-feature-flag-tracking`. |
297
313
 
298
314
  #### Example
@@ -409,12 +425,9 @@ export interface FleetFlagSet {
409
425
  triStateFlag: 0 | 1 | 2; // flag has non-boolean value
410
426
  }
411
427
 
412
- export const FleetFlagKeys = createFlagKeys<FleetFlagSet>( // generates type-aware keys
413
- 'enablePermissions',
414
- 'enableBreadcrumbPage',
415
- 'enableAlertsRedesign',
416
- 'triStateFlag'
417
- );
428
+ export const FleetFlagKeys =
429
+ createFlagKeys<FleetFlagSet> // generates type-aware keys
430
+ ('enablePermissions', 'enableBreadcrumbPage', 'enableAlertsRedesign', 'triStateFlag');
418
431
  ```
419
432
 
420
433
  ```tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/docs-uikit",
3
- "version": "38.3.1",
3
+ "version": "39.0.0",
4
4
  "description": "Documentation content for Uikit packages published at docs.st.dev",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,5 +16,5 @@
16
16
  "cli": {
17
17
  "webpack": false
18
18
  },
19
- "gitHead": "8f7bec33cb159c5f00e9bb416475835dd2cbef15"
19
+ "gitHead": "9138e3fcda061941b89620b9004426f5c13a89ae"
20
20
  }