@xh/hoist 88.1.0 → 88.1.2

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.
package/CHANGELOG.md CHANGED
@@ -12,6 +12,31 @@
12
12
  3. Plain ASCII punctuation only. Use " - " for in-sentence breaks, never an em dash.
13
13
  -->
14
14
 
15
+ ## 88.1.2 - 2026-10-06
16
+
17
+ ### 🐞 Bug Fixes
18
+
19
+ * Restored the `MsalClient` defaults lost in v88: `enableSsoSilent` and `enableTelemetry` again
20
+ default to `true`, and MSAL logs at `Warning` level. Also restored the 3000ms
21
+ `system.iframeBridgeTimeout` that caps `ssoSilent` failures, dropped in the MSAL 5 upgrade.
22
+
23
+ ### 🤖 AI Docs + Tooling
24
+
25
+ * Fixed the v88 `codemod-remove-makeObservable.mjs` deleting constructors that merged defaults into
26
+ their `super()` call. It now removes only constructors it emptied itself, whose remaining
27
+ `super()` passes through the constructor's own params. The v88 upgrade notes gain a grep to find
28
+ constructors an earlier copy removed.
29
+
30
+ ## 88.1.1 - 2026-10-06
31
+
32
+ ### 🤖 AI Docs + Tooling
33
+
34
+ * Fixed the `@persist` ordering check in the v88 upgrade notes. It missed the stacked
35
+ `@persist.with({...})` form and flagged fields that were already in the correct order. The check
36
+ for removed `*Col` aliases now matches whole words only.
37
+ * Added a step to the v88 upgrade notes to restart the hoist-react MCP server after installing v88.
38
+ * The v88 codemods now print file paths relative to the working directory.
39
+
15
40
  ## 88.1.0 - 2026-10-01
16
41
 
17
42
  ### 🎁 New Features
@@ -55,7 +55,7 @@ export interface MsalClientConfig extends BaseOAuthClientConfig<MsalTokenSpec> {
55
55
  *
56
56
  * In practice, and according to documentation, this operation is likely to fail for a
57
57
  * number of reasons, and can often do so as timeout. Therefore, keeping the timeout limit
58
- * value -- `system.iframeHashTimeout` -- at a relatively low value is critical. Hoist
58
+ * value -- `system.iframeBridgeTimeout` -- at a relatively low value is critical. Hoist
59
59
  * defaults this value to 3000ms vs. the default 10000ms.
60
60
  */
61
61
  enableSsoSilent?: boolean;
@@ -105,6 +105,7 @@ export declare class MsalClient extends BaseOAuthClient<MsalClientConfig, MsalTo
105
105
  /** Enable telemetry via `enableTelemetry` ctor config, or via {@link enableTelemetry}. */
106
106
  telemetry: MsalClientTelemetry;
107
107
  private _telemetryCbHandle;
108
+ constructor(config: MsalClientConfig);
108
109
  protected doInitAsync(): Promise<TokenMap>;
109
110
  protected doLoginPopupAsync(): Promise<void>;
110
111
  protected doLoginRedirectAsync(): Promise<void>;
@@ -139,6 +139,6 @@ async function processFile(filePath) {
139
139
  formACount += localFormA;
140
140
  formBCount += localFormB;
141
141
  if (!DRY) await fs.writeFile(filePath, content);
142
- console.log(` ${path.relative(REPO_ROOT, filePath)} — form A=${localFormA}, form B=${localFormB}`);
142
+ console.log(` ${path.relative(process.cwd(), filePath)} — form A=${localFormA}, form B=${localFormB}`);
143
143
  }
144
144
  }
@@ -127,13 +127,13 @@ async function processFile(filePath) {
127
127
  `import {${names.join(', ')}} from '${m[2]}';` +
128
128
  content.slice(m.index + m[0].length);
129
129
  } else if (Object.values(RENAMES).some(to => new RegExp(`\\b${to}\\b`).test(content))) {
130
- console.log(` WARN no mobx import found to update: ${path.relative(REPO_ROOT, filePath)}`);
130
+ console.log(` WARN no mobx import found to update: ${path.relative(process.cwd(), filePath)}`);
131
131
  }
