@multiplatform.one/core 7.21.0 → 7.23.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.
package/README.md CHANGED
@@ -64,17 +64,21 @@ container's environment. Catch-up then re-reads each mounted collection through
64
64
  `/api/resource` and makes no `live.*` request, for signed-in users and visitors
65
65
  alike. The key is public config, so the SSR document publishes it per request:
66
66
  one image serves a bench with `live` and one without, no rebuild. Unset, or
67
- `cdc`, keeps CDC. Writes through the SDK (`createDoc`, `updateDoc`,
68
- `deleteDoc`) still call `live`, so this makes a bench without it work for
69
- reads, not writes. Snapshot mode also refuses progressive subscriptions, so a
67
+ `cdc`, keeps CDC. Snapshot mode also refuses progressive subscriptions, so a
70
68
  screen built on `useFrappeInfiniteList` fails under it.
71
69
 
72
- An app can fix the choice in code instead, through `frappe.syncOptions`, which
73
- `createApp` hands to `FrappeProvider` as is. A `catchUpStrategy` set there wins
74
- over the env.
70
+ Writes (`createDoc`, `updateDoc`, `deleteDoc`, a `FrappeForm` save) call `live`
71
+ too. The same deployment sets `FRAPPE_WRITE_STRATEGY=resource`, and they go to
72
+ `POST`, `PUT` and `DELETE /api/resource` instead. Unset, or `live`, keeps the
73
+ live app. Resource writes carry no idempotency key; the `@multiplatform.one/frappe`
74
+ README lists what else differs.
75
+
76
+ An app can fix either choice in code instead, through `frappe.syncOptions`,
77
+ which `createApp` hands to `FrappeProvider` as is. A `catchUpStrategy` or
78
+ `writeStrategy` set there wins over the env.
75
79
 
76
80
  ```tsx
77
- createApp({ frappe: { syncOptions: { catchUpStrategy: "snapshot" } } });
81
+ createApp({ frappe: { syncOptions: { catchUpStrategy: "snapshot", writeStrategy: "resource" } } });
78
82
  ```
79
83
 
80
84
  ## License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/core",
3
- "version": "7.21.0",
3
+ "version": "7.23.0",
4
4
  "description": "Core framework shell, provider composition, and layout factories for multiplatform.one",
5
5
  "keywords": [
6
6
  "app",
@@ -41,11 +41,11 @@
41
41
  "access": "public"
42
42
  },
43
43
  "dependencies": {
44
- "@multiplatform.one/i18n": "7.21.0",
45
- "@multiplatform.one/logger": "7.21.0",
46
- "@multiplatform.one/platform": "7.21.0",
47
- "@multiplatform.one/store": "7.21.0",
48
- "@multiplatform.one/theme": "7.21.0",
44
+ "@multiplatform.one/i18n": "7.23.0",
45
+ "@multiplatform.one/logger": "7.23.0",
46
+ "@multiplatform.one/platform": "7.23.0",
47
+ "@multiplatform.one/store": "7.23.0",
48
+ "@multiplatform.one/theme": "7.23.0",
49
49
  "@tanstack/devtools-event-client": "^0.4.3",
50
50
  "@tanstack/devtools-utils": "^0.4.0",
51
51
  "@tanstack/pacer-devtools": "1.3.0",
@@ -54,8 +54,8 @@
54
54
  "react-cookie": "^8.1.2"
55
55
  },
56
56
  "devDependencies": {
57
- "@multiplatform.one/frappe": "7.21.0",
58
- "@multiplatform.one/web3": "7.21.0",
57
+ "@multiplatform.one/frappe": "7.23.0",
58
+ "@multiplatform.one/web3": "7.23.0",
59
59
  "@sentry/react": "^10.51.0",
60
60
  "@tanstack/react-query": "^5.100.7",
61
61
  "@tanstack/react-query-devtools": "^5.100.7",
@@ -72,10 +72,10 @@
72
72
  "vitest": "^4.1.5"
73
73
  },
74
74
  "peerDependencies": {
75
- "@multiplatform.one/frappe": "^7.21.0",
76
- "@multiplatform.one/frappe-ui": "^7.21.0",
77
- "@multiplatform.one/keycloak": "^7.21.0",
78
- "@multiplatform.one/web3": "^7.21.0",
75
+ "@multiplatform.one/frappe": "^7.23.0",
76
+ "@multiplatform.one/frappe-ui": "^7.23.0",
77
+ "@multiplatform.one/keycloak": "^7.23.0",
78
+ "@multiplatform.one/web3": "^7.23.0",
79
79
  "@sentry/react": "^9.0.0",
80
80
  "@tanstack/react-query": "^5.0.0",
81
81
  "@tanstack/react-query-devtools": "^5.0.0",
@@ -97,6 +97,32 @@ describe("createApp frappe sync options (MPO-324)", () => {
97
97
  });
98
98
  });
99
99
 
