@servicetitan/docs-uikit 37.0.1 → 38.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,13 +3,31 @@ title: BREAKING CHANGES
3
3
  sidebar_position: 0
4
4
  ---
5
5
 
6
+ ## v38.0.0
7
+
8
+ ### [@servicetitan/ajax-handlers](./ajax-handlers)
9
+
10
+ - Canceled requests now reject with the cancelation error instead of returning a never-resolving promise.
11
+
12
+ Previously, canceling a request caused the promise to hang forever, silently swallowing errors but also blocking any downstream code from running (including loading-state resets). Now, cancelations reject like any other error.
13
+
14
+ :::warning
15
+ Any code that makes cancelable requests must guard against the cancelation error using `axios.isCancel`.
16
+ :::
17
+
18
+ See [Cancelation handling](./ajax-handlers/cancelation-handling) for the correct patterns, or use the `fix-cancelable-requests` skill to automatically find and fix affected call sites. Install it from the [uikit AI Marketplace](./ai-marketplace).
19
+
20
+ ### [@servicetitan/startup](./startup/)
21
+
22
+ Upgraded Prettier from 3.8.x to 3.9.x which includes formatting changes. Run `npx startup eslint --fix` to fix new lint errors.
23
+
6
24
  ## v37.0.0
7
25
 
8
26
  ### [@servicetitan/startup](./startup/)
9
27
 
10
- Upgraded TypeScript from 5.x to 6.x, which turns several deprecated `tsconfig` options into hard errors and changes compiler defaults that can surface as new errors in consumer projects.
28
+ - Upgraded TypeScript from 5.x to 6.x, which turns several deprecated `tsconfig` options into hard errors and changes compiler defaults that can surface as new errors in consumer projects.
11
29
 
12
- See the [TypeScript 6 upgrade guide](https://docs.st.dev/docs/frontend/upgrading-to-typescript-6) for the breaking changes and the `migrating-to-typescript-6` skill that automates the mechanical fixes.
30
+ See the [TypeScript 6 upgrade guide](https://docs.st.dev/docs/frontend/upgrading-to-typescript-6) for the breaking changes and the `migrating-to-typescript-6` skill that automates the mechanical fixes.
13
31
 
14
32
  ## v36.0.0
15
33
 
@@ -41,8 +59,8 @@ See the [TypeScript 6 upgrade guide](https://docs.st.dev/docs/frontend/upgrading
41
59
 
42
60
  ### [@servicetitan/startup](./startup/)
43
61
 
44
- Upgraded Jest from v29 to v30. The largest breaking change is that v30 drops [alias matchers](https://jestjs.io/docs/upgrading-to-jest30#jest-expect--matchers) that were deprecated since v26.
45
- For a complete list of breaking changes see the [Upgrade Guide](https://jestjs.io/docs/upgrading-to-jest30).
62
+ - Upgraded Jest from v29 to v30. The largest breaking change is that v30 drops [alias matchers](https://jestjs.io/docs/upgrading-to-jest30#jest-expect--matchers) that were deprecated since v26.
63
+ For a complete list of breaking changes see the [Upgrade Guide](https://jestjs.io/docs/upgrading-to-jest30).
46
64
 
47
65
  ## v32.0.0
48
66
 
@@ -91,6 +91,7 @@ Shared uikit skills for ServiceTitan repos.
91
91
  | :---------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------ |
92
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
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` |
94
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 |
95
96
  | `running-startup-commands` | Run tests, lint, and builds via the `startup` CLI in projects that depend on `@servicetitan/startup` |
96
97
  | `spell-check` | Check for spelling errors in code changes |
@@ -6,6 +6,10 @@ title: AJAX Handlers
6
6
 
7
7
  `@servicetitan/ajax-handlers` provides utilities for handling AJAX requests, authentication, and response processing in ServiceTitan applications. It includes automatic date parsing, authentication wrappers for protected resources, and comprehensive error handling.
8
8
 
9
+ :::caution
10
+ See [Cancelation handling](./cancelation-handling.mdx) for how to handle cancelable requests.
11
+ :::
12
+
9
13
  ## API
10
14
 
11
15
  - [withMicroservice](./with-microservice.mdx) - Use to wrap components and authenticate requests to protected resources with support for Bearer and Token Server authentication.
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: Cancelation handling
3
+ ---
4
+
5
+ When a request is canceled via `CancelToken` or `AbortController`, `initAjaxHandlers` rejects the promise with the cancelation error. Code that makes cancelable requests must handle this error to avoid unhandled promise rejections and spurious error UI.
6
+
7
+ Use `axios.isCancel` to distinguish cancelations from real errors:
8
+
9
+ ```ts
10
+ import axios from 'axios';
11
+
12
+ async loadData() {
13
+ this.cancelToken?.cancel();
14
+ this.cancelToken = axios.CancelToken.source();
15
+
16
+ try {
17
+ const res = await this.api.getData(this.cancelToken.token);
18
+ runInAction(() => { this.data = res.data; });
19
+ } catch (e) {
20
+ if (!axios.isCancel(e)) {
21
+ throw e;
22
+ }
23
+ }
24
+ }
25
+ ```
26
+
27
+ If loading state is set before the `await`, reset it in a `finally` block so it clears even when the request is canceled:
28
+
29
+ ```ts
30
+ this.isLoading = true;
31
+ try {
32
+ const res = await this.api.getData(this.cancelToken.token);
33
+ runInAction(() => {
34
+ this.data = res.data;
35
+ });
36
+ } catch (e) {
37
+ if (!axios.isCancel(e)) {
38
+ throw e;
39
+ }
40
+ } finally {
41
+ this.isLoading = false;
42
+ }
43
+ ```
@@ -139,7 +139,7 @@ A custom `build.outDir` is not honored for MFEs. Their bundles must reside in `d
139
139
  For advanced configuration, create `vite.dev.config.ts` (development) or `vite.prod.config.ts` (production) in the package root. Config files support full Vite `UserConfig` including `plugins`.
140
140
 
141
141
  :::tip
142
- Config files at the package root fall outside the main `tsconfig.json`, so they get no type checking on build or in CI. See [type checking root-level config files](./build#root-level-config-files) to enable it.
142
+ Config files at the package root fall outside the main `tsconfig.json`, so they get no type checking on build or in CI. See [type checking root-level config files](./build.mdx#root-level-config-files) to enable it.
143
143
  :::
144
144
 
145
145
  Import `defineConfig` from `@servicetitan/startup/vite` for type safety:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/docs-uikit",
3
- "version": "37.0.1",
3
+ "version": "38.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": "9a2e5579f88cf9895fd2948ce5d5810e976d20b0"
19
+ "gitHead": "a96a725030a0c422257567b1f06025bca8ca53b9"
20
20
  }