marko 5.33.15 → 5.33.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,9 +20,5 @@ unsafeCharsReg.test(str) ? str.replace(unsafeCharsReg, replaceMatch) : str;
20
20
  * arbitrary code.
21
21
  */
22
22
  module.exports = function escapeScriptHelper(value) {
23
- if (value == null) {
24
- return "";
25
- }
26
-
27
23
  return escape(value + "");
28
24
  };
@@ -18,9 +18,5 @@ unsafeCharsReg.test(str) ? str.replace(unsafeCharsReg, replaceMatch) : str;
18
18
  * arbitrary code.
19
19
  */
20
20
  module.exports = function escapeScriptHelper(value) {
21
- if (value == null) {
22
- return "";
23
- }
24
-
25
21
  return escape(value + "");
26
22
  };
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "5.33.15",
3
+ "version": "5.33.16",
4
4
  "description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
5
5
  "keywords": [
6
6
  "front-end",
@@ -20,9 +20,5 @@ const escape = (str) =>
20
20
  * arbitrary code.
21
21
  */
22
22
  module.exports = function escapeScriptHelper(value) {
23
- if (value == null) {
24
- return "";
25
- }
26
-
27
23
  return escape(value + "");
28
24
  };
@@ -18,9 +18,5 @@ const escape = (str) =>
18
18
  * arbitrary code.
19
19
  */
20
20
  module.exports = function escapeScriptHelper(value) {
21
- if (value == null) {
22
- return "";
23
- }
24
-
25
21
  return escape(value + "");
26
22
  };