@xh/hoist 89.0.0 → 89.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +61 -5
  2. package/appcontainer/MessageModel.ts +11 -10
  3. package/appcontainer/README.md +6 -2
  4. package/build/types/appcontainer/MessageModel.d.ts +4 -1
  5. package/build/types/cmp/input/impl/LiveCommas.d.ts +21 -0
  6. package/build/types/core/XH.d.ts +7 -6
  7. package/build/types/core/model/HoistModel.d.ts +1 -0
  8. package/build/types/core/model/ManagedRefreshContextModel.d.ts +1 -0
  9. package/build/types/data/cube/View.d.ts +0 -2
  10. package/build/types/data/cube/impl/RowCache.d.ts +1 -1
  11. package/build/types/data/cube/row/BaseRow.d.ts +5 -0
  12. package/build/types/desktop/cmp/grid/editors/impl/InlineEditorModel.d.ts +6 -1
  13. package/build/types/desktop/cmp/input/NumberInput.d.ts +5 -2
  14. package/build/types/mobile/cmp/input/NumberInput.d.ts +5 -2
  15. package/build/types/test-support/agGrid.d.ts +2 -0
  16. package/build/types/test-support/hoistCore.d.ts +7 -1
  17. package/build/types/test-support/index.d.ts +1 -0
  18. package/build/types/test-support/jsonBlobs.d.ts +130 -0
  19. package/build/types/test-support/testApp.d.ts +5 -2
  20. package/cmp/grid/Grid.ts +1 -1
  21. package/cmp/grid/GridModel.ts +8 -3
  22. package/cmp/grid/columns/Column.ts +1 -1
  23. package/cmp/input/impl/LiveCommas.ts +59 -0
  24. package/core/XH.ts +7 -6
  25. package/core/model/HoistModel.ts +4 -2
  26. package/core/model/Hooks.ts +1 -0
  27. package/core/model/ManagedRefreshContextModel.ts +5 -1
  28. package/data/README.md +3 -2
  29. package/data/cube/View.ts +3 -9
  30. package/data/cube/impl/RowCache.ts +2 -2
  31. package/data/cube/row/BaseRow.ts +14 -1
  32. package/data/cube/row/ParentRow.ts +1 -1
  33. package/desktop/cmp/dash/canvas/impl/DashCanvasView.ts +49 -52
  34. package/desktop/cmp/grid/editors/BooleanEditor.ts +2 -1
  35. package/desktop/cmp/grid/editors/DateEditor.ts +4 -1
  36. package/desktop/cmp/grid/editors/SelectEditor.ts +4 -1
  37. package/desktop/cmp/grid/editors/impl/InlineEditorModel.ts +17 -5
  38. package/desktop/cmp/input/NumberInput.ts +51 -12
  39. package/desktop/cmp/input/Select.ts +25 -7
  40. package/docs/README.md +2 -0
  41. package/docs/companion-library-docs.md +205 -0
  42. package/docs/doc-registry.json +8 -0
  43. package/docs/lifecycle-app.md +17 -0
  44. package/docs/unit-testing.md +54 -3
  45. package/docs/upgrade-notes/v89-upgrade-notes.md +101 -2
  46. package/docs/version-compatibility.md +2 -1
  47. package/icon/README.md +4 -1
  48. package/mcp/README.md +79 -4
  49. package/mcp/cli/docs.ts +75 -30
  50. package/mcp/data/doc-id-resolver.ts +50 -9
  51. package/mcp/data/doc-registry.ts +462 -44
  52. package/mcp/data/doc-search.ts +25 -6
  53. package/mcp/formatters/docs.ts +136 -36
  54. package/mcp/instructions.ts +69 -0
  55. package/mcp/resources/docs.ts +10 -8
  56. package/mcp/server.ts +7 -13
  57. package/mcp/tools/docs.ts +64 -18
  58. package/mcp/util/paths.ts +85 -2
  59. package/mobile/cmp/input/NumberInput.ts +42 -4
  60. package/package.json +19 -19
  61. package/public/msal-redirect-bridge.min.js +1 -1
  62. package/svc/JsonBlobService.ts +7 -4
  63. package/test-support/agGrid.ts +12 -2
  64. package/test-support/hoistCore.ts +32 -5
  65. package/test-support/index.ts +1 -0
  66. package/test-support/jsonBlobs.ts +543 -0
  67. package/test-support/setup.ts +16 -6
  68. package/test-support/testApp.ts +36 -7
