@openelement/protocol 1.0.0-alpha.11 → 1.0.0-alpha.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openelement/protocol",
3
- "version": "1.0.0-alpha.11",
3
+ "version": "1.0.0-alpha.13",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
package/src/data.d.ts CHANGED
@@ -43,16 +43,22 @@ export type Action<T = unknown, Env extends object = Record<string, string | und
43
43
  * as plain HTTP (303 on success, 422 with the re-rendered form on validation
44
44
  * failure, redirect/error as status codes).
45
45
  *
46
+ * Success carries no data envelope. The application-loop contract makes a
47
+ * successful non-GET action answer 303 (PRG) — the framework never answers
48
+ * 200 with a rendered page, or with a success document, for a successful
49
+ * mutation — so the fetch channel answers `{ type: 'redirect' }` naming the
50
+ * PRG target and the authored return value is discarded by design. Success
51
+ * data travels the PRG target instead (query state the loader re-runs with,
52
+ * which the props projector then maps; see the router guide's "Form actions"
53
+ * section). The union previously declared a `{ type: 'success' }` member that
54
+ * no code path ever emitted — removed so the type matches the wire.
55
+ *
46
56
  * Error outcomes (CSRF 403, unknown action 404, unparseable body 400,
47
57
  * unexpected 500) are NOT part of this union: since #863
48
58
  * they answer RFC 9457 Problem Details with the
49
59
  * PROBLEM_JSON_MEDIA_TYPE content type — see ProblemDetails.
50
60
  */
51
- export type ActionResult<Success = unknown, Failure = unknown> = {
52
- type: 'success';
53
- status: number;
54
- data?: Success;
55
- } | {
61
+ export type ActionResult<Failure = unknown> = {
56
62
  type: 'failure';
57
63
  status: number;
58
64
  data?: Failure;
@@ -9,8 +9,13 @@ export declare const PART_PROGRAM_VERSION: 1;
9
9
  * Bump when the generated-module contract changes shape; generated artifacts
10
10
  * stamp both this and PART_PROGRAM_VERSION so consumers can tell format drift
11
11
  * from release drift.
12
+ *
13
+ * v2: platform lifecycle callback bodies are emitted inside a
14
+ * boundary-capture wrapper calling the base class's `_captureError` — a
15
+ * generated module now requires a runtime facade carrying that protected
16
+ * method (the v1 shape emitted the bodies verbatim).
12
17
  */
13
- export declare const COMPILED_MODULE_ABI_VERSION: 1;
18
+ export declare const COMPILED_MODULE_ABI_VERSION: 2;
14
19
  /** How the compiled component attaches its root: light DOM or a shadow root. */
15
20
  export type RootMode = 'light' | 'shadow-open' | 'shadow-closed';
16
21
  /** The root of one program tree: element, part anchor, or text. */
@@ -24,8 +24,13 @@ const PART_PROGRAM_VERSION = 1;
24
24
  * Bump when the generated-module contract changes shape; generated artifacts
25
25
  * stamp both this and PART_PROGRAM_VERSION so consumers can tell format drift
26
26
  * from release drift.
27
+ *
28
+ * v2: platform lifecycle callback bodies are emitted inside a
29
+ * boundary-capture wrapper calling the base class's `_captureError` — a
30
+ * generated module now requires a runtime facade carrying that protected
31
+ * method (the v1 shape emitted the bodies verbatim).
27
32
  */
28
- const COMPILED_MODULE_ABI_VERSION = 1;
33
+ const COMPILED_MODULE_ABI_VERSION = 2;
29
34
  /**
30
35
  * Operator/literal compatibility for when-Region tests (issue #1372). Both
31
36
  * wire validators (this module and the server serializer's shared validator)