@zerotal/flow 1.11.2 → 1.13.0
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/CHANGELOG.md +54 -0
- package/api-surface.md +0 -1
- package/package.json +6 -6
- package/src/Component.ts +9 -29
- package/src/augment.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,60 @@ change.
|
|
|
11
11
|
|
|
12
12
|
## [Unreleased]
|
|
13
13
|
|
|
14
|
+
## [1.13.0] — 2026-08-31
|
|
15
|
+
|
|
16
|
+
### Removed — **BREAKING**
|
|
17
|
+
|
|
18
|
+
- **`Component.client(…)`.** Use the `` this.# Changelog — @zerotal/flow
|
|
19
|
+
|
|
20
|
+
All notable changes to this package are documented here. The format is
|
|
21
|
+
based on [Keep a Changelog](https://keepachangelog.com/); this package
|
|
22
|
+
follows the Zerotal monorepo's unified versioning.
|
|
23
|
+
|
|
24
|
+
**Maturity: `stable`** — matching this package's `maturity` field. The public API
|
|
25
|
+
follows SemVer strictly: anything importable without an `@internal` marker keeps its
|
|
26
|
+
shape for the rest of the 1.x line, and `api-surface.md` is diffed by CI on every
|
|
27
|
+
change.
|
|
28
|
+
|
|
29
|
+
…` `` tagged template.
|
|
30
|
+
|
|
31
|
+
A security fix rather than an ergonomics change, which is why it did not wait for 2.0.
|
|
32
|
+
`client()` took a **string** and queued it for evaluation in the browser, so the caller
|
|
33
|
+
owned the escaping — and its own docblock had to warn _never interpolate unescaped user
|
|
34
|
+
input_. A method whose documentation has to tell you not to hold it that way is a footgun
|
|
35
|
+
with a label on. `# Changelog — @zerotal/flow
|
|
36
|
+
|
|
37
|
+
All notable changes to this package are documented here. The format is
|
|
38
|
+
based on [Keep a Changelog](https://keepachangelog.com/); this package
|
|
39
|
+
follows the Zerotal monorepo's unified versioning.
|
|
40
|
+
|
|
41
|
+
**Maturity: `stable`** — matching this package's `maturity` field. The public API
|
|
42
|
+
follows SemVer strictly: anything importable without an `@internal` marker keeps its
|
|
43
|
+
shape for the rest of the 1.x line, and `api-surface.md` is diffed by CI on every
|
|
44
|
+
change.
|
|
45
|
+
|
|
46
|
+
is a tagged template, so each `${…}` is encoded as a JS literal before
|
|
47
|
+
it reaches the page and the caller cannot forget.
|
|
48
|
+
|
|
49
|
+
`zt upgrade --to 1.13.0` rewrites a call whose argument is a single literal. One whose
|
|
50
|
+
argument is a variable or a concatenation is **reported, not rewritten** — those are the
|
|
51
|
+
ones the warning was about, and wrapping the finished string as `` # Changelog — @zerotal/flow
|
|
52
|
+
|
|
53
|
+
All notable changes to this package are documented here. The format is
|
|
54
|
+
based on [Keep a Changelog](https://keepachangelog.com/); this package
|
|
55
|
+
follows the Zerotal monorepo's unified versioning.
|
|
56
|
+
|
|
57
|
+
**Maturity: `stable`** — matching this package's `maturity` field. The public API
|
|
58
|
+
follows SemVer strictly: anything importable without an `@internal` marker keeps its
|
|
59
|
+
shape for the rest of the 1.x line, and `api-surface.md` is diffed by CI on every
|
|
60
|
+
change.
|
|
61
|
+
|
|
62
|
+
${expr}` `` would
|
|
63
|
+
encode it as a string literal and stop running it as code.
|
|
64
|
+
|
|
65
|
+
Removing it frees `client` as a property name on a component, as removing `title` did in
|
|
66
|
+
1.7.3.
|
|
67
|
+
|
|
14
68
|
## [1.9.0] — 2026-08-29
|
|
15
69
|
|
|
16
70
|
- **The component and flash types are documented.** Every built-in component exports the type of
|
package/api-surface.md
CHANGED
|
@@ -45,7 +45,6 @@ class Component = {
|
|
|
45
45
|
cancelled: boolean
|
|
46
46
|
child: <C extends Component>(ChildClass: new () => C, opts?: { key?: string | number; props?: Partial<C>; lazy?: boolean; defer?: boolean; stream?: boolean; slots?: Record<string, string>;}) => Promise<HtmlNode>
|
|
47
47
|
clearDurable: () => void
|
|
48
|
-
client: (script: string) => void
|
|
49
48
|
currentUrl: (options?: CurrentUrlOptions) => string
|
|
50
49
|
dispatch: <K extends string>(name: K, ...args: K extends EventName ? EventArgs<FlowEvents[K]> : [payload?: Record<string, unknown>]) => void
|
|
51
50
|
dispatchSelf: <K extends string>(name: K, ...args: K extends EventName ? EventArgs<FlowEvents[K]> : [payload?: Record<string, unknown>]) => void
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerotal/flow",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"maturity": "stable",
|
|
6
6
|
"private": false,
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
"@alpinejs/morph": "^3.14.9",
|
|
48
48
|
"@alpinejs/persist": "^3.14.9",
|
|
49
49
|
"@alpinejs/resize": "^3.14.9",
|
|
50
|
-
"@zerotal/client": "1.
|
|
51
|
-
"@zerotal/core": "1.
|
|
52
|
-
"@zerotal/orm": "1.
|
|
53
|
-
"@zerotal/validator": "1.
|
|
50
|
+
"@zerotal/client": "1.13.0",
|
|
51
|
+
"@zerotal/core": "1.13.0",
|
|
52
|
+
"@zerotal/orm": "1.13.0",
|
|
53
|
+
"@zerotal/validator": "1.13.0",
|
|
54
54
|
"alpinejs": "^3.14.9",
|
|
55
55
|
"typescript": "^5.8.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@zerotal/broadcasting": "1.
|
|
58
|
+
"@zerotal/broadcasting": "1.13.0",
|
|
59
59
|
"@types/alpinejs": "^3.13.10",
|
|
60
60
|
"@types/alpinejs__anchor": "^3.13.1",
|
|
61
61
|
"@types/alpinejs__collapse": "^3.13.4",
|
package/src/Component.ts
CHANGED
|
@@ -554,7 +554,7 @@ export abstract class Component {
|
|
|
554
554
|
_shouldRefresh = false;
|
|
555
555
|
|
|
556
556
|
/**
|
|
557
|
-
* Raw JS expressions queued by
|
|
557
|
+
* Raw JS expressions queued by the `$` tagged template during an action.
|
|
558
558
|
* Drained by _drainEffects() and forwarded to the client in the patch frame.
|
|
559
559
|
* @internal
|
|
560
560
|
*/
|
|
@@ -1124,28 +1124,6 @@ export abstract class Component {
|
|
|
1124
1124
|
this._shouldRefresh = true;
|
|
1125
1125
|
}
|
|
1126
1126
|
|
|
1127
|
-
/**
|
|
1128
|
-
* Queue a raw JavaScript expression to be evaluated in the browser
|
|
1129
|
-
* after the current action's DOM patch is applied.
|
|
1130
|
-
*
|
|
1131
|
-
* The expression runs in the Alpine context of the component root element:
|
|
1132
|
-
* `$el`, `$refs`, and other Alpine magic properties are all available.
|
|
1133
|
-
*
|
|
1134
|
-
* Multiple calls are batched and executed in order after the single round trip.
|
|
1135
|
-
*
|
|
1136
|
-
* @example
|
|
1137
|
-
* this.client(`$refs.titleInput.focus()`);
|
|
1138
|
-
* this.client(`$el.querySelector('.toast').classList.add('visible')`);
|
|
1139
|
-
*
|
|
1140
|
-
* @security Never interpolate unescaped user input into the expression string. Prefer the
|
|
1141
|
-
* {@link $} tagged template, which encodes interpolated values for you.
|
|
1142
|
-
* @deprecated Use the `$` tagged template: ``this.$`$refs.titleInput.focus()` ``.
|
|
1143
|
-
* @category Actions
|
|
1144
|
-
*/
|
|
1145
|
-
client(script: string): void {
|
|
1146
|
-
this._clientScripts.push(script);
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
1127
|
/**
|
|
1150
1128
|
* Run a client-side expression from a server action, interpolating values safely.
|
|
1151
1129
|
*
|
|
@@ -1158,13 +1136,15 @@ export abstract class Component {
|
|
|
1158
1136
|
* this.$`$el.dataset.count = ${this.items.length}`;
|
|
1159
1137
|
* ```
|
|
1160
1138
|
*
|
|
1161
|
-
* That is the whole reason it
|
|
1162
|
-
* the caller owned the escaping, and a value containing a quote —
|
|
1163
|
-
* produced either a syntax error or something worse.
|
|
1139
|
+
* That is the whole reason it replaced `client()`, removed in 1.13.0. Building the
|
|
1140
|
+
* expression by hand meant the caller owned the escaping, and a value containing a quote —
|
|
1141
|
+
* a name, a search term — produced either a syntax error or something worse. A method whose
|
|
1142
|
+
* own documentation has to warn you not to interpolate into it is a footgun with a label on,
|
|
1143
|
+
* so the label was replaced with an API that cannot be held the wrong way.
|
|
1164
1144
|
*
|
|
1165
|
-
* Runs in the component root's Alpine context after the action's DOM patch
|
|
1166
|
-
*
|
|
1167
|
-
*
|
|
1145
|
+
* Runs in the component root's Alpine context after the action's DOM patch: `$el`, `$refs`
|
|
1146
|
+
* and the `$flow` magics are all in scope, and multiple calls execute in order after the
|
|
1147
|
+
* single round trip.
|
|
1168
1148
|
*
|
|
1169
1149
|
* @category Actions
|
|
1170
1150
|
*/
|
package/src/augment.ts
CHANGED
|
@@ -25,7 +25,7 @@ declare module "@zerotal/core" {
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* $flow — the client runtime object, available directly in JSX client expressions
|
|
28
|
-
* (event handlers, attribute bindings, text children) and `this
|
|
28
|
+
* (event handlers, attribute bindings, text children) and `this.$` scripts.
|
|
29
29
|
*
|
|
30
30
|
* It is the single home for all client-only magics, so the component class itself stays
|
|
31
31
|
* clean. The rule: `this.name` is always YOUR member (state/action); `$flow.name` is always a
|