100
+ describe("createApp frappe write strategy (MPO-396)", () => {
101
+ it("hands the provider resource writes when FRAPPE_WRITE_STRATEGY=resource", () => {
102
+ env.FRAPPE_WRITE_STRATEGY = "resource";
103
+ expect(renderedSyncOptions()).toEqual({ writeStrategy: "resource" });
104
+ });
105
+
106
+ it("carries both env strategies for a bench without the live app", () => {
107
+ env.FRAPPE_CATCH_UP_STRATEGY = "snapshot";
108
+ env.FRAPPE_WRITE_STRATEGY = "resource";
109
+ expect(renderedSyncOptions({ syncOptions: { cdcInterval: 30000 } })).toEqual({
110
+ cdcInterval: 30000,
111
+ catchUpStrategy: "snapshot",
112
+ writeStrategy: "resource",
113
+ });
114
+ });
115
+
116
+ it("ignores a value that names no write strategy and lets the app's own win", () => {
117
+ env.FRAPPE_WRITE_STRATEGY = "rest";
118
+ expect(renderedSyncOptions()).toBeNull();
119
+ env.FRAPPE_WRITE_STRATEGY = "resource";
120
+ expect(renderedSyncOptions({ syncOptions: { writeStrategy: "live" } })).toEqual({
121
+ writeStrategy: "live",
122
+ });
123
+ });
124
+ });
125
+
100
126
  describe("createApp frappe navigation (MPO-333)", () => {
101
127
  it("hands the provider One's router for routed FrappeListView and FrappeForm", () => {
102
128
  renderedSyncOptions();
@@ -175,9 +175,11 @@ export interface FrappeConfig {
175
175
  type?: string;
176
176
  };
177
177
  /**
178
- * Options for the live data engine. When `catchUpStrategy` is omitted,
179
- * FRAPPE_CATCH_UP_STRATEGY (`cdc` or `snapshot`) is read at runtime; a
180
- * bench without the `live` app needs `snapshot`, since CDC catch-up calls it.
178
+ * Options for the live data engine. When `catchUpStrategy` or
179
+ * `writeStrategy` is omitted, FRAPPE_CATCH_UP_STRATEGY (`cdc` or `snapshot`)
180
+ * and FRAPPE_WRITE_STRATEGY (`live` or `resource`) are read at runtime; a
181
+ * bench without the `live` app needs `snapshot` and `resource`, since CDC
182
+ * catch-up and live writes call it.
181
183
  */
182
184
  syncOptions?: SyncOptions;
183
185
  /**
@@ -392,9 +394,10 @@ export function createApp(appConfig: CreateAppConfig) {
392
394
 
393
395
  function FrappeProviderWrapper({ children }: PropsWithChildren) {
394
396
  const configuredCatchUp = config.get("FRAPPE_CATCH_UP_STRATEGY");
397
+ const configuredWrite = config.get("FRAPPE_WRITE_STRATEGY");
395
398
  const syncOptions = useMemo(
396
- () => frappeSyncOptions(cfg.syncOptions, configuredCatchUp),
397
- [configuredCatchUp],
399
+ () => frappeSyncOptions(cfg.syncOptions, configuredCatchUp, configuredWrite),
400
+ [configuredCatchUp, configuredWrite],
398
401
  );
399
402
  // A fixture corpus is an explicit opt-in, so it enables the provider
400
403
  // without FRAPPE_ENABLED=1 in .env.
@@ -2,19 +2,33 @@ import type { SyncOptions } from "@multiplatform.one/frappe";
2
2
 
3
3
  /**
4
4
  * The sync options the Frappe provider runs with: the app's own, plus the
5
- * catch-up strategy FRAPPE_CATCH_UP_STRATEGY names when the app sets none.
5
+ * strategies FRAPPE_CATCH_UP_STRATEGY and FRAPPE_WRITE_STRATEGY name where the
6
+ * app sets none.
6
7
  *
7
- * CDC catch-up calls the bench's `live` app, so a deployment whose bench does
8
- * not carry it sets FRAPPE_CATCH_UP_STRATEGY=snapshot and every catch-up
9
- * re-reads through /api/resource instead. The value is read when the page
8
+ * CDC catch-up and SDK writes call the bench's `live` app, so a deployment
9
+ * whose bench does not carry it sets FRAPPE_CATCH_UP_STRATEGY=snapshot and
10
+ * FRAPPE_WRITE_STRATEGY=resource: catch-up re-reads and create, update and
11
+ * delete go through /api/resource instead. The values are read when the page
10
12
  * runs, not baked into the build, so one image serves both kinds of bench.
11
- * Anything other than `cdc` or `snapshot` is ignored.
13
+ * Anything other than `cdc`/`snapshot` and `live`/`resource` is ignored.
12
14
  */
13
15
  export function frappeSyncOptions(
14
16
  syncOptions: SyncOptions | undefined,
15
17
  configuredStrategy: string | undefined,
18
+ configuredWriteStrategy?: string,
16
19
  ): SyncOptions | undefined {
17
- if (syncOptions?.catchUpStrategy) return syncOptions;
18
- if (configuredStrategy !== "cdc" && configuredStrategy !== "snapshot") return syncOptions;
19
- return { ...syncOptions, catchUpStrategy: configuredStrategy };
20
+ let options = syncOptions;
21
+ if (
22
+ !options?.catchUpStrategy &&
23
+ (configuredStrategy === "cdc" || configuredStrategy === "snapshot")
24
+ ) {
25
+ options = { ...options, catchUpStrategy: configuredStrategy };
26
+ }
27
+ if (
28
+ !options?.writeStrategy &&
29
+ (configuredWriteStrategy === "live" || configuredWriteStrategy === "resource")
30
+ ) {
31
+ options = { ...options, writeStrategy: configuredWriteStrategy };
32
+ }
33
+ return options;
20
34
  }
@@ -119,9 +119,11 @@ export interface FrappeConfig {
119
119
  type?: string;
120
120
  };
121
121
  /**
122
- * Options for the live data engine. When `catchUpStrategy` is omitted,
123
- * FRAPPE_CATCH_UP_STRATEGY (`cdc` or `snapshot`) is read at runtime; a
124
- * bench without the `live` app needs `snapshot`, since CDC catch-up calls it.
122
+ * Options for the live data engine. When `catchUpStrategy` or
123
+ * `writeStrategy` is omitted, FRAPPE_CATCH_UP_STRATEGY (`cdc` or `snapshot`)
124
+ * and FRAPPE_WRITE_STRATEGY (`live` or `resource`) are read at runtime; a
125
+ * bench without the `live` app needs `snapshot` and `resource`, since CDC
126
+ * catch-up and live writes call it.
125
127
  */
126
128
  syncOptions?: SyncOptions;
127
129
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CreateApp.d.ts","sourceRoot":"","sources":["../../src/app/CreateApp.tsx"],"names":[],"mappings":"AAAA,OAAc,EAMZ,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAEvB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAW9E,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAC;AAIjE,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,QAAQ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xB,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iHAAiH;IACjH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAMD,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAChC,gFAAgF;IAChF,QAAQ,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;IACpC,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;IACpC,uFAAuF;IACvF,MAAM,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC;IAChC,4FAA4F;IAC5F,IAAI,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,gDAAgD;IAChD,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC/B,gFAAgF;IAChF,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAQD;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,eAAe;;iDAwMW,gBAAgB;;;cA2B5D,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,aAAa,CAAC,CAAC,CAAC,KAAG,aAAa,CAAC,CAAC,CAAC;wBAatE,eAAe;EAKzC"}
@@ -1,13 +1,15 @@
1
1
  import type { SyncOptions } from "@multiplatform.one/frappe";
2
2
  /**
3
3
  * The sync options the Frappe provider runs with: the app's own, plus the
4
- * catch-up strategy FRAPPE_CATCH_UP_STRATEGY names when the app sets none.
4
+ * strategies FRAPPE_CATCH_UP_STRATEGY and FRAPPE_WRITE_STRATEGY name where the
5
+ * app sets none.
5
6
  *
6
- * CDC catch-up calls the bench's `live` app, so a deployment whose bench does
7
- * not carry it sets FRAPPE_CATCH_UP_STRATEGY=snapshot and every catch-up
8
- * re-reads through /api/resource instead. The value is read when the page
7
+ * CDC catch-up and SDK writes call the bench's `live` app, so a deployment
8
+ * whose bench does not carry it sets FRAPPE_CATCH_UP_STRATEGY=snapshot and
9
+ * FRAPPE_WRITE_STRATEGY=resource: catch-up re-reads and create, update and
10
+ * delete go through /api/resource instead. The values are read when the page
9
11
  * runs, not baked into the build, so one image serves both kinds of bench.
10
- * Anything other than `cdc` or `snapshot` is ignored.
12
+ * Anything other than `cdc`/`snapshot` and `live`/`resource` is ignored.
11
13
  */
12
- export declare function frappeSyncOptions(syncOptions: SyncOptions | undefined, configuredStrategy: string | undefined): SyncOptions | undefined;
14
+ export declare function frappeSyncOptions(syncOptions: SyncOptions | undefined, configuredStrategy: string | undefined, configuredWriteStrategy?: string): SyncOptions | undefined;
13
15
  //# sourceMappingURL=frappeSyncOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"frappeSyncOptions.d.ts","sourceRoot":"","sources":["../../src/app/frappeSyncOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,kBAAkB,EAAE,MAAM,GAAG,SAAS,GACrC,WAAW,GAAG,SAAS,CAIzB"}
1
+ {"version":3,"file":"frappeSyncOptions.d.ts","sourceRoot":"","sources":["../../src/app/frappeSyncOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,kBAAkB,EAAE,MAAM,GAAG,SAAS,EACtC,uBAAuB,CAAC,EAAE,MAAM,GAC/B,WAAW,GAAG,SAAS,CAezB"}