steel-frame 7.2.0 → 7.2.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
CHANGED
|
@@ -65,7 +65,7 @@ $ npm create steel-frame
|
|
|
65
65
|
|
|
66
66
|
## How SAFE is Steel Frame
|
|
67
67
|
|
|
68
|
-
The
|
|
68
|
+
The safety of your application is ensured by
|
|
69
69
|
|
|
70
70
|
- `100%` coverage of code by unit tests.
|
|
71
71
|
Each function, each branch is working as designed.
|
|
@@ -135,8 +135,8 @@ We respect semantic versioning:
|
|
|
135
135
|
|
|
136
136
|
### 7.0 - 7.2
|
|
137
137
|
|
|
138
|
-
- **7.2**: Add models
|
|
139
|
-
- **7.1**: Add support for ARIA
|
|
138
|
+
- **7.2**: Add tracking of the builtin models size. Reactive array/set/map can be converted into a builtin model.
|
|
139
|
+
- **7.1**: Add support for ARIA attributes.
|
|
140
140
|
- Add `debounced` and `field` functions, which extend the reativity system.
|
|
141
141
|
- Add `Zombie` component, it keeps HTML elements alive some time after destruction.
|
|
142
142
|
- Add `abortSignal` to cancel fetch requests and timers when component is destroyed.
|
|
@@ -97,7 +97,6 @@ export interface Internal {
|
|
|
97
97
|
set(obj: types.Expression, field: types.Expression, value: types.Expression, area: types.Node): types.CallExpression;
|
|
98
98
|
safeInit(arg: types.Expression): types.Expression;
|
|
99
99
|
Switch(arg: types.ObjectExpression): types.CallExpression;
|
|
100
|
-
ArrayModelView(array: types.Expression, arg: types.Expression): types.CallExpression;
|
|
101
100
|
safe(arg: types.FunctionExpression | types.ArrowFunctionExpression): types.CallExpression;
|
|
102
101
|
updateIValue(area: types.Node, left: types.Expression, right: types.Expression): types.Expression;
|
|
103
102
|
wrapFunctionBody(fn: types.FunctionDeclaration | types.ObjectMethod | types.ClassMethod | types.ClassPrivateMethod): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from "@babel/types";
|
|
2
|
-
import { ctx
|
|
2
|
+
import { ctx } from "./internal.js";
|
|
3
3
|
import { bodyHasJsx } from "./jsx-detect.js";
|
|
4
4
|
import { checkNonReactiveName, checkReactiveName, err, Errors, exprCall, isReactiveName, isReadableName, isWritableName, nodeIsUnsafe, reactivityTypeOfNode, toKebabCase, } from "./lib.js";
|
|
5
5
|
import { compose, meshExpression, processRefCall } from "./mesh.js";
|
|
@@ -64,32 +64,9 @@ export function transformJsxArray(paths, internal) {
|
|
|
64
64
|
}
|
|
65
65
|
else if (path.isJSXExpressionContainer()) {
|
|
66
66
|
const conditionalJsx = tryForConditionalJsx(path, internal);
|
|
67
|
-
const expression = path.get("expression");
|
|
68
67
|
if (conditionalJsx.length) {
|
|
69
68
|
result.push(...conditionalJsx);
|
|
70
69
|
}
|
|
71
|
-
// arrayModel.map(item => { <div>{item.x}</div> })
|
|
72
|
-
else if (expression.isCallExpression() &&
|
|
73
|
-
t.isMemberExpression(expression.node.callee) &&
|
|
74
|
-
!expression.node.callee.computed &&
|
|
75
|
-
t.isIdentifier(expression.node.callee.property) &&
|
|
76
|
-
expression.node.callee.property.name === "map") {
|
|
77
|
-
const array = expression.get("callee.object");
|
|
78
|
-
const handler = expression.get("arguments.0");
|
|
79
|
-
if (array.isIdentifier() &&
|
|
80
|
-
internal.stack.get(array.node.name) === VariablesStatus.ArrayModel &&
|
|
81
|
-
precheckSlotParams("ArrayModelView", handler, internal)) {
|
|
82
|
-
compose(handler, internal, "compose", true, true, false);
|
|
83
|
-
result.push(t.expressionStatement(internal.ArrayModelView(array.node, handler.node)));
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
err(Errors.IncorrectArguments, array, [
|
|
87
|
-
"Mapped value must be and identifier initialized with array model.",
|
|
88
|
-
"E.g.: `const C = component(() => { const arr = arrayModel(); <div>{arr.map(..)}</div> })`",
|
|
89
|
-
"Use directly ArrayView or ArrayModelView for any alternative cases.",
|
|
90
|
-
].join("\n"), internal);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
70
|
// process text values
|
|
94
71
|
else {
|
|
95
72
|
const value = transformJsxExpressionContainer(path, internal, ["acceptsReactive", "acceptsRaw"]);
|
|
@@ -309,15 +309,6 @@ export function transformProgram(path, filename, opts) {
|
|
|
309
309
|
Switch(arg) {
|
|
310
310
|
return call("Switch", [arg, ctx]);
|
|
311
311
|
},
|
|
312
|
-
ArrayModelView(array, slot) {
|
|
313
|
-
return call("ArrayModelView", [
|
|
314
|
-
t.objectExpression([
|
|
315
|
-
t.objectProperty(t.identifier("of"), array),
|
|
316
|
-
t.objectProperty(t.identifier("slot"), slot),
|
|
317
|
-
]),
|
|
318
|
-
ctx,
|
|
319
|
-
]);
|
|
320
|
-
},
|
|
321
312
|
safe: (arg) => call("safe", [arg]),
|
|
322
313
|
updateIValue(area, left, right) {
|
|
323
314
|
return t.callExpression(t.memberExpression(left, t.identifier("up")), [
|
package/build/cli/run.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "steel-frame",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.1",
|
|
4
4
|
"description": "SteelFrame: Build Fault-Tolerant Web Applications Effortlessly.",
|
|
5
5
|
"main": "build/cli/run.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@inquirer/select": "^5.2.6",
|
|
61
61
|
"csstype": "^3.1.3",
|
|
62
62
|
"esbuild": "^0.28.2",
|
|
63
|
-
"vasille-web": "7.2.
|
|
63
|
+
"vasille-web": "7.2.1",
|
|
64
64
|
"vite": "^8.3.4",
|
|
65
65
|
"vite-plugin-babel": "^1.7.3",
|
|
66
66
|
"vite-plugin-inspect": "^12.1.0",
|