@constela/server 10.0.1 → 11.0.1
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 -0
- package/dist/index.js +4 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -90,6 +90,23 @@ Features:
|
|
|
90
90
|
- CSS custom properties for theme switching
|
|
91
91
|
- Preloaded languages: javascript, typescript, json, html, css, python, rust, go, java, bash, markdown
|
|
92
92
|
|
|
93
|
+
### Call/Lambda Expressions
|
|
94
|
+
|
|
95
|
+
Full support for call and lambda expressions during SSR:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"expr": "call",
|
|
100
|
+
"target": { "expr": "data", "name": "posts" },
|
|
101
|
+
"method": "filter",
|
|
102
|
+
"args": [{
|
|
103
|
+
"expr": "lambda",
|
|
104
|
+
"param": "post",
|
|
105
|
+
"body": { "expr": "get", "base": { "expr": "var", "name": "post" }, "path": "published" }
|
|
106
|
+
}]
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
93
110
|
### Route Context
|
|
94
111
|
|
|
95
112
|
Pass route parameters for dynamic pages:
|
package/dist/index.js
CHANGED
|
@@ -528,6 +528,10 @@ function evaluate(expr, ctx) {
|
|
|
528
528
|
case "lambda": {
|
|
529
529
|
return void 0;
|
|
530
530
|
}
|
|
531
|
+
case "array": {
|
|
532
|
+
const arrayExpr = expr;
|
|
533
|
+
return arrayExpr.elements.map((elem) => evaluate(elem, ctx));
|
|
534
|
+
}
|
|
531
535
|
default: {
|
|
532
536
|
const _exhaustiveCheck = expr;
|
|
533
537
|
throw new Error(`Unknown expression type: ${JSON.stringify(_exhaustiveCheck)}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constela/server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.1",
|
|
4
4
|
"description": "Server-side rendering for Constela UI framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@constela/compiler": "^0.
|
|
19
|
-
"@constela/core": "^0.
|
|
18
|
+
"@constela/compiler": "^0.14.0",
|
|
19
|
+
"@constela/core": "^0.15.0"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"isomorphic-dompurify": "^2.35.0",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"tsup": "^8.0.0",
|
|
30
30
|
"typescript": "^5.3.0",
|
|
31
31
|
"vitest": "^2.0.0",
|
|
32
|
-
"@constela/
|
|
33
|
-
"@constela/
|
|
32
|
+
"@constela/compiler": "0.14.0",
|
|
33
|
+
"@constela/core": "0.15.0"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
36
36
|
"node": ">=20.0.0"
|