@flowview/runtime 0.2.0 → 0.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 +28 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @flowview/runtime
|
|
2
|
+
|
|
3
|
+
The runtime contains the small HTML escaping and value helpers used by
|
|
4
|
+
FlowView-generated render functions. It does not parse templates, compile code,
|
|
5
|
+
or provide a sanitizer.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import {
|
|
9
|
+
renderValue,
|
|
10
|
+
renderAttributeValue,
|
|
11
|
+
renderRawValue,
|
|
12
|
+
} from "@flowview/runtime";
|
|
13
|
+
|
|
14
|
+
renderValue("<script>"); // <script>
|
|
15
|
+
renderRawValue("<b>trusted</b>"); // <b>trusted</b>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
FlowView templates are trusted source. Ordinary interpolation (`{{ value }}`)
|
|
19
|
+
escapes HTML by default. Raw interpolation (`{{{ value }}}`) is explicit and
|
|
20
|
+
must receive an already trusted or sanitized string. Passing untrusted markup
|
|
21
|
+
to it can cause cross-site scripting. `@flowview/runtime` is not a sanitizer.
|
|
22
|
+
|
|
23
|
+
Mixed static text plus interpolation in one attribute value is unsupported by
|
|
24
|
+
the compiler. The optional `track` expression is accepted but has no rendering
|
|
25
|
+
effect; the compiler reports warning `FV0015`.
|
|
26
|
+
|
|
27
|
+
See the root [FlowView guide](../../README.md) and
|
|
28
|
+
[security model](../../SECURITY.md).
|