marko 5.33.15 → 5.33.17

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.
@@ -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.17",
4
4
  "description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
5
5
  "keywords": [
6
6
  "front-end",
@@ -64,8 +64,8 @@
64
64
  "build": "babel ./src --out-dir ./dist --extensions .js --copy-files --config-file ../../babel.config.js --env-name=production"
65
65
  },
66
66
  "dependencies": {
67
- "@marko/compiler": "^5.35.11",
68
- "@marko/translator-default": "^5.32.12",
67
+ "@marko/compiler": "^5.35.12",
68
+ "@marko/translator-default": "^5.32.14",
69
69
  "app-module-path": "^2.2.0",
70
70
  "argly": "^1.2.0",
71
71
  "browser-refresh-client": "1.1.4",
@@ -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
  };