@xh/hoist 89.2.0 → 89.3.1

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
@@ -11,6 +11,26 @@
11
11
  codebase, or with the symbol itself (`Foo.bar` now ...) when a living API changed behavior.
12
12
  3. Plain ASCII punctuation only. Use " - " for in-sentence breaks, never an em dash.
13
13
  -->
14
+
15
+ ## 89.3.1 - 2026-10-21
16
+
17
+ ### 🐞 Bug Fixes
18
+ * Fixed pinned columns scrolling out of view in the summary row of mobile grids during horizontal
19
+ scroll.
20
+
21
+ ## 89.3.0 - 2026-10-21
22
+
23
+ ### 🎁 New Features
24
+ * `fetchNdjson` streams are now aborted cleanly and fully via the `autoAbortKey` or if the reading
25
+ consumer closes the connection early.
26
+
27
+ ### 🐞 Bug Fixes
28
+ * Fixed a `FetchOptions.fetchOpts.signal` replacing `FetchService`'s own, which left `timeout` and
29
+ `autoAbortKey` unable to abort the request. The two signals are now joined, and an abort with a
30
+ custom reason reports as "Fetch Aborted".
31
+ * Fixed oversized pinned column zones in the desktop column chooser. They now fit their columns.
32
+
33
+
14
34
  ## 89.2.0 - 2026-10-20
15
35
 
16
36
  ### 🎁 New Features
