ziex 0.1.0-dev.1259 → 0.1.0-dev.1309

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
@@ -172,15 +172,17 @@ const zx = @import("zx");
172
172
  ## Versions
173
173
  | Zig | Ziex | Branch | Status |
174
174
  |-------------|---------------------|-------------------|----------------|
175
- | `0.17.x` | | `zig-0.17` | Development |
176
- | `0.16.x` | `0.1.0-dev.1068`-* | `main` | **Latest** |
175
+ | `0.17.x` | | `main` | Development |
176
+ | `0.16.x` | `0.1.0-dev.1259` | `zig-0.16` | **Latest** |
177
177
  | `0.15.x` | `0.1.0-dev-1050` | `zig-0.15` | Latest (`Zig 0.15.x`) |
178
178
 
179
179
 
180
180
  ## Roadmap
181
- [Ziex 0.1.0](https://github.com/ziex-dev/ziex/milestone/2) is targeted after `Zig 0.17.0` release. You can see the [roadmap](https://github.com/ziex-dev/ziex/milestone) to learn more.
181
+ [Ziex 0.1.0](https://github.com/ziex-dev/ziex/milestone/2) is planned for release after `Zig 0.17.0` is available. You can view the [roadmap](https://github.com/ziex-dev/ziex/milestone) to learn more.
182
182
 
183
- `0.1.0` release will indicate that Ziex is production ready with all majore features fully baked and will receive patch releases for bug fixes.
183
+ The `0.1.0` release will indicate that Ziex is production-ready, with all major features fully implemented, and will receive patch releases for bug fixes.
184
+
185
+ The `1.0.0` release will signify long-term support for that major version, receiving bug fixes and minor updates.
184
186
 
185
187
  ## Editor Support
186
188
 
@@ -682,12 +682,12 @@ class ZxBridge extends ZxBridgeCore {
682
682
  clearEventHandlerModes(velementId) {
683
683
  eventHandlerModes.delete(velementId);
684
684
  }
685
- submitFormActionAsync(form, statesJson, fetchId) {
685
+ submitFormActionAsync(form, actionId, statesJson, fetchId) {
686
686
  const formData = new FormData(form);
687
687
  formData.append("__$states", statesJson);
688
688
  fetch(window.location.href, {
689
689
  method: "POST",
690
- headers: { "X-ZX-Action": "1" },
690
+ headers: { "x-action": String(actionId >>> 0) },
691
691
  body: formData
692
692
  }).then(async (response) => {
693
693
  const text = await response.text();
@@ -911,23 +911,23 @@ class ZxBridge extends ZxBridgeCore {
911
911
  writeBytes(bufPtr, bytes.subarray(0, len));
912
912
  return len;
913
913
  },
914
- _submitFormAction: (vnodeId) => {
914
+ _submitFormAction: (vnodeId, actionId) => {
915
915
  const form = domNodes.get(vnodeId);
916
916
  if (!form || !(form instanceof HTMLFormElement))
917
917
  return;
918
918
  const formData = new FormData(form);
919
919
  fetch(window.location.href, {
920
920
  method: "POST",
921
- headers: { "X-ZX-Action": "1" },
921
+ headers: { "x-action": String(actionId >>> 0) },
922
922
  body: formData
923
923
  }).catch(() => {});
924
924
  },
925
- _submitFormActionAsync: (vnodeId, statesPtr, statesLen, fetchId) => {
925
+ _submitFormActionAsync: (vnodeId, actionId, statesPtr, statesLen, fetchId) => {
926
926
  const form = domNodes.get(vnodeId);
927
927
  if (!form || !(form instanceof HTMLFormElement))
928
928
  return;
929
929
  const statesJson = statesLen > 0 ? readString(statesPtr, statesLen) : "[]";
930
- bridgeRef.current?.submitFormActionAsync(form, statesJson, fetchId);
930
+ bridgeRef.current?.submitFormActionAsync(form, actionId, statesJson, fetchId);
931
931
  }
932
932
  }
933
933
  };
@@ -1259,7 +1259,8 @@ async function init(options = {}) {
1259
1259
  domNodes.clear();
1260
1260
  }
1261
1261
  };
1262
- registerDevReinit(normalizedOptions);
1262
+ if (true)
1263
+ registerDevReinit(normalizedOptions);
1263
1264
  return { source, bridge };
1264
1265
  }
1265
1266
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ziex",
3
- "version": "0.1.0-dev.1259",
3
+ "version": "0.1.0-dev.1309",
4
4
  "description": "Ziex is a framework for building web applications with Zig.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -37,7 +37,7 @@
37
37
  "license": "MIT",
38
38
  "scripts": {},
39
39
  "dependencies": {
40
- "@ziex/cli": "0.1.0-dev.1259"
40
+ "@ziex/cli": "0.1.0-dev.1309"
41
41
  },
42
42
  "peerDependenciesMeta": {
43
43
  "react": {
package/wasm/index.d.ts CHANGED
@@ -14,7 +14,7 @@ export declare class ZxBridge extends ZxBridgeCore {
14
14
  setEventHandlerMode(velementId: bigint, eventTypeId: number, maySuspend: boolean): void;
15
15
  clearEventHandlerModes(velementId: bigint): void;
16
16
  /** Submit a form action with bound-state round-trip. */
17
- submitFormActionAsync(form: HTMLFormElement, statesJson: string, fetchId: bigint): void;
17
+ submitFormActionAsync(form: HTMLFormElement, actionId: number, statesJson: string, fetchId: bigint): void;
18
18
  /**
19
19
  * Create and connect a WebSocket.
20
20
  * Calls __zx_ws_onopen, __zx_ws_onmessage, __zx_ws_onerror, __zx_ws_onclose.
@@ -58,6 +58,7 @@ export declare function init(options?: InitOptions): Promise<{
58
58
  bridge: ZxBridge;
59
59
  }>;
60
60
  declare global {
61
+ const __DEV__: boolean;
61
62
  interface HTMLElement {
62
63
  __zx_ref?: number;
63
64
  }
package/wasm/index.js CHANGED
@@ -682,12 +682,12 @@ class ZxBridge extends ZxBridgeCore {
682
682
  clearEventHandlerModes(velementId) {
683
683
  eventHandlerModes.delete(velementId);
684
684
  }
685
- submitFormActionAsync(form, statesJson, fetchId) {
685
+ submitFormActionAsync(form, actionId, statesJson, fetchId) {
686
686
  const formData = new FormData(form);
687
687
  formData.append("__$states", statesJson);
688
688
  fetch(window.location.href, {
689
689
  method: "POST",
690
- headers: { "X-ZX-Action": "1" },
690
+ headers: { "x-action": String(actionId >>> 0) },
691
691
  body: formData
692
692
  }).then(async (response) => {
693
693
  const text = await response.text();
@@ -911,23 +911,23 @@ class ZxBridge extends ZxBridgeCore {
911
911
  writeBytes(bufPtr, bytes.subarray(0, len));
912
912
  return len;
913
913
  },
914
- _submitFormAction: (vnodeId) => {
914
+ _submitFormAction: (vnodeId, actionId) => {
915
915
  const form = domNodes.get(vnodeId);
916
916
  if (!form || !(form instanceof HTMLFormElement))
917
917
  return;
918
918
  const formData = new FormData(form);
919
919
  fetch(window.location.href, {
920
920
  method: "POST",
921
- headers: { "X-ZX-Action": "1" },
921
+ headers: { "x-action": String(actionId >>> 0) },
922
922
  body: formData
923
923
  }).catch(() => {});
924
924
  },
925
- _submitFormActionAsync: (vnodeId, statesPtr, statesLen, fetchId) => {
925
+ _submitFormActionAsync: (vnodeId, actionId, statesPtr, statesLen, fetchId) => {
926
926
  const form = domNodes.get(vnodeId);
927
927
  if (!form || !(form instanceof HTMLFormElement))
928
928
  return;
929
929
  const statesJson = statesLen > 0 ? readString(statesPtr, statesLen) : "[]";
930
- bridgeRef.current?.submitFormActionAsync(form, statesJson, fetchId);
930
+ bridgeRef.current?.submitFormActionAsync(form, actionId, statesJson, fetchId);
931
931
  }
932
932
  }
933
933
  };
@@ -1259,7 +1259,8 @@ async function init(options = {}) {
1259
1259
  domNodes.clear();
1260
1260
  }
1261
1261
  };
1262
- registerDevReinit(normalizedOptions);
1262
+ if (true)
1263
+ registerDevReinit(normalizedOptions);
1263
1264
  return { source, bridge };
1264
1265
  }
1265
1266
  export {