ziex 0.1.0-dev.628 → 0.1.0-dev.727
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 +17 -9
- package/index.js +10 -4
- package/package.json +3 -3
- package/wasm/index.js +5 -20
- package/wasm/init.js +5 -20
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Ziex
|
|
2
2
|
|
|
3
3
|
A full-stack web framework for Zig. Write declarative UI components using familiar JSX patterns, transpiled to efficient Zig code.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Ziex combines the power and performance of Zig with the expressiveness of JSX, enabling you to build fast, type-safe web applications.
|
|
6
6
|
|
|
7
7
|
**[Documentation →](https://ziex.dev/learn)**
|
|
8
8
|
|
|
@@ -94,6 +94,8 @@ const zx = @import("zx");
|
|
|
94
94
|
- [ ] Server Actions
|
|
95
95
|
- [ ] Rendering performance
|
|
96
96
|
- [x] Client Side Rendering (CSR) via React
|
|
97
|
+
- [ ] MDZX (Markdown + ZX) (MDX eqiuvalent)
|
|
98
|
+
- [ ] Render page as markdown via .md
|
|
97
99
|
- [x] Routing
|
|
98
100
|
- [x] File-system Routing
|
|
99
101
|
- [x] Search Parameters
|
|
@@ -156,9 +158,16 @@ const zx = @import("zx");
|
|
|
156
158
|
|
|
157
159
|
#### Editor Support
|
|
158
160
|
|
|
159
|
-
- ##### [VSCode](https://marketplace.visualstudio.com/items?itemName=
|
|
160
|
-
- ##### [Neovim](/
|
|
161
|
-
- ##### [
|
|
161
|
+
- ##### [VSCode](https://marketplace.visualstudio.com/items?itemName=ziex.ziex)/[VSCode Forks](https://open-vsx.org/extension/ziex/ziex) Extension
|
|
162
|
+
- ##### [Neovim](/ide/neovim/)
|
|
163
|
+
- ##### [Helix](/ide/helix/)
|
|
164
|
+
- ##### [Zed](/ide/zed/)
|
|
165
|
+
|
|
166
|
+
## Community
|
|
167
|
+
|
|
168
|
+
- [Discord](https://ziex.dev/r/discord)
|
|
169
|
+
- [Topic on Ziggit](https://ziex.dev/r/ziggit)
|
|
170
|
+
- [Project on Zig Discord Community](https://ziex.dev/r/zig-discord) (Join Zig Discord first: https://discord.gg/zig)
|
|
162
171
|
|
|
163
172
|
## Similar Projects
|
|
164
173
|
|
|
@@ -190,10 +199,9 @@ const zx = @import("zx");
|
|
|
190
199
|
|
|
191
200
|
## Related Projects
|
|
192
201
|
|
|
193
|
-
* [Codeberg Mirror](https://codeberg.org/nurulhudaapon/
|
|
194
|
-
* [ziex.dev](https://github.com/nurulhudaapon/
|
|
195
|
-
* [
|
|
196
|
-
* [thegates.dev](https://github.com/nurulhudaapon/thegates.dev) - Example clone demonstrating ZX capabilities
|
|
202
|
+
* [Codeberg Mirror](https://codeberg.org/nurulhudaapon/ziex) - ZX repository mirror on Codeberg
|
|
203
|
+
* [ziex.dev](https://github.com/nurulhudaapon/ziex/tree/main/site) - Official documentation site of ZX made using ZX.
|
|
204
|
+
* [example-blog](https://github.com/ziex-dev/example-blog) - Demo blog web application built with ZX
|
|
197
205
|
* [zx-numbers-game](https://github.com/Andrew-Velox/zx-numbers-game) - ZX numbers game
|
|
198
206
|
|
|
199
207
|
## Contributing
|
package/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
var zx = {
|
|
3
3
|
name: "zx",
|
|
4
|
-
version: "0.1.0-dev.
|
|
4
|
+
version: "0.1.0-dev.727",
|
|
5
|
+
jsglue_version: "0.1.0-dev.628",
|
|
5
6
|
description: "ZX is a framework for building web applications with Zig.",
|
|
6
|
-
repository: "https://github.com/nurulhudaapon/
|
|
7
|
+
repository: "https://github.com/nurulhudaapon/ziex",
|
|
8
|
+
homepage: "https://ziex.dev",
|
|
7
9
|
fingerprint: 14616285862371232000,
|
|
8
10
|
minimum_zig_version: "0.15.2",
|
|
9
11
|
dependencies: {
|
|
@@ -21,7 +23,10 @@ var zx = {
|
|
|
21
23
|
path: "vendor/zig-tree-sitter"
|
|
22
24
|
},
|
|
23
25
|
tree_sitter_zx: {
|
|
24
|
-
path: "
|
|
26
|
+
path: "pkg/tree-sitter-zx"
|
|
27
|
+
},
|
|
28
|
+
tree_sitter_mdzx: {
|
|
29
|
+
path: "pkg/tree-sitter-mdzx"
|
|
25
30
|
},
|
|
26
31
|
cachez: {
|
|
27
32
|
path: "vendor/cachez"
|
|
@@ -31,7 +36,8 @@ var zx = {
|
|
|
31
36
|
"build.zig",
|
|
32
37
|
"build.zig.zon",
|
|
33
38
|
"src",
|
|
34
|
-
"
|
|
39
|
+
"pkg/tree-sitter-zx",
|
|
40
|
+
"pkg/tree-sitter-mdzx",
|
|
35
41
|
"vendor/cachez",
|
|
36
42
|
"vendor/cliz",
|
|
37
43
|
"vendor/jsz",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ziex",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.727",
|
|
4
4
|
"description": "ZX is a framework for building web applications with Zig.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"./wasm": "./wasm/index.js",
|
|
11
11
|
"./wasm/init": "./wasm/init.js"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://
|
|
13
|
+
"homepage": "https://ziex.dev",
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/nurulhudaapon/
|
|
16
|
+
"url": "git+https://github.com/nurulhudaapon/ziex.git"
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
19
19
|
"zx",
|
package/wasm/index.js
CHANGED
|
@@ -205,6 +205,9 @@ class ZxBridge {
|
|
|
205
205
|
constructor(exports) {
|
|
206
206
|
this.#exports = exports;
|
|
207
207
|
}
|
|
208
|
+
get #alloc() {
|
|
209
|
+
return this.#exports.__zx_alloc;
|
|
210
|
+
}
|
|
208
211
|
get #handler() {
|
|
209
212
|
return this.#exports.__zx_cb;
|
|
210
213
|
}
|
|
@@ -272,19 +275,8 @@ class ZxBridge {
|
|
|
272
275
|
}
|
|
273
276
|
#notifyFetchComplete(fetchId, statusCode, body, isError) {
|
|
274
277
|
const handler = this.#fetchCompleteHandler;
|
|
275
|
-
if (!handler) {
|
|
276
|
-
console.warn("__zx_fetch_complete not exported from WASM");
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
278
|
const encoded = new TextEncoder().encode(body);
|
|
280
|
-
const
|
|
281
|
-
let ptr = 0;
|
|
282
|
-
if (allocFn) {
|
|
283
|
-
ptr = allocFn(encoded.length);
|
|
284
|
-
} else {
|
|
285
|
-
const heapBase = this.#exports.__heap_base?.value ?? 65536;
|
|
286
|
-
ptr = heapBase + Number(fetchId % BigInt(256)) * 65536;
|
|
287
|
-
}
|
|
279
|
+
const ptr = this.#alloc(encoded.length);
|
|
288
280
|
writeBytes(ptr, encoded);
|
|
289
281
|
handler(fetchId, statusCode, ptr, encoded.length, isError ? 1 : 0);
|
|
290
282
|
}
|
|
@@ -394,14 +386,7 @@ class ZxBridge {
|
|
|
394
386
|
return this.#writeBytesToWasm(encoded);
|
|
395
387
|
}
|
|
396
388
|
#writeBytesToWasm(data) {
|
|
397
|
-
const
|
|
398
|
-
let ptr = 0;
|
|
399
|
-
if (allocFn) {
|
|
400
|
-
ptr = allocFn(data.length);
|
|
401
|
-
} else {
|
|
402
|
-
const heapBase = this.#exports.__heap_base?.value ?? 65536;
|
|
403
|
-
ptr = heapBase + Date.now() % 256 * 4096;
|
|
404
|
-
}
|
|
389
|
+
const ptr = this.#alloc(data.length);
|
|
405
390
|
writeBytes(ptr, data);
|
|
406
391
|
return { ptr, len: data.length };
|
|
407
392
|
}
|
package/wasm/init.js
CHANGED
|
@@ -205,6 +205,9 @@ class ZxBridge {
|
|
|
205
205
|
constructor(exports) {
|
|
206
206
|
this.#exports = exports;
|
|
207
207
|
}
|
|
208
|
+
get #alloc() {
|
|
209
|
+
return this.#exports.__zx_alloc;
|
|
210
|
+
}
|
|
208
211
|
get #handler() {
|
|
209
212
|
return this.#exports.__zx_cb;
|
|
210
213
|
}
|
|
@@ -272,19 +275,8 @@ class ZxBridge {
|
|
|
272
275
|
}
|
|
273
276
|
#notifyFetchComplete(fetchId, statusCode, body, isError) {
|
|
274
277
|
const handler = this.#fetchCompleteHandler;
|
|
275
|
-
if (!handler) {
|
|
276
|
-
console.warn("__zx_fetch_complete not exported from WASM");
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
278
|
const encoded = new TextEncoder().encode(body);
|
|
280
|
-
const
|
|
281
|
-
let ptr = 0;
|
|
282
|
-
if (allocFn) {
|
|
283
|
-
ptr = allocFn(encoded.length);
|
|
284
|
-
} else {
|
|
285
|
-
const heapBase = this.#exports.__heap_base?.value ?? 65536;
|
|
286
|
-
ptr = heapBase + Number(fetchId % BigInt(256)) * 65536;
|
|
287
|
-
}
|
|
279
|
+
const ptr = this.#alloc(encoded.length);
|
|
288
280
|
writeBytes(ptr, encoded);
|
|
289
281
|
handler(fetchId, statusCode, ptr, encoded.length, isError ? 1 : 0);
|
|
290
282
|
}
|
|
@@ -394,14 +386,7 @@ class ZxBridge {
|
|
|
394
386
|
return this.#writeBytesToWasm(encoded);
|
|
395
387
|
}
|
|
396
388
|
#writeBytesToWasm(data) {
|
|
397
|
-
const
|
|
398
|
-
let ptr = 0;
|
|
399
|
-
if (allocFn) {
|
|
400
|
-
ptr = allocFn(data.length);
|
|
401
|
-
} else {
|
|
402
|
-
const heapBase = this.#exports.__heap_base?.value ?? 65536;
|
|
403
|
-
ptr = heapBase + Date.now() % 256 * 4096;
|
|
404
|
-
}
|
|
389
|
+
const ptr = this.#alloc(data.length);
|
|
405
390
|
writeBytes(ptr, data);
|
|
406
391
|
return { ptr, len: data.length };
|
|
407
392
|
}
|