marko 5.33.15 → 5.33.16
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/runtime/html/helpers/escape-script-placeholder.js +0 -4
- package/dist/runtime/html/helpers/escape-style-placeholder.js +0 -4
- package/docs/fastify.md +18 -0
- package/package.json +1 -1
- package/src/runtime/html/helpers/escape-script-placeholder.js +0 -4
- package/src/runtime/html/helpers/escape-style-placeholder.js +0 -4
package/docs/fastify.md
CHANGED
@@ -41,6 +41,24 @@ app.get("/", (request, reply) => {
|
|
41
41
|
await fastify.listen(3000);
|
42
42
|
```
|
43
43
|
|
44
|
+
### Global Outputs
|
45
|
+
|
46
|
+
We can add global outputs from the server side using the reply object or fastify instance.
|
47
|
+
|
48
|
+
```javascript
|
49
|
+
reply.locals.newProperty = "Your value";
|
50
|
+
```
|
51
|
+
|
52
|
+
To use this in marko components we just need to refer out.global
|
53
|
+
|
54
|
+
```marko
|
55
|
+
$ const { newProperty } = $global;
|
56
|
+
```
|
57
|
+
|
58
|
+
To know more about sending the data to the browser checkout:
|
59
|
+
|
60
|
+
### [Sending global data to browsers](https://markojs.com/docs/rendering/#sending-global-data-to-browsers)
|
61
|
+
|
44
62
|
### BYOB (Bring your own bundler)
|
45
63
|
|
46
64
|
For the large portion of Marko's API a bundler is required. The example code above assumes that Marko templates can be loaded in your environment.
|
package/package.json
CHANGED