132
132
 
133
133
  filesChanged++;
134
134
  renameCount += localCount;
135
135
  if (!DRY) await fs.writeFile(filePath, content);
136
- console.log(` ${path.relative(REPO_ROOT, filePath)} — ${localCount} renamed`);
136
+ console.log(` ${path.relative(process.cwd(), filePath)} — ${localCount} renamed`);
137
137
  }
138
138
 
139
139
  /** Move names imported from 'mobx' onto '@xh/hoist/mobx', merging into an existing Hoist import. */
@@ -157,7 +157,7 @@ function redirectMobxImport(content, filePath) {
157
157
  if (kept.length) {
158
158
  console.log(
159
159
  ` WARN not re-exported by @xh/hoist/mobx, left on 'mobx': ${kept.join(', ')} ` +
160
- `(${path.relative(REPO_ROOT, filePath)})`
160
+ `(${path.relative(process.cwd(), filePath)})`
161
161
  );
162
162
  }
163
163
  if (!moved.length) {
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  /*
3
- * Phase 4 codemod — deletes every `makeObservable(this);` call, drops newly-empty constructors
4
- * (body contains only `super(...)` ± blank lines), and trims `makeObservable` from any import
5
- * that no longer references it.
3
+ * Phase 4 codemod — deletes every `makeObservable(this);` call, drops constructors that this
4
+ * emptied down to a one-line pass-through `super(...)` (args are the constructor's own params,
5
+ * bare or spread, ± blank lines), and trims `makeObservable` from any import that no longer
6
+ * references it.
6
7
  *
7
8
  * Scope: hoist-react .ts/.tsx.
8
9
  *
@@ -17,6 +18,7 @@ const SELF_DIR = path.dirname(fileURLToPath(import.meta.url));
17
18
  const REPO_ROOT = path.resolve(SELF_DIR, '../../..');
18
19
  const EXCLUDED_DIRS = new Set(['node_modules', 'build', '.git', '.idea', '.husky']);
19
20
  const EXCLUDED_PREFIXES = [];
21
+ const REMOVED_MARKER = '\u0000makeObservable-removed\u0000';
20
22
 
21
23
  const args = process.argv.slice(2);
22
24
  const DRY = args.includes('--dry');
@@ -66,30 +68,36 @@ async function processFile(filePath) {
66
68
  removedConstructors = 0,
67
69
  trimmedImports = 0;
68
70
 
69
- // 1) Remove lines that are only `makeObservable(this);` (plus optional whitespace).
71
+ // 1) Replace lines that are only `makeObservable(this);` (plus optional whitespace) with a
72
+ // marker so step 2 can tell which constructors this codemod emptied.
70
73
  const callLine = /^\s*makeObservable\(this\);?\s*$/;
71
- const kept = [];
72
- for (const line of lines) {
73
- if (callLine.test(line)) {
74
- removedCalls++;
75
- continue;
76
- }
77
- kept.push(line);
78
- }
79
- lines = kept;
74
+ lines = lines.map(line => {
75
+ if (!callLine.test(line)) return line;
76
+ removedCalls++;
77
+ return REMOVED_MARKER;
78
+ });
80
79
 
81
- // 2) Drop now-empty constructors. Match:
80
+ // 2) Drop constructors emptied by step 1. Match:
82
81
  // constructor(<anything until close-paren>) {
83
- // super(<args>);
82
+ // super(<args on one line>);
84
83
  // }
85
- // with optional blank lines in the body.
84
+ // with marker and blank lines anywhere in the body, then keep only pass-through supers whose
85
+ // args are the constructor's own params (bare or spread). Anything else stays.
86
86
  const text = lines.join('\n');
87
- const reEmptyCtor =
88
- /^([ \t]*)constructor\s*\([^)]*\)\s*\{\s*\n\s*super\s*\([^;]*\);\s*\n(?:\s*\n)*\s*\}\s*\n?/gm;
89
- const trimmedCtor = text.replace(reEmptyCtor, () => {
90
- removedConstructors++;
91
- return '';
92
- });
87
+ const filler = `(?:[ \\t]*(?:${REMOVED_MARKER})?[ \\t]*\\n)*`;
88
+ const reEmptyCtor = new RegExp(
89
+ `^([ \\t]*)constructor\\s*\\(([^)]*)\\)\\s*\\{[ \\t]*\\n${filler}[ \\t]*super\\s*\\(([^()\\n]*)\\);[ \\t]*\\n${filler}[ \\t]*\\}[ \\t]*\\n?`,
90
+ 'gm'
91
+ );
92
+ const trimmedCtor = text
93
+ .replace(reEmptyCtor, (match, indent, params, superArgs) => {
94
+ if (!match.includes(REMOVED_MARKER) || !isPassThrough(params, superArgs)) return match;
95
+ removedConstructors++;
96
+ return '';
97
+ })
98
+ .split('\n')
99
+ .filter(l => l !== REMOVED_MARKER)
100
+ .join('\n');
93
101
  lines = trimmedCtor.split('\n');
94
102
 
95
103
  // 3) Trim `makeObservable` from imports when no longer used in the file.
@@ -128,7 +136,41 @@ async function processFile(filePath) {
128
136
  importsTrimmed += trimmedImports;
129
137
  if (!DRY) await fs.writeFile(filePath, modified);
130
138
  console.log(
131
- ` ${path.relative(REPO_ROOT, filePath)} — calls=${removedCalls}, ctors=${removedConstructors}, imports=${trimmedImports}`
139
+ ` ${path.relative(process.cwd(), filePath)} — calls=${removedCalls}, ctors=${removedConstructors}, imports=${trimmedImports}`
132
140
  );
133
141
  }
134
142
  }
143
+
144
+ // True if every super arg is a bare identifier, or spread of one, naming a constructor param.
145
+ function isPassThrough(params, superArgs) {
146
+ const names = new Set(splitTopLevel(params).map(paramName).filter(Boolean));
147
+ return splitTopLevel(superArgs).every(a => {
148
+ const m = /^(?:\.\.\.)?([A-Za-z_$][\w$]*)$/.exec(a);
149
+ return m && names.has(m[1]);
150
+ });
151
+ }
152
+
153
+ // `config: Foo`, `private x = 1`, `...args: any[]`, `y?: Bar` -> config, x, args, y
154
+ function paramName(param) {
155
+ const m = /^(?:(?:public|private|protected|readonly|override)\s+)*(?:\.\.\.)?([A-Za-z_$][\w$]*)/.exec(
156
+ param
157
+ );
158
+ return m?.[1];
159
+ }
160
+
161
+ // Split on commas not nested inside brackets, trimming and dropping empties.
162
+ function splitTopLevel(str) {
163
+ const parts = [];
164
+ let depth = 0,
165
+ cur = '';
166
+ for (const ch of str) {
167
+ if ('([{<'.includes(ch)) depth++;
168
+ else if (')]}>'.includes(ch)) depth--;
169
+ if (ch === ',' && depth === 0) {
170
+ parts.push(cur);
171
+ cur = '';
172
+ } else cur += ch;
173
+ }
174
+ parts.push(cur);
175
+ return parts.map(s => s.trim()).filter(Boolean);
176
+ }
@@ -1,6 +1,9 @@
1
1
  # Hoist React v88 Upgrade Notes
2
2
 
3
- > **From:** v87.x → v88.0.0 | **Released:** 2026-09-28 | **Difficulty:** 🔴 HIGH
3
+ > **From:** v87.x → v88.1.2 | **Released:** 2026-09-28 | **Difficulty:** 🔴 HIGH
4
+ >
5
+ > **Target v88.1.2 or later.** It restores `MsalClient` defaults that 88.0 dropped and fixes a
6
+ > codemod that could delete constructors. Earlier 88 releases are not recommended.
4
7
 
5
8
  ## Overview
6
9
 
@@ -214,6 +217,11 @@ in-place upgrade can leave older copies of packages that Hoist now requires at a
214
217
  `@codemirror/state` and `@codemirror/view` in particular - and `tsc` then fails inside Hoist's
215
218
  `CodeInput` with conflicting types.
216
219
 
220
+ If an AI agent runs the upgrade with the hoist-react MCP server, restart the server now. In Claude
221
+ Code, reconnect with `/mcp` or restart the session. The server reads the installed `@xh/hoist`
222
+ version only when it starts, so until then it answers with v87 docs and types. The `hoist-docs`
223
+ and `hoist-ts` CLI tools read the installed version on each call and need no restart.
224
+
217
225
  See the [dev-utils migration guide](https://github.com/xh/hoist-dev-utils/blob/develop/README.md#migrating-from-v15-webpack)
218
226
  for the full option reference, and Toolbox's
219
227
  [`rsbuild.config.mjs`](https://github.com/xh/toolbox/blob/develop/client-app/rsbuild.config.mjs)
@@ -316,24 +324,48 @@ error, and leftover imports as unused-variable warnings. One known skip: a field
316
324
  decorator line is a call form with a trailing comment, such as
317
325
  `@persist.with({...}) // note`, gets no `accessor` - add it by hand.
318
326
 
327
+ **Check for lost constructors.** Versions of `codemod-remove-makeObservable.mjs` before 88.1.2
328
+ could delete a constructor that merged defaults into its `super()` call, such as
329
+ `super({...defaults, ...config})`, mistaking it for an empty pass-through. If you ran an earlier
330
+ copy, scan the diff for removed `super(` lines that took anything other than the constructor's own
331
+ params:
332
+
333
+ ```bash
334
+ git diff <pre-upgrade-ref> -- 'client-app/src/**/*.ts' 'client-app/src/**/*.tsx' | grep -A3 '^-\s*super('
335
+ ```
336
+
319
337
  **Audit `@persist` ordering by hand.** `@persist` must now come *after* the MobX decorator. The
320
338
  codemods do not reorder decorators, and a reversed pair fails silently: `PersistenceProvider`
321
339
  logs an error to the console and the field simply stops persisting, with no type error.
322
340
 
323
341
  ```bash
324
- grep -rn "@persist @bindable\|@persist @observable\|@persist$" client-app/src/
342
+ # Reversed on one line: `@persist @bindable ...`, `@persist.with({...}) @observable ...`
343
+ grep -rnE '@persist(\.with\(.*\))?\s+@(bindable|observable)' client-app/src/
344
+
345
+ # Reversed across lines: prints the MobX decorator line under a leading `@persist`
346
+ grep -rnE -A1 '^\s*@persist(\.with\(.*\))?\s*(//.*)?$' client-app/src/ | grep -E '^\S+-[0-9]+-\s*@(bindable|observable)'
325
347
  ```
326
348
 
349
+ The stacked form, with `@persist.with({...})` on its own line above `@bindable`, is easy to miss
350
+ in review. The second command finds it.
351
+
327
352
  Before:
328
353
 
329
354
  ```typescript
330
355
  @persist @bindable accessor showInactive = false;
356
+
357
+ @persist.with({path: 'gridState'})
358
+ @bindable accessor gridState = null;
331
359
  ```
332
360
 
333
361
  After:
334
362
 
335
363
  ```typescript
336
364
  @bindable @persist accessor showInactive = false;
365
+
366
+ @bindable
367
+ @persist.with({path: 'gridState'})
368
+ accessor gridState = null;
337
369
  ```
338
370
 
339
371
  **Audit enumeration of model instances.** `accessor` fields are prototype getter/setters, not own
@@ -457,7 +489,7 @@ All of these were deprecated in v86 or earlier. Search for each and replace as s
457
489
 
458
490
  ```bash
459
491
  grep -rn "withSpan\|mergePersistOptions\|PopoverFilterChooser\|LogSource" client-app/src/
460
- grep -rn "boolCheckCol\|numberCol\|fileExtCol\|dateCol\|timeCol\|dateTimeCol\|compactDateCol\|localDateCol" client-app/src/
492
+ grep -rnw "boolCheckCol\|numberCol\|fileExtCol\|dateCol\|timeCol\|dateTimeCol\|compactDateCol\|localDateCol" client-app/src/
461
493
  grep -rn -A4 "XH.fetch" client-app/src/ | grep "span:\|loadSpec:"
462
494
  ```
463
495
 
@@ -574,8 +606,8 @@ After completing all steps:
574
606
  - [ ] `pnpm lint` / `yarn lint` / `npm run lint` passes (or only pre-existing warnings remain)
575
607
  - [ ] `grep -rn "makeObservable\|experimentalDecorators" client-app/src client-app/tsconfig.json`
576
608
  returns nothing
577
- - [ ] `grep -rn "@persist @bindable\|@persist @observable\|@persist$" client-app/src/` returns
578
- nothing (`@persist` is last, including the stacked one-decorator-per-line form)
609
+ - [ ] Both `@persist` ordering greps from Step 4 return nothing (`@persist` comes after the MobX
610
+ decorator, on one line or stacked)
579
611
  - [ ] Dev server starts with `rsbuild dev`; production build succeeds and CI passes its version
580
612
  and build tag through `XH_APP_VERSION` / `XH_APP_BUILD`
581
613
  - [ ] Application loads without console errors, including no AG Grid theme-conflict warning
@@ -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
- | 88.0 | -- | 42.0 | 42.0 | `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) |
64
+ | 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) |
65
65
  | 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) |