@@ -177,8 +177,9 @@ export declare class FetchService extends HoistService {
177
177
  getInternStats(): PlainObject[];
178
178
  private static readonly defaultIdGenerator;
179
179
  /**
180
- * @param forStreaming - true when called by fetchNdjson, which applies its own span and
181
- * track across the full stream lifetime - suppresses both here.
180
+ * @param streamAborter - aborter for a stream, set by fetchNdjson. It applies its own span and
181
+ * track across the full stream lifetime - suppresses both here - and releases any
182
+ * autoAbortKey once the stream completes.
182
183
  */
183
184
  private fetchInternalAsync;
184
185
  private sendJsonInternalAsync;
@@ -187,6 +188,8 @@ export declare class FetchService extends HoistService {
187
188
  private withResolvedHeadersAsync;
188
189
  private shouldPropagateTrace;
189
190
  private managedFetchAsync;
191
+ private isAborted;
192
+ private releaseAutoAbortKey;
190
193
  private abortableFetchAsync;
191
194
  private parseJsonAsync;
192
195
  private safeResponseTextAsync;
@@ -15,14 +15,6 @@
15
15
  }
16
16
 
17
17
  .xh-mobile {
18
- // ag-grid adds these when the center viewport has overflow, so that the space taken by the scrollbar is consistent in
19
- // the top and bottom pinned-row divs. On mobile we do not render scrollbars for the center viewport, so force hiding
20
- // in the top and bottom pinned-row divs.
21
- .ag-grid-pinned-top-rows-container,
22
- .ag-grid-pinned-bottom-rows-container {
23
- overflow-y: hidden !important;
24
- }
25
-
26
18
  // Prevent the "bounce" overscroll effect for horizontal scrolling on mobile devices, as it
27
19
  // conflicts with the drag management in the Navigator.
28
20
  .ag-body-horizontal-scroll-viewport {
@@ -127,15 +127,12 @@
127
127
  height: fit-content;
128
128
  min-height: 40px;
129
129
 
130
+ // Shrink ag-grid's auto-height body floor (150px by default) to match our compact drop strip.
131
+ --ag-auto-height-min-body-height: 40px;
132
+
130
133
  // Match the unpinned bucket's reserved gutter, so action-column checkboxes share a right edge.
131
134
  padding-right: var(--xh-scrollbar-size-px);
132
135
 
133
- // Override ag-grid's own inline min-height on this viewport (set via JS layout) to match our
134
- // compact drop strip.
135
- .ag-layout-auto-height .ag-body-horizontal-scroll-viewport {
136
- min-height: 40px !important;
137
- }
138
-
139
136
  .ag-overlay-no-rows-wrapper {
140
137
  // ag-grid's inline centering padding-top is computed against a pre-layout (~0) auto-height
141
138
  // viewport, hiding the text until a resize recomputes it. Our strip is a fixed band anyway.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "89.2.0",
3
+ "version": "89.3.1",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -213,18 +213,23 @@ export class FetchService extends HoistService {
213
213
  // The runner will manage the lifecycle, but we won't await it here -- return
214
214
  // the result straight away. Also stifle telemetry exception. Stream already produces them.
215
215
  let ret: NdjsonResultImpl;
216
+ const aborter = new AbortController();
216
217
  runner
217
218
  .run(async innerCtx => {
218
219
  ret = new NdjsonResultImpl(
219
- this.fetchInternalAsync(opts, innerCtx, true),
220
+ this.fetchInternalAsync(opts, innerCtx, aborter),
220
221
  opts,
221
222
  this.getInterner(opts.internStrings),
222
223
  (cause, response) =>
223
- cause?.name === 'AbortError'
224
+ this.isAborted(opts, aborter)
224
225
  ? this.abortedException(opts, innerCtx, cause)
225
226
  : this.streamFailedException(opts, innerCtx, response, cause)
226
227
  );
227
- await ret.whenCompleteAsync();
228
+ try {
229
+ await ret.whenCompleteAsync();
230
+ } finally {
231
+ this.releaseAutoAbortKey(opts.autoAbortKey, aborter);
232
+ }
228
233
  })
229
234
  .catch(noop);
230
235
  return ret;
@@ -311,15 +316,17 @@ export class FetchService extends HoistService {
311
316
  private static readonly defaultIdGenerator = new ShortUniqueId({length: 16});
312
317
 
313
318
  /**
314
- * @param forStreaming - true when called by fetchNdjson, which applies its own span and
315
- * track across the full stream lifetime - suppresses both here.
319
+ * @param streamAborter - aborter for a stream, set by fetchNdjson. It applies its own span and
320
+ * track across the full stream lifetime - suppresses both here - and releases any
321
+ * autoAbortKey once the stream completes.
316
322
  */
317
323
  private async fetchInternalAsync(
318
324
  opts: FetchOptions,
319
325
  ctx?: CallContextLike,
320
- forStreaming: boolean = false
326
+ streamAborter: AbortController = null
321
327
  ): Promise<any> {
322
328
  ctx ??= {};
329
+ const forStreaming = !!streamAborter;
323
330
 
324
331
  let spanConfig = forStreaming ? null : this.createSpanConfig(opts),
325
332
  runner = spanConfig ? this.runner(ctx).span(spanConfig) : this.runner(ctx),
@@ -327,7 +334,7 @@ export class FetchService extends HoistService {
327
334
  opts = this.withCorrelationId(opts);
328
335
  opts = this.withTraceId(opts, ctx.span);
329
336
  return this.withResolvedHeadersAsync(opts, ctx.span).then(opts =>
330
- this.managedFetchAsync(opts, ctx)
337
+ this.managedFetchAsync(opts, ctx, streamAborter)
331
338
  );
332
339
  });
333
340
 
@@ -428,15 +435,19 @@ export class FetchService extends HoistService {
428
435
  return isFunction(propagateTrace) ? propagateTrace(opts) : propagateTrace;
429
436
  }
430
437
 
431
- private async managedFetchAsync(opts: FetchOptions, callCtx: CallContext): Promise<any> {
438
+ private async managedFetchAsync(
439
+ opts: FetchOptions,
440
+ callCtx: CallContext,
441
+ streamAborter: AbortController
442
+ ): Promise<any> {
432
443
  // Prepare auto-aborter
433
444
  const {autoAborters, defaultTimeout} = this,
434
445
  {autoAbortKey, timeout = defaultTimeout} = opts,
435
- aborter = new AbortController();
446
+ aborter = streamAborter ?? new AbortController();
436
447
 
437
448
  // autoAbortKey handling. Abort anything running under this key, and mark this run
438
449
  if (autoAbortKey) {
439
- autoAborters[autoAbortKey]?.abort();
450
+ this.abort(autoAbortKey);
440
451
  autoAborters[autoAbortKey] = aborter;
441
452
  }
442
453
 
@@ -455,17 +466,24 @@ export class FetchService extends HoistService {
455
466
  throw this.timeoutException(opts, callCtx, e, msg);
456
467
  }
457
468
 
458
- if (!e.isHoistException) {
459
- // Just two other cases where we expect this to *throw* -- Typically we get a fail status
460
- throw e.name === 'AbortError'
461
- ? this.abortedException(opts, callCtx, e)
462
- : this.serverUnavailableException(opts, callCtx, e);
463
- }
464
- throw e;
469
+ if (this.isAborted(opts, aborter)) throw this.abortedException(opts, callCtx, e);
470
+ if (e.isHoistException) throw e;
471
+
472
+ // Any other error means the server could not be reached.
473
+ throw this.serverUnavailableException(opts, callCtx, e);
465
474
  } finally {
466
- if (autoAborters[autoAbortKey] === aborter) {
467
- delete autoAborters[autoAbortKey];
468
- }
475
+ if (!streamAborter) this.releaseAutoAbortKey(autoAbortKey, aborter);
476
+ }
477
+ }
478
+
479
+ // Fetch listens to both signals, joined - check each, as a custom abort reason is no AbortError.
480
+ private isAborted(opts: FetchOptions, aborter: AbortController): boolean {
481
+ return aborter.signal.aborted || !!opts.fetchOpts?.signal?.aborted;
482
+ }
483
+
484
+ private releaseAutoAbortKey(autoAbortKey: string, aborter: AbortController) {
485
+ if (autoAbortKey && this.autoAborters[autoAbortKey] === aborter) {
486
+ delete this.autoAborters[autoAbortKey];
469
487
  }
470
488
  }
471
489
 
@@ -478,16 +496,17 @@ export class FetchService extends HoistService {
478
496
  let {url, method, headers, body, params} = opts;
479
497
  url = this.resolveUrl(url);
480
498
 
481
- // 2) Prepare options for fetch API
482
- const fetchOpts: RequestInit = {
483
- signal: aborter.signal,
484
- credentials: 'include',
485
- redirect: 'follow',
486
- headers: new Headers(omitBy(headers, isNil)),
487
- method,
488
- body,
489
- ...opts.fetchOpts
490
- };
499
+ // 2) Prepare options for fetch API. Join any caller signal with ours, so either aborts.
500
+ const {signal, ...callerFetchOpts} = opts.fetchOpts ?? {},
501
+ fetchOpts: RequestInit = {
502
+ credentials: 'include',
503
+ redirect: 'follow',
504
+ headers: new Headers(omitBy(headers, isNil)),
505
+ method,
506
+ body,
507
+ ...callerFetchOpts,
508
+ signal: signal ? AbortSignal.any([aborter.signal, signal]) : aborter.signal
509
+ };
491
510
 
492
511
  // 3) Preprocess and apply params
493
512
  if (params) {
package/svc/README.md CHANGED
@@ -136,7 +136,8 @@ override async doLoadAsync(loadSpec: LoadSpec) {
136
136
  | `params` | object | Query string parameters |
137
137
  | `headers` | object | Additional headers |
138
138
  | `timeout` | number | Timeout in ms (default 30000) |
139
- | `autoAbortKey` | string | Cancel previous requests with same key |
139
+ | `autoAbortKey` | string | Cancel previous requests with same key. For `fetchNdjson`, covers the whole stream |
140
+ | `fetchOpts` | object | Options for the native `fetch()`. A `signal` here also aborts the request, alongside Hoist's own |
140
141
  | `propagateTrace` | boolean | Send a `traceparent` header when tracing is enabled. Overrides `FetchService.defaults.propagateTrace` |
141
142
  | `loadSpec` | LoadSpec | Metadata for tracking |
142
143
  | `span` | Span | Parent span for tracing. Typically supplied via a `Runner` chain (`runner.fetchJson(...)`) rather than set directly |
@@ -119,19 +119,24 @@ export class NdjsonResultImpl implements NdjsonResult {
119
119
  decoder = new TextDecoder();
120
120
  let buffer = '';
121
121
 
122
- while (true) {
123
- const {done, value} = await reader.read();
124
- if (done) break;
125
-
126
- buffer += decoder.decode(value, {stream: true});
127
- const lines = buffer.split('\n');
128
- buffer = lines.pop(); // retain any partial trailing line for the next chunk
129
- for (const line of lines) {
130
- if (!line) continue;
131
- const record = JSON.parse(line);
132
- interner?.intern(record);
133
- yield record;
122
+ try {
123
+ while (true) {
124
+ const {done, value} = await reader.read();
125
+ if (done) break;
126
+
127
+ buffer += decoder.decode(value, {stream: true});
128
+ const lines = buffer.split('\n');
129
+ buffer = lines.pop(); // retain any partial trailing line for the next chunk
130
+ for (const line of lines) {
131
+ if (!line) continue;
132
+ const record = JSON.parse(line);
133
+ interner?.intern(record);
134
+ yield record;
135
+ }
134
136
  }
137
+ } finally {
138
+ // Close the connection if the consumer exits early or a line fails to parse.
139
+ reader.cancel().catch(noop);
135
140
  }
136
141
 
137
142
  buffer += decoder.decode();