@@ -0,0 +1,205 @@
1
+ # Companion Library Docs
2
+
3
+ A companion library is an npm package that builds on Hoist. Examples are `@xh/hoist-chat-kit` and
4
+ a client firm's shared package of Hoist overrides and components. Such a library can serve its own
5
+ docs through the hoist-react MCP server and the `hoist-docs` CLI. It needs no MCP server or CLI of
6
+ its own.
7
+
8
+ The library declares a doc registry in its `package.json`. When an app installs the library, the
9
+ hoist-react tools find the registry and serve its docs next to Hoist's own. Agents search, list, and
10
+ read them with the same tools, and the server instructions tell agents that the library exists.
11
+
12
+ ## How It Works
13
+
14
+ 1. The tools find the app's `package.json`. See [Discovery](#discovery).
15
+ 2. They check the app package and each of its direct `dependencies` and `devDependencies` for a
16
+ `hoist.docRegistry` field.
17
+ 3. They load each declared registry and prefix its doc ids with the package name. For example,
18
+ `core/README.md` in `@acme/hoist-acme` becomes `@acme/hoist-acme/core/README.md`.
19
+ 4. They merge those docs into one search index with Hoist's docs.
20
+ 5. The MCP server lists each library in its instructions, with its version, description, index
21
+ doc, source location, and any [guidance](#agent-guidance) from its authors. `hoist-ping` and
22
+ `hoist-docs ping` list the same, plus any load problems.
23
+
24
+ Hoist's own doc ids do not change. Short ids such as `core`, `grid`, and `index` always mean Hoist
25
+ docs.
26
+
27
+ ## Opting In
28
+
29
+ 1. Write the docs as markdown files in the package: package READMEs, concept docs, or both. Use
30
+ `##` and `###` headings. Search ranks and returns docs by section.
31
+ 2. Add a registry file, for example `docs/doc-registry.json`. See
32
+ [Registry Format](#registry-format).
33
+ 3. Declare the registry in `package.json`:
34
+
35
+ ```json
36
+ {
37
+ "name": "@acme/hoist-acme",
38
+ "description": "Acme overrides and components for Hoist apps.",
39
+ "hoist": {"docRegistry": "docs/doc-registry.json"}
40
+ }
41
+ ```
42
+
43
+ 4. Publish the docs. Add the registry and every doc file to the `files` field in `package.json`,
44
+ if the package uses one.
45
+ 5. Install the package in an app and run `npx hoist-docs ping` from the app's `client-app/`
46
+ folder. The output names the library and its doc count, or the problem that stopped it from
47
+ loading.
48
+
49
+ The `description` in `package.json` appears in the server instructions, so keep it to one short
50
+ sentence about what the library provides.
51
+
52
+ ## Registry Format
53
+
54
+ The registry uses the same JSON schema as hoist-react's
55
+ [`docs/doc-registry.json`](./doc-registry.json). Only `entries[].id` is required, so a small
56
+ library can start with this:
57
+
58
+ ```json
59
+ {
60
+ "entries": [
61
+ {"id": "docs/README.md", "title": "Acme Index", "mcpCategory": "index"},
62
+ {
63
+ "id": "grid/README.md",
64
+ "title": "Acme Grids",
65
+ "description": "AcmeGrid, the firm-standard wrapper around Hoist's grid.",
66
+ "keywords": ["AcmeGrid", "AcmeGridModel", "GridModel", "export", "column presets"]
67
+ }
68
+ ]
69
+ }
70
+ ```
71
+
72
+ | Field | Required | Description |
73
+ |---|---|---|
74
+ | `entries[].id` | Yes | Doc path relative to the package root. The tools reject a path that leaves the package root. |
75
+ | `entries[].title` | No | Display title. Defaults to the id. |
76
+ | `entries[].description` | No | One sentence for list output and search ranking. |
77
+ | `entries[].keywords` | No | API names and topics. Terms here boost the doc in search. |
78
+ | `entries[].mcpCategory` | No | Category for filtering. Defaults to `package`. |
79
+ | `entries[].aliases` | No | Extra short names. The tools scope them under the package name. |
80
+ | `entries[].mcpAudience` | No | Set to `maintainers` to serve the doc only in the library's own repo. See [Maintainer Docs](#maintainer-docs). |
81
+ | `mcpCategories` | No | Category ids and titles. An undeclared category gets a title from its id. |
82
+ | `mcpInstructions` | No | Guidance for agents, as a string or an array of lines. See [Agent Guidance](#agent-guidance). |
83
+ | `viewerCategories`, `entries[].viewerCategory` | No | Ignored by the MCP tools. The Toolbox doc viewer uses them. |
84
+
85
+ Use the hoist-react categories where they fit: `package`, `concept`, `devops`, `conventions`, and
86
+ `index`. Give the index doc the id `docs/README.md`. The tools treat that path as the library
87
+ index.
88
+
89
+ ## Agent Guidance
90
+
91
+ A library can give agents short, direct guidance with `mcpInstructions` in its registry file. The
92
+ MCP server adds it to its instructions under the library's name, and the ping surfaces show it.
93
+ Agents read server instructions before they use any tool, so guidance reaches an agent that never
94
+ searches the docs.
95
+
96
+ Use guidance to say what the library changes about writing Hoist code. A client package of Hoist
97
+ overrides is the main case:
98
+
99
+ ```json
100
+ {
101
+ "mcpInstructions": [
102
+ "Use acmeGrid and AcmeGridModel instead of grid and GridModel in Acme apps.",
103
+ "Fetch through AcmeFetchService, which adds the Acme auth headers. Do not call XH.fetchService directly.",
104
+ "Read @acme/hoist-acme/docs/README.md before you build a new screen."
105
+ ],
106
+ "entries": []
107
+ }
108
+ ```
109
+
110
+ - **Keep it short.** The server cuts guidance longer than 1,500 characters and logs a warning.
111
+ Put the details in the docs, and point to them.
112
+ - **State rules, not features.** Name the Hoist API that the library replaces, and what to use
113
+ instead. The library description and index already say what the library provides.
114
+ - **Stay in scope.** The server tells agents that library guidance covers components and patterns
115
+ only, and that it never overrides the user.
116
+
117
+ The tools trim each line and drop blank lines. If the value is not a string or an array of
118
+ strings, the tools ignore it and log a warning.
119
+
120
+ ## Maintainer Docs
121
+
122
+ Some docs are for the people who work on the library, not for the apps that use it. A guide to
123
+ writing the library's docs is one example. In an app, such a doc only adds noise to search
124
+ results.
125
+
126
+ Mark the entry with `"mcpAudience": "maintainers"`. The tools then serve it only when the library
127
+ is the app root, as when an agent works in the library's own repo. An app that installs the
128
+ library never sees it. The entry stays in the registry for other readers, such as the Toolbox doc
129
+ viewer.
130
+
131
+ ```json
132
+ {"id": "docs/doc-conventions.md", "mcpCategory": "conventions", "mcpAudience": "maintainers"}
133
+ ```
134
+
135
+ ## Doc IDs
136
+
137
+ Each id is the package name plus the registry path. The resolver also accepts these forms:
138
+
139
+ | Input | Resolves to |
140
+ |---|---|
141
+ | `@acme/hoist-acme/grid/README.md` | The doc, by its full id |
142
+ | `@acme/hoist-acme/grid` | Same doc, without `/README.md` |
143
+ | `hoist-acme/grid` | Same doc, with the package name unscoped |
144
+ | `@acme/hoist-acme` or `hoist-acme` | The library index, `docs/README.md` |
145
+ | `@acme/hoist-acme/<alias>` | The doc that declares the alias |
146
+ | `grid` | Hoist's `cmp/grid/README.md`, never a companion doc |
147
+
148
+ The `hoist://docs/{+docId}` resource accepts the same ids, for example
149
+ `hoist://docs/@acme/hoist-acme/grid/README.md`.
150
+
151
+ Write links between your docs as ordinary relative links, such as `../grid/README.md`. The tools
152
+ rewrite each one when they serve the doc, so an agent that follows it stays in your package:
153
+
154
+ - A link to a doc the tools serve becomes its full id, such as `@acme/hoist-acme/grid/README.md`.
155
+ - A link to any other file in the package, such as source or a maintainer doc, becomes a file
156
+ path that the agent can open, such as `client-app/node_modules/@acme/hoist-acme/grid/AcmeGrid.ts`.
157
+ - Links that leave the package root, and links inside code, stay as written.
158
+
159
+ ## Writing Docs Agents Can Use
160
+
161
+ - **Lead the index with what changes.** A package of client overrides should say early which Hoist
162
+ components and patterns it replaces. For example: "Use `acmeGrid` instead of `grid` in Acme
163
+ apps."
164
+ - **Name APIs in keywords.** Agents search with API names. Put each class, config key, and function
165
+ that a doc covers in its `keywords`.
166
+ - **Put examples under specific headings.** A search result is one section, so a heading such as
167
+ "Export a grid to Excel" finds its reader better than "Usage".
168
+ - **Link to Hoist docs by topic.** Agents can read hoist-react docs with the same tools, so a
169
+ library doc need not repeat them.
170
+
171
+ ## Discovery
172
+
173
+ The tools start from the package that consumes `@xh/hoist`. They check these places in order:
174
+
175
+ 1. The `HOIST_MCP_APP_ROOT` environment variable, if set.
176
+ 2. The working directory and its `client-app/` folder, then the same pair in each parent folder.
177
+ The first `package.json` that is `@xh/hoist` or depends on it wins, so a run from inside an
178
+ app, such as from `client-app/src`, still finds the app.
179
+ 3. Otherwise, the first `package.json` in the working directory or its `client-app/` folder.
180
+
181
+ Claude Code starts the MCP server from the project root, so a standard Hoist app resolves to
182
+ `client-app/`. The app package itself can opt in too. An app can use this to serve its own docs to
183
+ the agents that work on it.
184
+
185
+ The tools find each dependency at `node_modules/<name>`, walking up from the app, as Node does.
186
+ They read only direct dependencies. A library that a companion library depends on must also be a
187
+ direct dependency of the app for its docs to load.
188
+
189
+ ## Limits
190
+
191
+ - **Docs only.** The symbol tools (`hoist-search-symbols`, `hoist-get-symbol`, and
192
+ `hoist-get-members`) cover `@xh/hoist` only. The server instructions tell agents to read a
193
+ companion library's docs and then its source for exact APIs.
194
+ - **Loaded at startup.** The MCP server reads the registries when it starts. Restart it after an
195
+ install changes a companion library.
196
+ - **Untrusted content.** Any opted-in dependency can add docs. The server instructions tell the
197
+ client to treat all doc content as data, not as instructions. Library guidance is the one
198
+ exception, and the instructions frame it as advice from the package authors.
199
+ - **Load problems are not fatal.** A missing registry, a missing doc file, or a bad path skips that
200
+ item, and the tools log a warning to stderr and report it in `hoist-ping` and `hoist-docs ping`.
201
+ A field of the wrong type falls back to its default. Only `entries` and `mcpCategories` warn when
202
+ they are not lists, so run `hoist-docs list` to check that titles and categories came through.
203
+
204
+ See the [MCP Server README](../mcp/README.md#companion-library-docs) for how the tools implement
205
+ this.
@@ -279,6 +279,14 @@
279
279
  "description": "Model Context Protocol server providing AI assistants with documentation search, TypeScript type exploration, and code generation prompts.",
280
280
  "keywords": ["MCP", "Model Context Protocol", "AI assistant", "Claude Code", "tools", "resources", "prompts", "search", "symbols", "documentation"]
281
281
  },
282
+ {
283
+ "id": "docs/companion-library-docs.md",
284
+ "title": "Companion Library Docs",
285
+ "mcpCategory": "devops",
286
+ "viewerCategory": "devops",
287
+ "description": "How a library that builds on Hoist, such as hoist-chat-kit or a client firm's shared package, serves its docs through the hoist-react MCP server and hoist-docs CLI.",
288
+ "keywords": ["companion library", "hoist.docRegistry", "docRegistry", "package.json", "client package", "overrides", "sidecar", "HOIST_MCP_APP_ROOT", "package-prefixed doc ids", "library docs"]
289
+ },
282
290
  {
283
291
  "id": "docs/lifecycle-app.md",
284
292
  "title": "Lifecycle: App Initialization",
@@ -210,6 +210,23 @@ Every entry point begins with `import '../Bootstrap'`. This `Bootstrap.ts` file
210
210
  This import must come first (or at least before `XH.renderApp()`) to ensure all registrations and
211
211
  type augmentations are in place before the framework initializes.
212
212
 
213
+ ### Import `@xh/hoist/core` First
214
+
215
+ Within `Bootstrap.ts`, import `@xh/hoist/core` before any other Hoist module, including app modules
216
+ that import Hoist themselves. Hoist's packages import each other in cycles that resolve only when
217
+ `core` loads first. If another package loads first - `@xh/hoist/icon` via an app's icon
218
+ registrations, for example - the app crashes at startup with an error such as
219
+ `TypeError: span is not a function`. Typecheck, lint and app-level cycle checks do not catch this,
220
+ because the cycles are inside Hoist.
221
+
222
+ ```typescript
223
+ // Bootstrap.ts
224
+ import {XH} from '@xh/hoist/core'; // First Hoist import
225
+ import {installAgGrid} from '@xh/hoist/kit/ag-grid';
226
+ // ...
227
+ import './core/Icons'; // App modules that import Hoist come after core
228
+ ```
229
+
213
230
  ## Key Source Files
214
231
 
215
232
  | File | Contents |
@@ -59,7 +59,8 @@ Most of Hoist depends on the hoist-core server. `Store` reads a soft config, `Gr
59
59
  to user prefs, and nearly every service loads data on init. Tests therefore need a server.
60
60
 
61
61
  `test-support/hoistCore.ts` provides one. It is a small, in-memory stand-in for hoist-core's
62
- `XhController` endpoints: auth status, environment, configs, prefs, and activity tracking. It
62
+ `XhController` endpoints: auth status, environment, configs, prefs, activity tracking, and
63
+ JsonBlobs. It also serves the `XhViewController` endpoints that `ViewManagerModel` calls. It
63
64
  answers in the exact JSON shapes hoist-core renders, and names the server source of each shape.
64
65
  Hoist's real `fetch` calls reach it through [MSW](https://mswjs.io), so the code under test runs
65
66
  unchanged, from `FetchService` down.
@@ -176,6 +177,9 @@ describe('PrefService', () => {
176
177
  - A file boots once. To test a different boot outcome, such as access denied, use a separate spec
177
178
  file. `initTestAppAsync()` rejects, naming `XH.appState`, if boot stops before `RUNNING`. That
178
179
  includes `LOGIN_REQUIRED`, where an app with a login form waits for the user to sign in.
180
+ - `initTestAppAsync()` also rejects if boot triggers a problem that the kit's guards catch, such as
181
+ a request the fake does not handle. It waits for the requests that boot started, so none lands in
182
+ the first test's request log. It logs any error that the app handles during boot.
179
183
 
180
184
  Tests that do not touch services, such as `LocalDate` or filter tests, do not need to boot.
181
185
 
@@ -258,6 +262,26 @@ Write the test for the correct behavior. If the fix belongs in a separate change
258
262
  `it.fails()` and add a `// BUG:` comment that describes the problem. The suite stays green, and the
259
263
  test starts failing once the bug is fixed, as a reminder to remove the marker.
260
264
 
265
+ `it.fails()` cannot mark a promise that rejects with nothing to handle it, such as a load started
266
+ without an `await`. Vitest reports that rejection as an error of the whole run, not of a test, and
267
+ fails the run on purpose. Fix the code to await or catch the promise. If the fix must wait, filter
268
+ that one error with Vitest's [`onUnhandledError`](https://vitest.dev/config/onunhandlederror)
269
+ option. The filter applies to every spec, so match the error narrowly:
270
+
271
+ ```typescript
272
+ // vitest.config.mts
273
+ export default defineConfig(
274
+ mergeConfig(configureVitest({appCode: 'myApp'}), {
275
+ test: {
276
+ onUnhandledError(e) {
277
+ // BUG: OrderService.refreshAsync() leaves a rejection when the server is down.
278
+ if (e.message?.includes('Orders unavailable')) return false;
279
+ }
280
+ }
281
+ })
282
+ );
283
+ ```
284
+
261
285
  ### Desktop and mobile
262
286
 
263
287
  A module graph can load the desktop or the mobile platform, not both. `initTestAppAsync()` boots a
@@ -357,8 +381,35 @@ it('flags orders over the configured limit', () => {
357
381
  - A path can also be an absolute URL, for an external API the app calls.
358
382
  - A request that the fake does not serve fails the test, and the failure names the URL.
359
383
  - A file boots once, so test each role set or user in its own spec file.
360
- - The fake returns canned data. It does not enforce the server's business rules or role scoping.
361
- Test those against a real server.
384
+ - The fake returns canned data. It does not enforce the server's business rules or role scoping,
385
+ except for which JsonBlobs a user can read - see [Views and JsonBlobs](#views-and-jsonblobs).
386
+ Test those rules against a real server.
387
+
388
+ ### Views and JsonBlobs
389
+
390
+ The fake keeps an in-memory JsonBlob store, `hoistCore.jsonBlobs`. It serves `XH.jsonBlobService`
391
+ and the endpoints that `ViewManagerModel` calls. The store starts empty. An app model that creates a
392
+ view manager at boot therefore needs no setup: the view manager loads no views and selects its
393
+ in-code default. Seed views and the user's view state to test anything else:
394
+
395
+ ```typescript
396
+ const {jsonBlobs} = hoistCore;
397
+ jsonBlobs.addView({type: 'portfolioGrid', name: 'My Positions', value: {sortBy: 'pnl'}});
398
+ jsonBlobs.addView({type: 'portfolioGrid', name: 'Firm Standard', isGlobal: true, token: 'firm'});
399
+ jsonBlobs.addView({type: 'portfolioGrid', name: 'Risk', owner: 'bsmith', isShared: true});
400
+ jsonBlobs.setViewState('portfolioGrid', {currentView: 'firm', autoSave: true});
401
+ jsonBlobs.add({type: 'appNotes', name: 'notes', value: {text: 'Hello'}}); // a plain JsonBlob
402
+ ```
403
+
404
+ - `jsonBlobs.get(token)` returns the stored blob, so a test can assert on what the client saved.
405
+ Change the blob to model an edit made elsewhere, such as a later `lastUpdated`.
406
+ - `jsonBlobs.viewState(type)` returns the user's state for a view type, as the client receives it.
407
+ - Blobs last for the whole file, like prefs. `jsonBlobs.clear()` removes them all.
408
+ - A user reads only the blobs they own and the blobs shared with all users, as on the server. The
409
+ fake sends `manageGlobal` from `hoistCore.roles` and `jsonBlobs.globalWriteRoles`. Those roles
410
+ default to `HOIST_ADMIN`, as in hoist-core's `xhJsonBlobConfig`.
411
+ - The fake does not check write access or duplicate names. To test the error for one of those,
412
+ serve the endpoint with `hoistCore.route()` and `hoistError()`.
362
413
 
363
414
  ### Server state for every spec
364
415
 
@@ -20,7 +20,8 @@ the move to TypeScript 7 is strongly recommended.
20
20
  - **Icons added via `library.add()` (recommended)** - Register them with `Icon.register()` so
21
21
  `IconPicker` offers them - see Step 8.
22
22
  - **Grid rendering defaults (review)** - Column virtualisation is now on, and columns without a
23
- `renderer` render plain text with no wrapper span - see Step 9.
23
+ `renderer` render plain text with no wrapper span. React element values in those columns need a
24
+ `renderer` - see Step 9.
24
25
  - **Badge spacing (required if used)** - `Badge` no longer has a 5px left margin. Badges that
25
26
  follow text need a space or a container `gap` - see Step 10.
26
27
  - **Column Library config (required if used)** - `ColLibraryConfig.autoExpandOnFilter` is gone.
@@ -28,6 +29,10 @@ the move to TypeScript 7 is strongly recommended.
28
29
  - **App option presets (required if used)** - Desktop `themeAppOption()` and
29
30
  `sizingModeAppOption()` now render a `RadioCardInput`. Apps passing `SegmentedControl` props via
30
31
  `inputProps` should add `previewCards: false` - see Step 12.
32
+ - **`agOptions.groupDefaultExpanded` (required if used)** - `Grid` now ignores it. Set
33
+ `GridModel.expandLevel` instead - see Step 13.
34
+ - **`disableScrollOptimization` flag (required if used)** - `GridExperimentalFlags` no longer has
35
+ this flag. An app that sets it fails to compile - see Step 14.
31
36
 
32
37
  Apps can also stay on TypeScript 5.9. Hoist v89 type-checks under 5.9, 6, and 7, so the TypeScript
33
38
  move does not have to ship with the Hoist bump. We still recommend that you take both together.
@@ -371,8 +376,14 @@ the app renders. A registration runs when its module loads, so one left in a laz
371
376
  missing from `IconPicker` and from `Icon.get()` until that tab loads. Toolbox keeps its icons in
372
377
  `client-app/src/core/Icons.ts`.
373
378
 
379
+ Put that import below the import of `@xh/hoist/core` in `Bootstrap.ts`. Hoist's packages import each
380
+ other in cycles that resolve only when `core` loads first. If `@xh/hoist/icon` is the first Hoist
381
+ module to load, the app crashes at startup. Typecheck, lint and app-level cycle checks do not catch
382
+ this, because the cycles are inside Hoist. See
383
+ [Import `@xh/hoist/core` First](../lifecycle-app.md#import-xhhoistcore-first).
384
+
374
385
  ```typescript
375
- // client-app/src/core/Icons.ts - imported by Bootstrap.ts
386
+ // client-app/src/core/Icons.ts - imported by Bootstrap.ts, below @xh/hoist/core
376
387
  import {faGithub} from '@fortawesome/free-brands-svg-icons';
377
388
  import {faFaceFrown, faFaceSmile} from '@fortawesome/pro-regular-svg-icons';
378
389
  import {Icon} from '@xh/hoist/icon';
@@ -440,6 +451,44 @@ After:
440
451
  }
441
452
  ```
442
453
 
454
+ **Element values need a renderer.** ag-Grid writes a plain cell's value as text, so a React
455
+ element value now shows as `[object Object]`. The usual source is a `getValueFn` that calls a Hoist
456
+ formatter. `fmtNumber` and its variants return an element for options such as `label`, `ledger`,
457
+ `colorSpec` and `tooltip`. Have the `getValueFn` return the raw value, and format it in a
458
+ `renderer`. Sorting, filtering and export also read the raw value.
459
+
460
+ **Find affected columns:**
461
+
462
+ ```bash
463
+ grep -rn "getValueFn" client-app/src/
464
+ ```
465
+
466
+ Before:
467
+
468
+ ```typescript
469
+ {
470
+ field: 'elapsed',
471
+ getValueFn: ({record}) => {
472
+ const {startTime, endTime} = record.data;
473
+ if (!startTime || !endTime) return '-';
474
+ return fmtNumber((endTime - startTime) / 1000, {precision: 2, label: 's'});
475
+ }
476
+ }
477
+ ```
478
+
479
+ After:
480
+
481
+ ```typescript
482
+ {
483
+ field: 'elapsed',
484
+ getValueFn: ({record}) => {
485
+ const {startTime, endTime} = record.data;
486
+ return startTime && endTime ? (endTime - startTime) / 1000 : null;
487
+ },
488
+ renderer: numberRenderer({precision: 2, label: 's', nullDisplay: '-'})
489
+ }
490
+ ```
491
+
443
492
  ### 10. Space Badges from Preceding Text
444
493
 
445
494
  `Badge` now renders inline with no outer margin, like a badge in most component libraries. The old
@@ -520,6 +569,47 @@ After:
520
569
  themeAppOption({previewCards: false, inputProps: {outlined: true}})
521
570
  ```
522
571
 
572
+ ### 13. Replace `agOptions.groupDefaultExpanded` with `expandLevel`
573
+
574
+ `Grid` now opens group rows with ag-Grid's `isGroupOpenByDefault` callback, driven by
575
+ `GridModel.expandLevel`. ag-Grid checks that callback before `groupDefaultExpanded`, so a grid
576
+ that sets `groupDefaultExpanded` in `agOptions` now ignores it. Such a grid logs a console warning
577
+ and opens only one level, the default `expandLevel` for grouped grids.
578
+
579
+ **Find affected code:**
580
+
581
+ ```bash
582
+ grep -rn "groupDefaultExpanded" client-app/src/
583
+ ```
584
+
585
+ Move the value to `expandLevel` on the `GridModel`.
586
+
587
+ Before:
588
+
589
+ ```typescript
590
+ grid({agOptions: {groupDefaultExpanded: 2}})
591
+ ```
592
+
593
+ After:
594
+
595
+ ```typescript
596
+ new GridModel({groupBy: ['region', 'desk'], expandLevel: 2, ...})
597
+ ```
598
+
599
+ ### 14. Remove `GridExperimentalFlags.disableScrollOptimization`
600
+
601
+ The post-load row height pass this flag disabled now runs only for grids whose rows vary in height,
602
+ so the flag is gone. An app that still sets it fails to compile.
603
+
604
+ **Find affected code:**
605
+
606
+ ```bash
607
+ grep -rn "disableScrollOptimization" client-app/src/
608
+ ```
609
+
610
+ Remove the key from the grid's `experimental` config, and from any `xhGridExperimental` soft
611
+ config.
612
+
523
613
  ## Other Changes to Review
524
614
 
525
615
  These need no code change in most apps.
@@ -532,6 +622,14 @@ These need no code change in most apps.
532
622
  source position. Grids with no
533
623
  sort may show new rows in a different order. Set a sort, or set `maxPatchRatio: 0` in the
534
624
  store's `experimental` config to restore the old behavior.
625
+ - **Filters that read outside state need `refreshFilter()`.** A patched change re-tests only the
626
+ records it touches. A `FunctionFilter` that reads state other than the record, such as a model
627
+ property, no longer re-runs on the other records when data changes. Call
628
+ `store.refreshFilter()` when that state changes. v88 hid a missing call by re-filtering every
629
+ record on each change.
630
+ - **`PUT` requests default to a form-encoded body.** `FetchService` now labels every `PUT` without
631
+ an explicit `Content-Type` as `application/x-www-form-urlencoded`, as it does for `POST`. v88
632
+ sent `text/plain`. A `PUT` that sends a raw `body` should set its own `Content-Type`.
535
633
 
536
634
  ## Verification Checklist
537
635
 
@@ -553,6 +651,7 @@ After completing all steps:
553
651
  - [ ] No `columnLibrary` config sets `autoExpandOnFilter`.
554
652
  - [ ] The Options dialog shows theme and sizing choices as intended - cards, or a segmented
555
653
  control where `previewCards: false` is set.
654
+ - [ ] No grid sets `agOptions.groupDefaultExpanded`, and grouped grids open to the intended level.
556
655
 
557
656
  ## Reference
558
657
 
@@ -61,7 +61,7 @@ Verified against both hoist-react and hoist-core changelogs.
61
61
 
62
62
  | hoist-react | Min Core Required | Recommended Core | Max Core Tested | Notes | Upgrade |
63
63
  |---|---|---|---|---|---|
64
- | 89.0 | -- | 42.0 | 42.0 | No new server-side pairing requirements | [Notes](./upgrade-notes/v89-upgrade-notes.md) |
64
+ | 89.0 | -- | 42.0 | 43.0 | No new server-side pairing requirements | [Notes](./upgrade-notes/v89-upgrade-notes.md) |
65
65
  | 88.1 | -- | 42.0 | 42.0 | Use 88.1.2 or later - earlier 88 releases drop `MsalClient` defaults. `ViewManagerModel.manageGlobal` derived from server `globalWriteRoles` (42, degrades gracefully). TC39 decorators are client-only - requires hoist-dev-utils 16 | [Notes](./upgrade-notes/v88-upgrade-notes.md) |
66
66
  | 87.0 | 40.5.0 | 41.0 | 41.0 | `ViewManager` group rename + bulk edit (40.5); directory group names/search, tabbed config editor (41, degrade gracefully) | [Notes](./upgrade-notes/v87-upgrade-notes.md) |
67
67
  | 86.0 | -- | 40.0.1 | 40.0.1 | Client `MetricsService`, `Runner` API, remote-`traceparent` spans | [Notes](./upgrade-notes/v86-upgrade-notes.md) |
@@ -121,6 +121,7 @@ to find the minimum hoist-react version for a given core release.
121
121
 
122
122
  | hoist-core | Min hoist-react | Notes |
123
123
  |---|---|---|
124
+ | 43.0 | -- | Grails 8 / Spring Boot 4 / Java 21 server upgrade. No client-facing changes and no hoist-react bump. |
124
125
  | 42.0 | 88.0 recommended | `JsonBlobService` limits global blob writes to `xhJsonBlobConfig.globalWriteRoles` and reports `manageGlobal` on `xhView/allData`, consumed by v88's `ViewManagerModel`. Older hoist-react keeps its client-side `manageGlobal`, which the server now also enforces. No hard hoist-react bump. |
125
126
  | 41.0 | 87.0 recommended | Tabbed/typed config editor, directory group names + search endpoints - consumed by v87's Admin Console, which degrades gracefully without them. No hard hoist-react bump. |
126
127
  | 40.5 | 87.0 recommended | `ViewManager` group rename + bulk-editing endpoints consumed by v87 (which requires 40.5 as its floor). No hard hoist-react bump from 40.0. |
package/icon/README.md CHANGED
@@ -231,7 +231,10 @@ instead. Runtime installation matters when you replace a built-in (see below), b
231
231
  calls to that factory then render the app's icon.
232
232
 
233
233
  Registration is a one-time task at app startup. Import your `Icons.ts` from `Bootstrap.ts`, or any
234
- module that runs before the first render, so the factories exist before use.
234
+ module that runs before the first render, so the factories exist before use. Put that import below
235
+ the import of `@xh/hoist/core` - an app crashes at startup if `@xh/hoist/icon` is the first Hoist
236
+ module it loads. See
237
+ [Import `@xh/hoist/core` First](../docs/lifecycle-app.md#import-xhhoistcore-first).
235
238
 
236
239
  ### Registering Multiple Weights
237
240