66
66
  | 86.0 | -- | 40.0.1 | 40.0.1 | Client `MetricsService`, `Runner` API, remote-`traceparent` spans | [Notes](./upgrade-notes/v86-upgrade-notes.md) |
67
67
  | 85.0 | -- | 39.0 | 39.0 | Nested app-load spans, `InitContext`, name-based `sampleRules` | [Notes](./upgrade-notes/v85-upgrade-notes.md) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "88.1.0",
3
+ "version": "88.1.2",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -78,7 +78,7 @@ export interface MsalClientConfig extends BaseOAuthClientConfig<MsalTokenSpec> {
78
78
  *
79
79
  * In practice, and according to documentation, this operation is likely to fail for a
80
80
  * number of reasons, and can often do so as timeout. Therefore, keeping the timeout limit
81
- * value -- `system.iframeHashTimeout` -- at a relatively low value is critical. Hoist
81
+ * value -- `system.iframeBridgeTimeout` -- at a relatively low value is critical. Hoist
82
82
  * defaults this value to 3000ms vs. the default 10000ms.
83
83
  */
84
84
  enableSsoSilent?: boolean;
@@ -135,6 +135,17 @@ export class MsalClient extends BaseOAuthClient<MsalClientConfig, MsalTokenSpec>
135
135
  telemetry: MsalClientTelemetry = null;
136
136
  private _telemetryCbHandle: string = null;
137
137
 
138
+ constructor(config: MsalClientConfig) {
139
+ super({
140
+ initRefreshTokenExpirationOffsetSecs: -1,
141
+ msalLogLevel: LogLevel.Warning,
142
+ domainHint: null,
143
+ enableTelemetry: true,
144
+ enableSsoSilent: true,
145
+ ...config
146
+ });
147
+ }
148
+
138
149
  //-------------------------------------------
139
150
  // Implementations of core lifecycle methods
140
151
  //-------------------------------------------
@@ -403,7 +414,8 @@ export class MsalClient extends BaseOAuthClient<MsalClientConfig, MsalTokenSpec>
403
414
  loggerOptions: {
404
415
  loggerCallback: (level, message) => this.logFromMsal(level, message),
405
416
  logLevel: msalLogLevel
406
- }
417
+ },
418
+ iframeBridgeTimeout: 3000 // Prevent long pauses for sso failures.
407
419
  },
408
420
  cache: {
409
421
  cacheLocation: 'localStorage' // allows sharing auth info across tabs.