@xh/hoist 78.0.0-SNAPSHOT.1762979452848 → 78.0.0-SNAPSHOT.1763163153396

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
@@ -2,17 +2,24 @@
2
2
 
3
3
  ## 78.0.0-SNAPSHOT - unreleased
4
4
 
5
+ ### ⚙️ Technical
6
+
7
+ * `FetchService` will recognize variants on the `application/json` content-type when processing
8
+ failed responses and decoding exceptions - e.g. `application/problem+json`.
9
+
5
10
  ## 77.1.1 - 2025-11-12
6
11
 
7
12
  ### 🎁 New Features
8
- * New method `StoreRecord.getModifiedValues()` to gather edited data from a store record.
13
+
14
+ * New method `StoreRecord.getModifiedValues()` to gather edited data from a store record.
9
15
 
10
16
  ### 🐞 Bug Fixes
11
- * StoreRecord will no longer report `isModified` as `true` if a field has been edited and
12
- then returned to its original value in a subsequent edit.
13
- * Restore support for `TabModel.content` being nullable to support dynamic tab content.
14
- * Remove stray context menu from appearing when clicking on column group headers and other grid
15
- empty space.
17
+
18
+ * StoreRecord will no longer report `isModified` as `true` if a field has been edited and
19
+ then returned to its original value in a subsequent edit.
20
+ * Restore support for `TabModel.content` being nullable to support dynamic tab content.
21
+ * Remove stray context menu from appearing when clicking on column group headers and other grid
22
+ empty space.
16
23
 
17
24
  ## 77.0.1 - 2025-10-29
18
25
 
@@ -42,7 +49,6 @@
42
49
 
43
50
  * Support Grails 7 service name conventions in admin client (backward compatible)
44
51
 
45
-
46
52
  ## 76.2.0 - 2025-10-22
47
53
 
48
54
  ### ⚙️ Technical
@@ -25,6 +25,11 @@ import { IStringifyOptions } from 'qs';
25
25
  export declare class FetchService extends HoistService {
26
26
  static instance: FetchService;
27
27
  NO_JSON_RESPONSES: StatusCodes[];
28
+ /**
29
+ * Regex applied during failed response handling to determine if contentType indicates JSON.
30
+ * Matches `application/json` as well as variants such as `application/problem+json`
31
+ */
32
+ JSON_CONTENT_TYPE_RE: RegExp;
28
33
  private idGenerator;
29
34
  private autoAborters;
30
35
  private _defaultHeaders;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "78.0.0-SNAPSHOT.1762979452848",
3
+ "version": "78.0.0-SNAPSHOT.1763163153396",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",
@@ -38,6 +38,12 @@ export class FetchService extends HoistService {
38
38
 
39
39
  NO_JSON_RESPONSES = [StatusCodes.NO_CONTENT, StatusCodes.RESET_CONTENT];
40
40
 
41
+ /**
42
+ * Regex applied during failed response handling to determine if contentType indicates JSON.
43
+ * Matches `application/json` as well as variants such as `application/problem+json`
44
+ */
45
+ JSON_CONTENT_TYPE_RE = /application\/[^+]*[+]?(json);?.*/i;
46
+
41
47
  private idGenerator = new ShortUniqueId({length: 16});
42
48
  private autoAborters = {};
43
49
  private _defaultHeaders: DefaultHeaders[] = [];
@@ -410,10 +416,9 @@ export class FetchService extends HoistService {
410
416
  });
411
417
  }
412
418
 
413
- // Try to "smart" decode as server provided JSON Exception (with a name)
419
+ // Attempt to decode server-provided exception if returned as JSON.
414
420
  try {
415
- const cType = headers.get('Content-Type');
416
- if (cType?.includes('application/json')) {
421
+ if (headers.get('Content-Type')?.match(this.JSON_CONTENT_TYPE_RE)) {
417
422
  const parsedResp = this.safeParseJson(responseText);
418
423
  return this.createException({
419
424
  ...defaults,