{"_id":"piral-ssr-utils","_rev":"819-1558ec94282dcafce43eb6e6f1c66e39","name":"piral-ssr-utils","dist-tags":{"canary":"0.15.0-alpha.4409","next":"0.15.13-beta.5591","latest":"0.15.13"},"versions":{"0.9.0-pre.755":{"name":"piral-ssr-utils","version":"0.9.0-pre.755","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.0-pre.755","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"84cb7b49847f2b1268a1da28c89ffeaf13fe3679","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.0-pre.755.tgz","fileCount":23,"integrity":"sha512-SHlWKqYhRCfYdSMqVUZDfYv1yMrt1tcdb0lMUu5eR3jNRwHSB1LxQp8Njqif6ieXlHioXC3KzrtL4hdO/+YD2A==","signatures":[{"sig":"MEQCIDnvma7x0ZktA/1Z2fgJPPuTVaMPjOZV6Pm7bvztUrjZAiB68KejqZ7Rj06EERaQ8brClTikNap9NJh3P62rBcB2GA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19291,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3TeoCRA9TVsSAnZWagAAWsYP/itImHKaFGT+1IZNePVe\nvCrK0mDm715fmd/R1GgvoZTsenhJ7Jup0o8fBdMsYjUuDI+nssfz9y9NtOlF\nLgWYpKo7uiSnd3XyCzmaBcJuvK+Wzuu5ugDAplRNKO9VJyVe9X5TVKx2+CIC\nS9i5ZnrSF86RnDzRR/cAy3EHSnoq5heIjYKddVKE1a0GZEMMhpvzdo7xGTKa\nwE0HlC0Yw6C1QVvrz2lyOPD0OjekBo/81MH205GrBhH3EHX2IayvyAErBOT2\nz3oUm9UiAuJpmeHbrCNA9PMVeoA7SPQqJ2hyCCgAqW0sqK1olTW+brdAqUA4\nso9NZlcqplyh75JbN/caO3zHsfYdZhwrx2SZ5t4YcvR9oqWiOHvnA3PY0Pio\nKUD1Q8ViB/MJx3b22/NqK0NepqtET+YBlFqQ473nVV/i+YhNc/yKg1H+ggIN\nCBHrtPQ8/4bPTVGxJ0ZTWH7Zp3JRvvZSpdwGymmOr+KJPkR73FEirSwV277P\nh2AYSdfi8NbOpzGn8cotlOTCkGJB8SJ24/P2mnMpaJM3/wYSMGM6X8XWMvpf\nKB0WteaX4i+gLvK9swAwX/qH51LKBwWXnCL+KV3yIJSTGtU0Rtlbv0u++1aL\nc/ox8JoAbq7nHYmiqq906pnW6eP/p+j+niws76sf/sZRuaqg1Dcws3au+8yG\nvlaH\r\n=co1P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"d9a89026e93ddb2eec63195a98f0a40ec64400cc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.0-pre.755"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.0-pre.755_1574778792086_0.6078678522687666","host":"s3://npm-registry-packages"}},"0.9.0-pre.756":{"name":"piral-ssr-utils","version":"0.9.0-pre.756","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.0-pre.756","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0361549f498dbea4d4e39a8178842837a66e1f9e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.0-pre.756.tgz","fileCount":24,"integrity":"sha512-yp1hcwGubmfyEbirQYc9BRf+tYjsGRHub0eiR1ENZFKNe7fnQh06Y2FaTncLRo4Nw5ihRwiMUIopMn+95TDPSw==","signatures":[{"sig":"MEUCIE8qRzEJsmxtTRc6m5LozlBqwCU2WIw42xSXpeOcjBZGAiEAjA9qxBaAsbqncas4avrHg7UB9oEKyfZ3y6yG8nWURUI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3VTbCRA9TVsSAnZWagAAfFYP/3WF7aZZtL2ZmbiwHILr\nWAY0JD70Y3fj+74ejRCNuPBNBWozDHY31sBUItcaZ6RO3xp3xwlwvU4Bir8T\nHHnxhcbrQxgaMeJTJmSmS4gORSUpzUo2gxnbvkiCfTMceZf/OJBybeJnJQGV\nWbqSCPb/vJTdrS0IlKxCm1WeuROjv26ojQKsjzac/D67ZrLb0UtxvImHzSWB\nJGkELZ54SWdLYVl2Kv9UUl34ZmNA6/xUouv4LLSmFpNFN/Hribp2397BJCka\nZyx3bBRafhCd8Zv1QFBHnKd08Sn8YiszFAzsbLmLUYCM9RO8EAKEWgdUzEzQ\ncnSmK6Dl4sMQcHnfG0aShn/rkpKZ26nLUBznap5DO50TKdHFchux05r9hKuB\nU8KEmGPG2PKyn/KQo7HtClnftKnvbSmRlr0txgYPBHp4IS9FEVX3+IWRfyh7\no/6MSxUmlyJKMcmMqd6Q1lu51ErCs2n/v365jyNQoEzBL/BMk+++LrTOh3QC\nZiRKa/Wz1aD2MZkAjPVOVGg5WIop8TBUKcv9fJ7kWm5KJj5ySIyXCYyRKKGm\nBmOTxp3rijkwM6KSFl2gQLaPboscCeYraVO3ySGtMjHvY46MFzkz2ZqKEvsn\n4NZsoCXdTp9y/Xlenj8TUC0ijE0rcyOrqUQdbcoVHkIZF4l7wr+KPeeSBIk4\nrwSx\r\n=tH25\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"412a395210f272c7245d8e186970dbb129dc8cd3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.756"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.0-pre.756_1574786266681_0.7284338041950029","host":"s3://npm-registry-packages"}},"0.9.0-pre.757":{"name":"piral-ssr-utils","version":"0.9.0-pre.757","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.0-pre.757","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"755da35b032d59093be784a340c599a4f8b98bf1","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.0-pre.757.tgz","fileCount":24,"integrity":"sha512-vM/KgC0KvOPF+sKdKJJ35SVizkF5UbmmJQiOXWcuGl/lR6ThFd3+3XoIQ0A7cKVKDymjXXFBZ34tJyonQsYUgQ==","signatures":[{"sig":"MEYCIQDPg6U7c7nas0JYbA5h+5lszqUP7SYdF2z5hq0OpPNsGAIhANOPDXza4Hvixqc2Gjm4asgdxSJ/pMjhfnNDteUXiwIu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20821,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd36gaCRA9TVsSAnZWagAAILMP/21YL2O36v/aITksnOWg\n1vGiQxFwSuvGGBFF1+1QVtyZbO4Pp85TpUYjdHNDFItVjsSBFo2OXuByUR4k\nm6BxKeBivQY29x901DLuVDtjCcLZe+bcWbaN9nlpVzKh97OlsOLzwRU4rghq\n+T9B6egmS9p03xKhF27m5ueka4iRpSgQ8pwyWvzJGWLHBK2//333h8sP4p2f\nZyVr5jrE8b0YchqZ0bzcjaMJ9FEuC5EZzPkHNnybfLghypTTdwLtNT/Am/2p\nOtDhJ7PTQVmFpvxub/mlvZTgXZEmN7nfebDGflB8IsF2zp1nrpgBGir5oDPZ\nnF+eITiohjiSrY63ttAorfPfvX0V0i+CWPuXx74y1C5sPn9X3kB9ablH92nD\nqoPKlIQhT7rZ43yMsYB8KrQNnGOTE2zBsql/9GURD3Zq75OcPc0k9YYQUtA8\nJz9xymFrxI3U/KfVWmdX3pit5oBwqe2hiGF8AP5i9e7n9uBgvZoeW7f2JWvl\nnCigiLREXHBYcFXfvWEFJsBhQnucGppiB4cxOsrsin2KKstl+skhWgj9wDgl\nJsWfGFnGair+JKIgz3JEe1CeweOxtaerF7fEf0iQc7xO1PjYz9EU39Rh3THR\ncBotFZwy8q9F2+FG5j52PJqiRpsti6dM9NofzQkYgK6yIWp3bacEScfTX10Q\nPvqv\r\n=G73q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5a508f91c2f538c7be04b4052e13b272bc481fb9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.757"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.0-pre.757_1574938650191_0.47233470549169865","host":"s3://npm-registry-packages"}},"0.9.0-pre.758":{"name":"piral-ssr-utils","version":"0.9.0-pre.758","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.0-pre.758","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b9bf65a733cd6dadd7d18d6fd182c13cc46d8d99","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.0-pre.758.tgz","fileCount":24,"integrity":"sha512-F+RzwepH9ix6LtKgMh5sslI45qvoSeiLcCu8eOmYkKb5Ss+wkQbYvJYdTJsyfjnI7cI6qeQ9ZlfF/gKy1AZjuQ==","signatures":[{"sig":"MEYCIQD5ydLwEtwceEFot3485izRt2WwZmbYzzmvYgNHJxyd/AIhAIdnj5ySmR7SeRO7r8KbC7v0Cdo2SMOJQKqrZXNkKs2q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20821,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd4GcnCRA9TVsSAnZWagAAkScQAJnL+EBiiMNatVfRUjbd\nvKI7SXWJsUMQCilP6Qz/g6StpAj6QTFehdVDeMMok/1cmsBEujQw11KS1ltt\nvH4RkG8OfsrCnBB1iYC6ejsS+AE65n9bNbJPKgRHB6UEEcTUcHNygJ88PxrP\ny7LngG/HBYSIOBLEVCpRLcujc1ICnTU2XmIwB8tb5EcvKvUqTZy6+Zg1WXmf\n+Ya5Yan3EKSDnSCf/4rQ/pnGufevNv9Mb0tUmQa94ZRDvDtFsbqURpAEaAzZ\n2v22gpIQ3qU9nDvvJT7M2qg07/JI8+3ojQ/gPtyp8XC0bwwYUJgKK69cVsp5\nrMS9+FuxO/bDQHZEt6A0QJke7oNL9KZVChtAdQ+40saMAY0vUUfqyxYjF27N\nSJiIpqjIIcNXmKG5BMNfU0zLpf/eoVFdI8//EkFMSHToBcrFuevBTrYnYg/I\nBxJ4w9D04ZsvWXOc1qzMEyphLJzhh1LRmarmqb9NMvhxWoDYskFePBno20At\nnWP7P2XuQy5AML3B/v7HkmyVCKshR3oXU6u4qpYQmQXo76cgzqs80x75/TGj\nQmVb1yonD93mdKM8qGifhPHjFzAhaXVhlKiS2kwFLwxgkCqdN6imejTe4p9g\n+sAIngd4ZG+Ok2CL6VEfnxkpcf+00Arw7T5xJdRaVAGrd3OIyF3zh8P/7xZc\npEaE\r\n=egJR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b55b47bf72b559ee4dc3bfa0012252e59eff3161","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.758"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.0-pre.758_1574987559491_0.8423690168219009","host":"s3://npm-registry-packages"}},"0.9.0-pre.759":{"name":"piral-ssr-utils","version":"0.9.0-pre.759","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.0-pre.759","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"60f96fcb38a139de320aada6b752f21fb9329c5a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.0-pre.759.tgz","fileCount":24,"integrity":"sha512-CMVa2VrZyehm3tXbv49UXa2v0gJjCBKcsOc5edeKbtXJ0UJU/CGPExY2oBLb1qMqY2NCcxkpieJEtHfaxBg2eg==","signatures":[{"sig":"MEQCIERIX3xlTGjqnillumO5ayuWIdk8WS2XnJa70nWOFHeiAiAl7TO5QgC9MhbBq5BaQs83ZvrGvS79ysPg18dAmkk/Jw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20821,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd4Sa1CRA9TVsSAnZWagAArd4P/jlHEUU6rMms2fmwwcqI\nZ+iV92tXuJnRZb/hMjXB/9LDwzgYz9zXnt2mxBojGDZB9XoTdOQA0QbsA81T\nub+giP7qRxxQRduPMQMm5+NGNS3pPQ4zkEg5Yi+Xc4qFEKu2cNqx5LwL3CsZ\nayvZJXlwvepyNNPPcBqfnSqOMal4pAd4d2QCcDqY8sXt0pK8LVvFImzMyp6s\neB0v8VL/bI9m5Eq5vZv3QsqHx6TnRdNlSrtohTFC71Qq6cMDPRrWxINDSR6M\nAGQYBcDLLGIUPjaFcNObWw5JtoH/iyrJANOlJ+NgRcY1ASGeacK1mu8shIhG\nhamxZfPThqKYC6LL6LRu6nRpuPaSOV404P60peZBVPVFfW6Tc9QtotXm5X8v\n1Ug18aqHtyBWdspOkNaF+7bgaEaIySJSj2tjzb/Dqa3ExNd9fS/NhGv38TYN\nvRHw6ApTbfRg0G6+gP8sxBnFCed65UMS3p53DJsOKzeZFGnRqh4qj7hdV30o\nJY+29njc2wfeJ3bG8nYkk7bGghV38bCy+ewlybK/ejA3hte/4erjKX1Bkvcz\nmN0X1p3lVJalg/4BqM8QmW+ft/BWCTqt/dhqU77CpguJJ9zFrYQS7ZDUQjt9\nfbeGjvCgHyemCg01vkU+TPEZlRzJ1g2XZl3d0CYaMWFQ7npyu49WzX4t4xqj\nFXv5\r\n=1PSt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7f99fea46690df403c1090aa68b81a29bb5b83aa","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.759"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.0-pre.759_1575036597191_0.5408906864786165","host":"s3://npm-registry-packages"}},"0.9.0-pre.763":{"name":"piral-ssr-utils","version":"0.9.0-pre.763","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.0-pre.763","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b663d72a83b5f71ad29b4aec8a1a49de10630c73","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.0-pre.763.tgz","fileCount":24,"integrity":"sha512-b/mwf13rmCnkNR7VAE5gwq55SGieDmVJPkfkiJ+/pd1WjFG+vTjvvzVhctxCiTehdA8/g+lX0X4qJspP4jLiFw==","signatures":[{"sig":"MEUCIQCuOb3YqFjPsT38HMsTMP5R51gdeQytptyGceE+JgxLfwIgUJ29u7nYFCCXDe0z0rTrL89D7a9T+PbZqa8V4xMEZw0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5T4cCRA9TVsSAnZWagAAYroQAJ7GJVzfAMYMKoG6T1vD\nR4wEqyFQtZvCwklbMK7aMb+EhIZXotZc6LB07WlkiWcm4UgR2kYoMuUUNAyK\neBwUUNNj+5qhUcE6503nECXfHm8ITt0pcvzwG3oOkL7IOSWTEmRx8OlsP6zm\nJAl6uQJVzjdknpDL52LSW5ueEJJSEUmmxaMZKwfFlWOtiRYcnHp1k0JOC9hC\n+sPmJXD8GRMFoQPMcQhpdo7iq+1auO98bY8Ae8T6ymxd1EHh/0RvA/VKWCje\nmeZVFXHX/w5fGldoHvvY0Zsau1KHHNNYNSk61vqCsk7qWRwmYm1zDVNnKTTh\ngfvczm4S87GvjibAuaDIYOJvBLzo8m3cmcuzoTAgS1n9TZNmx6NjLP8YNNG6\n0iXVRy18yc4eOIT93Yc61ebbql4VlZG8F2rlfwGH4hWZOvRgeH7jxA7+Bq5k\nueNFi36rFYABhl07hQmsqg5Ezz91zxV3u5FwPDnULNxLS4UFXxKSnJrXWeaH\nCLTvjsTJlXR4kszW/zvlCRbUbb07vXYW13QN7xa87v4Qkc8fXZ9bQsYnZokw\nqJC6xJZh61jl9MH7zCjdlrTRygl0GUxCaClywKrjMc8AEQ4vxOGcGAb0tf+K\nVGrjIXLZnNlVIuKHMIocVnWq0iqC5gQlx72iDe9UxNw2oX72KFqb/slJ5Smk\nv6bH\r\n=eiqN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"244d493ecf0c7986e549b0ee2fe48feb20c52cd9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.763"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.0-pre.763_1575304731950_0.8021911346636099","host":"s3://npm-registry-packages"}},"0.9.0-pre.765":{"name":"piral-ssr-utils","version":"0.9.0-pre.765","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.0-pre.765","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5afc533e71b778a97c943cb2b955e02aa7659558","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.0-pre.765.tgz","fileCount":24,"integrity":"sha512-Adfpv0eYR+BWDrAExfK7rPLVx28f12o1gdJTMqR093oqIWVrePVUVL4fVvmriP95MtGDgsQYBBLYxGQvk0Mt3w==","signatures":[{"sig":"MEYCIQDzfzIFW5PFstVs3NwmsGqlImsz4jzjZt37Y3nqkrLRMgIhAIyw5L1n/yEN1ZaXsncMD7iqlG1Qrs1zntW43hhE6/wS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5j3bCRA9TVsSAnZWagAAvHIP/2KqCWgPmzZgTlBe7iHi\nCVWiCijYQQQMW37nVxh2r6zPjfhmrkTGte4uXa5a2OT7kOATMJDQv7lEkvp8\n/uuc/CiNDNlqqkD1e+pgTgazeF30DO/K1jKZwxhwU7hCXqujMf3eNgSnTqZ1\nFaiiJdmuAIh4bkGwH0eLJEAXLS58bkCZV0xdygDN+IwcbSd1PHHHhxn1pYOG\npPgZlFI7O2LmUh9ZNPaQIvLm0syTv7LqP3EnssSnLmIZYM9N7U+svjidYEyW\nfs0V6sM+gz2sMfSOfoiZaC8s8AQNKHWgsJIhG9MXDxk+RhTE0qPLBEC9DV4z\n3E9Q2ugyikNL1tCG1bKFuWJATFzTZTK0PT6NtUfzBS1XuI4wXs46vtwjmhkN\nTnKcN1cO8hEnL1XFBHZMKyeMiRFw2VDEKBYeABh5GyTI42a5EFtYqFSgpTX+\nz9ivtIWzQn/KnxfW686WTwwaZUY9DT77apDSlMXcdDid+F4y0Bb2DOW19/YY\nRl/LsVNckHwv/DGyedyKI56/wo9GSbY/UM6hdwSaItJm2p6Gir5WRyn2U/+8\ng4rxLQvImgAck0VglG9cD7zcGEMGx12koDRcBljLFucvPLYE1xTaS2fdXt7Q\nsVlz0NlsdjQjAqLGi8jHyhpugdjR3QVdywkeFlvWVUmMfTaPu6opG21wLNhI\nGwH/\r\n=O03P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"81e14b202558d9c3bcf2f8bfdf0b758d0b4b1043","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.765"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.0-pre.765_1575370203030_0.36631181029094195","host":"s3://npm-registry-packages"}},"0.9.0-pre.767":{"name":"piral-ssr-utils","version":"0.9.0-pre.767","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.0-pre.767","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"df8a7132cd8e93c369044121213ae5908e17372d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.0-pre.767.tgz","fileCount":24,"integrity":"sha512-DMNfscCEvS5sHZchXODjmFr5wLqnLCkgUUoAgmmphv+m9mVR85k6yQhUMujN8UhnLM/5v3TRQlD8NOT8DFVT2Q==","signatures":[{"sig":"MEUCIQD03ddxVu1QZMwvxtJUEgp0M0CCAnr+WIPMpt2Wt4XBAAIgUb+RREVNvvrbUGBGkvZZtIpexO+HfrBSUWdL0JWF9F4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5mwPCRA9TVsSAnZWagAAAbQP/1LODTRiaJzYFON3SaTt\nyu0jlGgqKKWej84l7jTRdI6P87y7+z3aUrYzgH3Kr/UXsebhWvY5yE11sM4a\nCc3OUtfqaRVAUYn02l13UCPuTlq5CBkQyYf/0mQdCZ9uz4kbKA1qG7UzOBD0\nLF4xb1Q64EMWkK/0UMAlvkFFr0/6L98pifOaRbdsgpJs3WKmWKBJ7FmTBUnE\n+zpbjDhH9jMoz6uLEnMBEoGdcPeGRzqP0DhwWR+4QNFcEl/Z9jU/as8QA7e8\nqYVRvezCT7TR9wNqndhZtn1CL4k8qrdEyuH/d7bNSeO+8MZLM/acit/NNtvC\nhLAt9L256QrtXGHzssuVUF8UtW5iWvu0hNz/t4dDCHKOay1rE1uK0wtE+dvE\n8buAzi4nZdN4F+TyIfjn/PzJIk+c5Lfwkxt3N1wqhlYqzfEWM79S2fz81sN7\nCC8bYIktBrq15zShaRFc3nwoUVOtpSSdJ3+OmV2qFWvTiDaxr9Zz1cTr/PO9\nKizsPvRte7Rv9kB5dPU+UYjZcFE7t+m4muIIRvqKSaPOqToxB1kl1EPFEj/z\n/5JYnI0/LZiTrI99jrYAAFxJaBTASOpoPcMcGrvOHptpCVhex1Cumo5tsp0J\nl+OrMQ0tzstMUloPbNCnJgmZ0GjzJOqj06YMrIblYi0k2WpC8JHRzaFCms5r\nYfYi\r\n=1b7y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"6c850918cd58a646829f056813dff3bccaba125a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.767"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.0-pre.767_1575382031155_0.7445431485468892","host":"s3://npm-registry-packages"}},"0.9.0-pre.770":{"name":"piral-ssr-utils","version":"0.9.0-pre.770","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.0-pre.770","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f3ce7ae93def7a29c412ba5f6241c5a9674e6304","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.0-pre.770.tgz","fileCount":24,"integrity":"sha512-GSg3cBDIIEl29oDeQosX1xyQvrlRrcF+vgjf7edssONFwH0C/2u+/PV5hJHqjYVsvgzTcazAjXPyQxAtaa80nw==","signatures":[{"sig":"MEYCIQDrqlmF4P8myO8QqlIZJEcnN2c8kB8Beo0DBYuwxj2zuQIhAMYNsBTDTX0k6LCHAuT//sKvSHun25Vd5fQqfIIueUWH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5nkWCRA9TVsSAnZWagAA/ZgQAJ+Bn5FNHSQck2chKLkU\nvX8yOOPm67t1T4zWV3oSnfAjwoRaBp/LjjifgBVo5nY1Z9jN4XXkfZ2fNd1T\nZ9vFn9kKOKI+hZFxMrEKXHFIU/MHIq3WBP8vgpKiVFQ6WHDuLVBPfyOpB2Xq\nzxXGS9o0O6FIOlMf6kOJCDwVx5UUcd+3Do2NUjN0R4i/fhwTS2kaXu0bZZZR\nz5/4Ku+qeiwOZOYRAg6tlm/wf2OMjmbk6kjob/iwck9R21jqSo+EGkxAJW4y\nAzqZKO1ANhfVkI49QeBR6+y239eL7H9M9CpIuTes26Tz6oADCbe0t8rjcI52\nbT4D2q3wZ2xh7qZEZgkt3VW2j/NgIO8/H7SXTR5NdG/PdA04kb4bb0mt9agd\npdjGOj9406g6nlUQUBkrh56a4TNEyjTSX/6++bT/0Q50M7DKrINfKlWY5y87\nWcjlhjfnq9VD5CUBB20UpRF8LETamSlL9TH9olpSQYF48yWL01QQ6ksAOShL\nwo9G6J9rQ//GTvjgTcBvBuRxPWOdGjdA02M/ZUqh+xz9oqhybxaa6OKO0wap\n/vhscSXhFvfXx1tXjy/o4HoAWbZ7AJD+itNXCBO6JANkLCNAIuWUmAnaeYCG\nMG/A0mNZegX1ITE+2dB2DjOB+f1w6DuH6/h0uUXQcdwiLSO2NFYe3n0w1Jh3\nA/6I\r\n=smYQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a9d4f01638bda4e99ac9b9328dcfd681ac8c2b3b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.770"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.0-pre.770_1575385366233_0.6797271623969288","host":"s3://npm-registry-packages"}},"0.9.0":{"name":"piral-ssr-utils","version":"0.9.0","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.0","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2c308e6d96fcedb71324c71d63beb8c29bb556f1","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.0.tgz","fileCount":24,"integrity":"sha512-fnXoCpBarmweEeQWi/zH6rEJ92OZnFAWIbkaHdBamudTR6/Nff7oYiczt3k02jNBU+MdS2TiErzPyZYbMGsMIQ==","signatures":[{"sig":"MEQCIH00BICidQpx0UuRYt3zvDpfcg6wBnrqd520rdyCjEWmAiBY3skbzGtQU8fB9W05RWW5ltKDAjaalEQz6PsepRCG0w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5ofLCRA9TVsSAnZWagAA97oP/2ABJLYdb4cR/eXoTUfT\nxqDgMAfX10yQcNUa7TVDqzxhy9vX5us5EFHZRb67JaQwuVzgIaqHwN8ioMH2\nOd0//e2vWsvdShGYBUGkfaKB0qV6BQAqbakTZHCZiqtLH175Twt3ZBOtOarj\ndO5kmC9YxEDvHPi0UZvkwcodqDl5lY0X1+Clf4y/jlrLOylcyOfqPHW8ypZn\nvWc4Zy5VHLIfmZys9M9hgdpqC5LpiugnDpAJmdTJU5vMQMn6Kok+jzQ4P0d5\nTrmxkRMlaGrHqj4BqPoB4cB5Vqrz0FS2jHE3N5yFJn2sHXjeEribRbd5+tUj\na0keEj5oPtALRbMTJVyz/I7PjFIkPiGGB5IeXzp30QMJCWzOinSi6y+8C5cw\nE2OEhEBX9PZPH7l8z2B4k/IMXGFwodFtYWd81hpjXGp4guhVIkXo0FkaSo4E\nXXSJEsw2BQfyAPJz0HM7tPUoqQpU6hQayyAdpO94apwRaLTzXjVBPjQ27XBr\n6+LmiaJx/76jPLdZCNl336hEa8K9MAyCnwSes3IgC4FVlMDGdsDsgXijngPA\nAd5EIwbxujFq5p85P8+uSlTCjprkxZpl6oeqaRzBj/lbERbrfR6WAnS7mvwz\nmq/IFiA07niWaWn8JFIPUR+4WTxZbZCj+e5vxqc9146bW9IRLlCGTLwcIiPL\n9sj3\r\n=6sMw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"7ad4b45a83f6f747feee198853377897ce5111b5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.0"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.0_1575389130933_0.991204313641135","host":"s3://npm-registry-packages"}},"0.9.1-pre.779":{"name":"piral-ssr-utils","version":"0.9.1-pre.779","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.1-pre.779","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1f42ead34360be6b8c118bb127ffa11b91e1775b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.1-pre.779.tgz","fileCount":24,"integrity":"sha512-bfct+kkQ/Zr5UE16EOJx2bvFhZ2378vn7R3D42lZ+djTxpjwMg7oB3vQZlQ5BSRZW3BRsnoCK7Hu+89LokI1Nw==","signatures":[{"sig":"MEUCIQD3FlDZPGMfAEmbwkaFOrs9/qhmNUNMZdap9/js4PDfcwIge8pwuDJHiPwJ2CMblS7GHsFNVWXh4/oYrnTyXXXiVnk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6O7bCRA9TVsSAnZWagAAxQoP/0jmcXFIgruM7Ljh1K1d\naGri5MWLzW6w3w3VyYWweumj75atXVgRNotMrFY+GSvQAG0kHVtMUrYAHhtK\nGrsYZyKqINbApbNs2uxdhzIOx8bR1Bj9pZoD7mxGMxvkw3qftp4y3oMGcm+S\n2KoYSrql5eG0C2ZQjkgoOTyk3AmIB20eOivBcN1wOAwlHZYzZYyIB2W0muUr\nom8m9hyfQ31uGp2Ur+DarSGiTdb7jCtzWLOLg/K0vl1vyNv7FU6sTUN9pvvQ\nJUGYGLRxBPf39qNlWx854cQnGaduX1aBwURAAILxOwcLMSz27AlHQXHSxANe\nZ0diaLUmtNRN4HzTbOdpbGGZ1m50VdnhbQVMLNsvZ6dy7VyG49B5ZEjz9sX0\nE0MFSCLmx+GYo5KZgIKzkefNgIqyFpPqb4s8tRKqEo9FOdrOFCrXV2PBU081\nYRMrPi0c9W/x3ZbYiowVKMg0kUI9qjAuDWonI5ZSb6E7wstlsfWUU1kAtKO4\nuEIDtEF6q9YRQQpBB2bIKC1jPCRs2MNDeL5J4U8an4pD2IrgTo/DTPn7e6A3\nlOuxBf/swp3WMWKqJV3935Ax6f5/B/x8cxK1rmlZdcsS/IoL5wqNNBqsZaTU\n5PoxbDUhs3KlHLDQ1kp4A77EKEEZDbcqySL2KAqfjLEIz7j1WmaJDhL5DFQ1\ncGT+\r\n=sVAX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8d4e44dfc80a4b8c33a7a1c5b3426556499a7aaa","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.1-pre.779"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.1-pre.779_1575546587504_0.32644118741315076","host":"s3://npm-registry-packages"}},"0.9.1-pre.781":{"name":"piral-ssr-utils","version":"0.9.1-pre.781","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.1-pre.781","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8b842dc95cfef9e5e80e2fbe602d2caebd21e7ad","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.1-pre.781.tgz","fileCount":24,"integrity":"sha512-u8szf+1JDFImv+B4ujh1+UpobK4WC1I0c/Q9EjlnYB/Og06GiLI7/Eqc/BsCZbDfeB4lmNDoPw/iNNASPEJ+fg==","signatures":[{"sig":"MEUCIEVjKLhDaO28hKUnN6kUj9g4ME03nicdtIy6GLRWA55+AiEA8rSRmTVlS330yhSxmy3ZpTKjM2aAK86mEhZcWM9OyvA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6krQCRA9TVsSAnZWagAAom8P/imNd6Jeih2dRc8bvB0d\nbYIyxmuvXQGHsG130sqWFVD9SMm+4EBA27lB31vHJI/pNJKJKcgJDsX8cR6Z\n72use4Ocra226Vqc3B0KhqjSP5BxcFwowPdBga0Ub0f/W9TmfoVuUosGZnVI\nTOtCJ+6Ap4x1BItD/26DRSVpqXsp+EOpWRhsaP9xpbk8dJfqm5fGhuUD8YJF\ngLMaK3TXRrtATxB5YG+ol4u/aVHES0Y8TD0l3CNrymGnxzWYsLwn4iY8j2CH\nnd9SrG6jlc0Dy8mK/yz/CoqbeiYkE7Q0GxdIcSSFkFtkwbFvhnxCYRRwhgIb\nb22cDLV+9r0OqkB3I2uEkz2YiyZLdVkoO/reC4Kgsbek4Z7gRnnIrWKlOWk5\nkHYd5rkW9p9oWzr9Pz3dltFH8FUENeaeVjnBBnUPKVzz+28EeD9BrARDlmjI\ndhwz8SoJg8iB/9UFxCxKI68G89zFRH13712HopAfy14Vm4RZrqa8KwJwVtyJ\n5rJtXA2WEznO8ANX8mQLBzbyEmqBG5DL8VG0ic13wkum1V6QI5JEPW96nN2t\nZIow1093nA6olwb7FIr0wmf0PhHEXsZZmYSJV337BWoFeBLerKZFQsfiqu7E\nID1OdVQ+GcVn3OhH6WKfX2SorURwjUVa2pIuQSEr+ksF3v+wViS75/SiOvZ1\n62Jg\r\n=mooL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f51ad35e2e03757ed03872514a31c256cb8ca353","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.1-pre.781"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.1-pre.781_1575635664231_0.3866906842830675","host":"s3://npm-registry-packages"}},"0.9.1":{"name":"piral-ssr-utils","version":"0.9.1","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.1","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c36453a942242f50a6d074dc07c28da9a41113f5","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.1.tgz","fileCount":24,"integrity":"sha512-QERwmYi2UA9l4tT7XfPZhqm/4seNHJ+gPzVqkqx1GQoU0+xs1DUsh1+gmiGBjQEYE08H84fVsPca6jJEZVaCTw==","signatures":[{"sig":"MEUCIQCitFvZ/wdM9iKzVj55eeLrniCDNHlFo/EmRYHxZXYKNQIgYqPGQrGBfw5utVKyocjVE3wJIZiPJUpySFVaADIfsSo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6llECRA9TVsSAnZWagAAzd8P+gOz009RbLWAz9cWy7hx\nfI/iBi6kQdHc5CFL6EjH5Z0aU9SVumB3xMHJAQpNQHXElcAx4e56i9bEJzGx\nb5xBk6VIw/xXN2eaXz6o+z1vpj4O1OlUeyj4ksRXKptGd4l8yKmH8begNzj0\nKZz3GQp4Y3LWX8vd4KuuK2DLPKRRGCmk0ys6XHkYaoF4N1mjG6xgYG24sb1M\naUxD9RptrBKVkyAfh0Axoz/7JauysS4sr+Lb7CD7zXv6NhsefJY/+p5FC4/Z\ny3ZzMQy1MfGs/gc8RENWw8Ajxzk0DUcJz4/mQ4e1vvtEyVqbvtAS85L/dAjk\nn+g3OYQhLs070KPWd+D/V/9fUdpGibtjBgRyqvxw94SsX7L0tnxaHiBcQzO/\nAUTpD/Sid/9fwCgB6ZcuVbBcq9+QPhp0GmC7ZmYEfjKM/9glcUCGA0WWN8/0\n0v/zbKVLkhk1CLGFa0xhf7K6moOm/2uJaihfbR9wDU05AZJ8ZJ5vPVh91ZcH\nHC1I4Wu8ZdGTxwcSUuB3rIBnEdLrEDQqOET7Ze+tMLv7FeH19nlMvJNwjq3D\nhxl6DUoRjkJNnuLmCZWVaI4l2JUfNEQbbvgMUu+5+GVVkX7ildLg8yqvrse/\n+e7AZ/gpnfgQD8TzJ6QdI42NarR3I3PMiqOhX4qGUAkA31nKqOtf1AoaxftK\nogOc\r\n=0Fax\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"9103c40ba8d06f7413640c653152d0c7996aef58","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.1"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.1_1575639363672_0.971470347481397","host":"s3://npm-registry-packages"}},"0.9.2-pre.785":{"name":"piral-ssr-utils","version":"0.9.2-pre.785","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.2-pre.785","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c795cc864c48f894060063f5980585a84765d574","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.2-pre.785.tgz","fileCount":24,"integrity":"sha512-XqF5ARllN4FYE4TB2nEXUijXtR371Bmf2bH8mmMm63gd5mmgeVSJFsl9fTrMnSAMeyCMeecORrPjaQMB0tL3Ew==","signatures":[{"sig":"MEYCIQD4tdPdmixvq3sSqWQ8ImmAGIGSYmXhP2RRwMlTKO6CvgIhAPo1JqaRM//g/k/v04MKVZyZ3aqEzZu7am/q4z0gA3Cz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6tDvCRA9TVsSAnZWagAAv8IP/AzwcF/kgpDIsZb8lByz\nGNPL3X/sh4B3GDjLi54gD/88PMxROpcJKIWG/DyTXph53hhCAAW5lZA9ZLwT\nnw9nELpJz0YbcGG6OcgCL6Y6Jxgzz+t/tWll6Qtdl1RqKxybTfYXosW/iZhV\ngzJ89lKbNDue9jNtS2V4SW/ds9FNwWmVYoKCi1CZ4D1dTzQWgNEj4vHxWmFx\nDsJexS/6HObhVQWJtz/XXTJ49/x/Liie0nPE1URTBvXoF0i93TPOKq5V14Xh\nxTaeCry6eBOvpbdnQoL0Nhrudcv6DUyF1Q05cvv4LDc9UD4/Ewv57NPT8g5w\n3DkR/AtJu5UVBXxjv58ozQkFb1HKHRrDpLDYmoJViT8WvD3L7Juq9wBf6g9a\nCsHBXqFkQDrHvsffX9p3OMKHPXNTHhJxNKPZRJKdmC7B7cuRfuBkiHLmBdq5\ngncWjx00013qCDMbq8DLzgiQtdrz6UJZdccjn6pOWQ+TS0Yw7gbZlRJHO7P0\nr4c4Jr32TeVXwKGgrpPgWtr4RhUP0NqT/XT9S/e8vBFkzyYViDmsQDzBsBZ5\nX2fBTZTtbebxBGVBxCjntFJp6PIixbv6Y4iCXofVn5YWROu/lFhboJSyco8O\n5Pig0QB1H8HEkk7+zL2fUOQ4IOuQBi38XOrt8LmBarsuFAQf/+TASc40ixW3\npVQw\r\n=y3hQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"eb5c1159fb61fdc71bbea42469457f91fc08b1a5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.785"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.2-pre.785_1575669998782_0.09502913131275537","host":"s3://npm-registry-packages"}},"0.9.2-pre.787":{"name":"piral-ssr-utils","version":"0.9.2-pre.787","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.2-pre.787","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"154a7cc26f625c2fe79bc87b8392fe49c8838080","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.2-pre.787.tgz","fileCount":24,"integrity":"sha512-qqafRdun3PWnng6GDEEGQ8qXT8X7urefrHu3i84ZmpMdY2lMWIdWD17cqgek7fJnS3GVuamH2Mr91rAwNB9AfA==","signatures":[{"sig":"MEUCIQD4SsJDX3O/u0Mhy+WFP8jcP+jvtNW94V0TQetVRvNtjQIgEoV6+l0BRSx66AENrx+e4Xr8IaXkUazWXs3teSZhFfA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6vBjCRA9TVsSAnZWagAAEasP/ArQiv4/QaganhwW8ToU\n6Rzs9DyfqLtlOjUU5f+UF+C5Ki+F1zJt8UgclHsojXqaFeMatEogehMhgcT4\ngNDAIJLI8CWC58KItn6WN7s9vZQLKPcl5Nio3jFO0iqDyrURtS/Ml1tEVy9d\n9cAiJlyTfycz4cfQSdi3qpdoj/XQ0mn8JYWzovMW+4XkRUhjFUd5QO8qzlCi\nFlPwKyYxNW9sH0nRqMaGEyiiX4JKAninGo6IKyV21ATnwlwHvLlp8pwL9PCF\npi+REp3d75ArJsRpwH3CxwKAamgOyYVpJ8FOCFRF9aAtWVTGPaMgA7qtLqmS\nb35XJWHXmYGysM7qui2ehVlBWPzNEk7BKyftOiN3j2YHvdcBJJoVKBLO+HUF\nCy8hCdMLvSB8ak4lUv2SKtc0IxJY+iWPiOQr/K8cg2Phr/a/z3e5VSBMpQ1m\nIgM9ASob4AzzVHk+41uDIk2HI4Nh1aGud+kyNd0TSLUjvx36LxflPjTRKi7r\nZHONqiglBv/smccfghpjl9MOfSds88LHTvozk40ib3GZ76lhvr8yZgzr0bsT\nL7/vDrxSaGqWKHOod55Y1h7fTsXoWERD7C3fxxRqAwg8LQDhfeWIpVYeLX7E\nNixaqTlsMag0+Dc9LSmaWFhC6XmroeenugHBcWSF9zuJPTGSdX77/CZoF4jU\ntFsP\r\n=K8iK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"819b12f2defc6cf87e2e2912ea2ab45a1091bdd7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.787"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.2-pre.787_1575678051004_0.39657933892473696","host":"s3://npm-registry-packages"}},"0.9.2-pre.789":{"name":"piral-ssr-utils","version":"0.9.2-pre.789","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.2-pre.789","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4ef03ea563c2292ce2c72591d6fa6be6207bfa83","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.2-pre.789.tgz","fileCount":24,"integrity":"sha512-LHxcoADo1Tg4lcfCNHa0Xb/dR/vnBkWsVxwjLE7lmcFoFLxXnOnTXWCZzQyeASQIeDk4qM+NTUHctr2Z4EPDqg==","signatures":[{"sig":"MEYCIQDNYM6wRzLj+54bgNBBYUfhF+cuRL5Y+pGilDd2cMJXJgIhAO6zR0ICbNRm9f+x3fMFB69vT3oIcNZ8evFGKS4gXDnJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6wRrCRA9TVsSAnZWagAAsOgP/jUG+hFplW0D7oNV29/X\nx+/Nqt3PbSwqluHMmR0Xj9Q1PkmrCvJ3BwZ8+Ox9pZh4yBRmCh+AiexIqXkJ\nmiY9NbEFm9LJhPDZT2DUt/m4oteeZOzerx5rztG/dTd77OE7vrGeupH2oKhU\nmyqcR3k/PyN5W2/zWVZEkWTjiGqp0uRWsRea4tfmVOYC7khS2JtNc4198THj\nUxzkKLp3MWSPqchF+DLdI5E1keTTiHl/wYe5wPFCqzINjvjf95OH0aIKQTsz\nMoZQvPEYS/l5MN1YPuoQzt1Fg6ufpnx1AfaUcrVoZYX/Gyiaki11A2psTp56\noI7caB8iV+iPsRLLu0ThftZYB5VAR47cb0spWmRgIndKjqVU1cnWRuOwC13D\n/0R5Bm9jfjXOz9KrjMxEAZTk5htyeaPl4lFQVNjOzLjPV+XrgLnQeA2qJ1sN\nOg7kJs25BHdPTfuKKm8C1ouvcc09iqLAsvSQ/8XTgGebduLeMtz+I/tsf7gE\nNaxfqK/AaC2q8IlnaKpODpJJie1DpVsQvGaq2UfzAISz/t9x7A6pL2CgOdFp\nXZlm2LPM27KXdAcuTqfOx9k2wJaNMWlvDZmvJiB9eLoD3LJtiFwH4xdWS0ni\nIXUpqmj46QevejT5uaubrBlvAEkteYHvazbqvWL3EqqjqIiOxEFE+L/A3a0q\nOHKD\r\n=34Cx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e1088fd6dbefe529f0bc403454f3ca28a080358f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.789"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.2-pre.789_1575683179297_0.6053521385549152","host":"s3://npm-registry-packages"}},"0.9.2-pre.790":{"name":"piral-ssr-utils","version":"0.9.2-pre.790","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.2-pre.790","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1b9e3decabfdfa34723924e8e134ac1727847ba9","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.2-pre.790.tgz","fileCount":24,"integrity":"sha512-7Wn+ON2pUTqCnzjkKTTz2Wc3rGOp72AhmRCvwpZIMUDMeqU+8BDsi+ZOQiXEyJtVztF0kXQCVI6vQh5Rlx7K2Q==","signatures":[{"sig":"MEUCIQDLMlp4dkwLe4V3A2ICu9Bdh3PPyvc4n2FId8b54dvqFgIgVpGNwM+m4OKZx9RWYT+b4Sg5RvxIiYXUXS/ANRiPN04=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd65tiCRA9TVsSAnZWagAAUS0P/iOg6vLPh8HyKUMtIg8R\npb5LecFPTcwpojcDjbv50IYDtUfrTtAkfUxTbjdV/KGcSWFMn2JQ0ArKoTQE\ndk2vJ5gK9af8PkJJWl85NwD03hUsQEAk0HvaCaDe9CM3FNO8UvEue7X/Nuak\nlOAvjTo6AIzG0IGgiJu79CkhDisPYMPbbG/7/xmBh178mHXiuvgVx8+PGfUu\ndxrX9gkd6DxTcjXEr8vuto2lsUwS2puijj1rUL1w+YLDfLQYAr7P+x4mrq6c\nsExUeMnJEJIVdrm59sxZG0HsxHQ9DtugCvtc5ErrQCogNt8aJAC75ZiWOGNA\nMY/X1Vddwrj/AjNJtbR4npSqwBF49OXuNuj6ez7Z0Wv+3xDaI3V1zv7mpFFB\nE4BZpJt5LgbZmpzRXg7kkm9/B/gxF2GoxxQCuKduM/bDGeZ12WqxAzyQRwIr\ny/+JQVMQ/ihRnb4EzKazUdAuAc0Szvg4gVQ3WN1iQ2pYPreFgd5NSuYfyvih\nIgUWtUopHMrfO/waSRZ2dbBDEgJWrozfeulZO/BAwdtw4bp6xSQri+n9XkkG\nu5rZDPyjyElKO6JT3ENP4ran9Vhpw+8dHx7Pnz9W76R4bbZBWcKikgEOf5/t\nNC+c74KBH3ZuLjcwKRUOCJ5uVokGumYYlRGS3fdhu41DfTLFywdH2z2yhe2v\nmP8k\r\n=ARTj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"893836bad195885ee12f34ef449167c68cb19ad4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.790"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.2-pre.790_1575721826348_0.6829349956925663","host":"s3://npm-registry-packages"}},"0.9.2-pre.796":{"name":"piral-ssr-utils","version":"0.9.2-pre.796","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.2-pre.796","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d2c7dc8cc6a539235d41e0e22637f55a4581a392","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.2-pre.796.tgz","fileCount":24,"integrity":"sha512-Eqk4/By0scKQVPHWVdMxrJttB+U2ZNJy+h0TffMIF+f9ffrVyg2FC2LStQt/wr8F46UP2szZcq2zDl2oK/W2dw==","signatures":[{"sig":"MEUCIQCOxbzPJpPnli/4VKs/seCyXSjL0s4NzFOQM0GFW7/JRAIgfMmB1bePKiGqzhGkA+BgPLVGypDS7HsGLgkFjsJmLso=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd7apsCRA9TVsSAnZWagAAqDUQAIHDA9+r081mtk/Ho2xu\n45tutu8nUZPichbJTuK9Oin8eyhEftdcFkxproIda2miO14Jn6cZf2ZMB0sg\nV7Cg44Mcjfktf0lakKet1l6UdGr79aPzvoMaxQW4TjQJtvxQBrT80Qk8WXNH\nMgj5p8QOulICiH4sn9teUbgevpMVTqSmVeOWlMy/89/qpVmu/1FpKSIOQxko\nj2xKqFToqANaK84vi7/KC/UrjFtzTdrEzHsK+mmwevKp1fk0c7go7Wp5lUAl\n4COvUWPdbfMjC9tcz+XFpclevVkCMNDOFxDJdmAj7gFy3Cz7d3wQsda/bY84\nzus+lagPkfqrcjP+G+MzUORYfFMXleadrCsia9GOhZF9yasbyPM/ehhVg5wy\niVXVg5wQporKx9/YD3KJh8FbcVkNSACvYzXImu7KBsIDfrOJcrQudSPQAHrD\nR1e7Vi6/paYTfaHXplbdhaBHoV2NIiXE0e06d/i3w9pqN3Fr6eINh3RGwIpk\n6vv5WPtohUBBX/p50qkMlbWXUqa7K+d8B0ZoAiq06wBc/dBAo7BeBdA2ZsoU\nAUa2p2QnnPyKjNdEISRfE8xsfd2rugJlU/b2251nwFr1ctSHhxAwjUwEOQZx\nNpGMOLOU6pMW+34xcSGcsTcEG7dzTbaCE1rWf2v49f+A7e9xD7JIABbp6cYy\nyRlx\r\n=XPWo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b23724f27bc5ec384c0f2c1bbb6766aaf32b5596","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.796"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.2-pre.796_1575856748018_0.6963838890311282","host":"s3://npm-registry-packages"}},"0.9.2-pre.799":{"name":"piral-ssr-utils","version":"0.9.2-pre.799","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.2-pre.799","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2fee59162429ac62fc7f38070c2d247a0326b440","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.2-pre.799.tgz","fileCount":24,"integrity":"sha512-0h1vIcnOpUo8pLaaLFTZKdROanbMgPLIVwdErCNFFNA8rfr016uI75U20lad6l9MOQOTv+KzpWTOQvZaUqn1Jg==","signatures":[{"sig":"MEQCIC2GNSiwXiNmXjF+GYmu/xiNbcIeNqwHovJgEKNrw9qQAiAQytz81vHtYqRC2VXk6VTi2noB35uCWFOGUNXlyrDG7Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd7uBICRA9TVsSAnZWagAAKLUP/A13OlmdEPqH81g3yJbQ\nC+f6fcgoZixze5MfOgkuak+WUt4xg1r1WA/p5nsRmFl5aHiHew05EIU38Guh\nQ/YgdQRVVsvN199CemsxWu0mqxgytFihuChL3iK5ZKszrxMgPiklKzsMm+Mh\nRdg5F7OeDgbZmVg/O9cHd01fGhCSpUlvsJbDcMgDtzTovWoodWpYB1rd43Bi\nvRBD88KJ0h7ZJgpNCd1htmVqTS8f+dtUWgA13N/0OV2AMjt1TP5k630fmkFJ\na4iKjmQjfUfsNe6ZxdpNNlw5FA0vC99V05ejCG0sleeAqkT7Wg03hldsoxjh\nuE0vaStJ4iBLD3Ri0bKec9SG+Y8psjoHVqmCRBwbWYs5n5+P7IQa17d8JeFV\n/Z58CW406kdabFEd9p3yZFQ5GbYKtIP3C3HHY73Fyy9Gx193tV6FRRkzWGis\nyKUE4ze862WPFRtdutLiNADHIXP4Nvz1lyOSNxSQ2DiKmG5ZxyY6xPYgX8+d\n9YBRk79pc+T2mmckTd3j/pNSzTbmf8xe79Mfrys7MHNtW2UYegX7tSHc29Nt\no5LsAEX7ol+aQuzAw3q7RcyqmpSyzdfkZVlhg9sHC0ri3cG5dN8YeEeXBejh\nX5JfTPzGYa9auljmwtyS20UGorqM6gxzwx3eBjjTklcRFvbax9ZICou6mfwY\nKOY5\r\n=YPCy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"2853163131053dedca749cee0d2e12ab980a82a4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.799"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.2-pre.799_1575936072428_0.22868231482348933","host":"s3://npm-registry-packages"}},"0.9.2-pre.802":{"name":"piral-ssr-utils","version":"0.9.2-pre.802","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.2-pre.802","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8b70a67c559dc749e551e1b49434f19b9bf0f1c1","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.2-pre.802.tgz","fileCount":24,"integrity":"sha512-Fo7oowu3PQjjbN2fH57oFzKl6dr5jA9Q7CzfIfX6l7RrRtegD8aqwYJvkfw1gevfmP25rB3Exg8Pl+b9Ue+F5g==","signatures":[{"sig":"MEUCIEKgwvEhgWyc5v8MXaYyQENSKKoEihyFexUTQGdCkTluAiEA9vLJifrGahcy4YDwxGW8DrO6/5SST+m+a1qcqNXWZOU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd7/LMCRA9TVsSAnZWagAAgMMP/Al/j57OvMHMht440iTO\nphsnEHHYdZ9z5v1EwurD8YyvGO1ei1ouYr/TevMyaQdUe4vjdrbPygd0jbRG\nWvXjXOhsS5BDKCWuarOMdBCavJmSw6DeQ0oLpOXlhCNG2FRW11L6c/Tk6ifI\njbv2SKioUqePfcCB+gnJJ0ufIAdt7C/+mHE0HrO4Mtw06hf19xQpXUjBnRf5\nfvbTVnrjRu0A5SbgtGeOBjj42ppmCAQR4/OX3AoA+UPOjNgG1NybOHVBnDFE\ndJc9ClAsrI7HntDbpwJdZYnscdq3x1NspF1pO/fAYWgfeTS4LDpFqtjHCWau\n8x/il1vCjCwk3XOvxXIotC5D03f3k6wuI5u0lhoRTXoH3m58MxivkJmSSfVI\nWu+l8g8NW2PTQCZFgD71erEpKyU6Viq2MZ8gYWQkV1LTKNpAJDCMY0fJ/t+L\n8/Io2vhv8s2Y9MqSB8c1nsT6kx6pgk7yOv+gAqfVRA8LPLTWOdWNs9jNtqYL\n0SVquDVul2Z5f+JOU83bXRlCPhD87Dmwfv3BV4Pz3Zw7r59ACAib9Yp8+3xC\n2k+y9NY8/xXSIDD0wV6FW1S/O7rM8syfE8dzxLpydhTPwljnw29McZkY+c4j\neZkEDnwnntvRYEFvOzQjoGeUVBj3Jwe96PNH07lwOCQVOkp3lNykFdEsfNhm\nku71\r\n=/VRU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"104431a169c589745fb554e4b5daafb4e3935c7f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.802"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.2-pre.802_1576006348212_0.006356582933381816","host":"s3://npm-registry-packages"}},"0.9.2-pre.804":{"name":"piral-ssr-utils","version":"0.9.2-pre.804","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.2-pre.804","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b28af2bb81c3e30a34c5c7fc64eb103fcfe01eb5","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.2-pre.804.tgz","fileCount":24,"integrity":"sha512-BPNj07mL3/M99vDOgogM+/thFYHTFhWe05eUx6x3SJlGErCRMjLyWgWizmi4qIBq2GPcpO4frieo9DeqIQRPHg==","signatures":[{"sig":"MEUCIAk1djLUI1R9TipFksjMAFYiCjnEYA7O0KS5o6m5ANGTAiEAvwwsff8QMgoxQWdRVcsj7NNm4wNIyfHa5Kg7wth3oJ4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8DZzCRA9TVsSAnZWagAAAuUP/1ta5RX0D1mS5lnvXv1e\n9zS2ikpb/1dAp1iHcIc0BiTljGU1RvcJ/Ww1BHbBt6BZjpoP4phmYOZf9X1O\no4+g0E2qt2YztgtvSwm2uc2QzAiB5X6GOsExMZHEXuUqZP5yw6UL6CojCKkV\nWeBQHK35geZamRCEqTCeZ0ooQGy3/cEenBCnLLfGIlA/CbqjoUPdEchWiY/2\nAvyu68TZZA9ULlwKw3kFawWAu8RYf2o7YHXzLNb/hUFWdRKXACVeVL5D+YdT\nhHobUXzzRgof+zYREovabSFwPVC1zAeav9qn/uRb2Ezx19muy3syvuKZZcjA\nYNey2O7BYf5fLzhhyvHQnZpd861cQMxR9+z2A11syiXsLzQVqVGE4Kzrw7i/\nnv1rfrW/5Z5NYpDMlNbhoRE5u4QqyNEbFkAAIsv/ZCdukvHczu2G1S2uf9gG\ngd+RxK+/Xr9gnvMqItEjUuRx1pUY3p12WOcuVvvifCHPQJDYlyWCEvZDgdk9\nslzL27168P4frgJBdyNwHioLxAkzzzlnGu3a7hWSmRFHLaKZ9f1YcdfbkStS\n6XPgUZfNlIXX/kNuWewt/FORAAtLnyu/OOhbJMFqW0Yb9FC3YBiQbxt3lz+w\nqJUPlglDuQoNTl9GRutVk1tB6Xb4YVt2lAicc8grKTdEBQIh98h7j/7H4glO\nd0Y+\r\n=y24G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"25a519c7533b07d09c59f0fc2bbb1de1209a7ca4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.804"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.2-pre.804_1576023667213_0.5877728750158648","host":"s3://npm-registry-packages"}},"0.9.2":{"name":"piral-ssr-utils","version":"0.9.2","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.2","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"73f730a7b138ae1caa1280f7e40ecf6bbc0c3515","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.2.tgz","fileCount":24,"integrity":"sha512-PRL/Hw0SMR2lAdL4QQzIhDOdWdwQfAURTPvrPoEzfF8wIW9J1OrrqZBoQ8ft1EJIkroLRyQGqz1NAe12StoFXA==","signatures":[{"sig":"MEUCIQD0ER7Zt+ApMO5jDE20jbH4eAHTi9+UBOwKHxa5zaZ2AgIgD9QbkYgutMiabjLmIIs1t/Mg5ITZsZ8aT+0CHxVOXw4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8JPkCRA9TVsSAnZWagAAskgP/RI+cnStlUOhbM5cjvL6\nI2YRum/Q71rc59+nn4bd1noBNCEwPmPv1sYxGTa5UiVk/2bBsSvnbUeck3ef\nvnSg63UF23aRwHxkbPAGb471gi3f9sPRAqZlDkg/MDolPWUNTdP5sxsVB8ks\nXcUxRn9bsrfpNktrcktZG454aywRx1bR1dKvzBfK7AsyECAJDejeOaPUpCNg\naEw8tFDDDYHbj39T9IaB1JlFZCn0Q3Z4DdLGw1VzSF5YPpVNdG4ZJRUdoobC\nl/plO6WEV1Edc53pHpoIV0cFSYPQ6+vWSaGO4kGF25vBqsT/5H/kCvoT43HC\n4m1ZCjRmfAZXyq9LdCti3T2qhRO/qM2gxM1CdWZdnfSk6D9tJASl2kUaXMMx\ns3ugIFHIGP4/OOH0fj75Bvf2qI1tSCH/2IEBgTpK3HVuOVXst8EMH4eHMza+\n/b5BFBeuIZ9eaaZXHn/UZWJAr694OX4mhT+KmqNwkuWh2eUBnW9BdcgIh1Ox\nf+ZyO0TvnJI5YFK/aYjIrHB8W0Azm58+URSWvksxuxZPN0kbXxH3U5vsKVmS\nSia3aipP23jvAART0UkV61DgZTA9sQV9GBFMQPvFq4icCCjmsNAMhVuFqJ4G\nxk+CYJAaYvHSVOruaLLsKmUdAasXFQDU2l4OrBZkhxhTrocV7alhJbRB5Cga\nZ3u9\r\n=etXF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"cea779e782e08b2efd4104b5b6fef0f286779cd5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.2"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.2_1576047587608_0.33487332685430293","host":"s3://npm-registry-packages"}},"0.9.3-pre.808":{"name":"piral-ssr-utils","version":"0.9.3-pre.808","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.3-pre.808","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0dba03eb5c7e29be1366b53dc94fc400ef485387","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.3-pre.808.tgz","fileCount":24,"integrity":"sha512-6L+8OrspbX8/l8ZlZT0etZxQ5HTWxKugy8O8wlglr8QJQNda9GN1UtjsBCO/EhTHACSWanuhAph4u0awTvoGoA==","signatures":[{"sig":"MEUCIB9Xm+yRVO6lD6iF+Wro4fm2tY9pDnltdC1YLk2eEnkvAiEA6HOMYMjvNtLVvYgDVvh+JwS5LH4BEd0TkxJC6/QEnxg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8t8PCRA9TVsSAnZWagAACEoQAJlRJZZuOhXndaeCjJQl\n+KGTp0UA16Qlvbsi4HQP6j8ymZB+yJJLQLl4wV7BHT41rT+rIGAmR7juWVFH\nMyuC07fe5HioNYcRMMVNcxfIo/RiDcx74Lc7zK5oAeXsWGVdFm2BD0QXHZy5\nNZqKfO+w68k5aBw9kd1Bozq6Nm/PPuW0Qsb2R3PhiucpcsGGwPcivLFCCosF\nRzaGKz3G/VI8orzglQBzYKCoJvqvGs/z0rz+h340zeL7l90HwhbFbxlUU4BK\ns7Mk7f1qNGrSaUzDq+0u7EDJRboWBy5ANi5IAY6yfTugXsRnOJa0OlT6pT88\nApDioJwK0N/lRdsJ98fbSiJt9R2+mEyqot28cG+WbXjrm4nZmXSjq0YM9V0y\nFhDx2nCyZzcswfvzEUSh2D3w7N2lsRO01pKc8Wp+eW698cGrD11XobNZgbOb\n10b7eDsGsdD/RxFFKE2uOV3t7zYYemAlUaru6vaYGip1/47qs/OsLa/Ui45K\nioIzM7y2IYePPWzoRyhCWHbUdRVL0WEWvCeX8JKSVJBHdXUENE5CKq01CrZH\n2xqu9vTohpaV9q5RJuIL0PpPPPvCw0I+4q+MF2Z2lAhka3MCwzWzULAAwVeY\neg73IvVgO9EGu6U2S1dpf/ZHEDZpSx2NdHbTp1bYFMjXvNQtf7TW0eAX11jk\n/N8i\r\n=4Kzj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"987fc7d67c8638ae8897ac281f7dcaf9aa67a295","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.3-pre.808"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.3-pre.808_1576197903409_0.012087080664862526","host":"s3://npm-registry-packages"}},"0.9.3-pre.811":{"name":"piral-ssr-utils","version":"0.9.3-pre.811","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.3-pre.811","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a20a96a43e486484289beb5def5a80a071512a5f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.3-pre.811.tgz","fileCount":24,"integrity":"sha512-Wc/LmjnqHbcI4Ux7VCT58lTgRlDlN5dc7rQXZuTa3XrXARXMqwZkWHY2EdZ39ozBWLKCYH3+z2Jon+yN61gNJw==","signatures":[{"sig":"MEYCIQCNLaidrwdWG3dYLIaLmzNXrmXsn/onhueWRPUCBV05KQIhAJ+rQaToWm/fVqd5fsTOpaKT10zpr1VrBQ3bz6s/DyT4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd94qcCRA9TVsSAnZWagAA6nQP/1FDZM/P2YWF+vWx6STc\nnNDaC8X9TdhRmFRbwjmSpJoqySYPNdwt90bni+xRmX0y240gkKlZZ49EWE1w\ne0Yn6McghewvbMIoge6eU+lsCpy3kbdwvaalOqc3dOdZWUonNz6NhhKadXbf\nx5bEaN0glH9CDtoIBzLhtaIVzLNLALPIFp6HOzNv+v7TjjXa2GxASAkUj56H\nJDXF66NYpjSgm6hMAEPAKWVL9RNycXqJi3f9HTFq8AdE6iPwq0EIljrM8f3p\n/gh24T86eiuog5QSKCIsI+TVeOPzDSDE2E7+eMMPj+jHFGSoDFac2Rd5OGso\nuodcm1INIKko+ntHJxEKzgpHQniMvbTczEy/zo9Z+LRE1kshZ0myKfuERUkd\njJWFqvqvXsMUunFhUfHjBlIRxn5J8VGqPEY4yJvY9U9M/23yO6AwOvLlHtvA\nwzQM081qpx+xtai4DMSh88Xl/tT/fIlg9EFwraXdWFWeimAFnqtM8vrLNU6y\nr7XRMBUQLQH+tEtyYfxmIMVNrCi2wZsuQIIt0J3TBebjZuYvl9ZBg8fZCysj\nirvgEJNsTY/EuC1WY92BnL3R/9fDcT+BmXWyaCZ5BiAo412ev6o574plAHLc\nQlZMvjqD48hvlCoXFDpKb6xt9ixo785Rrz6POlR5XU2Wv0SiLtMXY+XuuDx5\n7vap\r\n=hxTR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"959564a1187da704f364977b2b1eb4c13075b7e1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.3-pre.811"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.3-pre.811_1576503963890_0.6772094643992512","host":"s3://npm-registry-packages"}},"0.9.3-pre.813":{"name":"piral-ssr-utils","version":"0.9.3-pre.813","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.3-pre.813","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"30a819ef9ece21b8347009b8d1742c9c06441041","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.3-pre.813.tgz","fileCount":24,"integrity":"sha512-z6aw5gtn9FV9y1gl2Fnk2iyX9gt4EDUz/QPIHeOEisInSZUoO40JGE83rpiXa93Ili+JG5xQg0ED73qqWmB1/A==","signatures":[{"sig":"MEUCIQDhwvzgHEYO/zpPbSr2XWhdOwV2qr1d3yYssSgLZH4aTwIgLjFUXx5rVFF97Zx+xprgJBIt+JjjsokmYLuHhRqmPcg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd9+DNCRA9TVsSAnZWagAARcwP/3j+IWYnPfckABiIyKMX\nUCN6hc6WNBLOvDOZrXtLOEMatf6lBY6uYDi9PFW7mpR45u4/S/AIes4OV+fe\n1j195GpDFQNkpYFm9eU3fDwOVxJS0GaHZclC7+flCClzYlw/92pWM3uC/HQS\nbN6/Rq8ePn3k2/uHlpJufhhcWWNLabnfPWiYjA93b3pYBRRvQOMjLvhbzSE5\nOWYlfzFRcnPTX4DXZA7nC6gGfkopOIuIcHku8TwJ+/x7S1CSD1c9+0ivJPs7\nnpI8/bPmQ/wMIZchmbwZJ2ebColS9Z2pHLpmtSWlD/BOvuvNVP33yLDdigj7\ndL46U855f6PtpyyI9G1hkuz+mJgk1DhCU/iuF6vMdbpSJyMXDl423bBNvR/v\nDYXfKUb3nuCnfbUeXFuhEghCcSgEgn3xOoXhp+Kr5Gu+imvNt82vIiVwR/v8\n0q8esEUPyUG5rlmdynvVbufJC+IvaWwayqjntRHimXvex00kbUxvs//36GCw\n+E9Gye/UFtiYqpWMp1dPGP1qEDtfl4f5z7ix63ubQhFqoBim4LJWDlpQrlsI\nGbNOzpPWeBBblYSYCLL7eYdSJMmoJlz+t5hZ2V5g1EyDnk/SwA9D4Pk0TdVH\nBRFiHlBZyuhLmQnLHYlXIpMDXJiKJcFgrie+cZdwz9tnJrGGmy0ZRRrHke3O\nK2Vy\r\n=r58X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"86f602267289f15d7871b033740ea7b8967dcb9c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.3-pre.813"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.3-pre.813_1576526028803_0.8885384742768256","host":"s3://npm-registry-packages"}},"0.9.3-pre.814":{"name":"piral-ssr-utils","version":"0.9.3-pre.814","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.3-pre.814","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2f57566644e8faa5f7be734518426ae7e98d0004","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.3-pre.814.tgz","fileCount":24,"integrity":"sha512-vNkX7r57YzTmmx12b18ax8ehAzhME50C+iv6vsYCLiQIKJqQ5U93ds/yjVwrtiEEdHsmfUlp06lr9nM9sSOjeQ==","signatures":[{"sig":"MEUCIG+JpxZu4HRh7hqBx4hKdsnt4s5zHwJrAJPR2tTfoGP1AiEAhzqdWNjAZRf6KURTtr8vY/crg6NwwxSU7VcAfshJgPk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+BUXCRA9TVsSAnZWagAAhKsP/2cFjqyRPCerVHCHO3Zt\nWVjxr/ZNx1tkxFDj51sijb5zZvm+k4BneJT8KjTaH3atGZDvBOYfANHVr5JK\nuvTX2AVSjigo3pyupOrlMj3fqa6Pkv+PEJF0bSI3RD6hExmsqalXqbCjukw9\nnbWYfCwda2Sn6zZOs6L8cTIGBdT9F8ugFFLebPAAIyCtbwbhRPZi1G43FopM\nS22KoWkmDFj00aikKDjx95khicXXcGrVom810Xl3MdeCjls459BWbo1gpR+a\nZeBCKz5aGKOqfEFbFP9qimDv+o+KTP9UmAgZpngQG5kxSHocISLN3RCBVJpA\n6S9GVJ1MdCj1RCdVcbB7HW2gdalbrmNfak1b5TGM6ud8dVb0mEtLI13d80zr\nXSx5+0CoQJfSF2F29/INRDNlYLRJmMan2dPMf26ka2RXyPyQLfDfM9WactB3\n2mka/LRbU9HxcDBRvrDq4T1JDnmDw5zEzfWpNYbU9UnHzYkFVHDs7ebCSdcH\neJ4lSfWj7WRjhVwr15IvPf+8YrRJwqePNlYNNeKXEm6XuKYqh20ZdKIBz2ZJ\n0rX1mSM0b9jtMC/MvIANPow1KFW1rh0SNWyK3Vkyt5fZujcrdy4kVf30Aay7\nUi6oc7Uur6UcMXyW8Mk8d1bkldnDW3pFWl02ORLmiD+joejuXFc0Oc/6ChMB\npMqU\r\n=x2Ii\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ffe17d238dc042d56ab11ba94c5d8a64117436ce","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.3-pre.814"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.3-pre.814_1576539414734_0.09751062710253788","host":"s3://npm-registry-packages"}},"0.9.3-pre.816":{"name":"piral-ssr-utils","version":"0.9.3-pre.816","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.3-pre.816","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ea97ca9067817974b069bf592d6cc9755a41293b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.3-pre.816.tgz","fileCount":24,"integrity":"sha512-Cdqz+tHL2Udvg+W0tnGorN4CkShz9wAIPSRH42KnS5x2wKUyPeiNerYiWYaLXYL4TiJVd2Bd+v6gq3/FLOfU5g==","signatures":[{"sig":"MEUCIQDsnlCImosd0COlNdwkAQdXWjIKpjTQmnL65om+iziidAIgEODnk+3i9kox2jtHYxqanxMrEo6H3hqbp2/wyhBqekM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+CoxCRA9TVsSAnZWagAAwzUQAKFxQ1t6C38V+aAJQ7wr\nrrepe/F+x0cO5mYey6MVjWUwxXYs3OpLDYV+WueY+akHALPUMimKWhuK/W3N\nyqMzF8CzZXXzOy1m3+wGuB+hIRNj28ZDqSdIL6hjgrNLQzEcNw6TmBlm5cD+\n3oP4g5RFPsjHB5FS1v45XdctHc6/PVLle6+2ZOG18JVWia+EcYEySfLVLTbc\nWYPJ6/+nv0vS/15UDhIdIhmYgPhk/X26HwHZ+gIajvv+HvFQhWRYNq0L/KQP\nxsWnaG1EaaPZvBv0wMhy3gD2SuvqWZcEK69YW79WAwSc6n1WyOQr2sT84jH1\nudLHo4XfzZE0YKVPBTydm2hpSrmHbAkviovGXNHdMMu6hLwe/0gXfmnTxfc5\nxYtrMlHysSVP6Wu6XiPsGGS/nSM4myqLwuSJcaE3coKGfrYh/zxMefX9LY3F\n/iHDjVo1AO5P5BNGl3dcw+mRTiXsPHAFpoW0r+kY7UzSHVlRx3OITp7UjDoA\nJx4Zhs0LNBPVA0Sqq8Rz0FxSbu4diiVSbmDJ4LDbWhMkb5SGVajD1T13v46H\nReoZRjaaFkCMs4qPGGnxEbQnPImMCHpIOlArUyq7bAa3o8rrN215cM91Pk0t\nR+iv/IUi95R5kVNDwqZpupdML4N2HvkHc+dGVnSSbfFDQeW/U1fNXpN2JwLf\n+q7d\r\n=uvqT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"63d278a1cfaf6788e0befb7a0a110e5a5bf3da2a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.3-pre.816"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.3-pre.816_1576544816688_0.8570826350486738","host":"s3://npm-registry-packages"}},"0.9.3-pre.818":{"name":"piral-ssr-utils","version":"0.9.3-pre.818","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.3-pre.818","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9241c3994dba3422bd0704700ebf1b71069593bb","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.3-pre.818.tgz","fileCount":24,"integrity":"sha512-2IZpgUZuO+MLoct1LoyA/13JaLCrAqiHT9H3f8evdx5Cf1KOIt68RsPRjOY4dhKJ0bgT+whOoXcaajwonV61DQ==","signatures":[{"sig":"MEYCIQDHR7oKPb9gcJFjm0MX1Aq1m1XKfQgF03TNF671KxgnnQIhAPEXdEBvnoBy+POuGnclCsy8h1ww9LPfTsjGwj6e2+5x","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+O0pCRA9TVsSAnZWagAAeuIP/Ret1WnpDfx8LCYgz0fh\nYXtshtZobRPkezxLS2CMUlmS7MJtF8EoWeZtJPdOLqxhfzBrrIc7HCQuJPZm\nMJgFhfLdwUDMp1EinmmrdYPeF83AwtRYDUsRDI26k1T1k4a6sARtZbfCLXzt\nt2rqeBeCfq0FzuEXitdSSSc9SzSWoRk5uKcisogDFhrCEDTYVXrA8lU+cIw8\nfbthCDEM3+d+9wut0bHk8uqsGQ9FuWDPMG07Lb5S6JG81OVlW8A0ghQ1WdCF\n9EYvrQl6ybEPvDoaN+5JtEgahOM6SjLvgd4TG9SGNdeA9HMh5gkh0Hj85qmG\nFRICQ/DV87Sbc4voMMm4v/nSE6XhURcgbMO9mCITQbUlPTrb/pTEqVwMzmD0\nxPUtLrAvE16GixGME17IBxi6YsNA7QbTdiPU5rskE4+lIWbY9ScnXZ59FE6J\nREUp9SYXi0QyzSzqFw7sjkV84hwtqrF67AsercJIt+kDsJfmRytei0xdiP2H\nwISPe7yRiGhSX1ajYuQMWp8Y/pV+KT1Ni7FQbOX1OPiqw7G9n2ZWetofCjFD\n+L/SoSWfcZ7dSlQRjb/XKm4bRxNHK9b+GCcZwm2pjidy2je/HZeC05s8CE46\nauYqKMDLwnad0Tjrlj5+XXcuBQicglzXOz/6dhwScnPEokZvb06XBX+hwYb+\nh4Du\r\n=J3Z+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"419737e5bd29f42c9b5397d2eac59d7069303903","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.3-pre.818"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.3-pre.818_1576594728801_0.294215361387967","host":"s3://npm-registry-packages"}},"0.9.3":{"name":"piral-ssr-utils","version":"0.9.3","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.3","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8e548f9efe4279e31b762b9afa14f716e7250de4","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.3.tgz","fileCount":24,"integrity":"sha512-SaMAqDiNtBvmvjdcsZy9zWLu+YNTsX6/jshnF8rjOx4g6pYEBU76c6zFKkg4fPnsPxOPL86LUxa6vHi+guOOpA==","signatures":[{"sig":"MEUCIBfLGKw1z7MBzv2OpxR099L8nqyAXtvaC05pnvm0m8U4AiEA0rUiUqS40ezh7M5V+oaFWuaboIZYqW6Sp3eZ8rmVMnQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+QcXCRA9TVsSAnZWagAAnS8P/jjqu4lrc5qYJ19Ju0RH\niIbx38y2kqBf9v2024gVxJJRDE4uiEyA3xpOVGYN0EezjsLNPAVVTmiGOKPW\nTEx/ydymnPCtuxjO7By39I1bv0BSk+2w2TJFNwGDOeBc/MXMGJCrHcPOQdYM\nZ635wAF1jxlwVGKs+AE0akPJmSETKv5kCQ1+GSAKXkK3mlfVBsFIhi2dIeYT\n9Sr6J6L4mmvVPofD9VYTVkEH6yPDxU26QD1u2A19XBwpg8CqhEsMxN/a+XIB\nYg9p1piYgkvJQgy3Fi/5ZS6Z19qaVzDIQIV7WPma8/yvhfiNk6+zCX9mNkhA\nYzG3E+48yAGNqo+ef2GJuC1ipGkeI11mZ/YyiGQxl+HMVl/baPss0GqBoaKf\n/TVI7Cn/B4XUU/r/FvyuJOVVJRr35yCOptSXTyL6sk9u5bVb2ZU3ZrtYryWD\n/cprhRY7hmhdHYEtDTa5jEl6gpvwVJwlFRcXRDos2K5CZjiZdEZYy+gb+hrB\nMPwa6p53istsr3aVF352VAl2G1JiKA6AGtT1cwP7BQ4PHQVJrxD6YFDUGtmn\n+kxHAll569EqW+sYAAj13YsjeRf0lsOfiJ4MR/RwhUSdLVAInxHX7JM2jSBo\nESGSwqIb+l1ArrNCE/B3r6rTiLx1T6FkugwUE4xu+sVWUB5XVLFoKoASj70L\nwbNw\r\n=+tZ6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"a079ff637821eeacd28f1209593b778e370d0366","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.3"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.3_1576601366816_0.4635806510940239","host":"s3://npm-registry-packages"}},"0.10.0-pre.823":{"name":"piral-ssr-utils","version":"0.10.0-pre.823","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.823","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"56b17380af9bdde31e22acca9ebee082941c5e28","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.823.tgz","fileCount":24,"integrity":"sha512-kWxou8g2OE36L2Us02c56oxmt66ABO7Dykpj/weOv91m6Tkz1/2rTIg0rXxIZaG14224jAsQn6vQWBYvuFZCtQ==","signatures":[{"sig":"MEYCIQCSOZ3BmBUAG6fsnn0BgIQgX4S5k98wM9iPa7nS+fbGBAIhAMSEHCXJp1veV1EVe1r8DtTrLewEFTECyjX9tWQwmp1/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+azbCRA9TVsSAnZWagAAi74P/RIHSaAvdNTbK6MQuLSi\n5JcsLTMSpboHkZW0l4f9xFaetcdcgSslmUvBUgKGPBB6tdU5Nl2kj5m+ReQL\nVfsoSTyk87JojRplDU10aL38V1N/63itxrYCra7XRYz9l2dHCD434IAB36v2\nhXC46ZGghc34cNPxMJhQwmUNTEk90ykXdRB8NulcI4hDs4AFniPzNZfqlyP+\nKcE7rLyC7bWf3LpxXVyyr0NgILtQd/UNbUqdDK08emyYjfGpA+V+CzH9UcT6\nqEsC2NHS6SR2lOZEMtIGg+QMstq1sTwDp1nS+SIMJfChnh4/U8c2JzbbdKGP\n1FT8plEgzXc7Tww0Ho75Q3d2zvILDmcGVNKLp6ABBTVGtfpmwmzLBtrODwaH\nF4DEXFCshIfv2ie0/EQxDBKtflJINLFPNpb4bmeZ3K4kZhR4w2woFVBRaPmY\n23hdYXmG3ZY+d2tBC8x/wd1zGDYVVBP1DqybNnRWDc/4U6icolWIlTAsJ8zA\nrHwr1Xp1kfbUz+jXusJbWGEV8llqPwbvB4v4/2LwlimIinIDYXWxiWN7WgM3\nn5In792Ny75SLFGAoMOQlOgS5hXXe/Y9hvGQLfp4+5sRvn4OgA5+hWN46n4l\nTjTwDug0MzQAFQuK5+soEW0ohgrHCB3Tpyi3Qrgf9q8sFI9ueWgSWYE15P/o\n+miy\r\n=TcCj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"6ffae5945e28b7d86c7701e25aa3b2698e32a985","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.823"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.823_1576643803121_0.6438306372234379","host":"s3://npm-registry-packages"}},"0.10.0-pre.827":{"name":"piral-ssr-utils","version":"0.10.0-pre.827","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.827","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ea9b83365414580467f5cc14172928a3a9ed3142","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.827.tgz","fileCount":24,"integrity":"sha512-KBJYma/MWhZH7XZthQ2x36ehaCjpTEW0q1i0vj4zsWVKGbCQlvialrJyYAmWAuDBh6MAuUh5SP2eyk0aIwNbhg==","signatures":[{"sig":"MEYCIQD27ac/l7Bf9pRxhGcDhrh0OneFU1RP15qzgDkumCJZDQIhALPKZciQlCO8NLXsqLAV6ED7BkD3gDIkShwr1nExPeBP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd/KXXCRA9TVsSAnZWagAAq58P+gJTOlIbFXVGdlyLSmOF\n5RgFmkaOpaxJqaVdceI1uNszC2kRC7ZcuvgVm0DJGqsAsp/i+27NAJPjLu2/\nxDYdGWL2Fx2J5YuyP4HlHHiU6T80JLnL2FCE5cqZFxJBCapzbieTDQbrqC3B\nX3lDI9YG9H2WV2kQSieD9UjX1Fi3sgt/d6SFXUl4Mn2c1tCkDgaxsfeec6A8\nBIQIA0p+1Nt2pbHuTVEP6qgkq/oNOxSYBK6IpHKSZIVMcs1I/uyKqAB8rEu4\n4lLT6leLFgDGDTlYCL36v+DWO6jTm2ixa+vy6rZiU178J3jNDReSul2gKyMX\nFtAHyhumFKZ9aEKZM+W97EmspaRBkvbW4rTma2RErE9kQ949mDtoGlaGb4qY\n3Dt752HStTsVS5mJEwM4+loqkXQfmQ+RO79ojvbJMNNHw+TArPw3IrAhuua9\nS53CUL4S2fW00lgdqoZ3jukFNuRJuVg4msV6EaSIH9XLn42FBQPr5MJM7aOu\nkLhYEiLPazVaKZZbjSZgqHYz/e4NfvdiQZttPAR1fSgv2+/J+1T4eQ/HGkSa\nMdrSyDxdXYscGqAaElg16csg3dGrzC87l6J6ADUDw9Iwz/GUfTTp+OQ5yoUs\nOFtFRJaCVR0VsjFPG2Tgvdut8ndekyjJTNMY99WXT2ufLYsb+GVpEUk6fr4Z\noP0r\r\n=+SJ3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"63305e6256095629479040df80d7616bbdd597ca","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.827"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.827_1576838615443_0.5168616183196644","host":"s3://npm-registry-packages"}},"0.10.0-pre.828":{"name":"piral-ssr-utils","version":"0.10.0-pre.828","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.828","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9d744076e52f6b3a56b73cab43be5a4156fba4be","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.828.tgz","fileCount":24,"integrity":"sha512-zvDX9zJqSt4ktOwr0ozcY9dMcEPTooXE9tSDXA+BeZabvT3EoGfaL57PUATnLLwPUG1YCBe3u37B3c+bEzo1Ww==","signatures":[{"sig":"MEYCIQDazIsPZ8aMJDVRpHNZYRKzVI15p/QWGEg9MD5DtCHruAIhAKU9fhh9xvPXrpmt8SxO8iSy5+TLzq6qvYnwlyZ67/52","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeAADaCRA9TVsSAnZWagAAblYP/izdlfg91nO07N7MMp4T\nslnMxYCo2N1PXas8xegfqbNvYr6Aga3zg2QHIW7QY9P2DB2UOLgmAHNT9Cfo\nTqpBfhxmMGDe6ObwWTEh4goygjAbQHtXcuUs1CosGGg68CuSnfRgnVcILE8s\n9GoAhnxfDBvHUfL/dmNjN8uc69cw9wy6I1aT9a3efiw0PkmBbgkHivQsnYFg\nrgdUseu/Ll7b8nikyeWjRayVj3q+e2AUN2xHMoXKhR806Mc5sFJm3IFjS2tH\nu0O1pWXDm3xs2O5/HKiLiKfEXRPITpuXOl8YwxJ4U12RtsdZosXj9GC8/HLm\n8Uhy9Bz1sq6vUwzXrm73d9tdvnpdtAWYOWSTCpVH0JhntyU8ZdvRr9x6ueLJ\nAFq6aJJORuxd9Y7hwtL9hSeB+tLsTF5c0KaBlxsPpurM8CdEM0SFqBzFgoSV\npsoXVWzw0EmRs/LwCALkTqVozj4Qnk8g71gGSA0fXD35OFnqCYu5UbkV2+oV\nzzIR5kavymah008aXESArqmyMkblUa/CdIesaGr4e+j5QLKG/di9TdKon8i5\nhbDyU+vdtoTiocgIm22HfAhA27MbjqkvgAwS7Ck2IfWglQQXWpq4Y6KTEs0v\nCo51LQ7aDajTCZd4wYP82DWKv9znaNerX4ZUNaIVEOmTUXtLzCV3CRqTP3bp\nFkb9\r\n=cLHm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a44758f42ec541d9bcb9f8cf39880fcb050c2934","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.828"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.828_1577058522188_0.30183172622635546","host":"s3://npm-registry-packages"}},"0.10.0-pre.829":{"name":"piral-ssr-utils","version":"0.10.0-pre.829","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.829","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8cfa82b7d3486e989ddb903e8bd373b6b429147d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.829.tgz","fileCount":24,"integrity":"sha512-AU40V9tk/mu3id/BS+s4dGKraDQKFAZzVIRthn6e8YYBkbYrR4VjDWRdDhzFmYGnTEcky287+dwEtCbWYBAmvw==","signatures":[{"sig":"MEYCIQCVl6iSRsgJB5KH97leWUSdaJFo4H6Zf2+r0Glmu+ANmAIhAOFCVzqayunu0tL2kV32UCQGk0IRqgj/prMBGdphl/pN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeA/rMCRA9TVsSAnZWagAAEukP/0JRHO9I7FhnpSlE8gBq\nah5fF+29OXnpaxH0uzj2hZ/TtknGpT0llCJPH/TODv2icFo6SnoJKGp9u+WN\n0rScLSCQX0j1VHsN/1PDqyLPB9oK75oygj9+lZh3MlgVkvhZI6xEmvoyE4Ci\nVaQGlK5v/aQQw1ZqyV8GOeylcDbDnzo++kjdoVvWwK0SHNoQyK1ZCG87Kq20\nAYNw6xwFgM3mLHISQzWWwUpQFHodSEfX2yR/tW9NiRdPfhMsV1aOF567OtM/\ntUZNDGnabYsHFKLIhNtm/wMAG29gCzKwtjtJRkdMHjR6LrVztTuOFlGb12Kv\n60Hzubp5R0OryinGxQnXrU0XTvIEoABQPictQTXZeH9SK4yWWAjcIMO47I1r\nmDw6kduSGRagJIS5Rj+EgQMs9nvbm9bTHPCalBp1EsmlUxdA8DNvTbDMjpqY\nUsgY8IWh4ZQSNiNjJkMTL41Z1uY3TN5nziGFkKUFKtOkgd4AcVDFpAyFAbV1\n16xx4x+n+655YQHwUwmeg7mTbBAaZt7Uiv5cXqanPOe6IKj3sH3zyZTCfHuU\nWzCIUVtGo1JaaXIvfb1ux19SAVE3xKUGWcSFUuDBLYwhKC3bi5XkIWIuBUE7\n0MXq9yFGcEosIdmWKfEcjAH+0Wyhb6YwFKepJrU/HfZNjz4HDdY5bs/u5puL\nYhIP\r\n=raKL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"94a14111028167c8f8fc045ee49d305693252090","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.829"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.829_1577319115856_0.9190893027143083","host":"s3://npm-registry-packages"}},"0.10.0-pre.832":{"name":"piral-ssr-utils","version":"0.10.0-pre.832","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.832","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1b27d8e3df010d72dde56bcdd44da177fc574f15","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.832.tgz","fileCount":24,"integrity":"sha512-BJiGoQ3FttUQLQeJU7JgBEga4u8hQwBzxmW9YJz704XiwxLfc/QRG2I+tRuCvdX9J0+NBhO8tHWlas4ukY8TTg==","signatures":[{"sig":"MEQCICGh0n0LAqj0xZfRk2/W5jj3K0t+ICtuQbWka6gfQaGqAiAs2c/HoCcxlpfLV+dF3u1oTY29fkSuvqJ4sl14imEZ7g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeCkqRCRA9TVsSAnZWagAA8ikQAJvR1VVaXGRl8PJgYdwE\n89bpA50099PrExOUpYPEHUsU28iE2hP9tArlPFhfkQqwerJnGl4aO7nQ8pzE\nf9CC+eFXj+Tdtar4YIKF+TtpLcwzhBKsxwCoRBBBtM+uLBGkSeVO1MX6BtCg\nYONu0xCo68RfIOW17UKxKb0EtOvzI8/ulCFJNFr/lxoz1jA1Xq2VFIJAZpWL\nBwVZVSBt2nM/mOImpH5skZM6s9LO9HhpKqRSYlWnokLW3G03P74FIb8vQSWF\ncTRNt+T1Ccea2OUBIH/MpkF2gQOeNUXPvP2SEEtcVceuKGlg6gJk1Xg6NXfX\njtCHq1oj5Di0fI3hKER02+YBILFP/u+X35qyh/BKLCRBJy+q9l4fYhjFH00u\nn/mGIB/t1Wy7hRQEg5VataNYdaR7G3VvIywlmvFrQCy1djZ2tQlLHhoGjblh\nHf92yDf41extkr4sMULuRHcZm8ejS23hDFsl8r4S2SjwqhdJoLbCDxV35EOa\nq3tCK9zUOsbpFM5AC31bcuAa1QO1cyDerCHQrjUKgB4Rj6HtCMtw7gQbqY1+\nNXH/S9eeb5EDqaBIOvv3MdkemVOxMf58bqQZv0CO6151eWYm0JLIGHaM+lN1\nLCjzU3cEyicROWAOWD1RLGSTB7gxHp6ucERgaz645FNU/lf348oKcl+AowBG\nlqgX\r\n=SiKY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a0cefab34906b64eb9737b210d77aa7aeff78ae0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.832"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.832_1577732753311_0.17472970212066619","host":"s3://npm-registry-packages"}},"0.10.0-pre.833":{"name":"piral-ssr-utils","version":"0.10.0-pre.833","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.833","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d7d5c9e1148d23df9be90edf41a95b211c1d1e50","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.833.tgz","fileCount":24,"integrity":"sha512-OdO7vN/3n//srj8OrhDmHs196noWwE/MeRYV/te6ugtHhmyuizm4y4bycCmfxe32QdR8Sm+Jp0cAsrP/KHR95w==","signatures":[{"sig":"MEQCIEBA26WmNMMX5mVQkYdf6Je16lxh9YPLoBE6YRHP/LYLAiAzemgNBdtxUbgXrgCc1rfuzWzgzIkzLTJ3vSlC1aAkYA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeDtsZCRA9TVsSAnZWagAAgvUQAIF2yDzRM6bru8dVVGZ+\noK/ak7+I5MzVJXtrswdrXnsUue7lhkR0cLDIVEzk7yEcewVi2tgj3PCxKhrK\nPPJrybPzJltOWJ7OjVflZfRezyLUkVIMRngP6pCcMD05srbrjuqY/dQLTwYH\nm8DHhyNxiYMhwfwYg/VMtGC+WyU0Nswau9XdqyaAKmyDm29F1s0UtM9s8H6y\nV8FtnCfm0THt2TrD3U8swDGYXC+Lyj9UQrjS42TNDyDlwx8a5gdOU69/7mof\nGcVl4Sq+a/nyErLcE52C55UP8uy38J9amoXWuj/+vpIE7ZjuVoQ+lRikUKRQ\ncC+mIhTqAfs2XM7mM2K5Ctukr8aHppVZ8rdD6llChIbh3EAA4H4X5YAX8Sn6\nokypU3SuTGO3H7UuHN8HvIhoFvzz9tm7udhKNoHUT14MbVcnl9FtwVVBbga4\nmpekWPdjRGXO7rQycshZmb7w1aAmGrsWbxzS9iwhSAQ2PVwWb8qWIqbLBW+9\nmKEv7mLPZS3n9YWiJfw1pAEZD9De7OQXDpe6xP5cThJz9mZCkypHNETBXHyB\nQ0sToN7UXG25p8mE5QiALsbk7aeKJDtDmhhKAHK8IdHnPmMMsrdLjK85NZum\noEclKRw0eak5cnX9jdfzxhGHWB3Bw6J4ywtwUo8hhnNniGh8UNvlbkRKLpHv\nrdPH\r\n=N/9u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d516ac407b61944d2d3609af92664843535a90e4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.833"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.833_1578031897039_0.7449475762708091","host":"s3://npm-registry-packages"}},"0.10.0-pre.836":{"name":"piral-ssr-utils","version":"0.10.0-pre.836","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.836","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b6363046e8a4e1789459bef5c64f220b67ca5972","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.836.tgz","fileCount":24,"integrity":"sha512-Ga5s9kj0MsCdMeE9miJadi6nvJTdibWct1Vu4OTb+lkVxJV4IH3Cl2iIvoO7b6iRcuS1vpnT2j12Is8saSVx9Q==","signatures":[{"sig":"MEYCIQDqt+7/rTcnDuh+Ow5YkV5hpsYLjgJvDm2Bftb4i+9NhgIhAMPXmK5UIPg9EGNs2vfnzxbLw7CRgqVoviVjJ0gWIWm+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFX0lCRA9TVsSAnZWagAAHpMP/j5yN8yd/jpD7E3RYjkJ\nDzC5qQNE/spEnWrX/8kmvlvm1/PmPYs2h1fYdqHWvE5MN6doj+WhfRsi3Dvx\nucVOpaRB+j0blzRPMBqk7w0MR8YJX+7LImT9Lk1dI6g8VoHpdz3yj64cQdA7\nI3ir+eBZIscFsn/l6OOjGv4kV0asO6pe1r3+6A1LIv9qgdlbfasjn50ZuY+q\nAIkWm+GvLT9CT92pfrfw4D7OmC2KER71x7mGzvpcBpfCIEDbOIjI263ePg4b\ndTuxe0+//SMvCq0x4O2Kl4SA6Seo6zDhkEo/VBAt481TdNBCjnNQWitFvStr\noXySgCKU05lQmn6Y9S1WzJdKfP6o43nTfGbDVqLSBRQEgLt+4nednSdmqYau\nRHL1ZJjDF90qktvF9tC5EQA4xiQDh6PDwHv4PEVW2ONDzlm6vrXyxASIXMOW\nzSXy+6CrAETZzn4xHXIQPtHeOTo1/j7WWHrfUVGOSztiJ4cOWismJgL/cbbe\n1D3uZZc9iAvrr9P2daUSiDYkRzNBEFUU6eOph+b9rkNn/MiemomXKRPY3njU\n3/ytGPqJ4ZgJnWESc9Vo0DINFcYJ/XmE9jXlNWETYEh7MN0TBRDX2/HX6Ux8\n6cpjbtrzF6ruTiQ6yy8k223U86QZuB9Lr7GNEsEvEBEqNryXvxDIE34CsMmS\nqH6/\r\n=ruWZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7bc9ac63f57e2c4ac1c984980ffbc9120c9c83a6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.836"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.836_1578466596725_0.9022370437965488","host":"s3://npm-registry-packages"}},"0.10.0-pre.837":{"name":"piral-ssr-utils","version":"0.10.0-pre.837","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.837","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f5053be3609ac0e97df36a8c7bcc0c3cff45f989","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.837.tgz","fileCount":24,"integrity":"sha512-a5hB2PwgNofgM8CnyGqR4bqA5/331dKXerhUYaAjHbimjFG6xxGpEaOlbhux3jNblY6WDamLcqhM6exe7GDUaQ==","signatures":[{"sig":"MEUCIQC/gY6jHUPvD3izvfGg+OHwnxF9K3mMVpCL3ps75V/mkgIgN21iq+TBLK9eDiRvWQndxkhmPyfovQ5qyHoH8OVqDNw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFns9CRA9TVsSAnZWagAAEQQQAJU5Ib88Ciyyr0p7j9Fz\n7q+7O1MS8QEKWcfieM+eF263SusZM27z/IVegd5qtbKczRs64lYH9y8cVHtR\nrAfPSFhdSOLcUl9tXn2j9NIdAlo40yfUkxQTkGvDD0M1jnaQ4xIBQ58G50sm\nlcqS57oeqQs/kNlBT6mqweAfHgNZO2quk5T7b2oaLQvP31ATMH9QjKkm22Yy\n6s4Hjk11P2z+jC2tOYjAH5RaloQ55gszHUzirQhiQW4TuBWAXwtgzg5cWDZ3\nqDf/2DS10KngbN9EIJSt0u30nVywCTYzClfYP0C9EXEAiMBttoH+Q156hi+J\n/IOVsBuPXW9XxC743Idmi3cVxkKR7uj5cRBwUr9GN2KEyF4VyW6LTzpthxvN\nmCsrbckFa1L665sdXPPJXb995T0G5hFM8WWp9FvytoCdf0RYEmo7DpjfHM8M\nQcMxP2mhitE/Ff4j/Ouxrvjp410fZUdxST+zmPHBcvuuaiZyI7ML6xVP3HGl\nvn2Y6gat9r4VSMTLf/lLI4vM/rsbvdAAjnJZxqoaGOwvtR7/mKDTZVMGoEl1\nxQZA9CNXzUF/k3raR7ca33WilAADe9wmb8t9kv1N6cby9vcB698/8U7jjx2B\n30gYk5Pr1b6A13zz5azUxbeTd/4unQ95T+HlDQITd7GoyBT47sKdmjOt8oHf\noyXh\r\n=oYWd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5e8fd9a6f76c1505c459b18a5a06fcbeaa77f1a8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.837"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.837_1578531644904_0.6962911235729166","host":"s3://npm-registry-packages"}},"0.10.0-pre.838":{"name":"piral-ssr-utils","version":"0.10.0-pre.838","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.838","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b50c6fd8be39760c5ab441071ecdab52d4f44bae","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.838.tgz","fileCount":24,"integrity":"sha512-Eht/QOnnRhzEq5DSkCkUO5fly4uw4moEu0YFZ0cug2glmbhPMGFpAobaKcWyg2AFjlayZDbYpXIDVMCeolfOsg==","signatures":[{"sig":"MEYCIQCR/fl+pgsOZS+3yGqvoqIAIo5Rmk8c9DFbK8MkoWsbCAIhANc2Ovsrfh+CYmYJdvBo+MdrvI0AwxZiBZ+W9Kq5Tupb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeGE3dCRA9TVsSAnZWagAAehYP/i3uQHPlboNqq8OXg8mP\nXPOCXzQHIRGiWVxJH01v5qubJvd5Tb9A7RAcjkKwNCqGtSE8JJLYmUU45xaX\nFhe/AqYpgzGu0mXfV9QjXOsmqm1l2dzudIMhEALKoRqf/5BI2XORM9TevYhA\nQ9I6TaqZX6wBosMf13Wljytk3kn9MlJt6NrvyRsdkTzhfdfobpXNwycs52ns\ncEg/xnTuQkqmaZBtKzX4oRbGLWwyMZlbIlqNa/CPQEOql9satXe5yD29NM87\n+qz/7+/0s8QC39wssaZUocYQ/any/BWuwzvXgL9LFNGoysQDqFG7cKsGi7yp\neG6EAR1+PEjEnCgCD9EfNbdp7u+lj48vIxNfFdvj/yF/W2HZePcX41f1NnYG\nIKQJWpbkot+1b+EuzddxBa80VyWTdf+lRho27sohKNbacSPHLIsHKKn8gwss\n1DIQxsva5FKS3GLudV3hyRVA9/KvHWG3sJ9TE6Z5NvaIjMRHDpIVb+BBIkqs\nRJwXJVjdDKwTlL3PY9pifRl2FQ7NMjqVj/CTkwh/9S3g47fMd1tTx57WJ0on\nopicM2O+x9+OTsEssxOu9j3LCgmMmwVQM7LklOVZnhYDiBFDvoVaR9CxGqt4\nsUfMSC3J8CHSr+hHGVVTBusGsqkaBSf/mKGRH87MT3oJtA0fGHK7ARx3alM7\nhiBU\r\n=Ntkp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5d2f55dafff3ceb751877958c5691dfbf995ae84","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.838"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.838_1578651100699_0.9127014600003449","host":"s3://npm-registry-packages"}},"0.10.0-pre.839":{"name":"piral-ssr-utils","version":"0.10.0-pre.839","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.839","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9761a836cf4e9b9c72a9239d67d949d6c6ca81e0","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.839.tgz","fileCount":24,"integrity":"sha512-hesifHik4yNg+sDa0UI4AUTgPnRe8M69NYMVpgOsvm0GSB+WYFcSYnwEYNOUcfTlLBDd4e/FSCuVI8uAP+evAQ==","signatures":[{"sig":"MEYCIQCf2WJAKnRa5q6DvfV1zGOnlzYuqiNZU26gIovxRvAduQIhAKMINvBJgx2n/BzlyHCKzo+ety6bbtV2joPp0sYsLtxf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeG7nfCRA9TVsSAnZWagAA8iwP/1zTB+vTaa4ZZe98S1CE\nFEwkJFyxCYH/sYD78zPgKojDlDlT9fzBkzPy9zPaMqIZau7uRvgC6wC3X9Yr\n96KdS5rXqQopFoFt1GYw2+f1ojd8nwGkcttwJCrBNDhmrAz3cItL6tE1nYRu\njMxa77ivkwUKGTPKgkcBXSZezwDFkVPEvtOZlatwEobu6XQB0Zqq2nWUQxbk\nOeoZWX9MISbofdj0GkjOIRPD0y3CDegVq0qKE79m+M4arbZASzNKUawRzG/B\nji651GqqtdB/Jq8WLgX2bpRy/YH93HVw1VYM5N4/r/L6saia0yIegvZudxbU\nu5lUyTgAZJg9VEQFuF7UpKH7Hpeh5TPD9Ktzzd8ZfmmT6pw4bny4GzRWSmb5\nvvL0J4N40uOTPdL31UZCwk5yVroEuO+Pe5lp9OouldoM1OvB3wkkHb8gUdB7\nfyIRKtPdsVocXM+di9SO8I9EV7zBR6/o0QDgGdTdFOrjqqow2X0HFuUBcOHG\nC4ts7YHDv65cxhn/2njBZ2g1RUUMBYE6YSgMiUA/+rh3PQa7VaN5BEqzLMSt\nd5IPCbNZtF5BWlFiOqTwfPybH1E3m71cfT91KRVNyDXV4jqeYDFYBghOIdST\ny8JGR6+laH8kWHybc/w3Oh5ITl9di7bYTgQcgUDdPNeAV+BFnOl4p2I/pb7+\nekld\r\n=wg07\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"33cdbbd12fb5819e531ad2e8d4d5eee03d63ec4d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.839"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.839_1578875359560_0.8978517939516246","host":"s3://npm-registry-packages"}},"0.10.0-pre.842":{"name":"piral-ssr-utils","version":"0.10.0-pre.842","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.842","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"54dabec8a6472113f8b6ac04a31406bd98ff72c7","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.842.tgz","fileCount":24,"integrity":"sha512-VljFHi+Jq1r27N8EDL8j1OUJ16nIuXdHreqBynOOMmnwpz5p+91282yulWv/hSShWnMaf5GX02uhqDyoV0zIYQ==","signatures":[{"sig":"MEUCIQC7idSMevYaq5NHeNlThq9MwqRM30S/HNf/uoXVOLbN2QIgf7wuf76nHXjBFF5Xu8tui50Kr4z7EP2v+YHBYpY4EWA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIctBCRA9TVsSAnZWagAAva4P/j2s3NKuYcuRG8BTQq5x\nYK5ibquhlhP6HgDpv5nHi/ymnAG6iNb3yXIboyft6xiR9UTqfaiWmSzMwuJh\nONXHUQoNEfkH5jSUxxZQKoS9AI9qjXVxb+tnDnxOJ2plfkLxEkvsqXatOgcz\n1Us5b/PycLJ7Dp7t1E3K0gV1iOtjRPYV6VGMvKAtKAdLRfl7sEp9PAjR1EUS\nQmoJ/5GXIaOHfG/oq7Q9BAFzGDUCDQstHmUbg9Alk7Gd++LA573W9phHo4WD\n4pMfuas1imlcFqPB/wuKxhh0+sKC24TPPi++y0OMitJ9wYaB2SclsThb7bk/\nrEnY6K0zmB1hQLK/jnzAHQaK1XbCMj6JFF4boN61s0gPAmVRuZLQLGSGo460\nAkVr5zS4IP9oiZN8Gz2xmtr199kKQeOfO/r+9W2HDRxuCZUdIhGltBH+lOK4\nSnMAT9NY/zWdNDMfqx5XMSw0aQVJ4icHLeSD4JSxpASacYiEDonRuyizzcxq\nxyG/NrN0dGFsZrNOlH8YDfj8EUFB+isq0mzFAuKGNBgv0QHaRagNGUz91VZC\nwm7hYOhhTdyajnMZ55qnwEUdXyT0TEDZwr2LPkyxu9xhF8S51wPRFn/5uDVA\nHBFYhpnZPqzj43R+CMr6xcHffj4obUMXgwmI7nViuXF+IapM9XNUfc8bzSHQ\nwEQ+\r\n=faGu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"15b240d304e7a079546be98203155ab6287ed2f3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.14.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.842"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.842_1579273025372_0.45455400666460366","host":"s3://npm-registry-packages"}},"0.10.0-pre.843":{"name":"piral-ssr-utils","version":"0.10.0-pre.843","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.843","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"839445b98585495b06ef30333d2be770e3f07464","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.843.tgz","fileCount":24,"integrity":"sha512-ShhNN7IJegfSmqFSLBQ9GMa8OtucMm2tsNiqx9MgQXPuCA/AgGmBHYiy/1/Dkm78NVSVKjzGFgE1zGLgvmaeNw==","signatures":[{"sig":"MEYCIQDZ6q8k7yvICZdTQVUi+z1MRE/KRMi7A1SI0qV70pCGdAIhANdzE44rce61tjP9ZGs26NV0Wjig7Xrf+9ntfVe1gr9s","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIuKNCRA9TVsSAnZWagAAcs0P/iG0nBjqvPF+3YoPL8Ou\nIo5UzLvuypZDmFOy9C3DwJG9uobeomvAqN7sGnJav5hIrp2qM8xk1j4uhro+\nZoRoWUFaKdsGn27HP4b9hYmz0LQCXQ4ezniygO9f3rVDM56uEEQE7YsC2rO6\nl5z4VXFXSuOCmwj3dgm9kRhlrFoNRFUoiMplRAsggTV+1TbzBJM4z5KCYrM+\nrIk+44Eon6eVAb89JRXgRC5Pfl3k5L7n/8Vi3oFzjgdc4+kATxfuRsO9o+ds\nzrGzbdaCrgq9c+rCDAqt513a4gB0p8vJQ5wD4t2PfM78XtnwwSH0rBtRY8gH\nDMOErknkv58r9cxr4HkxVBk9gIiLW2TGhAGmGjxrcLBsthyq61r9rOg4FhFj\nrEPVSsLHl21bMdXtfQyOMFm/P2cIzekxu/oSoy/NeK/bPSIHvOS7HIyiQzdT\nHvTtxytmUF5MELOlprNys6+j1/UbjCzyrBcbFE/QBRHmDGPlVYqpbrUnrjpk\nXRljDvytUEpNn1aLTaBIzAGVRg51IFWmm2IbQ665DwJ+5obOOS62UCdRwLc3\naR1x+IuAHlZnRIrkEioclZXBL2QQ4xIZ5IWR13M62S2OaE6v4jyCfuLcPJDB\nXF6Y+DLJ4pnoamyM1bEhdrZKtZZXr4KxnmdrlX6gpvJ9weamyf3z84/JGURI\n2CEv\r\n=p8cU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e0d6ae67c25cc01ffcd98d3b4f2b5aaac7f5c3fe","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.14.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.843"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.843_1579344525333_0.20301016510484682","host":"s3://npm-registry-packages"}},"0.9.4":{"name":"piral-ssr-utils","version":"0.9.4","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.4","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0bf6e06ad5727b589df1cbf8ed457a72b98c543b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.4.tgz","fileCount":24,"integrity":"sha512-ln1Pm8wT2W+P8wW92P+KwqF3lFAmP7BAU2Th6oyr7vXch5GBCof8+gB1Vu/59nOqYGT512KVvcMoPjSXmx1IFA==","signatures":[{"sig":"MEUCIGXM+1By98hONwT9xgael92x6VrvCfb6sPQseijWA/7vAiEA5PiFauk7moELeUmLJIEfpwarjS8GJwKLktm3ZOJjfoc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJdJXCRA9TVsSAnZWagAAYYcP/0go28NqHbPFWo26lseY\nCn4k1H33s/Q2EiQ993OO+jgeKsfBzARDgELo11rx/vLbw2FkU2ygX3fML9M9\nW6eiy/gMMDuLb/KAbHAwIujNn/TT6ESv/mkr7jmBehSSGpZQCAuw3oSH3uTc\nsEC7+DegBLbdj8TANsffR0TJkh6BplBVwsR81XurnFJdXqPgAOModxWoq50E\ng7mkooIbs6dFyV3obvakvpcuUKJmUMwrD889L3EUo+rXXMm/GyAeybJ0Zlin\n9qkFwwD/oddcSjFn+CCWo/9RsQfIBiropFls9vrJl3B334ci+loscnJ0l+Av\nfBE92tK46bdSz3uwQwzDhndo7k24qVMy0ikkWxwKG+V+m3Z4ZLn519OH6hGp\nMD5Wp1UlgCl7Zf5UFO296wO39EuTfdBe6aagpGORCDXr1qLHJ2kaB6tb+rPx\nRuR1k22xvdt/yQfQzz0dW4LYRLfhDVGUDeP8iPK6fGQAR0yYsVxRPH86WI/i\ncL+LBH2BlPCoyVuyXKzCI0tBhQO+1C/nlDt80FFvWnTrVOzKFnJJXfJk5ykL\ndL4qACSBurSk33Y13jg9zID0diyU8zeIQ9u93QfaOne/HnBqDRDaVcKlEIbm\nAH1oagwSqoVWSwkfuEUpjRwxVpIcvCZhWf5iriG0Wi/JnZa3oVffEn3NzVZ9\n4V9B\r\n=4F9U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"2426a2466d490035811e382e871f1a019eae3513","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.4"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.4_1579536983086_0.9047980955301602","host":"s3://npm-registry-packages"}},"0.10.0-pre.846":{"name":"piral-ssr-utils","version":"0.10.0-pre.846","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.846","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5028900e064dfb72778acdd09797ab1800c0d955","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.846.tgz","fileCount":24,"integrity":"sha512-ge3tnTz5/+w6XSOIZfC3Gu9oqNiYop43Ja8K7zvT0Lojlq4oCzNMN3+lL2KYygbFtMADUEQ3texcuj0oLy0RvQ==","signatures":[{"sig":"MEUCIC0CFU3fRnVfv8PEIxIVRiiMsxWj3M2lTp9bhpKiyi7wAiEA4GXXVlGbdmHIdvV92UO83taYrZpPjVhL5ILmLcdbWVQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJfGXCRA9TVsSAnZWagAArSsQAIevwcfggr830KZlKe2i\nJXNIUSQvam0y50x+GGMNae+OdhNyxo/ZpnwRHCotLZ6qBe8LYDDTjCb2fCre\n0Qfa0OQ7UCKZo14ONV4WBlNmfVZ/8IA4LbtzkkJe8MS7Z2LkzBZzn6QMnEj6\n0zDOmTJ8cgQwvS9fihaiU3yoodfat/Q1M/oCKPPEF88i7xspgTRNB1pqLFbw\nq/pA9Kz/Dq8Fr3EYMky3Zfym/L84plcbnBWD5Iw9uv6eNCsJLZmmvUnPzL1J\nC/j1SQOcwicBaY4HN0yXqufbEy6/UupB47pXUHXQIcC8/8lhKCOSz047yXT+\nP6qKflLOtk43u1Islsl57gtqDHsBZ649Xj2KStRPP4CjZI7bnQ+10qiOsUvv\nNhutCyUxTwxjA5I/0rG9Z3kzKQ6Goy/jsiId+3W1VEovd24ZfTF2W8wM0M/0\nsInQ6Uqxu8elp2d5l7lA7P9PK5hIdjgOtMtfvqcWAwPRyQxGzLNvzNNWr2uX\nyMOzByFPTeqowz9S+t0AG4y2tQvEPfuz+dXQcUvCsQ6HgDBGBnNX7vuRabp/\nrPNJYDgAbhT0/6vCCt+PCtQGJ3Q+4Io8hQeJ+FAs9nRtAXpyuKZkttRmGCst\nifHprtQg0Cszy/tAeNl1raN4eROnnJHzykwzvXG4AJojzFX8NIvQKAuSxNB6\n+rM9\r\n=fmno\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"bf161f59f5b0b218f7443a4cf61534edd2aef929","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.846"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.846_1579544983037_0.33273569360314337","host":"s3://npm-registry-packages"}},"0.9.5":{"name":"piral-ssr-utils","version":"0.9.5","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.5","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b6221fae9289f167d2e30597077316236c120308","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.5.tgz","fileCount":24,"integrity":"sha512-BwjUrPzHw6LVJ/bdRU5OeTlkRsqijukWUuJEE7BsaGkIV6FiCEV149Uqfv6X15lgnzL17J3/SIWzbjS+7JVkPg==","signatures":[{"sig":"MEUCIECuV+b2Dnwnn3IHDzB8ZBiaPAvbtaIdmXfquUnQMf4tAiEArifhisoiPhwM7cqizu+HDBnSXqLQu41AkDmprausuuc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJylCCRA9TVsSAnZWagAAAskP/1mMbvswD+tT/jI4upuA\nbO1eNZqHP2W0qUrj8xir6rAZu599CJqoC5EqZ6cdG2xaxCGsPyS2MyF+L5w6\nf9e1oO4OfT1/psqw8uO5/7gW6EDiqUx80XzzilLiVwsrwIrOykxfEgWm7+ou\nZS8ZTHjKbuojF/+TyDub+W0/4pkQ1J8oSMmsHbH9L4wK5VPnmkSumeGnMOSZ\n3KrjHB3BYW0PcTYxxwqrB6B5Mrvfb1rV+csaPsepF1IVYNFwVOU17mO0lcdG\n9OiXhjDMKeacV0ONlj2YhjpjgDs/clZleHWjG8SdaNJIw9zc7CvlOG9p21Wd\nNRhvuSMSSCIUrgx++SuKD+4A2lgWvz71IibVjfV9spBXWkLbIobIBnFIHgzK\n3QInaLbrbYZzZkZmGBkEBq5dM01T3x97FzCEkeD4GVhoy5o2Bdn7mfvuYdFO\nMZKv7sQsJ5ZoZMIIPthY+cxHrjmG1skT9nch+NfnUxrzB9XJwUFjsvM0Fasd\nG2KR24Jycw0HUbRUz6q/CErWumK1VG9K5vAYJWUIvMbwIkvGXcFP4Zb0KBep\nh7lPrmNeAuC+S2cgI3ReWKr0raWT1lKkNVz+vYFzinJF1caIUcFRu6StRUsN\nOQx1M1T2GL/CgpJ2v4xYG0kfbxwbVnhgz8NoFfmgX9XwlUBk3zs9rQAejKTK\nk0rJ\r\n=x8ek\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"1157b1851f65feec8001fcca9307f612328266f3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.5"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.5_1579624770559_0.4006313626781095","host":"s3://npm-registry-packages"}},"0.9.6":{"name":"piral-ssr-utils","version":"0.9.6","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.6","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4bff3d812f57ae77fb82a691650d95ad0401f176","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.6.tgz","fileCount":24,"integrity":"sha512-lZVWUEa8zR81wu5ErnAxNTPfQxR3AHYkrdHYZ1hlBtUmOrhc5S3juU8RrVDcf3olJxwSutBLOWNkAVkk9hpQYw==","signatures":[{"sig":"MEQCIFpPTCYhVRwIVWMNmeLF4x7ycZUrIMNdaydp6MbEMqsjAiB9l9ZSeDiVXmeqEgnFEHuBRhwKv5hCI85+/zQ8FoIVQQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKHmyCRA9TVsSAnZWagAATG4P/2SE8IMjeXa6XptGf8+1\nX4K/nU8dI8H7tHWaAxP3jPtIwQHGQcCrZNwA8UxtQUt/8PbExnP85yJLnFLX\nhXXav9dS0JpCwhp/iCsNw6yR80f5j//tOqCuEChbfU0sPM/zN2+IDLxJO7BD\nrxsj5s6bQOEWMT2NE19pnskQ4dai0udDyx7R0xACiOPzGcMReRGpQuWwmZ1S\naXykB+cS9iA7CJbD0gSPv3WgdaJ7O6BPt3Wm+SFPQpwkofxiEHj0ssEtCvDc\nMXFyddiFgrNidjHPMH/T+plqiWPx5ufMxdffaWcXdQa6aGPc6i3n9Dy7CXgR\nXdP9qse7lTcsAhntv+fgWCFRsW9xOC9WUN0HEdvFHV4ot2f0/kaIITqLr5sM\nFScP2wWqVKZf5CaB09+tXFObahyZaRNHDKGEJCDMKsogZCOENVmHPkaYf6aD\niizDUfqIZpGxbpw65BF0YRX8omd+r8TCkWAgW5LzvmoW485PjOaJQtI59aXC\ns0pgx+rJs2CwRBaayTcNEVEsV0c+RZqLHGJhfleufgptb9QuMWK7jguWSlDb\n+ugGW48t/aSuslW5zT5eVbs8dzVOv3APmUUUZh9lio4VF2fey9vSbxoBVCL9\nzrouotLXuBSWbYBk9JgUZzAPfFF5udlsK2bWHR1T30UggQwoHU6DRcma82JH\n6FHg\r\n=H59K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"fca193d792b4d49b5f8090415a8c7a90d88bfdfa","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.6"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.6_1579710897742_0.5044876844497097","host":"s3://npm-registry-packages"}},"0.10.0-pre.853":{"name":"piral-ssr-utils","version":"0.10.0-pre.853","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.853","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"121057929236a17838baffc40fc072fd28ea2ef1","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.853.tgz","fileCount":24,"integrity":"sha512-/HV4zp2vwI9H81WCx+S2c2oq01QBUneSvjELGUyAus/4vWuGiAvDtsglIuzZT7hcDUpHHDAtzc5CCYvcmcfudQ==","signatures":[{"sig":"MEQCIEjM7sheq7SsPy6QIxm5R989qb1LBtHBuIqZJ1B8mrHOAiBrfsBhjyV/JGA3O9jdxZblhP0HkR8KEfWiuIv9H2e4nA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKOhzCRA9TVsSAnZWagAAs3YP/0K4cx4sGm1Ckuxiefxm\nEgdlfjSAc+3n06QvAmXvmnTiz2CTJ7qbv5KC01PtvvGXabvFhoUBJOU4iVn3\ndUX27h/ArNTw7/NRmDSdwg4giyRDNbE7MRz23A7jdrUn0VjnSyXQIU+zD6WM\n6L1pr2zxH59TuO+dSr51MxxVkQUW8EmYXX7qcToiz5gD1BMHjDZRTGclxCpw\nglO7aNXyQWdZO3zuW3vilGRobwn+Pq3rUF0mH4evtWs9eZ3r8QrBaA2EvIG+\nNx+K8ZGP2uqAoCYWaf02M1KrvzTVf07Mmu7BC2sw1Qs6nvwSVV/WABg3314G\nlfC11zOmY0sEX9oIdL3RKGY/OlTC7jCJcAMiJmYQe9q0NCUT7i9A5yKdIdd8\nnEwiOO1plWz5fWQb0rKKNmfokz7HsQzzDjo6+WNXtvTElL5B+5xjMy8pZrvc\ntrPl3TEZQnfE6zu4KkA3PI3Kf3ozN/07Yzg4iP0h70D9tkFVBLOK/xG27DLx\nZZM18B8IL2wi2TYlmvKM/8UaQh0zQNSxKhkBdrtjrBHP2fMPiIcUuYeQmHly\nsTItgfrfgS0ZKSd6UMKVb0+Hw8Ef/DwHmnVkqC4RKpZCy9XgEZdp6PWkeL+h\nVTJ8p2qNZZzKSvkMIS78rjTzK/mNhPjMMF2KPmFpGvdWdiWPminBELmZHyEa\n+2pL\r\n=7fVn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"840155ef91a8f43f65ded5e18985ad25074bdc63","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.853"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.853_1579739251445_0.19735552026867142","host":"s3://npm-registry-packages"}},"0.10.0-pre.855":{"name":"piral-ssr-utils","version":"0.10.0-pre.855","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.855","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"31be60245660159872083aaffb862226fcf493dd","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.855.tgz","fileCount":24,"integrity":"sha512-ir+w7sFbhv+f1BrhGS+9kaT6DiYgvA4vH/GtTnq/V6dwihwJ1l14lg6q+YLkiDXwHvUSZgnvE/kHduyn9QwZZA==","signatures":[{"sig":"MEUCIESxykug3w3BshYcVabySoSmV0sU3x51kyLnSsl0QmmdAiEAttKXHD5jOWy4hexCDkXb+pxHghHRC0F6SIQ3q4Zrkkc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKjfWCRA9TVsSAnZWagAAK5oP/2dCY70hpr/XVM9yMFp6\ndMgECD082HyJcLYGU1vpeSRN74Whepe86wahYcXnTOkctiBkc8nFeynFBBX8\nVHHYxOTqKVdXDPH09lMKSSyH+qL+IMm3P+WskVkD1fvvRZp0OBPMrPsLwbMg\nmZvTeHotNnfnPuDA2ADNgUJ6PskSoiM1PsrSYGCfD+I1x4h/SrS13ms//agZ\nvC62UpjT8BjfxdLGn/VdbaDTHC8LaYH3MMcryneOwD3oSYPm4Kayq4r+v6Pl\nJ7bM7R/h75mRA5+gdJml84FjpoCF0SLrLJdNGCDO9SCZ3sh3lBgIDQDLa0bj\n1NhY5BQ5Zay4Ja6yGDLTAsFHhOUOjThD9QEKbkB9nIQcSq4l1Kpszrw2jr2o\n7SNf3Ee/LEJmosDWJcE5y5QsJdmyoKOZ0UALSa8FeROrzkBFM9B0N9KBj6r4\n3KrT9USn7O1nAv3RNG3WCvH59s2HxrkzVOhQ7pH/2YsBCmie5FDuczu5OO/h\n5VO5aA6HwvLzCKV+yCikCnxNUo0rdbEdQ6qkG4ZXNRFqI2Y5T6uKPh51wJXO\nmZszLhp1I7IjOrdcoUbEKhHDhjGphSk4ULdaamOaQFMVGuo9/HRxX/WyyEA1\nHMRM7nudPtQeJ0iMO0K6tKSDgIwRekVnOl+bFikFPpm1xg58jDYbSFDR7mYK\nHC3q\r\n=KZH6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5f1c30798e884881ced198bcd799c9e4dd084d47","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.855"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.855_1579825109949_0.36321549478104775","host":"s3://npm-registry-packages"}},"0.10.0-pre.856":{"name":"piral-ssr-utils","version":"0.10.0-pre.856","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.856","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"43cc86ee2cc4ef9324909d51a960bb23f0654dac","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.856.tgz","fileCount":24,"integrity":"sha512-9dtgliQzPwJ2W0mqAZk+IVX2OqZCwqstuI8JUWjlvU87+V/1LFkuaOxTUv0ILClGFQka13zeQ0q+yX5x59jTGQ==","signatures":[{"sig":"MEQCIAYg8Tta2CH4EwxBdm+JEQ2BW11qUugkBRpJJME+YpJZAiArttyav1idPN3D4Mvz9yFr06uIV4ROSIbbhQRKDZY4hA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKvFACRA9TVsSAnZWagAASdsP/393g3HE/4K8IweVvQdg\naUoSBDcx4pp/oIAx3b6uG9HnGWrq3m8Kx+4F+9O8TKjvpehQCQHYCw82z0P7\nuVv0Akr1YdadX2wltfxKMRmBKWDxvWBMh+kO6/nvWvE1LuocyPlU1cQY2OvE\n6RykkNOHf/0/P1KDMcoriekuRzZFJY2Fxb4rw+W24fOSo1JEhbKWPoKOp+ns\n+FKVejcW5XqrnLxdTWlhFYzb2caNhC99DSARN2s1mr6i9LmTY/WwDYTBFU9w\nOFUxJ3YMlnSjY35qSa/2jQg8ThgXIYvsCPLfIBv9DEoxIqq7YGGthGkzb//O\nA9vwCkkbwQ+dPNFjO52NjSmSTeEwMyBQFgLhCn9yZ8DrLDdkaYJzlCOR+GgV\nNdfwdFJ8kQ22CyKc9p0HffYlSLCFUzaU5rQ4E8+8kOI7FG7DqQEJpP4I2gep\nT37ZrvBAW2azHicRqZMi3/DjOYGI9jVm/MILrvL69OfTpsQSV3m3zqANSU08\ntMRiHrunwTKLzikBvDEUQ6OnFpoU/97o1Mi/P8Ku139Cr0zK6ArEKfPtlEYU\nALzNUpWcPnbix3CHhePwuYn2CDGkmOdqkvOxMmGri0aLgmoaWex6/gVEkAj3\n8T40s4tT+ijT3W+jYGO4B8nnKZc5RUl5pG/wwQmFB2aeJL5cIAVQBio9NecH\niWYD\r\n=+uNG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a886f74310f8d4eb6cb10bb665e994594164b666","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.856"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.856_1579872575683_0.16246013948095195","host":"s3://npm-registry-packages"}},"0.9.7":{"name":"piral-ssr-utils","version":"0.9.7","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.7","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"38e65adbbd1e9620b50b67bf2712d76df3bd9147","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.7.tgz","fileCount":24,"integrity":"sha512-F1R2uYagEMVWWU8XxvXeW88r7QTTHuRQEZze8TILaGzs4xdUdAyBhir+l8u5Kr+AlQnuZ/VO3Ito65xr2g+HWw==","signatures":[{"sig":"MEQCIF8GSMo0rv747ticKyxvT3E+fUn63zT4mvCYyK7qHNavAiBDKhhyAc5CL7jNEwOhUK1kw07vjMfokaCfiRkxBxBZkQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeLMlTCRA9TVsSAnZWagAATCwP/0tfNP4AxbMV+Ew4TuI6\nJfigcq1uBwFHm466twWV85nEMAW46IHIJ+WyM8fLLoTzAeHmU+cBQfa9KAIG\n7uYtIjlVbQyi6hI/ie5w3XZTK/g/xO/rtW+6ktEranozKo3+x7LwsAynYQGm\n5vYeXCeAmBfxZv1iPg6wTd2CvhafQTwa8c1mjLA1JRWY4eBlvv79IBvRCzFB\nxUrUPfwUUgeLpoRNd6slrct9aPzxa82JF0w/JUYPN4ZW0lNhUuaNQ/z/lCDa\n5WppofYxBvzzdf6+/Mw9kuu1GdjbofxWipAyndG6d51pNZ8f7ajsPQJ+vgZ4\neeCLUGtA2tt8kZyRiO0cUv3DdbvBqBh9UqNKFos6CNlSmI6c4HL/g2LZwI/X\nYRxTbLiLoCSCCxveKNJH847b8vZ/Qh0VhMDCbqkmlIeNRFSn78nUuxIeN8/o\ngPOuG7xcY+B2Kj9XrVuYZS5sMa7ddE8tEHUEro8VWlq4VTPj2pIfgCLBR1+f\n4iSk7IzT+E9DNCpeZSHFb50cFRIUM+MJ1HWYghpbbi2FUJZFij8agf/QO8J9\nBgWDqZOoNmoDJD+feGC0T4OCbfitCuI7n/IJqsdW511MaHRA70fEqdC1cb7m\n5hvwp+HCxHsO8H1+O6eVQi59KmTGExkfCD6pSNnz3pQBiXm8o2nqHBnZCZCX\n4aEZ\r\n=QJm/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"c4d1a6be5e020e5031fdf43392a48c341540104b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.7"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.7_1579993427421_0.685886628754508","host":"s3://npm-registry-packages"}},"0.10.0-pre.861":{"name":"piral-ssr-utils","version":"0.10.0-pre.861","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.861","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e71ca7a861f245fad90207d61b406718d6b1de59","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.861.tgz","fileCount":24,"integrity":"sha512-7R9TROOJb2H19ZIy6SsWMawNuAERtVsAKfHC/m02ll9gvNAKVdlJBtJPzGnw0mJUCAC1XYfeVb0pQlQENPULug==","signatures":[{"sig":"MEYCIQDBdakMm4xKuH7o1YjY7TqRiXrEpLPxEiRHW50f4HHMZgIhAJF94kEbgOfVKdLXksE1rNUR7tStaPvQ9C+KwNn1Z5hh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeLNGJCRA9TVsSAnZWagAATLkP/3u0bPbnMSKiTsFbWjLK\n3jv4ij4ckfeJUgW+59gdv1bflaF1LKe3WwUsNmPeMl2MBnHqvbvqp9bVtx1V\nAykVMmBoaZhKPQ5eVY9XzANh3Cn7UMioL8lx/hb6UCDK++dwPMEb7/Vv4x6b\nwajGN3T+eNBVlfFcQR9KSFE5d6owLYXjqxZIlpVY/Y/BAxP/qeWaCMneOSy1\nhu3ly0YMlZHnd2BiVNzJj6gYxrR7gRZ/gKa6dNluajAivYAVpLs0jBcM8i3W\n6ueWbYEnjk+MY6q1oR2NrQ8dnHsAOCpoE8ki3MTIxopJLdLNk3dbrpeKmjfy\njJ5H70kkkxxu8Y8rOEkyoFKX0pXWaRKakzbrGdSwEmFYwGBXEuVzqv7pURMC\nCOJC12TSTrAiMrJmeWrGXvPev87tY6kqtj4EchI0dGiZH55bdTC1S6hML2Jn\n8zw2cblkp/33CjOQhStZf8KU5aIGc2CijcUGadJESpiLdZO9qO1AkQWLeSWW\n3Xp8EyEEmmZeh3nPIZDScQcR21Hl3+pGRShRA6N4utivjRsupNFUvX42rjkE\n+eBDS8u4N4d8mqS5ibhc2ouvA4uqTUsmDFyokkiveXcc7E6PBvI1/zUKD/ar\nR+/ALGJNJVpS29cSGIbQN3Ttxwkamn2jgld+qsXQr+AQQqz4p0RxoLEb+3hf\nFpbk\r\n=v0vb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"572c61695cf3c9fd99a815889061c0c40b0cdc31","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.861"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.861_1579995529446_0.37209730511629835","host":"s3://npm-registry-packages"}},"0.10.0-pre.865":{"name":"piral-ssr-utils","version":"0.10.0-pre.865","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.865","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f107c3dea4c2d0e1234e4b3ded2a0bd5d8b998c0","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.865.tgz","fileCount":24,"integrity":"sha512-hA/bSzpJ6GIX2pxlng95NpQGjRVAX5e2zVu9sOZxC/1gZTBGVgJng1pn1DRmtoJ8Iea8BHi0WlzwQNZWEVUROQ==","signatures":[{"sig":"MEQCICkrCGJQSm82CDqOtRnpoSkzmbUZx07VZtConyEfXsg/AiA0MyXdBh5V/TQaccVjBubWvo+t4pBLZPopZKECYtzuNg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeLxIGCRA9TVsSAnZWagAAnUUP/iEsVenZWXAG2shUKRaw\na+JsM5qdfExGtoOmlj74MZoJf+/9fLXqSJhU46VWzfBOtXRz+iyUC6tCWuG4\nyB7UP/+wDdpw3wPPOTOwfgctN7i15yL/mv/m6o+1Zki3PRGLIMmy/DzGDUXP\n44wZqQC7biIru3J6A2Zr08BM5ZwGH3oQ2EYfYpPC0DsoOf2sOxe62i3fsbjM\n4uL3GEpXN5WDydtefwloiMcV6PGCohZMUBTp/Jj7D8y6P27Cc2S3GXaBU+5W\naoazwOxXZrYZpRbnQqnViwMJsCiFgVbWFfZCp3hN+m47Klg2wvS1BZgphV87\nKKpSYqXXI5SSO30OsnkjZLbzCuQ3Cez4ZfojlxvbxkucOjU4dbNXKFde1fiK\nPSUR96Z8rAateR4/uDxdoH94QmZ501gIrg/EzBVjLNrpLdfSFz2AeeV2MmzS\nHn4rrkkBCnhjdCzFje0qwNedmw1hIR8yhyPdd3LEG+xvtcgB6Y3MQWHItRYB\nA/pE63gdgyu4UkDCO5P26Rbt8OeKfLqRT8jnLuPJiW3459adXrPKAcVzaEsv\nOwDEu4QIZgJqvx1ZeuN6isS7uOXEbhX1BL/kQUHxfsq8M8ZZWC0I7DWcZZTm\ngt9ALwGSp4TP7v9bNCVbD9C6E4zS+MkXMHztZQKgFuEVHeVIaraboOkZlKCg\n0IoY\r\n=D2n1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8b61ba295ee24b9d5615528dd3e6f300b9186102","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.865"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.865_1580143109785_0.11977927327017768","host":"s3://npm-registry-packages"}},"0.9.8":{"name":"piral-ssr-utils","version":"0.9.8","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.8","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d50b99e8ee4f5c37ed37bbc66285efb3aca66986","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.8.tgz","fileCount":24,"integrity":"sha512-hIYPFoW6o5nOC1HHZhn7N990w6BoDoSHu0y6pXXRQ2M5oHa1Ybpm/YYB1wY3NiVa7DFmUuorSdNB9uxpPUV7Vw==","signatures":[{"sig":"MEUCICdXfkNp0xyKWOhYtKJIj6KMWvij+6fOvIzfIxAqlyLrAiEApL8KF64C4QT+Slh/jdvDZb5PsLh0fqpcPBQXSdfuuSY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeL2R+CRA9TVsSAnZWagAA3HoP/iO0aQuJ/kbo7QDj+6HQ\n3jKs0xmlem5s84e/CSm9V95hky7urH21ox6L8I0Cy6oXx8u/8KN3O+GF1kTF\nB3wspl/T6uEhQmC/vWtwTtFHsWUZnvq5b1sJkks5HTOtfNVJHmR30YRGSrUs\nuyre76W+V5g5lvEdf/lbZi5HJ5kgF7w+H5K8l0wFq9Sva9R3n3WcaeocdEM8\nlwz476qIiCgeUSIYsRdbe4WFVFXeqkDGA0H/YxmhwwhgVAHE/pIO8wQXl8Bj\nFb2y0opO59mzOkcBrE1SLByAqcRuI8T9wOVMKYsMrJ6vw2wo06qzrZrFB2ut\nd0DMhZUiU5XqbjUaMgwFgGhUyvpSuuYYkG6iKBbeOXh9mSBXFrxQLNyh86Oy\nghd26Y4zodrDIF0shDkN9YMPLAuaBKKXVTFnDrNpSAPp2JKsNIP/KIgRVeiU\nD3VvcpE+RKQUBdAofWF9JFmlLJwNW+1Igk/TDGbsQRHl8vmw6O8n496jNR75\nhDQn0ZDHaGDHa4LMEVonzNyI/J7827kT295OeWHAl8cqQPiBUe0UpF4PmlVL\nDguhzltejxZK+GPnkrkUflOiS0uDuAxV/JfTOoW8sibO5l9/dRstBr7ZAKqB\nNoDsnluUrxJqMC+aVaTJsAvE8wiLgsKct0vjen/XBV6HbtNBtzqR4wW3XkgN\nAiU7\r\n=mY1e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"0dba7e38487b43dbd350fb623f51c4449030e1ba","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.8"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.8_1580164221632_0.2637656876602126","host":"s3://npm-registry-packages"}},"0.10.0-pre.870":{"name":"piral-ssr-utils","version":"0.10.0-pre.870","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.870","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3ce57b3809c1d807810fedf91995f98f5ae59605","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.870.tgz","fileCount":24,"integrity":"sha512-LW1rQ2n8ZsZfSNN7TZ+XTLTnNQJnJuFMBJuz8iqoDpu3aWsiuz3zu/yB2C4qp8eAcLpgfoY1Dq3QtKdEdy3ffA==","signatures":[{"sig":"MEQCICxerXwhkllOgv/tn3iptmAeah4ktJawRJm4o0PrXZyGAiABYbhpgogqPMWMoY5SrqlN/no+WkZDZgA6eqE69DTsWg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeL2xsCRA9TVsSAnZWagAAqJ8P/Rn6+709JAZC2vu75OXi\nouS/G6Ly3JHGNMs4uSv35awA2bJTiE6HCwXLC9x9RAmN/oKxhF18oy57tIO7\n3ATGERIRhn73PVK/7PlelhL3S4k9kBgxKtt7VESp+4OefrfGS3/rCPhVpSor\nwXSi9HrR+gpruBLL+XjoOziIrZN3REUu7kVg9RLn8hJ0Wb9IifUWjsUxqCjg\nPPEY8JtUtUbVbuPF+tsR8jF+24RZ1bTxAph2kxdOfsk1hFskTgA0EtUO8jMn\n+9OYpKQD8mIb+l8v9N1kTC6Ui0NidQ0DHGZJcccKN/p5qY74P7R5sI1Vtsjs\ndsf48A7qs0011IvE/n6pBnfhNynVHJojZr6Xh8kYZZho54B4U710eMhr2Of/\nFTKBnmzEJiOuqhDBlGiMTbF7ywitlsbMczO0UqgJiqPWtLm7dMe+RcWxbWgY\n/KgRXlLOG2bsJVBc4prbwY4w1SYaHOBYKs7gOnrvA+AErxVmkQIkOGsbKcYS\nVR8zVtY5uqwyNKHMlSPxAZT4HKsD4W/JeKAEfaGj/RIwzXEnd2g1UMIrWgS5\nC3ZAerEiWHZVPkAaVNn/tGdLO6IRuzY1BjZZ0eJxdnd0yOCfxck6+g7b6mLH\nd5Staly3CW6I5qyE+ec7CDSaKSb9WndhcVsv9MuCMY53YtU4eUhhGFjmTjtc\nBLpD\r\n=7YJp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"3f5e9436fc72c2a007c9eaaabca013d0c5288f62","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.870"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.870_1580166251944_0.47855600857461456","host":"s3://npm-registry-packages"}},"0.9.9":{"name":"piral-ssr-utils","version":"0.9.9","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.9.9","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"70cab0f1b98d6de6840f39c1d49211fa44d24383","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.9.9.tgz","fileCount":24,"integrity":"sha512-2ogdRJ+Xn9IyWRS9AkJ2nSXHovnrIKsZYSWVaDHe5xXo/GDi+DbYTofkR7sXwKV5fV53WPrBv+uvztC8WnoMrg==","signatures":[{"sig":"MEUCIQCEYzQn9aDF4nrJhVzJDDJ/Mycxyvz9L5RfQGHKQGyVBAIgWmnoZKKM1yYs2/9Z8EA5DMx829wsPi2PDy3PWFYAg54=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMY3UCRA9TVsSAnZWagAADaQP/0BKfqmILa3YELBHTZYe\nEO6JysOvvFcpCQXn4JliGnJA/W/AqWVp9SUWVAPybtyj9jyuiJyxHdGgvNv8\nLM0HU3k6uVWdf9fOQ01IFdqr0foCYKveyd9Ku3L0OmQWm+b7xk825qvl2O+w\n5XZ0qAVIynKOJ8m+ONzErs5R/Vj8WocqpeS4b0M1ITMZY5zz+fC2Oz1KJFud\nkEZkYbTbEbLBUODc26jMsEXugB+HhVli/amlBnwd8wlKfhCrpJ+Tt1wFwBiE\nrhkGMR7STbY8Gz1DOhp28Lx5e66l/uJkcouoAvZZzpgKTcpRS1Bgh/WE6uIA\nlZHCAJXYoxkPsf0QORqpNjR/NzZh1IQP91YSp771pdQcEAGQKiKtNXdQBq8a\nuuhgny+xX53FJt5OA1YMTzfA3ODyma5RvdL/0iKb14Snyq5cV2l33l5m3jN4\nBizxvU5XxyPVzym7M1YOJ/L9Auhm455i0DD+StswhQ8qXoY8EQZjPZXK2/9e\nfL/9xyGJ6aQpCY5KEzVlrk9O4NyXFsqFwRRxNXA2N6sEE9olBs5M8WC71Lcf\n71lOevMkmwwAgLNWVYBvbQmQdQSPSlS6j6pnT5vVo+Z6Kr3rimiowtGvtUTI\n3E5gblaoCymJ2RwjybhlTZUl31h6Ra51mEJORqrCBv5r+Y0rYtUmG1gwkXaI\nISCy\r\n=jbe8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"07a4d59c9833cfc98b1f086b54abfbf3d65d8282","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.9"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.9.9_1580305875776_0.8963535374157356","host":"s3://npm-registry-packages"}},"0.10.0-pre.877":{"name":"piral-ssr-utils","version":"0.10.0-pre.877","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.877","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c1e2f6ac9f407c0d74d21b733a7fc8d3550d365d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.877.tgz","fileCount":24,"integrity":"sha512-CfeFLxxbvSDA6LvSq8/QUqemh+LsKFzgRreGpDP/9Q24ABIYTe8ekHCMP/t5eSL8BBU+hDclx7fdhgXeiROZEw==","signatures":[{"sig":"MEQCIAnzjFTs8djz3L4ly5bp6laFvhfwBRxQ9rvPrfQQIiyiAiBGAOhicXkxxWamspqhWLhss3kUZ+Td1EEtdtEIu7dEZg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMwM1CRA9TVsSAnZWagAAPhwP/0XM+0GddSfalVSRTeeY\nIwNe1+GB3KCacoLUs6qS76yYBKDGWZFBhbkPpD2gX8FR20rCLGfBNIgo/vV8\nNEeoO28yge3a7Bj6gKRd5MTd/lxeyAvPd2kVtvsgcLvxSwtEaDBcTKljFMyw\ndI+oUa2Q9zXgbjJrhnnTu6/qKSsNy78UqmPsaC9548Lo0oWG1lLk2MUqeU/R\nWLKSIMjufLbjVglN9sj3/0psOPssSyzRTDCJ6HNwD0JEawShk5wtE6nxcBzo\n8JYRAlBrjWeoiYXlZaTlEdMvTJcY+jKR7SxQwV75VGeE+jYqqPfNMXrN1zq/\nkT9xVBDqEMHwoEFB6zkZW3UMaPLB6RTNlhBkV0fQpKISgkwqshAN72jN/rkm\nopPLB70RaxmLdPtBsAlCXREx/9Uz+KkQCt2J/FMnWsifeA6vD+9+rH4tupYN\n8329Kp38aMRODv2EF+OxN1gIpGpDmGN7Qx45rZvrhYOwDKxjboC/2xO1L0Gs\n8nsJ8++ipdCTiVIe0KjdB7nTABYU574mPo6WL4hYWV77UQT0WF7nOuUwxk4x\nxVfqhHa/6Q/j1okxuCF8WTTwA46A2V8rKYsBCFVWWEZr0TwkLvxUkMTpEctq\n+YoPiJO9Huvgklm9UsncqNeQ91DQDYYVAwb5izGtgFEmfTWAx00JZMJJJPWj\nghEY\r\n=5RBj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"bf1caa3f88f10651f9193c685c7dfd404ff31868","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.877"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.877_1580401461476_0.7785722292145973","host":"s3://npm-registry-packages"}},"0.10.0-pre.878":{"name":"piral-ssr-utils","version":"0.10.0-pre.878","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.878","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"da33b1d2ce0223f44eada93bc274c3c905031806","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.878.tgz","fileCount":24,"integrity":"sha512-MzlmRhk4ujeraWnzpxVEG369SSHmwWXMLw/J7Wp3TIwb2RTl3keFNe7uvT4sWtT0YW5YZGn+SDTf6GmBwhZMXg==","signatures":[{"sig":"MEYCIQDZj/j3BKLcUZ2tgvx6A9OvsOuC4pQRLI5FiFL2MvcnQAIhAN1v6+YwIp2ydoCGetEG0hJ1OB1df2A/5Y7nD2I5P8pV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMyjRCRA9TVsSAnZWagAAs+IQAIeLS3LITRs9Woaxs0RQ\nsKsEJMiGQKCwb3YtD+HqCBdRmu40d82kwRP75cCPgyAFi3zNQzYN7cAXDwUF\nfxZU9O56zrat2fDFIJR5l6jPIrv1322VVevMysGUKyWCShfAnFipEOAU8H7g\nD1QbIYRDYcI7y3FQ0WeTNPVWn+dqkwHp/6+mtjZqBV5PKbYEtVza6KHDzxSt\nRI9JQ1026WqurrjTg6Lq/+Eu5VZpUbuELdbtpYaqdft+IAn2lelxkzC5mMZY\nUdE+Us0AsXnAmtx+QrjrZLhyjKEjjgN8C2JCEn5oZHNMQJ5eSZW4oOpaV/pY\nG0Q+d3i0+vaK9KCAuQw4PtY4yQ3aXmxnWZuNeQJx1ES2Ch30+yauyWPpJILl\n0pcgVkQUCdf+WT1+x6ZCzWzNRi4QWdjBk1HyyzPh1i9k+qvoGj0bEekxHM9+\nZFVtgqB9dn55qKkTNrXXPVxO2hM9rKLbz0CG/jGgdVAUUx7d0Jd2GxeM+v6w\nLC7xg0pLlVdt6WIccuW7Dx8u9bacSDnRrV7iXheOnfLmjwTSAnTKrmBVwoBt\n3oshTQArxmJ5tBc52okQXhb1pnuuy2NIVICTD5reDb2/vD+z0XLpRXM9WqjA\nUYNuJEv5eZfjihCu3UWQq14isTnNR2Xm+3IS6ZwoHG1p4+qxBOOT+q47HA/d\nQeeb\r\n=KDj4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"c7dfbd0aad35eca2b3fea19db8b86ce66859229c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.878"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.878_1580411089353_0.48129325452560945","host":"s3://npm-registry-packages"}},"0.10.0-pre.879":{"name":"piral-ssr-utils","version":"0.10.0-pre.879","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.879","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5c436c540b6c59e65f2df0193849863677077d6e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.879.tgz","fileCount":24,"integrity":"sha512-3JpjlFj1gLvi2kiDfi2ihB9xpFGz9CA2Ox+U4XcbNCEeQDXu+XJOrkVahjIeGAtIQ7uXL96102xRVJpCvawT5Q==","signatures":[{"sig":"MEUCIA73r9K0q45OLubuwyeCPxBv71pGSR252CTf2LOmXGZAAiEAusVlA31/X1Ikb+7NSXXyNg65Uwkvh5pfbseusNSsOtQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeM2TUCRA9TVsSAnZWagAAKTQP/AuI0k98CcCTUWVYjz0D\ndRACqRO10OhWta5zCHMcmlyjygRBmATzIylGHR1WWR3xxjlI1Jo9MZEspR3x\nJiZlBBZVF/7CmeVCaORORBNBXGFEH6A/OJyqiMyAuuRr25e80tME1HzdErpC\nTi5FrNNJWchKTn6uiV8DMAwvcKfPYUVJqbrV3U++bqzvUsBxqVPr9VddNyRB\nHYIYhtRa1BMfGhrGXutJIjJk+m+P2jaZQYI02ymtYSskrAffXCWD7cy9W3nX\nP2q6K8ucFpCeXlE0Vfa1QVKj8nVHjavhztRjspOkMM4Y4dfnP3KRSnn57mkB\nY0m7ntpc+y7jwG1MTvEytHONVvetdKUfd7CoOX7jPhhHlO1mGaua1QBJov2A\nBoB6v1C6dUraSRkFnTKLZ7AYmAZrVYQEM+6Pjjtk03t2pWbBiqFRs2E3ihiU\nTWFe/in+Gny15K2lPPKjGCijIF8619KvcGv557m6wKnsYIh247O91z/KM/Uw\nNwaLRoc9ak+Euz2BYrLf5rQpQ9W271P98gjvHMmlgslvj22lreouwl8J9rRX\nDKaUk23Y1A6Q44V9pXKFkFbeQJsrzjNXesf0/cgYi3WZ4GSl1shg60yYPfJC\npxxEF5P/Oxkayyhqsw3Jsbk7cjl/+HieqalqnTcSggy9KWAxRRe+cGHjykx5\ngm07\r\n=Xi1i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"db25225fec681aab93e9a10ecd3cc34bae1a2fe7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.879"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.879_1580426451871_0.8032256633679928","host":"s3://npm-registry-packages"}},"0.10.0-pre.880":{"name":"piral-ssr-utils","version":"0.10.0-pre.880","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.880","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"81a658a014b24297aa73f83b59d5433b29d9739d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.880.tgz","fileCount":24,"integrity":"sha512-elDP4XUOya31XIym9hPomvMzZxs27jM1/QUKubL8HBUt7/haE2RTTP5xII0DwOF7Ttpyb2703LVXwZBvzii0KQ==","signatures":[{"sig":"MEQCIB400v+u/kmjJvuWN8or2GV1GQyPmvIGFaj8rhUo7XPyAiB6UIUf+RAMEgaVnqK582KgTfEfLg7Kux3ADjMuapMANQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNAj7CRA9TVsSAnZWagAAZmEP/3eqZhqdIcZ2euV64VgD\n8Dz2J4Wr44Dm3JvzbwFxuA5PhVAKgMe7DqSHfeOQPP7bXBjfvcuyH2Arrdxq\nbIOYW432/VmbxMSiCakIUULfljiHjs+qE5yvlsi3cxPjZQMRCO7LhuelNHfm\nAhpZWhYzAtsBcVpORYmjzFf9X4AZ0bsXguHYnoe4T44BV+Lel9Ly9MvvONM/\nI7DvdSU2IWG7m7UFqWHzc93gmXQpZrzwyRsf9gItFnu+LG1DiP4DP+AcNz+x\n5b/+71EpVqOKrl42BePtCUgpYHxWaM8GxQmeezLOugJ+EMvT10EAaNMaRYEx\nJjtjNEn5U/BNaAK365EQpM8pPqDXtbKtxyHuAZmg7yaTs2xlq8TT9+cX/gZW\no1GRlNHlmHWMvXG7hHeR74V9XiktPDdGvOccwUJSYYO5N56Ij5s8SOqpMB+c\n5PQTDiJtJ5GGARgmFNKdX9LuxgjXfRPw3TZuGhQbHppoNmc5BOoGrcHyqAha\nluS3JDJJlIC1dSaCBbVocK23jdFa46KdXY0fWvYYHorOwz+1pKxk/9lqYfrz\nb1dI+qUt6eoP6fLfCtXuAHtp352A6XGZGS2dCdh6OYURt7obXR8Kb7L4/XcI\nhTKDyQlp0yTAEPEKMIFKKoEm3CZme4+FKb9QmeTWCakpaagOrZxfrS/+ffBV\nYm8N\r\n=6KZn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"922e2bbb5b1447d848e04ea01076760155381b16","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.880"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.880_1580468474812_0.2659834906385401","host":"s3://npm-registry-packages"}},"0.10.0-pre.881":{"name":"piral-ssr-utils","version":"0.10.0-pre.881","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.881","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"416a4e464fbc4ecdc8e47546ec2fba0ccc5afc16","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.881.tgz","fileCount":24,"integrity":"sha512-wtufbBw1iBCxEXtdYxdr3TgU/OEe4zRpcTHZTQ2bi2fEmfLBmxkFENe5Iq1gLnepN9fn2OJBZlBe3xYYnqtH1Q==","signatures":[{"sig":"MEUCID6V5jdboRGwoIMlLyEqayrSS9qejJQlbnO3GvPjJ2VwAiEArBnTwYucH1u1zlZ07Y9O7rv5F9+rLTzdBOaUoUMlUg4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNFNHCRA9TVsSAnZWagAAKi4P/jjCAB+SaMAMNEIVR7Nx\n/Hzs3t/9xcLvmVUeoOqVT/s2ey4devltBirdHx7NBiVltITjPU9RcnBB+GWH\nqh5nkHX1nrrmz3dQZNae6lLE5bQ9p1Mb9YH9l4MOMhj6YxNZvhEfxIP9iPNb\naKFQt0pQpCoucZrXP8cIoRim8sy5T9AMr7ldK9vz/bPExiioKn+0vINyKewc\nqJQZe6m1SjPb4jD0+ldQJBVUZKIur96GSLVrLivc8ldvuH3Ukae/VbRipBYE\nXNGCao1IbtT9lMle8hXJzS6gfBner/a0Zkw61av8u1HG0/GdbuVqHNywK8PJ\nNag98a/hNgXplFUuVmeuFoEDNJvdRdPPGNxP6ereBQn3TauZ3QCW+4m3wxXi\n/6CJnBES+Q2RC2exYNVLP+t1Iv0E1l1rbQs+aCJn1IS0d/W/8xo59Xj1f74d\nmJn6TVMnJOoZtCLIdfwxI8oh9YtFgburtjnMBOtjGeEAmqt0Qa8fsBLXc4jR\nZstbqstjWX00PAtng/rb/2gf3SZXjy7P7rIBlyUwo7w754yPiB2juTN6YE+S\nKZVktJJpQpDWQLU7pc1+knEQpPOXQqlrE98nFm5RrjjEJQF7Kf6RMyvk+wZx\nPsABXmgjxLT+sO7ij+N6S/j52Eaw8LQTzVrfWC0hjBN0cCgocplRL0SgkjF7\ns0c8\r\n=CvzD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f2b9b15c8bed663db3300ef34de5a9ad02ab4600","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.881"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.881_1580487495421_0.804412436316776","host":"s3://npm-registry-packages"}},"0.10.0-pre.883":{"name":"piral-ssr-utils","version":"0.10.0-pre.883","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.883","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"39e8bc3a9968c62d62c0534548a2079eb67ce1f7","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.883.tgz","fileCount":24,"integrity":"sha512-5C0OvFgSpg3gmxmMpwp0EnI81nI3EtMKQKYJHeH4aJesNxqY5eyVok08i2cSAjHJIU7HUnyswml/so94egCNjQ==","signatures":[{"sig":"MEYCIQCZWe/U1jmauOfWLskmvZ/dmq3HSsdJJfGS9vKo0Tm2DgIhAPRpIBRKgZOs3xCSolLtEfO0u4ooDihXYuB+YmriqnBu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNK3yCRA9TVsSAnZWagAAnNQQAIIPR7yTqtsOn2guHL88\nsCbt0ML8uyny+UJ+P/uF78wJDVNE5TWdxOmQnHfT9mHu/DSFoJPZ581mTRfs\ntLWyiokrTJXRzAyNgfkd4vvaDZ4D5qz+mT68bGR8MvJh9VExNzBQPnEEXg09\nmDqgEVJgBVZYhIiP5YR/MPrECeRPxpYs4E58hJq0sbEKbvdE/PNROvOx3kcR\n/Lfi8K5xSodDnq+HSnb/6WfdoVD3ZxnfjVBXIhm2L5FqWmROXOkmr0ZBNZq2\nPVX/PcfOsXv9bat7qUKJNp92QO7cgQKDA/Qt/EgLCueUUrQGBTRQopL3QYzY\nEBCoxeckskInuJ++a8/5JnrxyVF2iiKHKaxdItvBxVF0WKXQmrvHs1R62PVu\nOk+q86ptMCcvexf0x4CtzgZQtyIMi/X/cfY3oQxxxmwosVlzK5oU4Ry5PtCY\nSgc9ndhSFO/USPgBLz8J0jyoVZoimfST/+vGlx5Edrx1kDJEsLJTfxYP4jab\nX5p6tYbL1Og0ZLmvcFgBZlx8qah43CIapAj55oXTZvUA2V55CHUzXyOgF6LU\naxvastDAv6Ppu9DIP0Zs0OeKRecyQsB+gMcUWd0ukVjoacWWaY3sLyUb1VDo\nvvRm9tCVmEJEyvBLLn1EIx4pGIJkPpLWsXUDy89n6kySbPQlKp/sx6hCLRfO\ni+D2\r\n=uZX3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"4de08c8606e75c113f60db38aa5ab3f15f62b7be","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.883"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.883_1580510706147_0.6344728664425074","host":"s3://npm-registry-packages"}},"0.10.0-pre.885":{"name":"piral-ssr-utils","version":"0.10.0-pre.885","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.885","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7567a2cec064080d5915dae6b85104f1316e2566","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.885.tgz","fileCount":24,"integrity":"sha512-SReGnrSAkPbQP7ujSkAcK0O+F/cfUlOIdmHMVcpc86xASPScA9mvKBXKmloTmuRy+Drj563Kv1KAgHWFsWegCQ==","signatures":[{"sig":"MEQCIBN6RF/JI0XvnlHBJ8FbtWrOifgBet2hczj6HyxxoxnsAiAUvAA5CZtMb/N/xvYVkr36A/D4KWVevSUCY8EoUjMgOg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNXuTCRA9TVsSAnZWagAArhgP/1+OTlX/+Pvf/DclqCKD\nHjCvZD5HDQVdNU+SwnvMkjBVgqwDk6ejqa53L1mWUloQl4jj+y0Dq6POzu9W\n1Jj2xeI4A4i6W+0W9T9Yf33PqM5s5cdpG6ZqL0Cai1KMoQgtgTd7YmrFV9fp\nluQBJa77cWC2Wo9LHgEhpspilgh+4nsTw/JtNlcNKiVjd6o2ogaz1r8MmUiL\nLMWlYz/YwQdSOraqNV5fHf4aH0dFBTZz91sxtNP/UyBg/Ss0YHRHGQsWRKeu\nDSEPujVKeyaGHRuq0Vem3FauWqA/NVHjnqyZSBQnj/PVkViLar3GExdDGYi+\nIh6+KZUqOSfa18wdTqE6zxFbr+65ZNCL3poGpkNGd08oY0AwV08MhYBaHhJU\n8g8kIV2S3aRJ5VPwz/1iXW4OklTlyfD2uxIVM5RC0lVIIr9u1MX0Wz2qxddy\nHg02uUSpZ9FezVtiDfgk1Sx4BUd2g8Nc+hdiqgqmFsZ6fzSQyKzjAvhtEikK\nRpisxTYzezQ1waYj68gJx+eCeEdwfy4muSC5F3ZbFKOo7QL1q1tCRdzecLuG\nOJFjerHy+AOMcrc2XnBW8Ho508XVm8VDPBfbG5kqtpSTW7o4tgiwHn4mQk/P\nDh7NbDHY+gR+qbKt1Ufi3Ww4l2WsXkyekls2QIwOaEbS+UHCwkGEaoLLHXew\nEHoe\r\n=pea4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"21dd6e46d5478826848c21756a4534b7a1e87ad9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.885"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.885_1580563346722_0.7839359290623711","host":"s3://npm-registry-packages"}},"0.10.0-pre.887":{"name":"piral-ssr-utils","version":"0.10.0-pre.887","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0-pre.887","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"05ef1ed6639ecbc6258bccebbfc285af217dceff","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0-pre.887.tgz","fileCount":24,"integrity":"sha512-ACP6y3XGahOOATHteO+tM/SbsdxqSZW6LuEcU4qYAThsXZUd29+6MZfARkEuvAos17X55bEus+p/yCKIr8SopA==","signatures":[{"sig":"MEUCIDFQFB7tVoTwdnvS5KwBsysHBuclLixAEUZCib2TpHM/AiEA3oOo8zc00Sn9Vc1XoVT5KPJoMiemo4MxZuOmG5dOugo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNn2jCRA9TVsSAnZWagAADYkP+gLJn2d0DHZAyUQp5536\nsVarfK/eJxPQeCp5iWryuI8/LdqNDhlmAJAM84S95qaL5eSYAtz9Xz/iGJV0\nw5d2XM9+LDaZ/Z662z4qcMo0p2pmgL0VrEDuFPx9GWJm4t1cUVnOtoX0i94O\nYaozG2ERIwPQ9+7gXDtno9tRhr3OunQaIl3feEBiRTaH8Wd030WkJ2gvj7O8\nv9n0Y0qvHCZ8NLdjKO0+/g/P5ugxOmiPC8RPkKFvtuOiSt3YzIKHo2BLHUw6\n79Hhv/ec7cDzbDMPXqRMlyxEs447h28byeo8j2vuDBxi/NyGtccu6eI7A9kq\n2crqNAr+yHpQ3Rv3f9D2E4QdcBqSIvo9n4nwKvtNNPAgh2s4pe+yXmAE8RZI\nWxYn8xPi6kPNTZkCvc4hlup15hncVEclBbBn9C8/JkvGPciwdMplL/k+O1HG\nWjqmKFVdgThDfBo8i9Wyh1jPZgTuVwFrwXV/uB1gSUzsDxl2Nsr25FkiIbe3\nTorXudS5PBFagZ6H+KLV6WLpyxp6wp0MR7gEIQK11io1NAqmH0L9P6mSDvXT\nFpVOIpuJ7jOk9RlXL38sF5l84PxVll1BL877warQZOCMduqspLswwue3dxBe\nh+qspFPi4WyXOY4bFLf2jflNRrDRY0GipZEzKHlwCkoDJAzZ6LGwL6tbCvjI\n3TsO\r\n=55bW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a3e3f64790b46519bf28a49e31025cf00fa94fb4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.887"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0-pre.887_1580629411150_0.16710521153755376","host":"s3://npm-registry-packages"}},"0.10.0":{"name":"piral-ssr-utils","version":"0.10.0","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.0","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c535a8b4b3533591a16f32038fe8c4685eb0a71a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.0.tgz","fileCount":24,"integrity":"sha512-d7wlHJOF/SZNOSuGwvff8danccCzT2E/wZHMDUcGizD3KE8PF77cRrsOl0ydfTlH6UNwa1I+X2ETXU6mA0Y8Qw==","signatures":[{"sig":"MEYCIQDAio+Mpbd7E2v2NtZ7XFOidCO8gOGRPxuly37loXGFlwIhAPY9IQj9fsFbC4QPSwY6TAAQ46a8Ht65obdLKaMZAM8e","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNqFoCRA9TVsSAnZWagAAzTQQAKGq+jbyQgFWBusOeKKw\nj+bFZvVSndz05myXQ0HMP4J+VSYoJsyrW627OaEEh8kcP3s2vp4sarxTf4oa\nvzP0f21noF062i7TebvpKrlsYU/Hg407Z5FUVbQG5stDUrZ/e414TrUFjA6m\n/RklxzGKcA2taIIQv7WBdLmLImOum2IrCzYZSzdKrUajeCvKjwSmCLLWO4gC\n/AvGqZmkRUN/+GKR5ZjOFVG5YLxka+kxOyHdeBku1Mjf7oWbFvHt8Qz9Cewn\nkAzaKN30ZdvIVXuGCyqUPQrJ4uo/cPYt86DJldaTpn98t/SJF0hvhXHWhm5B\nr0ZcklSYkTsLCbyqWMfp5I5KuyyIQ6p1JASrWrA1SI2fwoAUNiXbry/CNexV\nzLTag9/eQHN2yxRLy1GrVvFQcFz1MYomAQ0CyuIb+hfgH4wwAsh1NHy6pdIO\ntUluIstKRzcl16HounI0KogBDcnB4Vq9lmn9/zv1bze68hlQb5hw1vis/lES\nFmzVoqor2WNNTHImvLb37grntiWWHNk0z2ypeKYfgpUKYuxRAbOarohjHJOq\npz8W441E9jiPvmDIWUKn31fhn3HGVkWHmAA8ZQOIZ4t+oBgnN7/q0lcWphk+\n7gqSvNGzRfhaS77KyURy9imDWpykSrMe6hvuzRKqnhQEeQ/0EgkAWzpcjdu+\ndWNa\r\n=Uoxj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"7c5a6e46f285d94749c3d9f4778aab8483435d63","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.0"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.0_1580638567929_0.9407408329764599","host":"s3://npm-registry-packages"}},"0.11.0-pre.891":{"name":"piral-ssr-utils","version":"0.11.0-pre.891","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.891","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e2140827bc8f1d76c23ed6dfac53828ce7062fbd","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.891.tgz","fileCount":24,"integrity":"sha512-XKH77CISnbczCcyj1MUDLwPIlYEQqtyGz4xH12jA9vDdpkoOkVlKzJFsYjQHVhZMFzBzuGz6nCCbcFSZX8QdIA==","signatures":[{"sig":"MEUCIQDdI+FBP0gXTRPmhA5Bn6BmVPMFBNxlYv/kNpcxgKvjcQIgQiBr/iKt5KlXt0ZNUSBahZ+2LUSd1+6GXsicyYgFlGA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeN2rcCRA9TVsSAnZWagAAcg4P/3pUMh+kjoxM06SDGyu4\nG2CoFcwON5Lv7i6WYrTijY/67KDlt5IZ1ILbM1dxxowWyHvVqvP44FLuH0FG\naNyZw4jhN72EUW5tntycAQ3uRDUggn29fL+9tX8nuur75Qa2XiJsL1AiYiAj\nCLDEH5ROg7kuofN7lGGmx6QnUVKUlVTJFHDf4oIHuamNvn+e0Dg0S+SWLyQd\non7I5Mr/sb2Pnckyq8BCQJL/ZvG9XWBLhV05r/TrYrWszp8HD3LzE4r1zKMV\nTn4+Nxha0pn3zTRVDtl2lGlAvrpDs2WWz965Lcn9ZIqaVxptfDIUb8/GTzEa\nTG5y/tPkl3FthVwMFBwqaaukxs2I08MLM3bGdiC98iOyAxp79gN1y3f8N5iZ\nElkE3onms6yzFonE3v/IUFDzRmYt1+A9Y4pgGxU3aQkpDyH6r20+th5UzdWF\nu4HchJOPBrr09RRT7oJ0ZqD3y5+xf2OrOVuOiUP6UlYijOY87d17/TxHxSpy\nyFKFMD9tmPyDosC2krAjrdTDKAqZiw2VWpYdk37Plc5vY7KelXCZPMm5zW3n\nORhaWqgccyG0sWWw+VJG9UkZymTYG6OZbTozsP9UkBptXe4/zSLAQcj0jV4p\nVLm41rnfozO6jivRDfEYuo40hhBr91A1yOb3wRwBV+hgUxD1gCxJDvZuMKAq\nHpGA\r\n=30Rj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"986aaf2b3e2977d7b2718defc713d72d9d87bc8d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.891"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.891_1580690139697_0.744442604794646","host":"s3://npm-registry-packages"}},"0.10.1":{"name":"piral-ssr-utils","version":"0.10.1","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.1","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f2758e76eaf9656d97220109565c09f435f68efd","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.1.tgz","fileCount":24,"integrity":"sha512-5U8OxrDTMHuCCXioFFe1wK7ULnDhGyhL7zchiT3V9S69YwksgQo/lGuOKDHzC17EgMS9//FeGIPH/ZMvwhjGsg==","signatures":[{"sig":"MEUCIGCf16AfD8U2ivxZgcWrwmvff4zgD7drR5Ij4NEeOCQdAiEAv/GNQHYcaF6kDG4lMRkrVpss839yi1bXNGP3s4JrW9w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOMftCRA9TVsSAnZWagAAr9cP/jCnJPx5DDCXTtKRKwkj\nhH/zIYPUYu1KmmCE3KHtUE7CtWm1YLvKiz7o58Gam/2fiGWv32s31Zm0HZwh\nI/Za+rzlUvc5Zh4pDyMkLUEL8UaaYoxVik9b83DRZK5l8261LAIvSNqwUVCU\nmxNNlAOdVe5ytU9Y8idnCS/L5PkI1KkDx5b4b99yH7cIYd6vAhiqPRCT5tTl\nePDwmNPY+d0wfn4RSvAGyKeaWiDHZxwV8ZmsoP39P9B6Uk3q8E6dxiIpZYvq\nrfqA3OUTwRiZg7We0vLqdLNGaIqYDWdlo4q8ceguGgRhB6dqyJ19TDSiMDIp\nX/Ln1utfWCH3TWph2eu8cqQJgQOR/4vzk3gu0dX4L2FIEqkMb6XtzWXIhF6H\no+w1odqrJRMEaGDVxefjo2UqdOtZk0GDgq4YhiQKeYynuCEw8hwY4qVVOt1W\n/S7tLPtIRu4PpxWL4vQ+td3idza4v415U39KJZ9/n8g6TiDRhZGFHM453rdR\n+l7GA2tOyFQfIzAJ244P4KlBbDM8R7vr2k7RDtosLsIhC/sOmomuIEodio2I\nB7Oy8PcoYg73cZ3GXxLSDpYFm6ECJou9P8+6ewFIkf4Xpz5UHPbMYLpcmTzQ\n4pjaBspE/SiFky/hZ57gF40AIsnkqobUHibeFbap9udyHhyT3XqaA1I7h7W2\nw6ss\r\n=l6uA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"b80789c07712083aa194d9673d0f271a16d671bd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.1"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.1_1580779501202_0.7974501849195961","host":"s3://npm-registry-packages"}},"0.11.0-pre.894":{"name":"piral-ssr-utils","version":"0.11.0-pre.894","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.894","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"662fae257a645d4240163b5f86afa0812493f435","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.894.tgz","fileCount":24,"integrity":"sha512-XoRtrr/c0rN2EUb3jarulat1Cxf9HHo0BveRtiuybXHWB6P3hnFEXiB4d8ybXXMDCx2pa5ixw/vX4tmSJXpRmA==","signatures":[{"sig":"MEYCIQCfmK9fv7mS19kz35SaJb2D0+sVOdra03jZPypXlxrahgIhAJNpNcrqHJ2LjcW2QsWSpqhtkESksUYGu3MiU47mcQym","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeORMaCRA9TVsSAnZWagAABCQP/ikSz4lnRS8R9xJbwCao\ncoNS3LZhoR2+UPk6l3kAdfxACGd5LTmf7VJa8BjdZgB3UcRXJPVuhOInE2+t\nfUrTYJkg2nazPkgSYu4RJuInG7j1QC657gLZ+OHL+DUQOmZlC2Ww2lI6Tk/y\nqtFtcRsyKWHndn6SWsKA4rxTMPrwsoxWd8EJgPcgz/22+YT6Ok6r+y4CvEu8\n6cKTVzSME/x0gYpN7/HgDHOa9XH1KSuhKdZ1bO3hKA/MydkS5RXxE5cgOdyd\n1NirbCm2cuqAzoAG+ckjiH55f2DY96X75LxmVXMG/8PY4t+3mvzQSNmUnM/w\n4zIfRAcyp8e8w6oNidsAcfjeNTbGlV1emMrAeehFqAEYYlIx+BZi6DmPRKSB\nMd8uPM44Om5AGfN7bKiJ6WwRi8FOPgM4bSR/4n61r/+AyZwM21dZnLRjBOyS\nV5+xJSffIwEvhPDZ4IdmESP5WakxVe3wisMI6DftGPEx5wiB4S3n2AdhvfoL\n74SHZhLpvBd8FquZY/RCskHw7gaegoereDGi5JuqC9WDnZyYtVMuSUdO6rtz\nlc5Ix3mdK0PIt3lKlk4bT1glZWLr3DfewtzqQKzVw1QdlAEXeIVT0wpLsLVC\njIkgksWKjlUrx0zlsghd/+JmjRMuviVCjhymWa60YMcIw6uNtE2j13JAdjfX\n15Po\r\n=Io9p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f65d88370c1bfdd90377b7d70b51afdd9e379bc6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.894"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.894_1580798746534_0.33027304225768406","host":"s3://npm-registry-packages"}},"0.10.2":{"name":"piral-ssr-utils","version":"0.10.2","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.2","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"bb503cd1fcc723444df016e1cf13e8838366b112","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.2.tgz","fileCount":24,"integrity":"sha512-biWEXJand+yIgAQcgRAkmpMtzvH0JRgJHOWoJHrFwUHSXp3FmEA61tOJEqZiWdnzA66IaQK86wzxrPe2vMUGHQ==","signatures":[{"sig":"MEUCIELpUyRcSExm6X4/A4Y9LZmlnUEuTV5sL0VXyaoMp3svAiEAvpJ412Yi+CAmC+JONWTPkOl8bNAnL0SiWK0FD9pqKqg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOtBDCRA9TVsSAnZWagAAV28P/j3Z0YkFQigo3XqlcUJi\n8xAhHLNorGVvJS9y15XxU2f4gLTKqXE9ksXMsBmGN8uEv9nff0g+7hwjLhM0\nbo5Fe7S31vk/+pDzF9vWS+S9Nq4AqJwRpzb4LzIPNAn+eI5ysXlhO7N6AYTE\nZL1VYjJBnuXckz+cjgCHi5NesP+BIVuBuNRc0JvkCd15rxZmmxsUK0aAxeo2\n8bTc0SEPn2Kb+EDyB1UWRDyGMfIxCKysgoStAjmzm80hW+DOZEu9KoAmVFa9\nnqKBHA1K3x1PHmXt+zbn0AwFkJmr7Ges0defD0mJq1cMjoYg9lLXaHh+hHOV\nYwBMxwp+PCvBwPHeFgaOfVuRoLjrpOpjmhHOEcZ+9sTyPgzp4Yu9LKflcdZv\nqrcxa5KW06hxY330l5muxRYJ/vZjPvRbS8xQI4QPHszjRCZFqm//NMVis1dv\nh8R0hzZuRgfwQrDb8zoCyUaoTIMzRCCOKRV2DXro3Hupp6dKo9NIBKx2uOLj\nc7O3Gbk7fDQmiXBeAflHbQC58SMYMxu68VHWjurcJVFszlnqQTSzdL/3ogjj\nQReUUQPx0HazoA2iQc1DenEfWNs/tBcAMA2uULzy5RFsgv2A9D8WWPzCyAWU\nauoMlFoXYLnkYuudThOXB0ypeqSFT3NmlPSZJHTINir9k2ju5OHsKF79nuFZ\nWxJS\r\n=UnFO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"d5e91c251ba96740dfe9f8995ed005df19fee923","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.2"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.2_1580912707047_0.13293371612488802","host":"s3://npm-registry-packages"}},"0.11.0-pre.897":{"name":"piral-ssr-utils","version":"0.11.0-pre.897","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.897","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b4d77f303ee0a60a7a35e2782d6fe0e574561828","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.897.tgz","fileCount":24,"integrity":"sha512-ohis4zzTCcYNyq+xk+Q8rUt5yxW32ITIa/PQaRVbq7/GOtUVAG+j80TZXK1IT48ya2S7S5XdA+0xfKu2QawlFQ==","signatures":[{"sig":"MEYCIQDbAkxL8uaWkJ9EXypoyeGs4Zbl4YDqgQVJmB3jcBSPoAIhAKAIvsckLSn+NFaZKz/Isv1VoLN4i6RjQXdUP1zmyRvx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeO0D/CRA9TVsSAnZWagAAnrAP/RCZFmUZX2Yte7w6eXYL\n2OGacYpkC7qBWDA+IGAQhwjQNbDa2uXc22uK0KzAhYbpsyikyFR3kLe5KSkn\npWUxvWVtl1qLQuEorCAgnOkjHd8DDIfBY0i5n8H6Xofq/YWlo9C/N729U37W\nRuS/FArMiqkc9LFAVwFshPKWcEg+AdLrQ97FzJO7dy6H8hs/SYCpJOpkYF5I\nTHM1FJau2e8uOSA8FRNEGMNEMeKiap2HHCYcDIJgsc4DImNJVgIE5IW8sKwo\n1NpQynxGgfyzOi2JWTB/eBTqe624u3lvQrgctBtQ5TwGERDpKG0o3ISaj87u\nmhKlTSAyVWhLwobiiTyAHThrZIKSDgZoeK0H1mv3UXR6kAzZGGZra4yifHmS\n2Vw2BxrekNzgs/evt5H5QiSpuCCVry2HV5b8qhALRKWfZy9GC01MBXNoFUfU\n/SsnDByHXN9gFHZiKY/T8tWbt29Ozxr0iH3f88XEvROil1MMypdNejvrZz5+\nwx7TWG12Vnyf/PSO24o1N/kpms5w+cVGdXCaTtMxKpOnNEEiZiOUoz321i/Q\n9FolyFZotrYLKbSBM/j8TGCXsFHKaN813qElGWugIAvWFbIpaP/FYt0pGv/S\noNejQX9lSoDQv36LoD75ioSOCEgudZSOAXKKJWCD3Fh67ekJObmW93su8DF6\n6w33\r\n=XckH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b375625e464e4ba5f87d189cf3c31c2f2bbbbb3b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.897"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.897_1580941567043_0.9120047937069826","host":"s3://npm-registry-packages"}},"0.11.0-pre.902":{"name":"piral-ssr-utils","version":"0.11.0-pre.902","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.902","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a3c94a8bb923d7bf26f9ef709bcd4dd0598dc869","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.902.tgz","fileCount":24,"integrity":"sha512-itKtK5xHzddARDvrmZlssoZU4LCfq8y7hb2JLgllt6TWRvSSQAlMsWXbolkjYGFvXfO5fFz+yPxOm2FWGVUdZw==","signatures":[{"sig":"MEUCIFMaw1jPZ+uqeAamFcSphCBovosqHzxJREM4MaFeNp8xAiEA95BnEBc1v/NFiRm8TF59dkO9WKSy6OhYWPX2Hh4usL8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJePTCyCRA9TVsSAnZWagAAXVAP/3L/NbgMgSe5D8/7qiA/\nCumP4CsGfBGzmLTLUw17j42F4nVxMehDLww7vU1wAJsdJJKzci1tVPujwJP4\niKnyJyrZ3Sc2qhsyzO6AvHvCXChNOyl5yRhSXuMJC9RBjU2NFz9IsQoFNFKV\n5tvBw07B2uQkHEwbFwzSMQ481KIv2EfYZBh/sRWS9czifjLvHFfYsmMZgkHM\nsjdRXPB9hszf/vNOfHF5tJEDbPBp+4a0W2zwxXpIO9Rp5ZaHO1TSks/FlHnq\ngWAVfE6qJuFQ8eMoZSdgl214EFyPJIHD+CjksU6c5fdNkoRAARiz/VPx/HMn\nI85OvSPN2xmHR6Pl2PhXnwCsWSETFBQ29+iLGL/4HvAf61WhCqYqGa8gqWE6\nXQulsd8EV97M6uAipIUQRcVNgsH0IIl/vrX7KuXk3vw106jH/C1b64HKJ1qd\n09Qx3c+pTzRHNu1BF2V8eoSg9kPCzLYXo6CNnuAJsQt2BXz397xarBsunCiH\nBl/AJ5YweISfjp1xFKj4+AYcuC19RIiJpAoYg29QC6Dh+/4HZ6DKqpWfJ7ac\nyNTDqvCQRRl8HF6dcyLxzSc/rgIC7Y7wgsguP8M+HotgulaElMwONwwpkg6I\n0VYrEwNbrlv5KPlW7ptLrz/6PGE6GhjL/2Ibp4cLZOHH2Yf3S72oMi2GY1nn\nAOT+\r\n=ag7w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7cbc35af921f49f7d664edaaa70757e5e7e21413","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.902"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.902_1581068465836_0.26094848993484665","host":"s3://npm-registry-packages"}},"0.10.3":{"name":"piral-ssr-utils","version":"0.10.3","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.3","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f63263023042da8b509af78ca9853c2e144fe244","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.3.tgz","fileCount":24,"integrity":"sha512-0yfOk9oj3Tqy1WA0Er4fcUxjCTGBmcxeh9Qdc88CK503G3xxAMHj/F7PEbZrF7tp7c/gnVgsfAxby504gs8gEw==","signatures":[{"sig":"MEUCIA94LYT0eIwExM30Uil5dYdWAG7IfSRuu1yELopVYdUjAiEA4ztwEm3eJADhEH4Rrtp0QIGz/qeVgyOmqDJeREYtbeU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQfWFCRA9TVsSAnZWagAA258QAJTLNtOixjuKxztNvCwz\n4f5YKL/fFZhGr4PVUZ13fCgvR69t2Wrq1LjBsMmmiFovaO/PpRgj176BN+k1\nwlF2+G+2nCPPFVD8ecUmb/+G0UVBhrsc4LFxmH123g0NtiaAequwAxfn3Bmq\nw1/fMHVJrckxvnuRLcnifeGdw6buGFHG9WZRS/togmKx8GeKeqFYu0l4bMPM\nZNPO6C/gISKXunl+XpmTnmdVHEW2VeXuhlorTBTmAqIs2zNrEQwnPbMm+WI6\nVMq32Q49hJ5i2GewQcMq8rXm/HcyinVAGj3HeegarcD5Rc5iyVKe0SbCSiyt\nRrnaLafpXjwBqOIyn+gv7fHPriXXAJKXRn8v5kRPJVJ4bykn7upnr8i85TRR\nUs4OMYZ+tGZOoOO3Wtn34ajYeBzvwY+VBYdCMUB0in1aCipBjDg24pcWDypF\nsGIfrnhlkNRnSvVzrmE5kwSGxakOF1lWvXHv2e39sPyOn0jThmH3nHPxC0xf\nWwXtkHyE++ucdLHLWFjvAsXnRo2vgaXEbuRRX1/JEGA5KwHZyiwx92/Qq/uN\n5wIi72ySGbk99f54gG37BDnjfmc3zdAWHnfr2WNmOwWa96aIaNQaq+wBdUHW\n+6qDhk9nfmPDFRnDv/pmgCYi6/L9T/tz17bxSwJr97x4KQr6h0KEfqFSvnzq\n3jcg\r\n=e1H2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"0ad92f1e5688ada20cd1b1cf2d4ca8d9870524cf","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.3"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.3_1581380997469_0.1202735183401662","host":"s3://npm-registry-packages"}},"0.11.0-pre.937":{"name":"piral-ssr-utils","version":"0.11.0-pre.937","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.937","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"30260ceb7c37542aa7afbd45dccf97da1dc2721c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.937.tgz","fileCount":24,"integrity":"sha512-4/kE4CDLiFuvwjGgm3ggpaVLnBW3ECqFjbjG8lGh9afm1GUbpvw4FgyvAy9QlleEX7xbbDMOLWcH4xEpsIaDnA==","signatures":[{"sig":"MEQCICyeGkoX/vUXDsskAsL5rSkn5yYyyIJThnNEeiTjp+UYAiBxlOylqXRdHkvUDzGaKDLXV23byvuoWUwhjL1L8rCgKw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQf3JCRA9TVsSAnZWagAAtuAP/1zFjTlFpjWddCtM6cvA\nDpGqSweCohBeH5dJwFqkJUNN9EmPgrMlC8qFE94O7NToceQQaoqNzQC8i4Fm\n7ByN2raUypD9LPeqnhlrhCR3ikBIV2ETs+qEZSV5xfXEIN36Cwa8BcAtGxZf\nqMcIoA4+RFLZrw8Bv/SDUAwFGbcsM50OXw8nW92h07DonVRudtcH2Z5c5Llw\ncp3jZUHOGRp/II0A4wqTS7p/zteVVTE+wUovPQEDWkoO5+1dIhmwWhFwPldJ\nASvRuiuOf9/foLtAJZGhf6/Mtmr0SvEErLZ7XTQbBfcT0AAAieRyJcO/QzKn\nF93mgce81HSCOExf4C+D81QGNoaC5ezffe8Isr4ddrKDi9gKqyefq3XLBkbI\nUP79UygKCu2JRRb0X7xGpN8/RGpmRJtYrrtP+AF3wwb4CUxDL2HslPx/iWGy\nSTzFm8zxaQR81MY2NKpwEjx2ouW46Z/cTNqrM/fHpY9imGUbneYzmQXHrCO6\nJ5jyzNv7lLzdR/i3ryg0l3TPkcp5tJ8xVhy6CkzGUIRnzFCPuZ9cHlU1HVtH\njIF0EYsNv9aBJ9lbi/0xjk1R/Y0rhDX4Jdb9gXdQtZZ8GyLX1n1M6f3+w04J\nsPwp//pFz+zeEb8esef0DY35kL/SH/Xk/Xa2aW4fSG57A9PancVGimW9II6h\nhQVr\r\n=lIu8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cbf15ae350358a406b53eea1774105ab4b02709c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.937"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.937_1581383112963_0.27596906795385046","host":"s3://npm-registry-packages"}},"0.10.4":{"name":"piral-ssr-utils","version":"0.10.4","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.4","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ec6d9198ef73ffd89912236d28eee716f7edf152","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.4.tgz","fileCount":24,"integrity":"sha512-kc7FefSJkomU/SQChdQZTqUEcX+mq3MVn7EfdwexAL+q6+8jmLCt73Va8wp4MzcNuK016we4tYtFFgdQml9oEA==","signatures":[{"sig":"MEQCIB3RnpsNz+1GW1q3gFebdFP6gtb3g37y+mW9DQRkLcG9AiBhOYGaG/oZB/jdEmSVeKPxt5Z8kwc5DtSsU3Pb73DZWw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQzKmCRA9TVsSAnZWagAAl3IP/0VxaNjfKBkMA2xmaaet\n5W9C0Dd/Mlc+vg9S2VGtrWr/aDlDSmk/ziBheyaffhkFWDgjmQ0iT7D43L/4\na8i82/nhtX7l2S4/o6N95VxFSQTJIFZz3lUtrBY1cxzk3sPMJcd05RZRO+a8\nFm4rWn/TW4PZH+MTnRw5f+VdDGShfEW1sv8qkAsulroSecYRBdm2A9xLPYfd\nQB19iWNmIoCYfvl1x2lZ3WeAwCf/GybqrahYSQyh3cKPKMKpCY/By24Icehh\ntvQsKeuSDnHBc34/VN8bC8i4rFNf+1f/O3naLlcgg6s0t76U9+wzFjOrT21/\nWYDOf3CYF6SVYbHwuQ9WiibcAF86pJ1mJGV/hEduTar+brFufYzGP6pOVcOM\nPerv/MMwb535BH5rFqRt6ncxj1J0CVxMapuLAuJgD0/IUhhev6GFAmVkLGlP\nnS9FPziMqdtSKFvryLloZhz8X1sYNiHNiKUpD2R/FaV7HJLLFaFjloSVb0XO\nuJM7T2Ip5y+SYnwh6kVG31epft8mUpkz8DsYvevunDR/4ecW0x0hXnH5DALn\n/+Vsujd41OO9ssrUbW6VUumi3ULrNgztIXe+MrjBHJ0ZnHfQCAuEWjOoSR4F\nsvyOMfj3bVLoy/St1Mz4PrRXkvbsWLx2AwiMbim/4Tbr7dfxkf18VauTbvR2\nyHNu\r\n=fzwX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"e2454461b557445b87633c0cd3b655c0395f711a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.4"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.4_1581462181929_0.835792527701962","host":"s3://npm-registry-packages"}},"0.11.0-pre.942":{"name":"piral-ssr-utils","version":"0.11.0-pre.942","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.942","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"02e91f1c1c626fc597d5e5ef2996ba1fb4de91e3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.942.tgz","fileCount":24,"integrity":"sha512-8CgjCDObolbUqNfUT9EjWe6d+Ke9oVELNJDb6ApGMqYS4lJoZoXCXh13pAsPlDNAVy4mwtGLa0ie8ka1lfAe2A==","signatures":[{"sig":"MEUCIEGbo+qLRRwAGnXG83h/IWoqWMDAEQafV7KwzUVAzH41AiEApl8EzoMD+sD+s9AnVP6s95EmBmth7wQuHdY3Ek4gGqY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQztpCRA9TVsSAnZWagAAhJkP/0JIkzqBvf0M7zDmNJnH\nhmXyoVklj1bI2BsTCrVk4dm23TdxwcfFvYi8DC2LL/19NVDIlScRvi8c+sdM\nEzN/8Zus5spz4/+qXUbo9X+K83hqsDhUPSObfMB1V94HEyADYMFrbTM+gXlF\nEcvNyVI6/0zeoX57OXzi9goY21ZYCCxMWoGPFgqjlXcgi1uWkk9tEz47duvC\n2y29TNeULwe0VY0xZFuOb1qJJ5xo3Q67kWj0XpnsQG4VKNg46Zqr1rdvus27\nESmYvgJB7j4rdR5e2IGwVUKYyVsifBafg1Uwz1g5IS4P3FRPOTsYSD10qAT/\ndjyVbRTg74E9hrvOjoru1hQgPet856d4r4Dvr1A0R/CQZAv4v7Mt6lnodqFu\nUxyFpiHD+dFZa9f+uNLe9WexzvyAqZ6Ch3W3LUjOKqGgxjqHKWfPHwAJnQCm\npVSC1pdEKjZA8P06uzPscRkdqqLmpEVQhCwyP8EZByRblTTyNiiHUcDvUeQg\n0LnB+m3WuXf7sASJiOCi/c2apdVmnUH4sNRlSC56bhW8kO6WRoXLWd7V7JYa\nGOM3d0LDThwEam9drh33tZa+jG4c4+iRNkBniTPxMOtacXRh+eCBeyt7gSz9\nmnWzzEwTtN6rSIIxgC++8BEEIR21ZXGSK6Cdkmhd3WRzh7/P1cHShwGnCcYI\ntwhE\r\n=TSXH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d8b76fd7dbc640799c7498884dfbfac8d8209ba1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.942"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.942_1581464424743_0.06530531926599292","host":"s3://npm-registry-packages"}},"0.10.5":{"name":"piral-ssr-utils","version":"0.10.5","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.5","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ad357d26da2a3860d7a07df56f6f1594027cb13b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.5.tgz","fileCount":24,"integrity":"sha512-CZjy6qv+AfF30BSgkfslLqEjofAVtXrx5piQew2Z52hBg62rZJLlfp9xhEarLvAcVxDRtN5SntJeO55kiIPIdA==","signatures":[{"sig":"MEUCIQCbQZypqjJKI5ks2EBsDoYQUkQAKGaf1WnqKcO4+YYH9gIgJNz6NpGZzj42p+49AMaCBviw0vKdTYWXhHgEx6Tcm0o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeSDDcCRA9TVsSAnZWagAAZokP/2pv8JJstmHL9NJ9mnKr\nmIEYsoqQcWZIJ2FeRVCkiwUGAyVY6fYAvzMhOT5xJ3Ivfzxiy8+qZMJk8t9f\n+exfqlZURnRoR4gKXYzdzZz4PUAThqeIJdcw5sdQ1ymHUtz/17pG8GFf2Blc\nrIeV4Xvbpldvl7VorrDQsI9+9sER/+2G576j4UP2Tg9kj+RUbTaDk4StNaxf\n7ZfnEiZ2ugLLOMnbq6WZG9PD58+21oi7fZvTrG9yoEOPfO5J87ga4trXBmGT\nyEJkvxvc4pK3yv4zXb6N0R4JgmV6Ujr0iK4WCdZCy5tN//ZhNm7C5eo0fIFU\n2Hiy/V3UxEnuIXPA/GzqdAyQoR0ORTrVzqREit25dpPbptyhtwIUV/rNa9AB\nFpPN35R5HixAXv0AqncPJJe0TnFoPTBmN5ovHkzsP4EBqClYC6FmnkRq4bWW\nfaRYHXLMK+xSwmMHq4K/nAROMIQSRraJfEFI8elJb0aU2Zyl7ji2tJNZm82y\nOjg4aU5W4emI2ynM3dScSVtXhUoOSNyaQ5z57KDOm+vfFJtJEF842BZvhMqN\n1dVQSOt8r3TG8w2yMiErbjN0BglvJm3kSedd/HYd447tcfaI4B+0cI0ul3Yc\nNPb0GE6ropqjNxxWV/DWtUAA2Ly5FJicBCrCte/gw5en4CTSyPCDU5V70ebx\nU4JR\r\n=bEDc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"77dfb1862c444a44c3d052e7709013c687f72dbf","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.5"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.5_1581789404475_0.8647440773184951","host":"s3://npm-registry-packages"}},"0.11.0-pre.945":{"name":"piral-ssr-utils","version":"0.11.0-pre.945","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.945","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f3d478f4a06f966c6b20c4503c56ae90b6c63d16","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.945.tgz","fileCount":24,"integrity":"sha512-xnYZeO/bsqIXFTfyVRnX0QLffSbrEnOisxrJ/COlg98I3ueWHWQNaqTk8DJR6gGBil4gNnbMPcPgipAKb9ewNw==","signatures":[{"sig":"MEUCIQCg2A21b7+gemBkItPiqZ5ToWQ1bvb+6dBm5SUyk5r1mAIgMlBEPOEHHHWIpRieDLWd9wrwgQumpat6liOHw8B6Yfc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeSGiaCRA9TVsSAnZWagAAKaIP/Rx5SYYR6VP0JA/F0g2o\n8nIaCQGSxn++BydRyF14kJv2v/imIX/am/K518y3yz5i3IeyWUnXN5wozSUf\nu1idnjn77ZIO+qcKFiNXLn0SLYP5Fzimjl2zJFd2t65ecejj8tU1jQYlg/Sm\nHCa9NFKYWOR+HO23i+oErt7spyYhWsDh7oIcimbBkDDVOzvTPpGTnHXRjAm1\nUL7v7rrgGAfmI0Wms3P4kfm1w07AUs8Xm3SRdX1BOzIgm1JCPIVbbTeXaFcH\nmu1qd+lZeyRklH/7jeOCdic6pNS9Waty1lkOzDKrW04Url7WJzBCN4sqPWAJ\nTmJZeST35fu3357OrBI6cMgNCDyDrVhYWolMLx4qMvX7Elt441Cu3RTAvK1n\nwD+MWcShwOD8COCTGu7qr3nns3pKZz2H+dlhEWW/AYvG3HlzQ0WiSeBjdJDn\nLJr8M6PFK9iDSMn4jlo9pUCIOEcfvboyH0/WDzY/DnBzReFEWGPVUjLBjYc5\nAEcGijsYCBzs2PGx2jFENVoEJQPO5aMwnCqyAZWJkT29RvTCn6+5nGjpXNis\nONew5CcZJoqsCUKg7NJFHO56dnSqxhDxVwt6IBxhb6yxXxdDP/4lAlvmXBvf\nOITDEtAvKzJ6uvl4183RzukWo2dcV8AOlGucFHyRULFuMdFdloB2gA2VfwPV\nmcqf\r\n=fQVd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ca915d3b6a6136e8060b764162193ed9a94810a2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.945"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.945_1581803673534_0.05258778385201546","host":"s3://npm-registry-packages"}},"0.11.0-pre.946":{"name":"piral-ssr-utils","version":"0.11.0-pre.946","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.946","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8d82741a2781e59c72da6eb41ba56222f130a5ea","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.946.tgz","fileCount":24,"integrity":"sha512-bLEgP1Pky1V9EoKRPZJfS/Ia4GeYdsJy4T+PA4URKh+XLh9EpkwkSKhREUdLCzIM6ajkDIgMP4Ka7mOeb//SkA==","signatures":[{"sig":"MEUCIQCvpV27QuNpcAe5DidDoRBGS7lSmbRFRABXWUQLCtyCygIgckTh7IdGuGw9TQJpsBgvQj4F23puvutOhUqjb5ISlLg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTFz4CRA9TVsSAnZWagAAi9QP/1duSWejhINt9wz0ZNTQ\n1ylRscoLe6Slw8cUf3oo+Le0qKuj7qNLJ76GftEBI22K7C22kmcDTDxc5rgZ\nPdGgSMaWm5Hvzk9ZvrYN8M5d5xIcHv6sHRrvSEGEGWuI+MpVJijKwymaKFMT\nuVT8vdayLYL2UqKZ7ykSmfUodjG6vztY0r2wUzmPk+gcJs7+gIpaLLKvOKYz\nYR6ibPOv9ynK3G4e1ZMj5VwD4KuvDMy4EBAtnzCJ5U+XWm8eBlZR+UID0Gvf\n4y//ep0kpnuXI4FIw5dtGs/IKpA5M08OpkIekduckAtilBe35mnXstpvsvPg\nYN8kqbchK1QvG2bOk7zP7+eULMv98Bit1dB20TtvR+NBGw6t4samcYmOW6eK\n2JdwsTL2rux9YQToboa1/bQ5SRCt72YE3fCLS9AVyMiZFRsBFWD/u+ExNpGG\n0SnaGnvL4m5I9kc8ReeIXw/WY9OxIw9yXQ5Qvq6GN2y6qgnTVNU4z5uQYG0n\ntUtrOSatA5Jv6GMiXN7LLaAVgT47PYb1AUUiS5UTesrUoBhw087uSyeFOS8i\nlp6MNNbKcz2kagHEum8q5iIobTicq/LH1nUHKrypdVVZDqzwuHMAXvqncVLY\nB5arw6Tm2n645Yj2+YS46rxePSrQPbatQaLxCqAkYpoLS/GYQKahZkIum2Yo\nRa3V\r\n=lEXF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"57ef718ad4bd78b8be6370d61b9096bdbeed054a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.946"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.946_1582062840565_0.3833426891038896","host":"s3://npm-registry-packages"}},"0.10.6":{"name":"piral-ssr-utils","version":"0.10.6","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.6","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"191c55506d44471c64f703b38fa3c71d49656ac4","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.6.tgz","fileCount":24,"integrity":"sha512-9kOe/7UVdXFo2lsVoxAOTKwp1PP21DmGB7HkEaf18UfZuWiEaYu//MSdU53nPe1htJ0TAcB+oD98FkJZeQy4qQ==","signatures":[{"sig":"MEQCIELYSdg/HTh2/Pj1cyD+YemOvj2k2vlZ2e8Yr4vdZnPwAiAQFZA9u9lZjbcqbn+0WlflfUiiugDpih50TAp0CB+OVA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTwAACRA9TVsSAnZWagAAGkEP/1w3RPeCqYUMgrawAZAf\nadskVOl1wOP4UiIetqT7pJgn1z6qLLtp0oSiuNhGswI8z4b/lts743wLhJpN\nbGSYf4bglYPD03Hby1Jeu/nR4FgFMXjhexMjSR7vY7QpUp2+D6SZbuVvwAtU\nS8KRlyjhoua2grrNIhxNRMEeql8DNmj074eTmtiKwffEs2XYwzHb20Cc6XgF\nzkOXqc2gEluhsXTXylzBeg8hQfifL7G+oEpyYPuIzfzPenWriEcgZQbCcjEA\njLNJwrxxPtLHtmS55qFCWh0fOfUmYty7sadeU8WOgARAxvuU0zDiz4UbdlN5\nFpV8zlov2FExFKU8qNCC9b4RGshjMQki/1Fz9W+SAyf/+txqJG73FCKai9Ie\nGfxKeG4E8J2yQWi6ut7wFEg0wU6WWCziS3M55PqjJ1bdtn0igJZVsX+7S5cf\nPfeCRLSJSgeiDrIvT5rKgY/mtLaUZG46pb84WnIQFFSNENQBtK0JUaX1xllM\ny9bU7prujUbzDBLeNk3AZ52VQXAHBGWZiAxDbrY3LYD6Li2yfTxRwRT+4LZQ\n+yh/rIn/lO+cfsrMI81Q5OhraHOTDqmbPbbSoIW1ZWx+M7mHHZZSz7Ax1XvQ\nM9Dl/5zxo71AFdiCEfj7577mNMZ0gfG2nb9COlIQ30ibjVhksrcH9v8lUuQX\nqK60\r\n=N5EF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"183d8436966f4c8bb96897e465c8d2372e1be7da","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.6"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.6_1582235647971_0.7270969346905958","host":"s3://npm-registry-packages"}},"0.11.0-pre.956":{"name":"piral-ssr-utils","version":"0.11.0-pre.956","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.956","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a8620a3734e717c24260cbac99d3c4c76d29e63e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.956.tgz","fileCount":24,"integrity":"sha512-gMXYGlfnUX5BzDZtjNZ4HBHylPjBYRxCmRk+vAXNva/le3NbYdjOUvTkyjDTlBi6E1PXYzmRs6e6e3bQLpYbxA==","signatures":[{"sig":"MEYCIQDSfCnNGnHJ1rpB6Q+5TD3T0jEg6l8Kv0WJgxSza1bDHQIhAIGOQ/BUwhYzSl8b/w/ljkjWBFsK2B9KSopOSfjHzdZi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTwfsCRA9TVsSAnZWagAAI4MP/RhSUcjCI9NWAzHQcrQ4\nNPmhcRMucYV5vSHW56+ZRrnCjf02JIpJhWzo6wDt+bCzn6AZTr7qtI8Q3yTB\n6qDihsYuUL+Q7T7B5TiCRJEA0/Je6251JuuL+zNzHQBrzquEz8Mk+yJJGfMC\nBuS8DzgwNEwG9oHbo1vBRLyJetskGzCAfr+l2cfF+uVjhJf3ZfOvWG1blQ0T\nnpEVAK28CFLs4z1UbkoOSrfruZ8Nqu35Sd2QnVXQ9R6qdVr6Q60zyQZ1/lRp\nsj3EB111ckIGMWCSIlFZNc89uE7l1Skpj+OT8X21N1PoapwCNJhSk3oD8wCg\n81s94xU4huxIWqAq3PV/AdZ/GmCFEA7gx82hP+lUUoHowCozNmtMSVb1yRb5\nRMo8wrTPGr5rc2Y1drS+m3xVB7NJT9GYo10S8qz11U1SGBdLpuwiZuIdjkjK\nw2vEhkX2Bv/v8aly9Pd3PnkdKjPXmSVqJ26YzRRKMVX5nEbchWP9K4c0HqF+\noiEkNjRlQvxsqstWKd924OmjDXqcZocjPK4slwQEKJemX5SFQFlDWzvey0Ja\nS49qXp10UnIru5m0D+R0rOiyclhxuiqq/bPKSYiVbyOb26IHG+9YHCROZv9M\ntgU9tQ2mtY2xvFkKyuMT38ZEcyfvDemm8N1o8FIf2H4mkEFVkzYuKpc2Ts3h\niDv6\r\n=DMiC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"374a47fbfc650b2c9a739623445c4c942aa5f0db","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.956"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.956_1582237675463_0.5836166532020981","host":"s3://npm-registry-packages"}},"0.10.7":{"name":"piral-ssr-utils","version":"0.10.7","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.7","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d0f26fbea0f9277c0607f8aaa5a945beb9469437","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.7.tgz","fileCount":24,"integrity":"sha512-4V4Z07WsGDBakLgHD186+v/4zhsPxz6qD3PBNfdbUsiyUVPAI1lYh+F8EP1eDfcs9MixiTXxMUikRZm59qp4PA==","signatures":[{"sig":"MEUCIERtOAgF7jevLlv9FQrBRuL6oSsIP3z/4PS4G6lzfZRuAiEA342ISt6rdfHevKQarn0tlUkJ3Tu25n3Vmq1Md8cFRPE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeT5tmCRA9TVsSAnZWagAAX8wP/0pUNkdt39jJc9Fsk4Ch\ngfZGLyCtKqaUqD8VktsDSOGaRjZNufjwHvGHtOPhGmJ8Mbe9dbeTJC49dCnU\n81zh+qbohdCXVXv3QecsGjUf+aRy8iwFMboBoK0JhGKq4DDkTmeWPGIVMmMC\nCILfWcv0K7I0HbeePypitODOWu++daj2eW2vLn0F6SRdyEruy/cKaTdsTEts\nk42A9U24SszBxF/VFf3jlD+WX/RziXG9lD1+WXtjHloFFW68JQN3JriQkSCP\nmdGjUQ2XHIVmcTTTMKGdAJVwm3AH0ng6eBinFVuH4iNXq/Oy9yB3ftS1j+1+\n0GgA3Wi4JNi4rz0Xc7L3v8Ltc4pfbhLWiU4UxyfzXmMfwHj+K3yBDuusYrkC\nlZidMsVKzhkgrmctVzPHx578gFhnAITdEM6qYn84X7SjeWulS3wkGrmzA3Fc\nlY2cGkvpvT22iL2fbIuCj9fTi3PtWxjXbRHRdMKzQYvZYWpTvsbJOD+n1T1A\nJUsEgG2qpy/4EXmNv+FE1y3NE65NaxVyuj/A77Y73sUXBu+BSgoMuTmcOZSL\nbbmKEbNb84EJgzZBdEApZlbiVONi979VtesVxV7Glfpx/Y8CCiK5m0lyJpdv\nUB0+x8n48N3kfbO++GvYE8qS+NPoHUH00uyVJnCUct05QBNiZD6KRP5m2SeP\nNyyV\r\n=rYeD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"5032f42229ec16cdee45d4eba49b4714fdc970b4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.7"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.7_1582275430373_0.9343487675101574","host":"s3://npm-registry-packages"}},"0.11.0-pre.960":{"name":"piral-ssr-utils","version":"0.11.0-pre.960","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.960","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b98caf23c3de52809b70af2637ed2dbead2481cf","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.960.tgz","fileCount":24,"integrity":"sha512-wZ4oLifuu0wyxJIhgAEPMpIPGYfRTWiS4d+7hSnYf16tur466cI76vsyBu/m50KTk+/mrkIbr8DH7VXgw3fUMQ==","signatures":[{"sig":"MEYCIQCNn0jKtv7MUjOvvslPjArh+w5CsIgh3irylz2dBkg1IAIhAI26dH59Ej6MXK14k2133kHCgcFDbslkxEhz2jGX0+R9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeT9LyCRA9TVsSAnZWagAAWtgP/A4Dh7PxCNNWliM4L8oF\nffYE3ix1SqUFacE8piwYjFiAicES+K/8SJYoOey2ypdjNPUlAbfHgXXc8qYZ\ns5DWorIkS4QqAmgFDIrgoVAJLIBzqRDVTYs46lRKR9vsL3lauJmSopMN5IQW\nj6PwsaUhlcrKFDTxuGQr8A/aA+o1iUnLjc6l4RzHQHEI/LZvYOg94uywgDWK\noidoPCF04YcURXvUVvQFh7sUduR2ysdpoqvAD5BhSW9p/n6IGteTskgiqKFb\noA9CMSMTArHv3l/3lB+XAWZ/BM37n3gUtHAZbnXfHojkEu71Daqe4buVRe8R\nw3wDEeNrpTjlxCu+ipd86VmJh7J4vm8LWY/wog0LXqJGfV654zc3+TSEcf7Z\nmOFsb+WWRWE7NPnbQTToqD/iCqufredYwEN0gj6/UpWbDhcG74a6Ul2/8gkt\nQzi/7q9OouMZDYn1POPWkIxobcFaLP8BI0fcg7odAYVSNi0x5xzLJ6TDULyg\nCCC8BnsIS30xEKw6+TGCDiL54Euoh74saGXUaRcnQ8LZ6irEPzKjZ/wQp0in\nnuyZJZh9sUxxMhmVxfCVQAlvadbbuIIoi2XgIphoa2H9FjR/oflJagqgFnnb\nAELrzoGPaFDQI6+qQlyCG69gXUo8I8jDgsVB3fIpCiLfqQbIVMZXoZKg4BmW\nhu6i\r\n=Qkf/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ae95c261b5c880bf19529c1361a3cec529f8008d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.960"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.960_1582289649841_0.6571227172394702","host":"s3://npm-registry-packages"}},"0.11.0-pre.963":{"name":"piral-ssr-utils","version":"0.11.0-pre.963","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.963","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e76c6921405c4fc336d990eff2b0f7310c2926cf","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.963.tgz","fileCount":24,"integrity":"sha512-PGmQjNkV32MlF8qQSXPyWhra+VNAqC+mvqkDpNIdixSi5/S6xw/ll+OfytS8vfxUY0AlIgv6yJPY7STfP4wXcQ==","signatures":[{"sig":"MEYCIQC5W9T1IQcWhMj9eEqq4IAsTZHYd/yBbhCUsGbfhU6txgIhAOXviRcpOiNzX4vfTcXpDBRzqTrQwBqwuflDG8aWj6T+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25892,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeUkd1CRA9TVsSAnZWagAAsjIP/2Qn45sq7v21v+xcMm0X\n/LzbemQXJwvEEePwDw2FgNOPs4JEA+IpfYoZvAbS3YQ3xj0GUfdckzI82iH6\nhLOOiCsmrZcqnyzR4Hw/+QMy8nRa1fhloxsqSkYJxEKHesnzwmQGdzeC9CGv\nos958nswNr8MCb5kXEQhJr2leBrhCIueJuxnTkNaQa+DM8cUu5ezwRVn9lB5\nhUZzFpQdl8jGlBaoD2SoQjYY2di17DgFxDDFKr3NjDcrdesBj0LUEkf4u5eE\nPD9K1lIwNTL/7gw3ZTzTtYCUd58IDX4Jbfgv/gTNMldCQX6+V/ZCfB2kBGTb\niw/o92OPuZq66rXdAKijdQY+9Eypx3Ty90c9FY9TlpeHJukv1wpSTuEGYaky\npawFwnxzBwkkXZF9jeQImbDqcL+S9cITFcOyqtFlBzedKULUlFVTWUg5O1aO\nmWJmsjqnz6B810JLroWj1dDxVPeWVi2Su8392OsTjVCfrSWajsdVvMJghDbV\n4hYbw3c06NhJXiJnPe8Sglsqa7K1I6hDMfMwPlkrL0FpAIFavIVHeraykMSc\nMVvqBeRUitCBjwIw4ojMXQvPDiNDyS5D2tQp57Sy+6p+GdJEQmQ8emOEZ0pW\n/tr4VK4nkXdmNAGHEFKyWo8scpSHjtYmmP3P5KXQJ141HVz1WyDdgIYCfnmn\nbEUW\r\n=KyGQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e234ba6d0a33bfea0d1d003ea3c4efc5debc5f34","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.963"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.963_1582450549553_0.3665660573716909","host":"s3://npm-registry-packages"}},"0.10.8":{"name":"piral-ssr-utils","version":"0.10.8","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.8","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"464744535d55b1c630dea4a32e00b553db79ed92","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.8.tgz","fileCount":24,"integrity":"sha512-SrQdKG97kmQSmoxaMMfUM2S0XLQHGme6Eso760tbKJtJgm4v+ekMVhdFwpWjuZfxDz5APWsgEsrF1KuRg57njg==","signatures":[{"sig":"MEQCIFcNvh9t/mht7/9i3IX5/Wrj+kPJhweNwIhQIaQ4py3bAiA9m2/9pi0rANp4bF95EImqhss71PILgPCt/mXlC/puew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeVUNcCRA9TVsSAnZWagAAbDAP/3C9A9LoZgzh+bhXjKo3\nIoqq4Ao/zN+9lnCcP9OP5GWHLiS++ryojONoiQFTMfLMU76ERI9kh5eNT0u3\niGhFtWCV5xuBz6yvwNNGjAd0WVMoqhbDu1GcAo6iYig78yrSMqOsPNN02f+v\n9X2QUDMevHsaOlxwX+lVW+w9GvZ7Wwn0ru3nGYIW9njhMW4LqgbrOSuw1pJx\nAFgWTvsmGgwpYmyZt1jm8mVn3QMyhs2/bsv74VRt25m558p2I971KyohYr+T\niUe8+KF9/bUQAY/Ofh2pePMmJLpdtFrYIgsnhpc9eq0L+iJdsIkb575OAc60\nBvZOz3MziAs0rJPQfN2QbsboAiS6s//PmY4PphgfuvPsq0mxN+1kvFcKgIJu\naAZ+dEwcJkamYBFfetbeKSjEbhjPlzeLa8pfiaU0azh61EZvF5l3sz1r82eE\nLrwsL4g77YPaU1oh21er0YlkixJxtbqOfwD6Fa03dXYZ4lh7t3OGanKhjCGO\nwfmianZVMSWjcxRpG5g1LoTM93Q4aLTMG2TxpS54iyL166vFkeEg+g3hm46/\nWi1S/xvbvGAFh8NF3IQMoW74UHNrxxIEzaHL6AApA2T0WaM2/hJxPlk7zDdC\nJtiM6TpyrurRDKZ9ESTyj6nImV4TLt+7EgFwDN8roPmNdLQaWLkQUvpLnqba\nA76U\r\n=DQt1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"eb6ac0ed3ecffa9e3574107cb8434961301dd69f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.8"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.8_1582646107902_0.2777841356618378","host":"s3://npm-registry-packages"}},"0.11.0-pre.970":{"name":"piral-ssr-utils","version":"0.11.0-pre.970","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.970","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8f4b9c9b1bfff247598e4fedd0be379c8626cde6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.970.tgz","fileCount":24,"integrity":"sha512-G/9lVgFURvBfgYP7QxkRS+6wMb/3hrpzzFv/d/+wro22smZnLaORUYnqTb8jvcHhbTpyrf/ddMZcq0BzcNZlhQ==","signatures":[{"sig":"MEUCIQCOnp++pxXBNGAZahEK8uDMWhT57Bd0JYTs6AK78WSaNwIgcRtGcjZ8xYOB7ijDuaqx+PVAQTzxwY1yyqASdw2djLg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25892,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeVUt8CRA9TVsSAnZWagAAjk8QAIwJxZp5l5Tu9zhR4RHb\nV4pOQSiX2ylB38HKW4/mLgpmLkevZl2ZWKDekCp74F3hTWMVJpCkihsSlz/C\nLAZwRigplMeNY6/6mSRJRP5fyNzlknaiLhzq21uNhUlpe09feomjQrAd5t7T\ne/A9vH8lU9IbIm6N3pPpzKyQMCUCRr5dXRYi4DkNWjSSmGSNEZjBBTVyIaeO\n9Rb/OxU2LF1ToczWMyrhl0NQ5xVsnjMiYcRbiWwtRQs1EmliyzsjHs1MeYQY\nwNVI6FMYRCacE6fDSq50Yu0BOs2f3aO27B9qRV/KrKv4PbdKwi3K+Ozi991T\nK55aV3bmXZkP0eX1LxBiO6tuc1BfZltypjcK6NDgtH9koIt1cZtqYXYwV80s\nhcF46Z3CiuAjw54sRxCr92Kx0ivqOi3AM/myZSbeN/GEBlyt70hVdCEN452J\nTv8fGrRlSDmkMvt90bTikm6Zj5SW7n6CqA+kqTwna67JiO7gZ6he+JWN/I5j\nQJRwZEyFIBSJhIw+EHVNsRYBRQB4ytShq6kgV+Zuh/eIuTZbNvFiAARNE0Ys\nn3eCrA60BrQeoDhWT8zjN2HSwHvJ3pWlWcIWXfusAclmoLSKttf1ngP0tqGs\n7U9hrPIrOGgjboRZA6szNubWK8SrXIqF/4mQklcAEy5ykzsSJYtNF7/m0ksa\nPWGc\r\n=L667\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b64bb8c772c15d6b81f35e9775111f519107935e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.970"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.970_1582648187931_0.6642896897202941","host":"s3://npm-registry-packages"}},"0.10.9":{"name":"piral-ssr-utils","version":"0.10.9","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.10.9","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fc65adb21812a94f97775efa4c358356eea9a1d3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.10.9.tgz","fileCount":24,"integrity":"sha512-c5u56/i/S/faUfPilFrX8FFcZ85WNnjPlce9anRA4DKQ9+eQ9oSrHxTMaoebMM9MrtVn5/GJQ8vCfJsHROl1jA==","signatures":[{"sig":"MEUCIQD5wn3tAwyJinulo92X+egK+OwqpjJ6AZthYCpAVXYncAIgHf5Ns3AZXXXo34h2CUwpb0aCf/o95vR6p9BMkTNHlKE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWPrnCRA9TVsSAnZWagAAbdUP/iPMVSzoLqcf0+mBe2zS\nHxKSuRwktw4uZNlytp4qQ15t71hT1h1ecTCwzmxQEex6Zrb81tdbPN6rMFdN\nBSu8dimv22zqAKvWxcFSzGNew+3YDRMXWYOrYO+K45r9NkXBRoZLkOGlkAxd\neUfmL69g8XcP/z8sxRq0nsugJIvSB6t+5netNjiXHXKpoBtjC+FlWQ0fmVz2\nSAUHugVZCMc4zOElPPAPWBcN2bi+SLK66dawIBDOvWjvIUiOfwjG7jYyacOO\nkBrgx4cZJ2q8LWgZQp70gy5jX1xEaM3dNtreyujBrfFsIGAKqPoFv2jq2UEa\nBAkYkiJhhN7fTlWFBOfsdambUm04fH1PfOFmaqlCPAJioQ72bUYxHWL1BQRg\nRwjTHgcXuE37eXUmcDXwfx6Es12GDvAUnLxpiKt2Pim4IlwcBnZ5mt0NNU/Q\ndgRI28kUGschMel8zD3tpUW7Aif72DLmgwvFCKyKf6Q+M0guTocaj8NbwVsh\nOEbagUhTYnDznwA0H/2fqVhkFChToaDaqj5bMiEMG1ewI0595RaKDVpfnjq/\ndk4kVw6kYgUAt5LfeTF5nyPj/JWQSl4u3klEHoTfv3M8FtkOEYXlsVAzYR7k\nqUF5WOJzkAQS7BLKYC3jvBpX68LT1N3/cRG9eBpGRX8CHuZwSs5I39zqzxsS\ne3N/\r\n=biwZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"0d7356ee8e244ddfcbdc12109856e2fef963cd41","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.9"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.10.9_1582889702634_0.04870678854704291","host":"s3://npm-registry-packages"}},"0.11.0-pre.973":{"name":"piral-ssr-utils","version":"0.11.0-pre.973","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.973","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7167542b6ca4dee87ae57c6868aabd108d3b8580","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.973.tgz","fileCount":24,"integrity":"sha512-ZxmfZs4dM3quMzUiKXgJKX2lnSxBi51O9cWxVxpyHAR/rDPng+uk9L6Krz8Mt1gk5rX9EWdAMPGIrmtffNttnQ==","signatures":[{"sig":"MEYCIQCVbKdYTaFCPPLiLshdCHtf9H31S9oykqoE97/x5okeeQIhAKY2zYs2lVJWzMUKzru5AXV4lUezrT8XIL90p8LDXFMC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25892,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWTngCRA9TVsSAnZWagAAxzkP/jxWpJzpazgPn1WOTJWb\n7eLjLv4m0M6fVZUw8TiwE/klgmK0lePyf4EF2Ja2nRTJ1xkxsLnFgunfyrmr\ngiLHV6PWLcV3m5BY+plXq/ipny9Qpk54ek/P3cSjGeHSw4Kv7Y44w2j3fVMk\nZUvr7AvSnRX74KvLyaJKQ6kvSHZNcgQJiLuD5bomgc0ItWB87RCipXUVxZEY\nDyzPne9DjN8YuA+VUiaOXEbtzhnghcVGVub3hO2on2QQzs1BxXpx/9FAPkXK\nSSsAFy/QOmeMhtXeqHyOcZiPcJtWAFONIHG6qOsinmCVyJ4T/lAAw/bjRYlc\n52iHbltYPw4oGOxlfl7UddeO3Cjf4ZjzEvIuRU7wUsk7tK6bUMaRYeRqqR5V\nnVlZKeZYlvcoLzsMxLGMy71tLb5aGtcc9fHCjgklAV9ETtoPM1uvJ9rRHVES\nuybNrrWyyPOe16WMdlZZITH6Z34Oa/wcKnqGn8/B3idLWf0yhsw19tOG9bi1\n84UHQjtrnO7o+iOqj8iM7e18dLE1edrDtMAfZsS0vUBst08eZnfgH0d1X0DM\n71Jq1oEMvSwySzZuAoQjMNsh/L+cg3ad59RVMgRsjEUrNlg43mo3rBBizXqs\n0RUnFxdNs4y5pR9W+9oMoIkMVhix9uSCCRegD0c6DDbTzEd1w5Ibji1CjbAS\n0zS0\r\n=Yta3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f7b8a4f8ba7b8e1fef5bd6361dc7744e18fbb30d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.973"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.973_1582905823806_0.6535549975745216","host":"s3://npm-registry-packages"}},"0.11.0-pre.974":{"name":"piral-ssr-utils","version":"0.11.0-pre.974","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.974","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"27ac1767b6241cc06ebef1077dea96393da154a2","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.974.tgz","fileCount":24,"integrity":"sha512-b8hln5CFYDLh+oLq+wsdR1MST/XhulfiJfmiPTcQcc1pOdubvTCoM9C9LwYHO9I7cfMLwhIPQI4GzrcWTV+Vmw==","signatures":[{"sig":"MEUCIQCCWe1XiPf8QTYNl4DFaCMeE+CoUAUUJ62es3j0goCaUAIgf3pu7yTyPlzkna2z1MlwfQzGZra/MiSkOZKf0sVUaa8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25892,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXgO2CRA9TVsSAnZWagAA4MAQAKKWSJB7ZdOt+ljnxSvr\nF+YkSOY5umGtxkhU6P9YR8RU77Dxbiq+rp6Nlv+9Hk+WTpHakj4a4fxQJMH1\n4yOAq0hEgicagY/tpHrng+KC3gUmk6wiF9WVC8YfzraaeEntnHDITSoKe823\nRMPyhXKOUfyz2+xdgDbXbUq3nuShPJ5D3RCn65xTTGY/BCcwIi1N+d9x60y2\nrSe/lTh/CTW4Or2ImIZTeu8nnHuhcnIPjAuGOPm0pVV95FYgvq3SUPRvYPXW\n2DOGPMh+azOac9gGpcv3NkIGWlXxFebiZ3oQNakXo5+Jdv/xH1EqmcKcG2YV\n+5QQe6tcIougSfTcJs/3CJ3DlwLh1wF72fv9OA2QWFOxX6/W7f/9DtJFHyp3\nDJxkykypZv2WMOz47qhckBF/tfNqlvYYDpkehzQDUHXvmnfBPBtFqlG+KHBa\n5mEq7JoNlL2AGCHyBieckmH19PbtrxI93QTn9b/xJJh5SDknq7AefARfUSVm\nIjxxWrKA7bNZkqjNMu29Rm6VAvsrlUUXuQLFgj4Wtqca708QoAR+s5gGDneH\nTpNDXGmirKiFtN/YtLeb/wb9X0Zuxki4Sxz9Rm7Q+8pbIt5DywuBoW0JRzIh\nkrqGKWtsMsdRoi405JVYqWSE7Ob9gbS9ilBkkS2DBgkRWZB/T5zsiTcCMScc\nMcIa\r\n=bETb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a5a59058e1fb5962970e40d1ab923bf69821de33","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.974"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.974_1583219638173_0.941142335433558","host":"s3://npm-registry-packages"}},"0.11.0-pre.975":{"name":"piral-ssr-utils","version":"0.11.0-pre.975","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.975","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c6e7ec841706a4241c4d4b8f54e73e5e4a401b8f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.975.tgz","fileCount":24,"integrity":"sha512-/cWlr6L6UbXK4Miv36Zm6s9QlIHsQA7BaoSLslYgYPRHsal02Iqx/B/ZvZeJE3/WloxSApaFoUAdQHyAllHX+A==","signatures":[{"sig":"MEQCID4o8JItERk/58b5p4sAHSQ0aN8rAmx1lj8NMeTwPNM3AiBCrWvc8F13UrSoejku4HrZmqxv5cOIUmiWqQtL7KakEg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25892,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXvAWCRA9TVsSAnZWagAACBAP/39hfoTr0zsk/H/hCb1g\ncfHO/mMHXZUogk3WSkUpj0HjrtTWwJPncGpNbCiQRJz6HRyF6QNdcRuTov3F\nlXQOmaKu0Il+IFoNtqnSjlQeguuLfMsJAH5Ao51/c1j2cjvBbPoYayI3+xvH\nP+d/rpFcxQdJn75ldRxTQ+Y5M6d2vhMkYUTbu35UaV+suHC1bOShyMe1L2Os\nT1LhK8z4gmrVroOcqWbGXotR69f9mRuwdQe82WXsdCugnf+RXHOQ21fjLNI5\nOgSIfwOOhQDc1jWIU03udIGv+R+mC7oxCE3T1KN3mW7mmv9YA4eBUnJQvbON\nT0UCQj4mb/z8ghwN2Mwh1pQ/UXq9pAFW7CgpIFknJayod0jhG/246kLU2Y6T\nf+lAQdZAmfiz9F/8JB0ZD3KH+mdgaOhZ0AsRgL14uNwqB7PhHyJwC0ZH/J12\nXluLc24H/UVz5GBpoHiE3Kd2twpxcAeJWrDdnEOcLlz90Vx+9LwL6rIkhjY7\ngnjxZ3rdRCLtH925lEuT4l7ClwcuMtI8MbA0lOCSHAe+dNYMxZe2W0XHzrwf\n/PtoDZF0F7UknuvvcAW6pYbWo4r+IJ2eP2iI3sIq4N5RZUkN2ZTIauU7SXbe\nYW6PtlYGrPHo0sLp5QrLS2f3rf7Df2hZMqijU4rECcUZ95njOQaQa/rIzckQ\nTg1d\r\n=BdqI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"117ad62fa9b3c0ef32a4e828cb686e91963b533b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.975"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.975_1583280150184_0.6074908245715884","host":"s3://npm-registry-packages"}},"0.11.0-pre.979":{"name":"piral-ssr-utils","version":"0.11.0-pre.979","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.979","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4cc3354ed525c42bcae8bd85d1b9daf98a690363","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.979.tgz","fileCount":24,"integrity":"sha512-EtvVedWiDgHtEesw98OSgetFW/VVRQXPYxI0GReT54O0lpGWqV7Brl2oFYtIaeax7pGnV2QZcF8sTZBwIEX6Gw==","signatures":[{"sig":"MEYCIQC/JYbnG9rcmE8E7mN+Cq/JhYj89iv7RqV4i44+NwH3WQIhAOYDioa4nw3s/SOgXO/UdEESn4QxNZtWHEpmASQGf6SH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYYOGCRA9TVsSAnZWagAAS8QP/RK91SRThA8xsAGs5sqf\nPnLO7oD0JeTwxei6ZUQKBJ5Y+r6wQVIwQM6NfgFj8jq7ba5gXtHPP+QbeNOa\nYWBmyn4ACr04o25gEOQELHYGumeGZ0/9ve3CYZ/PqtateHDOEjufCLNMk39O\nOVl88SHPaNXZ98b5B1h2b6C1I6oL1J807rccaPdkv4MgwDRkWWDds96oQBIv\n54zklTjSY2FCOpgpy+arLINw8PZw0JBHantZhCuqQBkbbkAXXJMi4cC0y+Op\nKxxvGW4bB1Vm7EjJmtSs2Gi1mgggtdURis/VCK0hz2B6lvMLWGLYTjoarVi5\n35GfHOkrDXGOra1j90aUbYU12JNuu/Ag/7LDsvg0CdMeVKFYTfGtzTrVK4jM\nQZaqFusI8eO2zbJ2VzqciGS96Sfg6l2THow9MX15C+ISzvmUfj7OPTcH20rB\nETjgx7h9uQEOCYCbskQgDPjLjRlBoDqSkT65fSrFBlXaog24N7wrAztRWkWX\nNapE4yMkQywrxAGHb5uWXYhbVm/3cgJmR0lzJ0brJBYblBEja1DsxwVnrDi8\nlFLiFNJHY6Nau4wFH3d4uFWeLsgwvDyreJiTNAe9sOsNM+fuwX0c21mm0SfA\nj9Lhv/Vg2G66ynditq71Mx+pysvqfSuI70S7zFv8USS3wGitJm2OGsTicw0B\nwut/\r\n=cT5P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"af040b498962a92072851cb10a7d3454d7a09c9c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.979"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.979_1583448966204_0.7806489646623345","host":"s3://npm-registry-packages"}},"0.11.0-pre.985":{"name":"piral-ssr-utils","version":"0.11.0-pre.985","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.985","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0a2c15204dac78e4a1b800243abaf5f6dab9d714","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.985.tgz","fileCount":24,"integrity":"sha512-XWDR/9pkBRsu/QOxrHEfs4hJ/qbLk+ejwVvNbwYPigN3W8psSN04DJMXphLZu1/saOLQsjepOo0ie+DsrY9Dgw==","signatures":[{"sig":"MEUCIGR9Oak2ihbOmWNphdWd3QjzumSy83Ql/g6C5qiJ4OlKAiEAlxJ6p+jDxQ12995Z3SafP8JUA6cxuXA3Hw8Rarcw4gI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZkMPCRA9TVsSAnZWagAAdvAP/3Ir3vTQiOJ9hW+9hwJQ\nOkweS6QKgzi/FBU5Eenh/S+hy2LmhJbpF6/2bxuYqGUlwLzpnkXtO4SmgMVh\nzgLxQ9xpa/ObHDQe03Lu24kaIhQ3GZDKLMSKypJqrXPmxm6yoVFe/ifUpDqp\nCn9ON8kZgbA+RuR8GgcUx3sehEEtZ550TZXZA5/vrIoAsX04yzrGCGbru2Js\nYaiQWbx8IIrGmsntocTTCccxJ3S//oZOj0iJXu+lDzDKaMcT+gaXJclfVx77\n7ppLsf9ZUsjgeMWNDLUdLpvqjqQQxdi/dvPe7A2cFmUhMm6L9lT26YtbVy+O\nXV551U9xi86Vtk/4J0zaiLjQxITDKsfjm4w6FZI1sszAv36AKBND6HKIjh9b\nYNhOVyYUZ1FKb7GUj67M81AzPj9aEHBmWdrKJhza+FUWv5/O45moSBQELjWY\ndDhz6CbWHASLTl+UYn3mvODSf9ytbKHkNlrlPWwETx8Uj6FL4e4kVnoF8l1B\nV+QMLg8V8HphtrVZ00KjRMNW/hGWIjba03DZoRtNyjxHGr3MZdPUDy+JtdKq\nICTuQWhEqIxi0JDkh3ZeyBkMMvTe6hYeVX75gFMfdhwvffh524FMMNA2tEMb\n9n3H0lIsn3DJYOgeg/OVgUZNp/OhCjI2PscMkzAPIkA+xqnoHV6D7gEmy28B\neRRO\r\n=5aPh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"bbe8f6adc85b9ea172b23e2970c6574e6b0a0462","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.985"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.985_1583760142616_0.9205638321567005","host":"s3://npm-registry-packages"}},"0.11.0-pre.987":{"name":"piral-ssr-utils","version":"0.11.0-pre.987","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.987","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"887fb9d4a43e0fda2fb0976b2da87993fd9d9526","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.987.tgz","fileCount":24,"integrity":"sha512-iSZfocozyG+hyIWxu6CsO20i1yjfAaP+zQEJZKln2cqMMh4pWew+4PJNyMtKoMw+HDFmArNJne0t+kFDfWnNDw==","signatures":[{"sig":"MEQCICGR3SID9zR/EenqC4GhMyiqwAm3IpZQCTu1oTT4WYJmAiArDv26mMZ5krwsU0Ab4l/7SHo7K7eE6XhGCLM0ZZBDcQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJebIIICRA9TVsSAnZWagAAbDoQAI2fiIjxDk4GhQ/lakte\nztg8Qy4aTZXRMUxOWYGufpSivwveWh+RfLLdSZgjgDoxcEwGU3t4iEfRcPEQ\nuwVKDMAeKZZOOOXYwOIshWJbJwCnqOUv+DOEJMYpg3B+eWdl6PsIiCO5ryVU\nsfscVrUdIN2QATW6OBsz9KdNwiSWdRhU+lxgeFVihx0ngCeMdR1idAHyM3NY\nP6di/GwyZq/x6V2mgh/IrtSBaLQHJ63t51vvRYdHoLs8Orkd6KCrqXWOuAMA\nn24/uuosxJl3KDoKeS6D55O5xy2pEMxsrwsvTvSoe3GJRCEZBth0FP3cusnR\n1uR2w5cG5269MadlNQzYT6ROUtL4imq5tConNI5py0YM092H1dKoQpUkuMF0\nkU54ZAIUGmWcQM8KPsnLiz3qc9cyXwKFSgH0VcmqXpO2bavVnGkh9Qhc+3W6\nBbKozQ+rlYvPadlaDh5iMth0PcdVP54/oeWynIrv37OTquExrSYswx/9fnNp\nu+og5sLf/mukv45BTSpNNjrtVRBG02Ai/uvfQ3JI6kXNnugWHuDLI94o9R+2\nYMzjq2T9fjFTwQBHgv9hpadoYxakjwdttptCrAysIgnTNpHi3aEYcaVDVmUU\n13Z2PeJ3M+3u0gr9PfPojs+5IKhtNnlx5KCwJTsRIzeQ/W46nz6ovaA0mFmF\nSKsO\r\n=q8cS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"633b65eba4ab9268df82c1705339a44ce087f923","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.987"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.987_1584169480122_0.5552721231016906","host":"s3://npm-registry-packages"}},"0.11.0-pre.988":{"name":"piral-ssr-utils","version":"0.11.0-pre.988","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.988","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a2d6ef47a05c749d0864d3640aec542d42911f0d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.988.tgz","fileCount":24,"integrity":"sha512-p7OTPJedN0kLoE4L8imVvuZXPj9gITmbsWlO5l9vusyxQ8AClx62Jp4qSIzyXhr2YrFEB7F2GNbjtdo3uy8zgg==","signatures":[{"sig":"MEUCIQC3sjIChG5eLIwbKKjqJN3b3oAXu2Ka1uvAMp1nWS+xGQIgZX6Gr4iL1EplGmFCa8T0lkY6aeYRZimwbH/MmlD5ArY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecpKICRA9TVsSAnZWagAA5XoP/0Gn7qPhBZZtLCF1++YA\nGNriCyNLYP4eZ9JN1ewcKizO5PvtpyE9po/SwGakpzj2s91kwIBy/p8UKD+6\nfa/jMoPHXNPK1bHnhbfDBKJ/YPxlGsgmNk1ae4xFYkDj9Q1Ec1hE6T66o/KY\njO5ePmbl1md93kTikHdrX4D7Ko6k6SSgDhb1JaI/TWgDfCYugOqmChuw6mEM\nBHq/mTGDRQ6xxvG7przKBC+fNuKG+FOfmmLGsx3nmAe6EC6J/sGuJstQPBK6\niIKidTXGlxHi6yarQDMz/F1wWHU1YtPshOsiZgDZNZtwC4PU+jKgc/zCnFtb\nLqQ85XBRBfKVss7E4QqLckpy1N7cHN/KcWYqZvfVPgNMbIXCLFp6Yg8PSKfN\n2RwMB2K9BFmHTMFnzaaXlb+Nckvo6IT2oayzJzLsvMF/QjakgQlQnHRcjWI2\nhvYZTpv/A0MT68j+Q4pi4b62fMjyE7tZRTfMY8a9yo3bCxi/IlUJ7kKjsz2y\nSXj/UdWc0MEVdEQyPm55C1L2otNeyO1mCtIKWx15uCLkW/aAhNN09FtA0mtX\n77AWsTPNg91jtt+yFemjyySX1PGWZTRSDRKqBnJxaZILGzL3PL+LJ6y4seYj\nI7Ox46N7OXM7CGIwTAPLX1lNkiiwlnVjyR74GjaVodRvGSSgr32UxuyVi3A2\n9WTA\r\n=sGTl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a7462fdb36cf7e7c0df2f79b1e3fb3b24f3334ed","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.988"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.988_1584566919973_0.4019760431531445","host":"s3://npm-registry-packages"}},"0.11.0-pre.989":{"name":"piral-ssr-utils","version":"0.11.0-pre.989","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.989","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"310f7ac50e91942c05d9d92cf7304596482de5da","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.989.tgz","fileCount":24,"integrity":"sha512-0mENDHpYtT8vW3xtWYVVTXnxdW2SAt/co/vzHSxkh9vyGHhIr1+LUpxAl4FqeczRrB7y+CMZRHzRrENVoEdrvw==","signatures":[{"sig":"MEUCIG36F1EQmeO18M/QZC8laueYHx5JwT5H3zuSJR8qyaGRAiEAuIewvnyWsjOXHhO5gwTt6lp7u4dhhsoc5Hm8TeDC1A0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedKuzCRA9TVsSAnZWagAAw3YQAJD8+C1FxZeIRG8I0vy0\nuf9g6YlYBd/Eut0+CHq0qj51P3nT2ifwGCDnOFU11YwxCxOPBw4atprBZtZH\nUa3P3JXAid95cFPpBnu36HZXCiuFu9DV6fnArN71HnBnF+2S4I39s4gHchkt\nQ0DXKcfIrAagJRpLbNiZLUcMPJcx9oupiCx6QOq1zG7LPAYvVtA2qB+QSHEw\nImNNjvQKiUFq/S2VgABvjQ6P71m4bICXwNVrkOdTuX1ypYGV2ovZCWK77zx4\n5rSzjS6/tyaAxieQCBZ6+rr9j19jY+1KMboFsSSW+41zu5dMBDqfxxS8xdEO\nMd4Ocmngrs932vQARPwsh2pvJ3ee+GQBP/qRLRE8y6MideJL1oQEjAOdZHeq\nCYiKFK6HOANNsfExdQQpwWOyJHMohQOeozXfJHTpT0LDs5+BVaFbO66dvFcS\nDnIKpr2pT/Nb9S7EVkKJpUX6em8Dm3lMVegoQ3vPk+Tp4cLC2LQg2GrApTLJ\n83yvzaIpjrSYkEHdt2Mhtvjbb0WX7A/gRLhuTDPxdFuKvL/K5SDlBLRHk7Cq\nAlLaHmdVpp7A7XGltSKjRGOsANc6/FxENvPFuVK1rjz53zxG8giupckE6AqR\nw/vY13fS3WPqWFo0NK8GQA5v4tE9mJRifExR6UntjiNYW9lx2ZD/auBhiXZ9\ngOk1\r\n=iA5J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"c46659b213a32211b8676196dfd1885bcc06f55b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.989"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.989_1584704435473_0.5790171138420366","host":"s3://npm-registry-packages"}},"0.11.0-pre.992":{"name":"piral-ssr-utils","version":"0.11.0-pre.992","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.992","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0dcda3737ab6dcaf607bfbe3e8dd4976e3867fb2","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.992.tgz","fileCount":24,"integrity":"sha512-4qLHNlQf0WMpU/1B1MPZnxHL3PsUR2A5R/QSMSKEArg1SOE4zkxysQliKJd4kbZFcOm+HQFHaMWjXhqHbE7Akg==","signatures":[{"sig":"MEUCIQD3ccgLIlF7K+bQHHsIDjBBDMCoE2LjRbyWoxYYcDgnMAIgF9zpx3oeOMGjXKEn0Us83xehoY7zrJhPcvYpaotBs0Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedmGSCRA9TVsSAnZWagAAHdIP+QCIWuzUES28yhUOqBGD\nZG3vjz74bF7hD0c67+ZOSAbF5kUNDfhZ02In3CFU1batdy+6O9jC5/KlITqh\nTsJTZwgBnIXBQ71Pv1hJ2HYKtwOTD+QQuamJ0lMVhLCGcxdo7DJ7qGrOc1hV\nOOkj34vSoIMzJ1l1bkhflU//9hL4ge4u1in40gRDIvIIi4VRKwfdlngKTfC8\nWz7ScTuCMLYy3YnQo5mbz5/fJSM501UFtyoXlzrUsWmCZkOxGh1MCzygcW87\nIqqD07Pe1PUE0cB/wst3qnbA7hpWvMvi/sSyRWhHTt990N+VJCtMDdNNqHfU\nLFAy19dg1pdIdFiwREiu1PJiT2QNmsdX10qDnAkdUAk9gD/Q6tCoXShReT9p\n6LVbUbzvD+PX71PugxR8b6OVpyYCrFZeAu/2tJEeC8FMYr7j1Wde0ZvIAC5B\nMQQFEAqsq14dlaMz4WcJstHmy4j3LJd696ARv5D7bFCztYEEl5+3bIusYj2a\nz9NgjGPEE9E0QZ/T0zNBy5Y6hwHwpChl1akAHVHNopTfHf7MpBMD0AknQx67\n80NgWNZhVSKaBhgiKwFORnt+QVLoD765kMHhbHh/mKgDOZfZ9EVnpjVh1NWL\nZk5vEByZ8GeU5Su6Bw9MnPzi7gK9ERyoKJaHMYfrNg4OkItziLcsCP/0xIaa\nnkZO\r\n=J1v6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"1bc857ce4ee178e56dd7cf7468af180411384aae","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.992"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.992_1584816530343_0.4207442726893993","host":"s3://npm-registry-packages"}},"0.11.0-pre.994":{"name":"piral-ssr-utils","version":"0.11.0-pre.994","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.994","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"45dcf971f7403c797bb3f87cca9817819c1d4f93","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.994.tgz","fileCount":24,"integrity":"sha512-zzugTuoOASDtod5Y7Fi/jy7mbs7ZFtCCOsH65jHmanpM6PpXunZzM3yr5gRcO9nJ/cVf+h/BKzbzVCFf/Cm40Q==","signatures":[{"sig":"MEUCIG6c+p+7STQ9esYUtKN3g1+gVsZk/rdyodkylk84YMKCAiEAirXL8hsPLt94RE5EheFghHQvU8iN2eqe96RoxESw4HU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedsuKCRA9TVsSAnZWagAASI4QAI8phiVRctVZYZmL+YtS\nAFX+jVwBatXx6HQK75tb39BkKpEq5s0ev57xeCG6/fYd+PKXD2zehAo83rtp\nsSxHtEcMLPPwkFAidB7Sa6TneTdvV94gPgOioU4QZdXNL5NfspZRn4gSEesY\nLYka5KPJFiCxTr9sf2w9sZb1a4xE6dH0g5ZEv6pAxVbhPrVmgOwAYfCxcX2k\nzpo5Sqql7MMEmVTcFFbe/SxcRT9pEFdMR1sfZu8XW0B0Ao5EPKa5sZe1rwo2\n+PpAAo0imk0xiR6OpzpWiPImsLTQYQmemEyG3AWeJ4bIVjNSe9YpedUpdt+f\nqWtBr/FVUqJQVYhkw1yVv+QpgMBdVE6/DLzyYXXRQwIU8Sc/TXHEAvPpAgSS\ntuSXP1OZTXh4HUMhU/43qaJtE06lwS6Dnbjdtc+BrXSmIGpdBGwOBzQRDc3p\nHzdthnJtLUyEbwMq4qcNT0uZLXL0yX2ShTVF+xJQgW2zQNmbzCNgcZ9A1B+U\nUva1xC1IhdwBrbaeQ254Ia9OhVNvpuzwiBFcO0L4WOIjdfsEeEN2wVYXMAX6\n9DdYN7VV2v3N7ijkt9F1BXWQ+AiZ95ReSJM8yK4HW9F0I7YpzHTuIPAjMJnl\nvRzw5qRM6ZKfZtSuTFQN9VvQBWn45y6ZlURElW0oMUSrsUDV7JbApy5uoN6N\nwntE\r\n=DnHD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"07210f348491032579e35b6eb7bde95ee8047e0e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.994"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.994_1584843658302_0.2289983776339739","host":"s3://npm-registry-packages"}},"0.11.0-pre.995":{"name":"piral-ssr-utils","version":"0.11.0-pre.995","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.995","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1e69efe7e182e8bbda19cfe01e9198d18042524a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.995.tgz","fileCount":24,"integrity":"sha512-DDGai08sZQ9nmDNJFHCG9iCfGFD/6GXxMrjJmnPvuQPOyiQNt3b6UtTA0TdTGYYCEGdc9ez5Yam196M5N+lw+g==","signatures":[{"sig":"MEQCIEKcNu6abPl1rV5lOSDMkbK2VOXaQMOT3BOiwPPBHsSLAiBM9/KCMgZxT2RNqT1huSO+08zlI7F7MELuQN8xah0NCA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJed/G+CRA9TVsSAnZWagAA0fUQAJOQyBKRyVwoWB7/vzB7\nSjuujGOYM6klD6DY/LJfx+tPVG2OAhQ49Vq94nYv2AnKgzAr/W8oI1j3FbQ4\nGJvvgnkY90Ed99xh9PVtdf9H+tfqFQWcSyke9jdVhWmR+52oGNhFTgM1pBC2\nep8LEvydqyMtNCydLAPooCAlZwpvC+h15iC3dv5qVFjeKPXJKdEpFvu5TgJY\nv1ewyCT1NOI9qS0MhI1r/f/6Xzz8Sw5L1W8UKjfLgevq+pzuwI5lOh5l/Sfz\ncJWLNH7mMXEsH2Vhln67BSBW9p0dn1zCWU8mTN3Rxz1rWA0BNCha99PzPV7V\nR2aQsMcj53v/NPHoS/ADI9Ocg/Sw8VL72Tu31m9aIZjGO+OI31xd/WV9TtbA\nMQaIULAMAV+1JYJWhLSjCRY2jXyMsnStSzDK9ELCCo3H5qHhxlLciyb5Rbz1\nqsH/Bki01eL7C2k/neS+IFT6hBJGZy8lxmppawEOKD07375lI54tuzeV6u0D\nous38oLk/zR78Oh9uhkUpsQDgBrTVqTULfmhDhIdlpERKc8Yx8AwcecEkPpc\nnEtdtI0h47Obww773mUg6hNwXbLlwl6GkvWgIiVo4Wv+VZKuN762G6HeuFIX\nPb7m8SO9HSw9pSinw9HYc7FfNqckyv0dy2b28pCzTAZQuFEQWbCESphqdE0o\n5m02\r\n=rO1Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"4ff66d3ac1e6f31274ac1487d56ba63f6c5f0004","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.995"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.995_1584918974050_0.009236746250640193","host":"s3://npm-registry-packages"}},"0.11.0-pre.997":{"name":"piral-ssr-utils","version":"0.11.0-pre.997","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.997","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"641b32382d01d139975aa8092c52bead953cde22","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.997.tgz","fileCount":25,"integrity":"sha512-jtjHYC/qpU0Svw0Afs74OmJLYYISo5Dy4BKFAc3gi+je1GepN4APJCPYs6A8pPFsH9kFPZxDdyTpoMyHZwvAEg==","signatures":[{"sig":"MEUCIQCyJIzXqynCoLnLptBHUM/FRndGhrZoxmEcvKdI1HBZWgIgfyLAbO4H1MNKLOKqnVuD16BiDeryry7g+2umOLp235g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefUccCRA9TVsSAnZWagAATr4P/0fTPUxeZ1DeLrqn59/H\nypy2zouEpNZ0XYdZqtOodxb8vJq64Bbx2gNof1mRvSaUb7bTqwi6ouFbiJ06\nuKcpjWLfHOc8GhkN5/1eAUJdeH9JQdjMMHKjD/2Xgf+Cj/TPIAzhBVKTHF0s\nkBggDvpRkrEtNDcGsKL9FJl83IHsk+ivMjuklsS4xZcbEqQjOjLWTN+wdDJD\ncZLwi1/XMJPs9/gE9re/MU8KHjpUuXWMn/LhuW8g9Qr8ansV8mlAGU/C1QSx\nNU10TqqeqIYy8rF8KZe2mSxu5ap8weopvvVz7bJTwAeLrqcwoRhz3TP1/Cd7\nuUZEvqiSXwovft3vRl0TYH3eyQ2ftvfP8RCeymgYbc+p/HUOyEWz0RkGKJ1U\n9tOvobA7XqdSQ0++Y8R0K3N4uMWBk2udLhtUp/yNccI5vczec2LjNIaaclmn\n5OwEDR56RTWrtws0duwnaDliwRjAaqQrKib3oQBMOgggcSgnc1gjv2QwOGHW\nVdDFWlUzzEs39zOQ4rtkOYfEGpWHdRQj4TlHButHoxhHGS0HAxxc5Va3dTp7\nEWuikdnvRk8iBF7+AdHaRGYMT0/OLCCzGWIWHzwLKLkLwmS38RYaiCQ7caCR\njtQ6JNG1Gb4OyzGorK1IonNgQ1XTMl80xfJuzMz4EXZr1MILu8haQnns3wcx\nVQzi\r\n=JJW4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"8aca7104e7ec07b937305210339e283d29b0b518","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.997"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.997_1585268508071_0.6276661030403674","host":"s3://npm-registry-packages"}},"0.11.0-pre.998":{"name":"piral-ssr-utils","version":"0.11.0-pre.998","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.998","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"abc2e48bb38ae676c5db6e5dda250bd8bf201ff6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.998.tgz","fileCount":25,"integrity":"sha512-MPVIEm3GR/PJrIHHuWgSJ5Pt3IHZWOFHscrSe4zvbSDkulPH9ifl2PEzmXoVD8GFE0Qalc4QnDOgikMtLjk/xw==","signatures":[{"sig":"MEQCIEzbD9xEiJb7f0g7xRgDc1k3gh6gJJONvP+3efRKSS2qAiBAgXhk7q9h5veuoBcUhxa+FVCaeuKn41ABB1YMJVj2KQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJef/+7CRA9TVsSAnZWagAA9cIP/39eawtKJT9GWmI75UQ8\nD5tGEqyWghcuQgmYs+x8Wz+ytD2GJiSwGxsKlYUa2A41+Z5XsdCuRvkLNXbo\n3PalbQ8rzIhuQSGrZ4unuwPfRrLxUMGjkBEr1APOzVWNi/8DaokkJp/e/3M5\nlNIpvRh6Qqk00QligPt1UbLA77qsfadudkDP7nSTTKe1UYVR0urmCp/SVU13\n3FBcdywYYOPZvjJRMx148zLQ7uarw56kk4hQIPlqZNbtdQJK/RhO1X6PLjud\nYUt0WqTrAIo8mZ+vChOFs9j9j9gut1F3PLid3PT9sUR6vOPHYC8Efk4W0Gu/\nxdDQHfanL7ExqLz03eKu5xozcA7dmRNzYYkfr3m+gShwgYFo3+d1WMaap0kg\n0xMvXHZJpjEakNk2Ec+GZR9yEl1UEkSxQ1Sw4BMTZ6rz2GIOVrR68bP2mAXB\noJ9h2MiPJJLzC7XI4lXn2NTUZKBZblvpVHC/arBYJoQuTAYO3J/XmM9dQ1+Y\nR0uah9fVCcJxEN0oCh713fMWy+XVExOZovvQ+9HjiDj3kYtb6Qtyk42x5IzR\n76DXDKr31+2bD2qeRrUmhSEHtgyAtRGZ6UCSeEBUV1nDeub6IYoTXUXMziEp\n6m/aQNO5dymv/NHd/eKF3COBZubwEuOmt5fcAN8iKYYZ/VrPCS78JJlS4+Dc\ngvSE\r\n=9FVw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"44884607b9a5e693e13201161b19f586834e3b3b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.998"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.998_1585446843326_0.0021622581109190797","host":"s3://npm-registry-packages"}},"0.11.0-pre.1007":{"name":"piral-ssr-utils","version":"0.11.0-pre.1007","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.1007","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"45dc1369369eb3af408c57e354fe8d3f9c847aba","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.1007.tgz","fileCount":25,"integrity":"sha512-qo9WWTL2nqQ6WhAfKs2ecOCKchAgBG+n7JBTRpF8llMPqFcMM2k8les+kLtpavd/EQGQ+acjmHeof+e07GNcbA==","signatures":[{"sig":"MEUCIGXF4HhH2zfOK50ieueeKr3flpfrYC7TOqYgzE2ppvrMAiEA2Tq6+ltERU/M0v2T46XS3J4Mz5cUWXkLIwPBia17ftc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25669,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegTQICRA9TVsSAnZWagAAmhoP/iBhD+0ZvsDiE+Cqr6jq\ncN06dT9bJPY0eQKTE1OHhnu50l5nR8e7lrDCNgzzOLwR6D4cOBidC/zlC/pS\neRHZxABV1jZPNOsYuohZQF1nvl+z+bBSLUyasAaGw11xlZZtT1ewpKr6eeY/\nn3VmZi8mWb8A4qsWLDuwsVtxekqigrSekO+vrqPdaMn7R1P835xWZJgfXews\n+0+Z0D4d+m8Yh4YVM3HTdf6XRaAd+A7S/Fg98XJgQlWX8c3fqFMcoEJjGXY/\nnvQVDMR/LRGIVhoziK5qNJa5r86bgB4ko7oxdj/j9bXFeEhczqkbh+rhzs15\nJzURT9ZG+e6yZ7mBCpfS6BzM5E/gb3M64dJXuW775kRWVMEbAs4f2Q1zKikh\nP6dteP9dsCB8h0nnJP+FKqdN4ldbMQQDl7bAz1NiWnDF/2MnIqwv2NRtMc7G\nAMvfhELAvbiQszwAggGv5EzzdILUq8aP3w03xh33BOcaxKTM3rPabuZg+x1i\nd6yIP4i86iD940HKIBpuxZQiG4a9p1L4cok0ZGlRDTg90QGg5tuDYRnO5jrf\n/OVP3DFwZgEdB7qtv2tHjfvsWA7jy9m/b29x3VRIJOE5S92g74ySqA+5Cknf\navOcF7fEZc6mFaTB9D19tf18K+LA23fruLUaNyABj9DykFKpUfIOkHi2snFO\nKqi4\r\n=nkLs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"052d043f9755832a38fb5badc61e4de2b4fd5e91","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.1007"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.1007_1585525768112_0.9051274317580436","host":"s3://npm-registry-packages"}},"0.11.0-pre.1009":{"name":"piral-ssr-utils","version":"0.11.0-pre.1009","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.1009","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ff93e2f4096dead14d1b293917ab19cec6e1b17a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.1009.tgz","fileCount":25,"integrity":"sha512-K/egUmOmeZiKDBcV38uWZgac+gTEnfc7j1ADl1QfS2uSRO3o3Xec1bv4vKvqqtljnzH3V+E9/apA8hcTEJFuDQ==","signatures":[{"sig":"MEUCIQDDc+vyANy7vHflDT9Rb0MBIv/5pl9uizZ6wCDiII5RnQIgZBGXiPFbH9toSi1p9Rn02kixOh3oGTyL/rb3h71PugM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25669,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegoddCRA9TVsSAnZWagAASfIP/2cj3CDtnpzbxM80PjYy\n+WH5BrtK0BBUw3HM3jQwfl5+BORXOTABSaX1KgmaW1tZxqNnZOIdzQN6+AmU\nU9QcKPI6Uc1FgvHMuPb+biM/83LRxYlR33fzd2Oz9VqcaFATdx/GNN2Ao1//\nROfKRfT5n6Vl0cOb+mj3/a8qlFT7l9Btmew9EpWNXoLoTgBTmB/hkVTUvIRh\nBkHPdcobxJuBDtgJF7cNeF0kphkI5PZ9IQtqlawPLGQGuFd6vCQtX9257nQe\nr5gMBxN6UPXVg8iB8F+GuFcp+0of4RKVCfkIj+ueqbw1WHKOQJNtFHWmI3V4\ngY3oH0YLvYrKnqJpXWgOmlQ5QrqNhDRDlOmBj/2j77SaGsjHt3+aZvCFLgYS\nVU81pR3roAiPW+ku+uuFiVW2B1CQoX/+p8kLJfeNISzzdkArD+Dy8WjuuCzM\n0Oe/1h+UYPW8ytUJ6FnUAbSGYPXomICz/UB8bEPQ6OV9Vzx8qINYbaXTlR3U\nQMMB21dpIBM9bcXpnPbf6C9pM2OXIdoYzaHhgsOTpLGQKGvK0QfZUOUEL+av\nJt/zi1A/OIZ3Qxb+8U15CyAPnGP/5c/las9BKK0XPeIXlguIDTQ9muP2NkPo\nX2o+o3kxrFiFoOh75JW58THy23oOKWkznY3PUBRl1paezdVlwpeem4itvt+0\nquGK\r\n=MN+N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"1874638fd56835dc825f7faab3513aff3c8ddd0b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.1009"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.1009_1585612636926_0.0029885069710264833","host":"s3://npm-registry-packages"}},"0.11.0-pre.1030":{"name":"piral-ssr-utils","version":"0.11.0-pre.1030","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.1030","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c662407435fd40f96a67e9883539aa68962a56e8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.1030.tgz","fileCount":25,"integrity":"sha512-QBttEFx4gIFrXoniazKUlMTFOKocBccXV0jAQwxU6xi9Xi0aTd5DsopjQud0xlJouyi800y+Kb0mm+EXKTt75Q==","signatures":[{"sig":"MEUCIA2l0ILK6jWaaixyC2oiLcuzAo+kW7Q9UI3URWu4pOz4AiEAkjmZxVQGnGZrT/+PpdgSMnukAh0luKk3cu7YNx3jODM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25669,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg1+cCRA9TVsSAnZWagAAYgQP/R2qEpFxMLxuxOYWo+zw\naOdFPkioRKKgcSHMQWVRnsRWBydDzAgxDXhxFFyxaSSslFOUlWGjuieuy1cd\n0Qb/bsxE+39X73QysewDhSdGSxMoZ9Yk+liKTWLeu3Ct8hixLC4MFpevmBEf\nhpEDvDyUSsoZQjnUxu8eo2QnEU6M6z8AIGHgIxAwWwjf/hfyc5yvRQvKSfa9\nQiPzW8DzHC2HncnPZgoVJRfiB4wyCEdJt1Udc66wqYX90PHK2a2/v+9vOyRy\nOO1cLx5izMENxCXnnRSW1cqlsvCzDxTA5zJR+8705k3amwhfS862k5Hxiybg\nzIF9nDw26Qjk4ZA6rXJdP7XFU6YJ0IozCd01ulE9bX5pR6VpNw4YrGo7ub01\nybZ8cMSQ4/nmPEF4+hLCcugv4a5b+M4f9By6omNHVbO+k9QFsPf/0eeKrqc2\niQ3RDyhjXtOY49ZzxV2HAFnqQ9kFffgEdyAwx7GAuvYtMuCmoJFmDff9aJUS\nOoJkGiEQcTE/A37x/WIZsZCE4lVG0PdyUSN+ZNCmQHrbIzWXHNP5b7l38be9\n9D0nrtM+hj9nQabDUw18qYUHCcBRR6PfCjbOsECdGxL9Snot+NPkkhhJGjd8\nwGiB7tHDbyUe5H4jbTC/653j7jxkvSgIsAzy1bOLhhg1xLJPueyTDne23p/g\nBlid\r\n=WLyc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"07cd6733fe26694c4a90ecf582b59915c64fa72a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.1030"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.1030_1585667995573_0.0011001167759694397","host":"s3://npm-registry-packages"}},"0.11.0-pre.1034":{"name":"piral-ssr-utils","version":"0.11.0-pre.1034","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0-pre.1034","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c136bc7732330346e006fbfad53c81fbf5d8c2ee","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0-pre.1034.tgz","fileCount":25,"integrity":"sha512-6xF9QXp7gze0UiAYVMos6GG4IVdv01E2ED69kIolaGgnlNSfigpYEdclizvgzkFnSFb1j+mVeJtzmkUdSv1gdg==","signatures":[{"sig":"MEYCIQDoOrdQHBIqMEg1rc6b9ZyMyhqMZMZZlX1b0Yq9Inh1kQIhALn2pj6GcVEvciBLCimTVkalXTBcsIzNPLsFXemX3ytd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25669,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg5I6CRA9TVsSAnZWagAANj0P/23QxA6eKM0F5iNNPbcp\nqanLhVAgKvWPKxgEFiQ7TROv7o5ILQXCangGK1WoE19A3zg8/imdLmmdL+g7\n71TGCJKmyUDJiih6STo1J1BBBGFsa39fjY41sGszdjg2374GYdBgllaYCYSg\nVuLxO8x1HZa022wiGlpUg5xJeU1OB0QkF4aVUnMUKNK5BaiDhnv7Iq6QSQmz\nfRCuARStWf3rtWcofNSGBbk/vEvFvhlEzcfcRkSqkzzK3/Y76OUMlv0Xni1m\n/W2e2hzx//saw7gcNleAJmoxNt6hIYt7sl8DTEHSYH1EpHjPWVh0WRZDWsRB\nNWmYylZfoDM6EEWxDxI4qiRmb4GIhv8Du73barxIABhmaLbtXF9ZPrw4VvNa\ny6eEXljGHVwUCuUftf55bPfvOHxc+aD4ve1zU3bxeTdQRXsiCr0lr883QC0v\n8/F+qJ+I9b01RbjOf4k78LwcYTgDhGjZehJHcnbEkpYEFijHWiXexqAlAjSz\nsZ8mWMINfkzj3XczDQDlfnAhP+tQpK1pTe+OJWefFecZ890EhYDyIdXHR/RM\nJOejWK2nLs5X4t/JJM1rZhQ5nIZrgE9KWrmCVIIrYcNAOHrTigrtWh6Etxs+\nXMHK3NM1eYtyYsnrwMDHJWGkEYojG/qRqczGZbXrTPYpuXBs5f7lz9TCLIsF\nllQ1\r\n=nSX8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"035e37243a04ddbdeb0fb918b3ed37086d8b8ced","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.1034"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0-pre.1034_1585680953730_0.5840571395749747","host":"s3://npm-registry-packages"}},"0.11.0":{"name":"piral-ssr-utils","version":"0.11.0","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.0","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3f4a99ea2b0c403dd779afd1623d2655cc51dd90","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.0.tgz","fileCount":25,"integrity":"sha512-yiZsz6fPwUyL4+QpPQJ6JE01++drMfniORo4Tsq8yT/S6s40qmP86/ZfpqEcCNei0LT+iYJ2S5UiDX2w4/QwHg==","signatures":[{"sig":"MEUCIQCbupMsf93fNK8eSmgfVgtrkSZ/Lir7m+4te7eWXXuBZgIgCFYNsuWN4YrjXLdclCT4IanUOLG7ugXBrjHewCO9vog=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehC/OCRA9TVsSAnZWagAAoVkP/A0413I0IdErCIMCpcW1\nDpUOVKjtn+qG2K+mOQ/7x4Ahnw9WMQwsVErC6qsk5MrtlV9iv+sMNDH+8gsh\nQDWsQn4jHYa1FO0fhnkSI5DRyhaaZe2AToou4tpXCrjRoCaAs7KVfGLIrkay\nU+mz24dTKJkefRixzQRvCFN2NTZ9GzUnKrA2s/qjSuDXJOOR5uvdWSOFwW1k\netD7Sf9GI66zYPTUpfRtkUXcQTQtt69yQivd+vknmjiRFlrygtdYOnHcTDjx\n8VP8lm71yqaLdoFJD3uuNXbBytXwLNzeEckieGWjQiw/2o+F5vbJT0iiBzds\nrIHz9qUhhbF6klc2UdQRQNvAJFP+sJKolkqrich/9xHALkp3QZGX1pV0Niri\nfqHgY8PFcy90DiULNX2P9IImnECvKFaiguNpVbWxepuVvwR5Rb+24N5e5jVk\nsnxl25HQAq+t/HQ6xzLBS6jYRLiJYkSPfKn58t9HoAz+SMDj21yHHtQZ1cWT\nFGNHp1IHcTl5TXGIrP/sD2ca7nOIhXauRsp2TURQtVdUiQse8i2vaMPN332W\nUjazhJLthGN6x5YpdxKpGCx6s6luyOr0lSYyL0nqRXluSjUyvqU0O7CsIABA\nDv07WqLT/oZef4tGMc1NlZgk0COhmpYRciYkYg/E/OlOdBOEaJ+xa17Xw8d4\nEDgE\r\n=jEja\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","browser":"./runtime.js","gitHead":"dab519d15986fa1488e1c184d0a664c422787b7f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.0"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.0_1585721293988_0.7323401511025258","host":"s3://npm-registry-packages"}},"0.11.1-pre.1039":{"name":"piral-ssr-utils","version":"0.11.1-pre.1039","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.1-pre.1039","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ecec88774eea3a83c763115c82a496c90ff3c934","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.1-pre.1039.tgz","fileCount":25,"integrity":"sha512-ImchdGOJsDRoWwY07i5zVqxGqeplBLtBQkcmWHd4vqhSdd0i/Q6ZkVSp2fjBcXbmnA2xhWusltyQ3HqLAU0btw==","signatures":[{"sig":"MEYCIQCPz+jpye8+ARnKVZvyFy/xgY8JaXyz8ORNDww0ezzDpQIhANt5hbIIUjEplW8/HkQM+TkOfuhqwAB+E+BC1eLaV9Pf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehFnrCRA9TVsSAnZWagAAKf0P/j8geIgFbDje0dDYlOb/\nLlU/F+vM2VoX72WvDv5nxaCw34fxGfMQHfe6Crq9oT6QwUSO1ABJNCCOLopP\nytXspaOS2PF3XvNJ66Y1my7VHCwjMqK9JTKRfyySdSMxU0Nf9f33TO0xAxY5\nNRUOTmpMMGX2c+wxHMeSfueqnrbt4q5w6vujnGCTaSN1EFpuoOxxqEsN0PZw\nCHgE8ecLB/Tgmu3mcZNn593L7sUtWfR3p8IH130HApd0wfIRfdOb9y6Vm21T\n8kDx+kQYva/7hHPGWfhdSr5JIQwRTuKxxY4JnwMHhIcne5T+BNH5+/zrknR9\nXOe2vdJvVXHzQ6NfrkBI+6zClTXWLgjixHJbm3/o96Y2fDq+506N3m1Oa1SH\nnvgF8vLA9gznT2ZwP8w5hssStJZXRIysgtzGqB9+wdQB4I/XOBybMO0cBRQ5\nLva6z2cIlneZl/rVYAcGPWX7cpiBEpEJONJRRbLHGpi7MhXcQep/4AWTIoAO\nvAjxsap+rRkeGOrEF1mi6i5g6ZmhR5bDZjIJMW6hc1Hawf59D3ny7v9APOAd\nAKQeHGQwf92xH9M7FiQUbQ26lyLE2cTwz5A57przqMhha7WSXG9WnUGF0jBz\nG1CFFhDpSKa/McOJERaawUhR1yT3wQ8Sfo84h46pQ6p6dkc53iJYvUm5UVCC\nCRtz\r\n=g4sa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"9fa59279f63fdaf15eaa5d82627eff741588120f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.1-pre.1039"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.1-pre.1039_1585732074775_0.3856387302809019","host":"s3://npm-registry-packages"}},"0.11.1-pre.1050":{"name":"piral-ssr-utils","version":"0.11.1-pre.1050","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.1-pre.1050","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"de4aabb73ff6f799d4082314cc2108b21bbffeeb","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.1-pre.1050.tgz","fileCount":25,"integrity":"sha512-5WL5iIydB+x3ausc3fHpFSHZEzG5tUu51BgvpcMF91SSxFG5IhVoDAzM6jhh3SzjWomUV6aPbvN0SzQRiZp4kA==","signatures":[{"sig":"MEUCIQC52lbFXUR9ZKOmD2ZCmBJbXaHVEWC9pFJFUjizhs5A/wIgI41VrFiU8lxlRCkO5g5yV0l98ge7zeWIwlxmQ/vBdCc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeis8BCRA9TVsSAnZWagAAb6YP/0ItEnIRJeIohyxtUS2c\ndAguxXa9+lXV3xTMGN3hjl+YkLevRihwchO1qqG2H6b1o17TKmijcZ/bBCyc\n1EkXIPjsjo5wcgD8Hjen9+EBp1JsxtYIw4wHEINO5mF+TBcCkxwIIGmjGCrZ\n7tDoUPf16ZqwZ96KklPwGgkAacufh2fClYtlT8f6DK7pTCZUmiIRmUl38hpR\njcY5KSNdLr8sjuWVRTSdaozsUwO/Wq/KOS12SS/dfPprST9mcLDUUOr+lxuN\ncCHV8h3E40C0fkNcp6z0iM7+1umubUtYpe61lj2IkJcvcKUOENKRFKFUfdDt\nd7o8h/rt2jcm/xmB1Xo1fwhaGRCP4uj/hvZFyHmfeOVKUHb+fkh1K7X/KwWL\nDT7wHCo/1nP5rMi2CHrzb/YWyzR9vFTKOWft24R1RVyYcrqL6f0+qRvvf3D4\noMe9luSuKy+BJJn3iCieStHWIRckwgX/XMNLHU0Bvk9IP4YksbcwfjndynSo\n/yLAd+o/sqSFxti6VBux0j5heddnyBDz/tlwF53Vodznup/TEwdhYnu6/ET2\nzjRlUA4zkBZPqizXlcvW9aqQB8dh1xlWy0lnRHW9A2Oiwb2y8dGlQ5ZAsw7j\n5zKwKm4cyEw2yIHc0m3bwMY3IjgKLkP9zHrAE05M+jaXY8EpdBxvBdvC+/eL\nV70N\r\n=eP4E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"7dfdde4ea9e8e9469ecbbba473b6a0d1f214e001","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.1-pre.1050"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.1-pre.1050_1586155265205_0.6010981278022884","host":"s3://npm-registry-packages"}},"0.11.1-pre.1053":{"name":"piral-ssr-utils","version":"0.11.1-pre.1053","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.1-pre.1053","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"10af3e8baad712bf4797ef9362bd50b202806c0d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.1-pre.1053.tgz","fileCount":25,"integrity":"sha512-jf61zM5nIYojg/6KUddKlgA/r89jxAiWDg5Bp7ypA5F6jlBRxYJ4sLJgNPEKiXebpf0/egBk3ku7g3qkwJ6msQ==","signatures":[{"sig":"MEYCIQDAKdMRL3MC2jdPHbUP3MUjcty8xE+M0oWJmpoF1m2eSwIhAL+kIK9VKVr2s0RmoCxwPnRHVfoqllKOfAtFJhMxNMQ/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejbf3CRA9TVsSAnZWagAAVQ0P/0RNtrmF2khwZWDYT+Qu\n48K8gKNio6DhpFn4YNADVE3Ft7X+be/NGh7pNoTRhw4C0hR75zMdrOTdbR9R\nT3st2ZqKJu0ovdizh/9eMkcJDZZRqpeH9cgq5XXADqX/xp0U7zW5sUCfHKYG\nQzFWIS1mCznLOTi2w+j++oaGJHu9Qeeso6SJIfAiJ9FkHYhFQP/5mTJsepKf\njbhg5vOJwXjoM1vJmhSqyZxytC17////NCUkBUa0A0l5a3yd83Xzaqpy8HFc\nK4lWAhdFCAr5gvbcnBmiN/C3KKlQ/hGRuzeQfOBJRpeMhXQQgsxN/xHkX8k1\n/lxYTD2F2gu+i19OOG7O8bn4nPAIUkm5nln+v55HDtXHcyByVcRkqIJS9GKe\nhDLxjDlIEfNUQ/p4YDDxm26dE0r2JdWhWu0DYSva5Uy2V6AxL0Z26MWOwcws\n0BaJFoQN3OH5WirzeGpGjx9vEEcNJpDKjMpUsJybK1gjXuNmTH17mMfxN/yD\nTFEUR4p8KnLRrnOU1Ovmw2oNlpsUMTgy5OSkMB3iGlBPI1A5JFVIGAB2yJjj\nZShDg6XdVwGH4BLlhd4oV3Iq34EacDwvQzIlKmPfY0XHgldtQliIq+2jODgh\nuMP6ifkpqchF3tj1lIRpR0WfpMMDqSpue59+X3JS6eK4R93NLNbRppA0cioo\nUg8A\r\n=OA5t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"02c384db2162e9ecdf276492fce3c47457e2dc7c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.1-pre.1053"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.1-pre.1053_1586345974719_0.2912535190506169","host":"s3://npm-registry-packages"}},"0.11.1-pre.1055":{"name":"piral-ssr-utils","version":"0.11.1-pre.1055","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.1-pre.1055","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0d5d809d4436f6347a177d014744f69093a89209","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.1-pre.1055.tgz","fileCount":25,"integrity":"sha512-dSsSwven46jzjujrAeK9zZ5aU2VZtxeNb6BV0qN9DiY4AmETGyvS5VzwtLPxnPGxWob+T8pLXsyo+crz2vHVag==","signatures":[{"sig":"MEQCIGDPvZCu4spY76a6fzu6aY7IX52ep/L7VL/ASXiUjXpvAiACTK8coNJ11lv64kQQCQK5PMzuS1NQwWBYBRiGioqVDQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejh42CRA9TVsSAnZWagAAShkP/jCmOa1mY+EsHpOGOSIR\nTh4kKvUdgDuPsdE0+Q/vI7CVfTYRwjk11ZnP2xyaSEdQ75wmIupw/Km3Io9c\nYMeh2BvTqnUTMHA/OTEBew4U+1QMHPPVLs1JtzC5DqO1k1fx7idQA1aosm+v\n/IftskaZtF+FfQRaXaAsCxkR43cBTlCovCk94F2usTn8yIGTI3+7ZcwiWL1v\nTux0O2mNUcM5WHFHOubGi49fuk0Z0K8B4FOvOyhl3hS+BTt2IhQHuKXRS8Fi\n27FiJ2Vwwxo20Y4twrasnVG4XjvC7XhstNNwE75+9E/ZyJYwBtwkViLbKVZG\nJKHUJ3BIOWHJI4cipzO/Yaa0+71rlo4w0+IIOk7phuHcoyXbmmw2fcvgvoYX\nQZkO6kl8zuLH/CCkgx8KlkoJKrtCk/mK0Rb1motoXNGZSsCLhEVtBuxRssro\nyCJcIDr6O2pnUwknCDqYXBe6ahE0DORSJdwA38JUnaj+GiwT5WLaADSY90nd\ntOg42VxyxtCa4sqEk8rO/xTeFy5gWYud9QAc4/l37fPRm9WeQDxSiPBUSjYA\nD5rLPMltMjs0LCtxheE/dKOU0Xs/1SiFHhGG86ST2To0U4T4YgaklpV1UBwl\nFZI3nchz6wNBQFJbkYsp0CC5mQ3PhJ3Oh8uTjTqXmmz/r3cgVjbDwOMT6iBp\ndjCO\r\n=go95\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"8c3fadc6ce15f27a84c3370ee5a6f095ef48d9d5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.1-pre.1055"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.1-pre.1055_1586372150145_0.6437921996856792","host":"s3://npm-registry-packages"}},"0.11.1":{"name":"piral-ssr-utils","version":"0.11.1","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.1","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3644e21670d2702b17c0a4f7c8240016b848e628","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.1.tgz","fileCount":25,"integrity":"sha512-WAsgTfu7BPg41X3qHhrw6vgnyJmHcDMOht/1PUdO6MRVrwdpYYDhdu4cXQkjYRZ5tH4Xp/7oOyg3hlT/1tspPQ==","signatures":[{"sig":"MEQCIHy74mJi7wrCvoEhoU1jOBB8goOj3Jfp+Ph40EMCKWKIAiAF21f53WhHY0KPq5e033kM6K9IBLi4GAmYfBi0i3G7Dg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25658,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejjGYCRA9TVsSAnZWagAATgUP/iXqPV8yAJiINlFl9byw\n4mbqsSZFeyK1TLU1jtEZErIfhtD7IjtFGjZGIrn1vuSLIZtkCxet6RPE6dZG\n84/ZYOYWtkbgbVz/UhhWxWqQfEluO7EW8UGJVQ14O540pa6KA0UMOsLUoW/t\nxoW1rPkcY7Paon4yJL9QoOl/CcdT+fXHg/4MW6W3utDb1Aq3SjYDiSVb8fmx\nODd3HmxcO7Ir3lFFbMW105X1uY8Rt7kS/gvMGw/hEP5yy/O85hS8e5kcjvb6\nJtaUedIeDjxC4kLt9VzNzGJ4zkk3DU60nXzbqYXBKKzbOgtoSIee+sPNGVub\nuOE5Bm3E2v6SOl+KRZ2vltbj9iM5qTfMH7PJNzObEbB6Z16lYKt4E87kmESm\nVEYrjj66UIDDMRCTFH/87TpMjMyA+WGjykE8WWVRUh6aD3SdQtcECfWHRxx8\nKde7+uDqqI0fz22Zg8+9NoPvabYAhsMX5CrdJ6HAy1o5tEQaulDHQ6ba6OaV\np1WffmuGgOx6EyG+jovCbSEFiH0Kf1n55Nul14p8+DBqgLGLo4XVnXlXQFjg\n8ovEN8QsA8CtOm0de29FZ3A1SWTD+TBEHU9TkxtQHfQnNTq7luehiGuXrODD\nawy1b4VCEfycU/xoc9KwTS77oe4t9ceo3VVFjzf6fEVI2wnnv2y/KNAloKgS\nmS6Z\r\n=z3/i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","browser":"./runtime.js","gitHead":"8423e8188c56c532fa01cecc607ab1664018bb15","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.1"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.1_1586377111832_0.3591416646144441","host":"s3://npm-registry-packages"}},"0.11.2-pre.1081":{"name":"piral-ssr-utils","version":"0.11.2-pre.1081","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.2-pre.1081","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b1c0afa353d9dedebe9954a1a007a3fc5c05d8c9","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.2-pre.1081.tgz","fileCount":25,"integrity":"sha512-lWxuvPdDNLA7j7XS5xR3uhPjtlES1XJ8Y78bZdh0dnnV328QwJbjgshInRFMyYN4qGe2iaGjlKzx4PMpLndnyQ==","signatures":[{"sig":"MEYCIQC36VYW7MpnmusaJQtnIEh3iZxwiZTHbjX1pOf4LiO/IQIhAPvjGORhpP5U6bv0nwT2Vy528ebO6v9njBKWRGG2+bMS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekkFbCRA9TVsSAnZWagAAGcAQAIKnB2Z8PofbaKCiCGQQ\nqY8NU29kiqdxW9gvX4zOnqb9dyYlUb/3HBpQ6Qo8+tGPx2DoT0blU29jYAS+\nVnj1feGw8B+jI35jotk80xFK+86OQdwtHH07ABxvDO9Gerrwu5IiUgyywdkk\nlExH2Hw5BghQV0bLKpqvewS0h8Iz3QX/vhLzmz0LrWaG18//NSpwS3tTrKHS\n2yxPmzk+nigWN27Y91g/l8n68yTPMjLC78bmcSWnheQDaZ0Mbx8xIP9akYuz\nQJwIsPZhbhaWj8nQuup5AK/CGlYYDhOxUNbLb+0aO2VIcN61CB3yC5/3mtIZ\nrwAOw9XigsXb7kauZjcaw/5wTBk4qR7dg+mf4YL8NOtsFqwqtXemV8W/m+5N\nzPmxSvd7kL3MY9qDw7O6GP0TGaF9d4DulKkU5GEbzt1Oc2sSLdw7Pc2KjvdQ\nqKrJYzJEqWwszJjJBLkP0wUujn54O1mk53qQhmXTeu1XMRIiF9cX1kZHgt/G\nExgOjp+lcCu1beUH7pWLt7dkkSjwlVAz4yq2OytJIBRGMjT48MrBFPkErlV5\n6Smg35Purn9fObWIGXg6Tw494Ta7twfgVg6Wyf1ijLRsVIZjl5O4tYT4JXin\nW9iSOBjvv6syITstRRRR1WMt/bOVqfCl0p4BC2/PnpDuTdyYZV8RC6xwDVFo\nfnJR\r\n=QmU4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"23e7fd9a8f9ee8abaee52fd6572601aa40949f73","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.2-pre.1081"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.2-pre.1081_1586643290987_0.2962813147054404","host":"s3://npm-registry-packages"}},"0.11.2-pre.1094":{"name":"piral-ssr-utils","version":"0.11.2-pre.1094","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.2-pre.1094","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"740fa435821dc8cc7fe2eb6ebea598d608223cbd","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.2-pre.1094.tgz","fileCount":25,"integrity":"sha512-/wZqUMMcuRTEgiQfhm/4HRvgo+d45+JcrDw2EwuIdcjrIGnELlC8yFv+PvcWh4e3xt+FCpGJxg8rMNNcLz3ySA==","signatures":[{"sig":"MEYCIQCEeNWiXAvF2O81tKovdb7F++780dHm4MJcHZLW0mDeVQIhAMSOtTtE04QnrRqGaQBWS7q93Ti/eF8LGb3uNUKCvDdI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemF5PCRA9TVsSAnZWagAAZsIP/3vJ1AgXh6yQxXUq/6cg\neikEv2EsMsEvYJkuWbu0f+CoGYqdNGxCGoBIuPCHrICgZ4BbKhBrTp6JdrW0\nNoFPxRSe+k0MZ7vuyW5SavN3adT9FXuYLudGjtszboi7LMsQmxrdg93YarWE\nNtqr/NQ3DaKvqBDRvNbasvKUqQwVJ6WLHQb4G84DR1M4StbMDs8mljYHNeOp\n7bgsmephEownqDw6fbhET3zucCvTiPYbixI8Pq9KmyPNHhI2UdUB0GYc95iG\nsiA7YzgA0mrV0M0BpXXtibY6gNg5A4n8rT+EIYs16k76kgAHe00JMqNev5sB\n5A9383QZ8kG0UBcdH9crPoZcn+IpjUg9uKiSuMGGUX2JIcXZCiMm7+lxb66c\ntmOOAcbP6L1oDxTNA6WHlrgGen97F/lZ7cM+nbYhxSM5lceW9osQuQjXcExP\nWnmL14x+WTy28ly4ZGsik+5VnBdi+IPsE2bI6lmdPTAzdk+Ys67dL3eQlzpo\nn6RiQPr6Txz0Xkf/uMLkO0fdYvgTVpmcTfpJL209Xa5qvX1OFF+h1z4F3wF1\nl9NBj9PBsso/IU4bDlIDdESyHC3aXWUSApT9h/q+p/nla3XI8maViLNEDALq\nXR4nTRuCqdCYQVaIHtmMfG/fBHiZFdKO/DheINKWcHBwXHzTEC/rcekwomwV\nQ5RB\r\n=5Ve+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"0a1d1ab093ee653fb6ab59bf518c7c977a1eec0e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.2-pre.1094"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.2-pre.1094_1587043919500_0.017685780496008885","host":"s3://npm-registry-packages"}},"0.11.2-pre.1095":{"name":"piral-ssr-utils","version":"0.11.2-pre.1095","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.2-pre.1095","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"58acb120fab569c8d21d89ac72473303e5e4f6b9","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.2-pre.1095.tgz","fileCount":25,"integrity":"sha512-0hQ7V5cOV1+zfWInBwpPww7mN/cB+JeDsiXy8Xt0KdYhf/dFHStlpgJwVt9Arafsy4y8a11/TbqmNA7qTPYYig==","signatures":[{"sig":"MEUCIBRqgBYwK6rdGyDkCIySNnxX7ZXMgsEhnaUixfGwnFJ8AiEA3xHwkf3nuZkXXIML4lRa5tWlWHkp8BJsLmNBzvz9GVY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJem494CRA9TVsSAnZWagAAricP/i3u9ZKuyMvP0ReDv7Em\nXGRZs7Y4L54D8Lt/SZbZ4C+PXupR91idLfOMrdTgmKkaO9+wV6+nd7FLkhva\nJOjc4+9g21zzpmYPCTDENyTLqkTCMzo5FPLYfoJZVScYp5y6QQlkQks8O249\nJBNamwodcryThq5KTs8wUO6FXG2bM+BeMSWb9OiotI4YeZ46lry4P8vecaZ6\nZTJiyJQssiDxc/AudQAXaQD/FqAhw0L8+g19CS2lFSsZ6W8iZqr49BLo56DH\n9VGk6Ep8XXra+xSJ2oGYe+V675IqEdkXVJzI9yK99WBYSBfGM/RXbGiU24Ua\nA/xqL8cEWBcoeDl+VcDqoJXO5hUKoGLg1DPEjj0WIOH+x2/ak9lyGNkMZKjv\nNVFSeA5qn1qI6WlMFbHnR5pHNsO2l6Vc3wEyTs9q5jk8poycM1T5Ii8aM/40\nOjHlHIne5OqE7/szDcT0JVCXm5Sdiq/t/oQKgUnJGn0jXGFIx6p+Zg4+3Fjd\njFRqIdCx6kXHl9+Z8KIN1FfndrGURaRpz6JUGUPr/xZ/H0WawbCI7PqwzQ0/\nnhL6ycz3JA6zx0zjnUI4TZdVjvcR71dxT2lQZ7DPS/WVpr1RDT0IMR1sez5W\nvhxMfa4JiyBktuS1TppDd8cXDmRiUns6XvJQVplA6UmyHfkh7vSZ2ozdR5j6\nhjMY\r\n=jBcC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"4dce013bafc1d17b04fb01b04f5fc4785ee22b15","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.2-pre.1095"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.2-pre.1095_1587253112327_0.7062686730618082","host":"s3://npm-registry-packages"}},"0.11.2":{"name":"piral-ssr-utils","version":"0.11.2","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.2","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"67b29ea53886b7793bb019bce33c74cf50b7e72f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.2.tgz","fileCount":25,"integrity":"sha512-AKP+fdfW87mVmlXD9g9Oca9DhcYrw7EGtqET8fRs4O0We7kJxR283NTL0nttpLNTeFR3hyQ4O79d23tR9avsJg==","signatures":[{"sig":"MEQCID7pQzE8zYB28ieQN1Y6DXpbXtu9UlBp2yADF60wt6/tAiBCExjIr8UclmsjaWDrfvC3CuTULY/tBL9Kye6oqzCjvg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25658,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenAgZCRA9TVsSAnZWagAAEF4P/2SbV9pPBL7D7Cl2s27S\n8CziVB8Sp4OEtvZE1rDQUfLo/dEwcvP6P4zBsM5jnnVZzCw1BGM/HkpdFoMu\nGxo5iQYJPfFyv/daUXSX1jgtWjbFj0izn1LNV3WqTVkBG12pGNAZZfGsnN8V\nRQF4fLwafyswvRa5ForkpV6os0dhO62cnfwzCKjvw0zXM04XaGqb1aCO7m2n\n7hmOAt3X6CvITtdlW4qtxLRwN481baGcky/XkhMM/R9JyKov7deXap9ULqCm\niL2Hwg2LiwpabpP3/fRjGCk2R9P66F73d4WkVcLNbG1nQv65jOdA2bWkX3LZ\nOi2GiwNj4ucclk+nE7NqiMi2rZJ/i8Pkd+Jw9qSRUoJ6RA077oWB3jr2kgEq\nFYorLvtkFNKzIBZD7xOoS/YUeTsoymmsS5iX6nl9HyNeaFXmtSz5l/AOfZ4Y\nlKl0o+716Ad75Pf3KGQdEnPMBzqfJznoKKiNOeRXsWVDFEYbEyWaoDgh3+Mq\nwTdgdVE0Uq9XWmKnVTVy9cDQkcEOizBM/8LluZVm8QSejwTnBPAiEGyX0mCj\nPkiaEoq06ahBRdDWdEu8CxGtddvwcZefNg4x86J4SJxwL1+1j4yhYBFRGaSQ\n5fQs2iZHoKs7hl5WlOGBpG583eEfVDmUGCHglw890C+xCOpp/FIb9u9igUri\nqxoh\r\n=ELPJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","browser":"./runtime.js","gitHead":"4b61732a1458cce64ca91393e8580dcf3742c0c6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.2"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.2_1587283993321_0.27403206039226746","host":"s3://npm-registry-packages"}},"0.11.3-pre.1099":{"name":"piral-ssr-utils","version":"0.11.3-pre.1099","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.3-pre.1099","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7c572144a36bdd99602077d686a7a97289015626","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.3-pre.1099.tgz","fileCount":25,"integrity":"sha512-f53TcWkvu/YdbQsEpwKWEtrhG00eBrLw1MoWw/FfLNwYBAr4iwvCukbTF/5J1nNgyD0ti6NVCAsQ51qHPiII7Q==","signatures":[{"sig":"MEYCIQDEUVdHevCAk1jpuyOQ5R+XJqfBGmzhoHXEqcK/uRk2mwIhAMKFOEaOXaYgEaa5niFH9ceX7g35fWVOBeXqxH9MjpuB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenimsCRA9TVsSAnZWagAAJLQP/3yGwqdGDKFbOVj63dow\nkO8+MYiO05IRNkK4GscTGF3bGFKfzRyvMSLlniH6oi93qw6F0GgewzdgQ+07\nR/qUWDX1uhqA22oEAYUZWZfCFhVd+QBYxIFB8UG0niSBdFGG41WriQgl/5Cl\nzMBF0EE5jQvtrCKhmizLGQLp+plk/qxwIl7hnW4ERUORYrMhsP1Y2LmVSqjL\nSKI+pQnAxO037F0PTuoJlBEvE0wl2lvIsRJjmPVsrOxSDTjydaBormd5370B\nSkWdmLrG42Zn919ilJhl16DukLbGRgbj0Bjb/IhU667CSJ9B/BaFhyizlo0I\nw6VPoMxvcQpqTqXNp2MfNx+1QKQ9eYIdLbDw6xs8NH5hhdBDFtDp30L0RFWm\n8rzhr5TDnHwhFFPfAoYNprBiDj2BuRtxUcXyLlMt1CiVwqeZD2RwSBr/3AsB\nvicCfSiiseUNBk/aPxdKBAAkjCkVf961pr+IEcvTwPuoPoyHFwcSfNogfU6o\nABkpm3sCiFI09vZJsa4j/vGSd8P1GgvH458Vs2aucloocPdYS0LT+n1k0c2d\neJLHfy7pTdB1E2aKuXoawX7JoAXcV4RtA2oe635sZbtY29sGT43c6ggcLHiT\nob7bOf5do53W3pQdjpicdkxwdZzB0tSXh2RsvT2gxJ4lXtwb6WrgzHO92yVu\nEQPF\r\n=0j82\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"54104122704bcb62118f7c7dedb0bcd4ad0e3798","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.3-pre.1099"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.3-pre.1099_1587423660091_0.9761658441169225","host":"s3://npm-registry-packages"}},"0.11.3-pre.1117":{"name":"piral-ssr-utils","version":"0.11.3-pre.1117","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.3-pre.1117","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"79674393dd283b3e9f1d331b4dc545a544698466","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.3-pre.1117.tgz","fileCount":25,"integrity":"sha512-+1L5Ku063lg82K9lOWzsCD+8jztWt9WgzOmp71UKrzgbzVPFmNfruu620gZPokNV0aI7MTrTSFiu4kBg8xIjzw==","signatures":[{"sig":"MEYCIQD8mR78Fa0f9V07PqcpN48OjMFvo6YOzBk/FomIYu7roAIhAM1d9H083O7B/9fyIF5iAJg3WazPkhRBI+48sVQY/vv+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoBWqCRA9TVsSAnZWagAAT+UQAJDxoBRKU81hJhmoV1WS\nzcYYOyUBsImMjkTn0vIGtYD2JsbPBiUhpr8rCXNgT1u0KXU4YazqpYFonnLx\ngHFI4GO4S9iSra5r5+2ZHwedygL0y8iCKluFM3OWQS6s8AmFKAkh2aKJqHvk\nycHNoDAfs+M/mvhXq5kx6i7PXjrMsw0TeQLQo67W6vKRlI/lYkxUs4AymADe\nj0gI/ALJPqNuOM1F5jJJ9QCfjyJaqDEjpVTqBMXY0/ZkXkeqW8ttOPTfn67P\nJZBzG2SFokY6vakihDwEYiRM+1is2BERWBkA7DyGIuK761/dNgyKSiledj3I\nbINvkB6yiTjp/FPr4z9M6zTAT/3Qn6cUAWvbGx8kMdAIDf2xJviojD5Yk0i8\nS57BvZ9467F2zajL00i4j3Omx4/pggu08OUTk/XEbeuFFWohEaPx0zRGzOzP\n8enIMgT54+hQxg9J95Y5fMk7Xu6+tj47MlHtdHIBUURuCFjImGH+t/mBWUlo\nrJa336sH5VucwVYGyaRCYw7rymU3aYNusBtWWbUKIweQ2vwMpBLuqNMoPzRD\nRsswQKj7eoJkXzh++6QpJ46u/3j0cxTT44UQicv/CtqGQHAiQOTtr5FksIEl\nvdb+YHxLH7faLkQRFjKoK5u/XAZ6HVAMjh3jpl9dR3KRRUzKvidPNQNPZK7d\n6X4Q\r\n=rodw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"b5a72285ad07aaa9716bd00a3f09cdf50ac7ee4e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.3-pre.1117"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.3-pre.1117_1587549609825_0.24082687152467375","host":"s3://npm-registry-packages"}},"0.11.3-pre.1120":{"name":"piral-ssr-utils","version":"0.11.3-pre.1120","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.3-pre.1120","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5c515eee285bd7ae9141e434bbdd22162326d703","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.3-pre.1120.tgz","fileCount":25,"integrity":"sha512-vki3Ts4CEwhnpHTrOS25YV/Oj542KuHcDrXVK/UKTNHKUOh/hU7HOfaeXScIy9Ah8cNwjgPyPWFd0oJCcOfreQ==","signatures":[{"sig":"MEYCIQDjC927BrWuGdNJWtDtUAB5sFud4fSq+GhuCjo9fv978QIhAOSNQTjOxm3nYLNEdVeIzrteLRdLOUAo1SWpf0IHitnR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoiZ3CRA9TVsSAnZWagAAfvEQAI8YQW2tO9zQbO9ePwJf\n4A6QMbhAkUJSe2GmcFLajItDZa/0G6IjXAbts+wpBiuzW+T3ch0w9ysdnwbY\nKmWnHFCMuomOdv29oxv/XoubPQ/E08COvPBk2BiHqoO+wyAwERsqikOrwGzO\nv8g6wNIFcNDgw+rgz0amraaN+CQSzE5++F67tnON3yZ8Ell+H67umfwF7f5d\nNZzEOPJD7mGxjijQdPgjQZokQ0WV6hT1PXK3bzL7bbY2hwIPBfpsL0pQ9cG7\n/kD6omORqq2LY5etRwprhqjSQBWPXxgO5DfwymEFhudDb1ABaNaZebZdZQp/\nx+gUpu20L/TmYeh6p5pmahTwROXNsNQg7viCO/8MxL9OZEPUePmJa1TMo6TA\nozWiOasguFtm51/Zk4/+Bh98QrWQZzJBPgs2B0XAKakTgDIRtc8prw6KYlp5\ndVDeuxa0E3hqSBINMJrlVHmUR6Pu2L5lNs6cSgAqDlF9e+RlHqsgTfczdLz/\n09w6WmQHD2v3iq1YUbDHS3PSFb9KUM9Dq2LHbbBHKz1hPNyudGb0W6kzKmXv\ny3GTzpvE0bxO8WgHMgVhsy+gUz26kMS3c/TJeKfDGpwst9KIFv3DOQNp95/S\nzFddSi11j+lhxxrQvEHkmqvXVzm9gcAv8Y3kbQ96uELGF8ikMiNR8rIq8owf\n7ZcH\r\n=7lkB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"372cfcab109f1329fc446082d0b0f48e2d00f6eb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.3-pre.1120"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.3-pre.1120_1587684983459_0.08258515398538191","host":"s3://npm-registry-packages"}},"0.11.3":{"name":"piral-ssr-utils","version":"0.11.3","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.3","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a9437835e22d3ae0a8f5fc29ec8b0a866fe9fdcc","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.3.tgz","fileCount":25,"integrity":"sha512-/PYM/TA6aIG4A5CWFLdVWxNRn1tm1wJPL+lRvm/Nm1apQBfChi7Mh19phWTB3HpGCpeIPMSA35/VHKF2IC7RFg==","signatures":[{"sig":"MEQCIHrCQhEuXL/plOv//DZcH17UfxfwqjkTl1CK9zLSDFeHAiAcoB/QiloWQMfvM8PlEqxbxspN/BfRYduKnS0ejejjTg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25658,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoqRECRA9TVsSAnZWagAAJK4P/2rQaNh7ZK43FH46gNyA\n+3wlRRAFXbY8+vJ7tvvzWw9I2u1bOL7SbgAzkjefBxhKAZpruV6+QYyEVl/h\nbM767ibbYKg+dFaFm+YAkMEPBYKf6nirSd+brxKJ6uC4kZBD3aetVNhCHDnb\nm/gutvENcYxkMJeb4kI9DgU7nccnpwmq2Rxkv8hG0lMAs+Ln/ybhjd5C9VBa\nKyfe64NK4sPWWnnrxFK8BXmdEzRR4F7jwpImBpfKtCfuEzA1oLwtJ1OqT3OR\ngJMq5g0f1Q5oXUXg1nG9VUCexcgnTMbyyrsqi6JC3gyV+DqszcEzhSS9ZtUY\nB8WumFHO7ds3c5l6861W//m4lTMxBSMh3HxbU/1+WP0NhEJJWwR080jaSy0z\nVvVk29oENBgm8rWEJnGU9ofEXjZPhWwEzDPj1KIqEcyRkNWpn+yDxBfVldeO\nKBjgS6LMPmhxIc3SswS+1epPa2XRYcw98Xm0L+u/WXg0jhvJC4MgyeRlgt5p\njepaHThqPubf6ukj8oN3SqHz5wb2NP3wjRThA7cLg3jgkTW31iVoyTxpleL2\nS6FRIi/gbYSd9UlwSG9xDT04QLFZ+K4thn4OUPRHyq3QY9DkwEmk3OV3yO2Q\nGaYdnFLrInIcwfbTLLWrabgvK1WVHSC89UFFiOzsz1lIeRQ7US9qniQBrDzd\n8S7T\r\n=Bc2D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","browser":"./runtime.js","gitHead":"b41a33758bc4e30f57183b3e6033167b2820d3b7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.3"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.3_1587717187638_0.9288320595754473","host":"s3://npm-registry-packages"}},"0.11.4-pre.1124":{"name":"piral-ssr-utils","version":"0.11.4-pre.1124","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.4-pre.1124","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d3f225e218bc08c922f6d22c863c18a94ad79508","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.4-pre.1124.tgz","fileCount":25,"integrity":"sha512-IY6rE+hNtOP4VvURdPGz2GXlLtgayLTvKUT9q4J4m4Fd3D1IYqIpdJEYlv35DXbO0QJrsogZQzcwdRbYVAgfIg==","signatures":[{"sig":"MEUCIQCbxmoYF9LYaMVn5mcXNVRbMwfT/ojZyvS/k30rvE5YXwIgO0+4TUOmMQzycrtX4oEaE6KT9l2DQmkVcUUbuZDlC0A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeo2jECRA9TVsSAnZWagAAQ4gP/jt1UixTBMPzVpIBHzEn\nHT+3a6lsTWNqwjQawP+gItjKTX3V1YcEJH1By8EphcNA+SdCS3KcmbPXCq7X\ncCaEiJN6cCcFJUTF3iIE4B/W3bwzYRiRx7SkD02luEU8KqH0+OgGwajg8Bv7\nhYuxsF8843Fsm7e66pW0DF3mcYrDY7anThuL/r23Z354u0Iewn7N8XRSSeJ9\nEe9RFWhblVSrjsVkxgATEIG0mwome3Xyo7Rk2k5g2+BL3xcL/JR7U4pXG5ZZ\na6ddl6/WCsGiaBZyjU6rnmKRpTGLRopuWVYVpbuNrN38vVEp/XPL2RR/IY7t\nmLZnaGGRqrFJ+Nv2XUPiw23sn/jfAmJGjWSKWE1TBUe7DWKo0A/bNfknYQR+\n/PX1iaMpaRnycJD9GJEWzTDxYClZuvY2E7oSF2UgEDaJncMQgRY4AxYle5m7\nw6zj6ldNG+HSVcYD3KKixuS47hcKYahvj4NpCTt39qMCk2iHO/IlIXWeiFbh\nKAdIS4PkB175vit7yNQ4khvZ/FWn40EM4mMqht3/9oOiYXrZVWyGSGYGyET7\n1rl5M4p8jRjHntEL7H2H9rFztuehhlKE6DUPm7LuLbW8shQnSsPlr/FTmhqH\nlclwBRl8vM5XVPeZjrmNEMSckSEELNhMt+wVc1KHkPbhX7IqYZDBYY2NJJMs\nCbrN\r\n=zhmD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"3015549938d3a7d3efbb8bb79af928e8a103fc05","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1124"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.4-pre.1124_1587767491843_0.5991683257539515","host":"s3://npm-registry-packages"}},"0.11.4-pre.1127":{"name":"piral-ssr-utils","version":"0.11.4-pre.1127","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.4-pre.1127","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"19d81f66354c71cc918cebdad8875a4cb4d66a95","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.4-pre.1127.tgz","fileCount":25,"integrity":"sha512-lpCcbv0WR7BpvAfF/NNM/FQMWs1XGLBoCGupZNp9za7iDdra1z6qvCFtgzZIWvbvYNZ85+pRgNHfUg3YLtgBew==","signatures":[{"sig":"MEUCIFBntl97PCiOBu2FPwHt3OTylWlhQ+ZTky9xiAGdCSuKAiEA7OhtiR2OIpTY8lZV4dzJBttRN1nGLtcOBC26qc6vALM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqQayCRA9TVsSAnZWagAAsrwP/07BKgmCOAyPK0hBvCQo\nX7cHMeQX9kP19IpjEaCRZ2uE0wsrCED00zQFXop+WLtLf4eylI25BPPUv6tb\nb0+2vdEMwsN5M3NUdXHEWCGg40HZEolrl1wEE2A6SS2zGvIrejASYuzncYME\nFsNM33oFpia2jhu+vTyrUc6VVXeH4d4pk6tBDXIHoJoxo8HJtroFrYKt2Uru\nteGAx7jtQyd6nZDVZnHLINK+UA6WUIK4R3A5zqsf3rHnYhR39Ri0xiiL2rVc\nk0PAo4yidgsXP/kHqPtvqsc8P9z7cBvLBjs9ZByDGpToZR70ZinHcmGftXTc\nvGYIl/ZBpuNtDAvGlpsaAze+f8sCCPU/d+EHuTK8f6B/szqM0aDQlgz3j0Tc\nNo8jJ0+npfsVw1McW7RUyj+Qdm8I+TQB07G9wVvCsrAiLscijL6O5BAdDc6k\nKPuHGvVStbRBNYOpWs1nlwGW5SW3Vt6DzYYnmUfs83KP2FzRh6LCrdkfaByj\nmJ653sq0eydAND6M8PnWLQXeC40+tXXGdOdkRmcuuMBYzQDKwaZCQgWqfIXt\nMV1s2dew58JTjXx8kdfLks7m7mI+xKEBvtj6nydv1eKngVOhKUZy7hVog/W4\nV7N+zRYFGHwiHoWCQ5y7/InhYLRyy/hyZy20KwaARcqGrPsnLLj44ijC8GcB\nKU0B\r\n=fnDh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"7691dca9a0cb411bc472ffdabb09f3847cc8f9d4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1127"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.4-pre.1127_1588135602078_0.9476613273601453","host":"s3://npm-registry-packages"}},"0.11.4-pre.1128":{"name":"piral-ssr-utils","version":"0.11.4-pre.1128","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.4-pre.1128","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"83fe31f97f2e364a0887d04b28efee9aa69de829","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.4-pre.1128.tgz","fileCount":25,"integrity":"sha512-rNiONoXzgXXeaeGk5qrUwQkMmf+kicMcYoItRaTlp1uDZdS9Aeplpc1vYVVdShSui7dMRrLFk5PXvP0rDAD40Q==","signatures":[{"sig":"MEUCIQD3uLwmvjjnT3yofNRgbIGD9AD9RXR68aSOC0zYQq4cNwIgOKorlyZIBgCau/A1mau3fRMiLad9krHLg6Ankg8cpwc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqXT9CRA9TVsSAnZWagAAxyoQAIZjO4z6sRYuMQ/bOs6/\nT8y9NGkEhY8VXCgJogfEQobVCXuH+DLG0DLPZO5xJxWyrGFNnPjY874Zx2ml\nZqZ6XTFOIAxoiv1UsZefmwc89H1QMmjOfkMeID+IQUX0G1ucQkVGcgcYLjmq\nY+qUunsWTnV0D5j1/G/1WqurZZadf1LTNgUNUkHMkooXnGLNtyMxjLmfoofc\ny7VCGYnZX9chDNukSL/AU9HMp8qtsJZeHaCUow70yo8E2ZJx2ekgoOwSUNgU\nBAopX6we26NU5EI0TWMSlSC8ITNqs76YZla3fuK4kMnm8nOqUNAtkVi82Ria\n3jA61ZbVKgcmCc1SvfVpPBZ51BTH78KA45QORnLdJxWAUX6rAb/nRuVKP0dg\nD6U24Opvp9ZCULBEuKJ6+UNDz1op6cQB3mxpY+JrtiFOhFXbCEi16HoLMm98\n3yKn2KwEYzT+BQKuBazRnzALtIoFSJcorg48qb+uvst1KgJomRyrmY6sPWy+\nQSOHYpmxB4GClkhOOs5+jV2Vgp2TXsVZdfWjN6ppQFxAO8kzNBtKxo0dThIn\n8GII2YWe+kpF14GRfVvbtxMcJkSJQjtaeN/zRhuoahnZ3U9RlFqRTA4sxFd6\n58nHVsJ4wZlHv0/tDEq+XXKvo3zj9tCQTaR4cRRUaiD1GBxb1GtXeLeAGiFI\n5URn\r\n=fGYx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"b704197e9f35e84d59a82b089f4f1839044f2c18","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1128"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.4-pre.1128_1588163837014_0.08352606849375421","host":"s3://npm-registry-packages"}},"0.11.4-pre.1130":{"name":"piral-ssr-utils","version":"0.11.4-pre.1130","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.4-pre.1130","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9bc631c888787faf37b181b49e41d272b202ff1e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.4-pre.1130.tgz","fileCount":25,"integrity":"sha512-vMV4bvXZLggRmgl9OSr1WItR5eLa7NRsblGGM88LX2a4MygRkX4atRpHD18MfL+n5zY6qpluTkOEuyHe6wclOw==","signatures":[{"sig":"MEUCIBmmRLkGpCatNdPw1zi01mAAbHysBYkEyO8OiOHwGiTxAiEA+QSgBXYRG+Ja6hn5NWxxLJlPDODR6Ay20KNLxeGZGsg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqtJACRA9TVsSAnZWagAA5VMQAI1vUli/6ZTvF1KcBFJK\n4GY4mdwyd/djGWaYUnSSRsujWhO8gdAa6gE9lu95Eof0OEpw1XQf5LJjkxWz\n7Ppyn5hcrczvMUt/GJO0STWhioBXPWZKeo5+SsoxoVRRE7G2bE8W6Kx/NRRo\nlJTKshMayLYOAVkfJ2NiQZbWSRkDUHKHc290xqrns5Gtryk6XwPv46H4yMvr\no0tkcjKYoYZJpf+tsf6AIUvfWz+FkeE/LTx/Q/SopTUvvv4ts4THRGOxwy7n\ncRvAp7IijS4nU1QNOjc9dWL1v2kO9s5/PIL4hBjicrZ9ybBcjnDkL5UrL7ut\nzgPeHF7aaNlOnH0FrRgI162PN/0+Fl9AomIoKDauPqz+CnwAK+JMcmgOZ3Ji\nDf397vii+RcPzcBnF4jUpYWPpcHmbXy01/xM0OYX9MD4Mp7dylgx1ySqk6Gp\nFZ4z0vrCAm64KNnDMLLXGy6a2AAyy7NtTPPVC+okeTzl8DkYAQGE/KXeGk4Q\n9MJPxHenkURPKgv58mzDFC0D5OItjJhLRzXi1yx3MQEYgUZ4llTc4jnSwIry\nZpoc9uioc4oO7JMtxvA4EOovqDE8Rsht/pcoutJ0AmF92ZGScVKQDgtApRjZ\ng0J4zggvkGbuTR8IEGLTyJOdyS9HrfpT0U3yMoqgVEN1L6OlkScNXqhJiF4Y\nYza8\r\n=ukuf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"f827b542687062d5f69ac0d035b3c0e1d48f83c3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1130"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.4-pre.1130_1588253248056_0.35859313373579993","host":"s3://npm-registry-packages"}},"0.11.4-pre.1131":{"name":"piral-ssr-utils","version":"0.11.4-pre.1131","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.4-pre.1131","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a1463969d98d9e0efa6fb6736280e5b0e3cf3100","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.4-pre.1131.tgz","fileCount":25,"integrity":"sha512-aNtwjl/D16C7RIfRLAl5pXN1msPDi21JZmYO5Sqh2hH/0VbN2eJz7Qo1I96olIeNd7gHbkXJKnPw0AyC19P7zA==","signatures":[{"sig":"MEUCIQDgC1G7BTfVR4zjHlnCQ8rXqOuLmSPdeGNYaAC2IxKA/wIgIXSV0szOsOgtNLP6tfAg9BXPi0D/LdBvi3FiYTx5lqI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqt8PCRA9TVsSAnZWagAANIEP/3Jard07s1VIYNcspPs4\nCAaIOhlBC0QslwDHVOpqz5Kqg6QlZuHLul8Eftk71+Bz7eYqPiFbz2JVZKFp\nOS7E14jMvXHYod+t6/8vAowFUv07a4DlXtSPDSr2E5TTJWspd/QH7YySIAcK\n4v1D8L4/G3KioaJ5U+k9j2ScV2jC55RG8Q+PZIXf4FXCW6nWoSD3LLuIGEwN\nJR+fipZaur9HwfphAyWR2RFtk8HKJ02st1tCl5ujAiXPycrRwUC7AcHPEAA7\ndkZnabcl8JY2vrEbs+I2p7tiWia7xTZVcagqRDO0ph7LbuMcA9qtcTjJXIVw\ngCSW9qFnZ/Q6hFdj53VFNfa9AoANWyz+HpbqWqY+g9eLF5nZMGNFws/drmGb\nigsbSt6mX6DLuADF0+W4TIJVUkOP3UULxD3FzwMU6g0h2DBN2aw3hGcAIDbm\nnlEZ9/fPJ8D5bSWp5ZCN2kRwzFZDmmE3DqWsvhNQnt5xQCtUhUReiNH7DZ1n\nR5lxB3DwtYvVkezRS9bj8WBlhCjd20vf5r7ebsDn2WMT9vFVFeImK+Mj/xVA\nQXR7JeMnZE9QPTKVCobwWPVfXeKz0SLqBkU0UtygMnUeSITuuuJ74zRMCWWG\n2fjDWkGzFor/tVKw3eYlTRr1vePNBhqWC3NIiQCtISiBFXvyVES+rNsQT+/3\nKaTg\r\n=AjMu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"dc3c156f8fcf7aeb3be43787bffce84aacd6a3a4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1131"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.4-pre.1131_1588256527324_0.3701493685340367","host":"s3://npm-registry-packages"}},"0.11.4-pre.1133":{"name":"piral-ssr-utils","version":"0.11.4-pre.1133","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.4-pre.1133","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4d13028123d71587890dab23e2f7d3b31d161cd8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.4-pre.1133.tgz","fileCount":25,"integrity":"sha512-tI/fr9D/BgUSaUvNeZgaYoBZKNnWQEkXm2hj6oMmwKdgrrNdyD3Ok51zzGyzf/Fh6ukNUlYnmgAOoyf43LLwnA==","signatures":[{"sig":"MEQCIEUbbsphopzo/vpz6Yi6dNEVW+OkdSiYLekjxUjAeMGAAiBqVGlWeyqqTQIWcR171gx7M1IUji1uq/Qe1HMP8mzq2w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJere2bCRA9TVsSAnZWagAArOkP/1P4ZvazsHQZtpFsB0YA\ngYHqQmB8LC7Mdn3BHXe3ygCh4TE38cqjvwNi/Hf+AQp+S+tVryRHpUaqaG7s\nIlN73V4fliK6+aJq6z2hcoZc5BO7E20xjxN0nftWpokmA2cuaj9UShfG23wG\n74GNG6yzQkCxVYRtV+sKllGz5YHaYHWDy4DVnLuM7soiwc5AGb/kLoDZXYPh\nlHphlphIJr/H8xTTZMuJESPe9tZOeLByTjZqu5vIWGzRHHVW/aR0bW7gsn/G\nSL8dk85R+ABrrPywdru7qSrhe/mQX97fO8lXpdkHgJdw/gObuCBTiDAsZNBt\nR3iS+bFatvN55r1dxlUSlzcqlUMvZmWHZ8nVo36elIyI8NB5PQCMcVTUUMH3\nT5HPOEEnKwaFO97TYUe/qoE4QjLBPp53V2NYyDqZTK2mE3q+6T1wh3lUA48B\nWsBfaIB/J1llDqwaCcHt9aO1QeDOXCEvYrND/fLDz2569AmHA1mM4z/or3AD\n5AJzdBihoLy9BjS0mFCd0f/Xnj7EPrdxWi7ija3XeDOVX9eKhE+/3WFL0mJK\nSe4r4hpUvx9yexAcMxgsOM8c563MRRYiLnugGcC+h3BsH9wwIvl2guj7wbhZ\nQupmkoatS3FF4FeFCe86TmWGglCY4HwqmJWRU3QnSBffO8Mj7WXDWhAlvhPi\n33j/\r\n=JH7Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"355d3fc1899b9d3562e202f679095eef53023026","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1133"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.4-pre.1133_1588456859379_0.7028555652535369","host":"s3://npm-registry-packages"}},"0.11.4-pre.1134":{"name":"piral-ssr-utils","version":"0.11.4-pre.1134","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.4-pre.1134","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3f96cdd88975f9dfa6481a12feaccacebde0c92e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.4-pre.1134.tgz","fileCount":25,"integrity":"sha512-7KoLnzghENZqN3LVabmJ0BUMqBW6NOQPaL1l1Ol2Jtb7yZM/nDnmJwW0oZDtrB04dGqvhiF44zH1qhKORsc9Lw==","signatures":[{"sig":"MEUCIGOriMuMwL1NPEdigTeud0kvrImXOhgTt2STdmwdxYhIAiEAp73LbXwHLLZv0+bac9iESywrS0j9AWyoWdE2FqTcfj0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesJF3CRA9TVsSAnZWagAAoUEP/j1NnpMr+Bj4/+AaORw7\nfrfoksKK4luzLIEytWfxOklysfFUqqdPbafknbJjJCK2gexW1W1kW7LPtBrh\n1nUfJZ6ebh/zOTP+G5jJuHJ19DJkuLaWBuHMjUN9Nnzi38FH+7/4gh5B4mKE\nYP+dWu8r/1XC6jWWjhxkbOCONfTLpYeuWW5yoXxeDPI4bpNIix+KTe/9BBwa\neMRwtwLRMKCqwK0OgrmWt5PwcNVGOEFh5DqRVxSYRctso8eSAIh1MhGv/RoY\nG5LLV5GUm5ELlKWMJiBaUN9oGANz2oTg4E8uly6pHmhnLt7TFkxiMRVmot4d\nN7kIcjRbrjM87AxHjY537gQcYP5TIE+Ew2r6IsJhHYNpFqe7BGekgulP4L2C\n8/hkmUdQMPbJTV4DVmty2Lw/xmBGu1SULCbSZP1mFpU9xKjlQRBYPrjgGNCA\nNj9ZUaP/JsIZiEdQJxzUC/NAdJunPHiTkl+JG6GwWu6P10eP70/xyJBbO40A\n2TMJ64sfNY8EJaSBHs0XGm9VRJZiUluuL7ORWOZlGJsCzwe244kashl5hvim\nRCmPaIp1VF3N0rXf5V7oM0Kx5REZgBltfpBARTfP5s7DnuHBnIOJOXxoAt2V\nLzaLYbAU26IoWPn2x24ULbCoQKC35bhaYF6MzL0OFqZdEik71Z93m6ZJ5nWo\nTKWD\r\n=XfYG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"d9908d8b3e18c432243ecd832599c5a34602fff5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1134"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.4-pre.1134_1588629878868_0.9276959257291435","host":"s3://npm-registry-packages"}},"0.11.4-pre.1138":{"name":"piral-ssr-utils","version":"0.11.4-pre.1138","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.4-pre.1138","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c79b00c0c9f2f1fbbc6c779fcb06fa4c9fdb650b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.4-pre.1138.tgz","fileCount":25,"integrity":"sha512-R+qm//0zahEkYH3GsPKq0SMDpZKYHCSlpAUzuFPOPCnvKfc1XK/Dq0s9QHhKdrhmg0+mTX1q8TDbZ1FqXlcTkg==","signatures":[{"sig":"MEUCIEml0uKRMA2+sX6kNDVUWsLA0/i0ef8la16Yhtk2JqgWAiEA+Z7t2wtOHRTtfL3CjmM5LvoVqx8M6caoARmIvx6HQJM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesY+TCRA9TVsSAnZWagAA5I8P/2UnMaP6QX6iVZAHKVHx\nM14X+NwBoGnWRSDJT7J1Wp7eeC/+pHarJVrOm6zcQfiH/T+hsIRPR35HiE/J\ntTnDwxp0LkSh/Hj2FR/4goRqi0I/cmJLeR+yEUSkQVt+mSi3CqwlQ+d74iQz\nM4A1XmgVwgrWhgfnw+AS/Lsz3BIStxZOO53Zo6DwsX/JhhZV5BxLR+Qpfg/3\nWsowkINS3KuctMRRNdbuMwfiMaAAQfC+kMLIGp4M7mrHM34RnqHHYg17WPOo\nx9Zstj/wuXmrdSGWux2K1yPwh27YQ7lGwsgtLkAxXsxBDGP7wO998EGpbAO2\nCTfohBbrJ/0JT8S/zs9XBki3LxnNJqtP7ZBcwE91cyAAM4j2I3LrgS/8Tr2K\nM7Nrz2CzaIUPxmSVDApkFHGNIUyB5SIBhwb2W6g/3B8zQInfMEt6o51o1zsT\nt1YViz8E3QYZPL/KIBIUyrbmxgJ7oSn1omoJ2ztQLa9Ps+mn0kGAgclxPvH3\nIuwVhz/bw38gvpIno5Xw9gaosQ8muHwAD0Z9+qfCXBiMz9W9BEEsNf8JnnRF\n2uYYmyzMwytdFT/Hyo4myZVEjOVPUccpNPJUCGeNkW9zivgGbxddjaDjUzE4\nzzTbf1gBIPKbyIAyAjkyuPLcAqieRjOMyzMuRLKYi0u2sBnWJWTyiYMNDHZF\nk5Jx\r\n=BEHU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"5f1285eb84470211707ce8589692d921fa3b95ed","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1138"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.4-pre.1138_1588694931133_0.2253860476915286","host":"s3://npm-registry-packages"}},"0.11.4-pre.1139":{"name":"piral-ssr-utils","version":"0.11.4-pre.1139","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.4-pre.1139","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4fc82392dedbcaacf685b70bd64611979b3fd82d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.4-pre.1139.tgz","fileCount":25,"integrity":"sha512-OFyx3m8RDMvhgc3PVP7CxUhKj1cPQa+ZYeBGDtgtrMjVUEUrRpV2QbWpMo4peOsA6PKFyIvgXCS2pkCCNAH9Sw==","signatures":[{"sig":"MEQCIFLy0al/iHtExWANk7OXtMIxGVBoJ6ZxEonIf/Ph+JRGAiB4cn34NvTRy3eVa/1fG9cnsAvsxlejJEUEVHx2OHEXYQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesaBfCRA9TVsSAnZWagAAuiMQAJp/OOvlx8SLJt7IP01/\nTMiSfpVh8u6mm28MQIdOHdE+0gFD+pLV51Lr/Vylvbqk/EYMwZYF8sh1pAAt\neO9LTh9yX+jQ1COnR9rKIUlrm/kujT9YC8kwO+9BiguXAJZQ0UlIq8xdPVxf\n1ZKT1PvbVx5b7b5xgGSAV9vKsoLcRmJYgqKup5gl6gVHsEhrRnIPJBnuH1nn\nspsUqdxAqAv11PBOoOGgpoc89XPZfbWhDRnGQYDA5IwNouWzeJWDIsRk9Lar\n+MbYHwxI7PwK99ExdqvUrhES3BZux7ZrK8MCljT9BZsX13Ld24y28CG4jjEy\nDeSOsWTajoC+WTg3Gjf9tjSnDV74PwYn1x4LAT1JL1IwH31VCSLzXdatqprA\n7k8ISmP7uWF2/6M1FpXV5l2V13DS/BY/dMa3OZnNXUKaKq77gi4pP596lZl+\noPoJoWfl/R70fRpbIp9vrVpnt/AsjSHY015FOrL/aQTVvJYp1qY0tFD20ioP\ns1qLlg7nzKJAIXoXS4M5PlNCGgdkvegAvFkzw3C78pUODKx71eIjwyFJrpRb\nsblEbE2oJe4S2EpGqQmqG4Sm0oO4TiP24CgU11PPWas69qlJuIX7oWsq2WiP\nPB+t/7zmJ86XHN4O7WC4y6bxYWwvmkky7/W+CWRMv/Aaq/o55GwhDMA3e2/P\nhUzT\r\n=gyAE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"2dc3a2efe561ba73f170543c5af486278100778a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1139"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.4-pre.1139_1588699231103_0.631249222417521","host":"s3://npm-registry-packages"}},"0.11.4-pre.1148":{"name":"piral-ssr-utils","version":"0.11.4-pre.1148","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.4-pre.1148","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c80e7110439ff4571be028a3f60aef8f752670c3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.4-pre.1148.tgz","fileCount":25,"integrity":"sha512-K/L1QYf8ZzfqyQwZPFvJ61+9p/vEETwnesS9JFPrY/vEIuy+SeV4yQ9BGknn50/qZNIyIiP03imZwF5xmHjv5A==","signatures":[{"sig":"MEUCIGxMf2fOHVNTKoH94ODuetzRxESroAOtpJ8Lq5mAhhC0AiEAwfKF6QrMRblWpzTJcUscX36R5w82A76hnLV5BwPLm0o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesp/OCRA9TVsSAnZWagAAhVkQAIeVyFjFw/0bzznr0+Dl\nWqO1TFQa56YPxEISipenK4+dEDkNXzU0/3O1Ei2zxL/PADF/xrOkgDvFRfWZ\nxkByP5mUeq05LElLtDf/o0oCUF31HgrdA7/hoocM/ae48EMIoMKArL1wmjCn\nkYW70coO+7uY0Yc3NKw2hoaMlQrrzWcSa4pYP1i0UO8uvHd6vJR68dgchCvF\nHdq90tMhsMFGAbe1Jh/5RwxgIYRU2RLuUFjcwaOCyYwpIeBnCkJUp680vtE9\nzmSV5HfeyTseHjwRvXyG/GcQwMqi4VnkkdLmsqQN6x+sqQ90ZuC/FD80TnxI\nnlGZk8+MzQJDtZ5ZnQD2aGcILVPjKspxYva7BFZ1R+Deye5sJYUKWpwC1VnW\n6Hs2jCFzLs7mxzbn9IuqXBaV5OjLJtvZjqPSp9nFsFRDCNuItm1B2A/1qYyp\nPqQ3YzFztBs6cHLPih/oUzQwAQuJo8VAdIOAT+sN3mQBBXQ7vpG6k6dm21sm\nHDVLgsm0m7ug3u1NR5NxIa40tE16/i2/MF0jJw2QxUkUcvQR3Dt8tdblYqWu\nyBf4Efgm0/Ds9hCBr4a0JRHJd1zFWOtv05KBBplz71McL4YQYY32xxAGswKD\n8FghcgLzonP2Mn79Gjrku4OWkrqHEs1bsX5xm0UKAR2C7HVbtURIc0vXlFB2\nv5TJ\r\n=9I1M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"321a77147c34a096138b46b09d8f07d71dc8c414","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1148"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.4-pre.1148_1588764622481_0.7315257176276533","host":"s3://npm-registry-packages"}},"0.11.4":{"name":"piral-ssr-utils","version":"0.11.4","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.4","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d022891a08a41a2fd0bb71fa3ffb12d38c576f51","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.4.tgz","fileCount":25,"integrity":"sha512-dDcSeBQfsinTMCEtZkobeU6UvuJ+Gl3HQv0PLPIOg5trjAw5fU1HL/SQDqsa0wAO28OBVHnzB04dTJpIcCrmgw==","signatures":[{"sig":"MEUCIQCfwajza+QmoNaTCt5vcVXgHpdiBPHPn4ouuGGuYLRB1gIgKkTVmWqIQfI5oVgGJ9h1Yl/D+zuRWstDe92jIba+i5I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25658,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesrelCRA9TVsSAnZWagAA6zoP/jGs6CoX6CpR5oVC6MxW\n1o0m0piII/MCXWmd38ANt9Do9o0VNCkpnenysRFxb72k1iybuKKJtZjZ9aFZ\niYEy6Ts0zafvZS9dUJc8+cYQrZfMsi/R5BX41+nANv4Su7qrgyYZif1gLL/m\n0CQEgfG6mCl6DR6wPAQ7Zn5gRCcLZcMvsZ98NempUetj4swituzFOfem9zQP\npvs/agQ5UdB35qjxrKX+3uFUQLhigXRi8rk0psCCNazmYWdEWUzINLD699D6\n7c3j2CD51Bn+TSDVTv8ifodpFnU1k98HrArf7CNgksoP2Lo0on+n9ItUsTK2\nQekjinXXnD6HoFGLG6i36sFxym7R22tvkZhNNTvEne2156Mn9OWEgIZoW7BI\ndnRMHMCSMpDdVnnL7YBHQBe0YhBggsuJU60z1mYmSiYNMlKmfmjFVl3WvZUa\n4rZeBfI8/DQ8ZoX3HE4rjQMAoUNKMhwx8DssmV3WXKYhLZX99MXSRDjZS7La\n49fy9iF1aKUIBPPpGVgq7o6Y+B5bNv3iQ6mjQ/Z6KyzhrZezehEgqRmK8mXC\nTsebErIwPXIiQpLzJ8Pzx7El82afptvjZMfyinMw3VuEaddDwSlmjmoN54Eg\nOPHa0aIUy3fOjKfivnSuUUMv94NFqZpciztfekPi621tPhq3cNSq2hqhyCag\nJFJ+\r\n=6+pE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","browser":"./runtime.js","gitHead":"f523ec865d0e49fc98375dc223aa893bf30210c4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.4"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.4_1588770725161_0.35147097517030534","host":"s3://npm-registry-packages"}},"0.11.5-pre.1155":{"name":"piral-ssr-utils","version":"0.11.5-pre.1155","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1155","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e97bbf0348d07977650f79937ddb2360f50e1963","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1155.tgz","fileCount":25,"integrity":"sha512-pgQmluo3Lg4W7qIW3lG2XLS235l++zVCEpDxqG1sjPeCM+EFlm08oxpbZ1UFOCTQcZFIsoQfk1lbgLuO3mzKhQ==","signatures":[{"sig":"MEUCIF65rdQ99d3KuXFQN0T7qzGZXyfGD0chjm8UFXCdQ31ZAiEAtH0x1cJYxyJB83FuW3Ih3Xjd0p1fHSjIc3oEP67cEfM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJes9q9CRA9TVsSAnZWagAAkmwQAJooKueH5UUGS9luDO72\n32uOTsJywwJ5FirrqWkFgqWtTqCQ7KsA9b+mztXax/Ndiu+/O3Ggzb/2Rl4H\nZ8jeVOT7qtz8lf2awNaykuEiqXTbpUMcyiH+oZ87m+px2ZeyXvmCrWpZACh7\nSRzMmI8tAgV/jho1RaGPCY2IVTGr+SlfXVGJfL90fCARaB2rcMSQB4HYy/Hk\nyhFUbc7OKCTpEwkX60AhnYjvit8Pxu00WrkWM2pK/wI3DzzqnR01eIVvZg4s\ncoCE1ew3zUDI452gT6X7bGWVIhWCb8g7eX/OiHywGlA+DaQLZEHIHrpEw+g4\nl/TuihWWKc/cAUbT4etRaBHImRyUzLRZY6BqWZlcUCdHtROBgcgO8Oyb53N/\nXp3edt5reSu5ki6pFWu5fXURtmciiN0rgh7dl1bRwdSNpRoiz5p0YznmmsWD\ndvzG+yp9ti9m5rWQXbrDsSpKa2zPzW4tBF/jCozHHBsDRgAEOVzIssrcmKMn\nyQlV5Csq/TenGORIbmWr+CwjGetMSZN715xhXpVnrycXTimNYf59d9S2w7pC\nxHmyWEhcDyAYyFFb6BjjPY3OBkkO7FiefOPsa8LqEiucZQlEJnk+RGvs4CJ6\nwq/Kjtpx+CvcKcWgLjYfcTnIVExRWkkFnUC2+AF8qwuxLZL+aMYHYVgAso3X\nyrZ8\r\n=m1x7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"49c7c465afe4ff5c075e6b0cd5d341ec617e03d2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1155"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1155_1588845244834_0.24074470243956836","host":"s3://npm-registry-packages"}},"0.11.5-pre.1167":{"name":"piral-ssr-utils","version":"0.11.5-pre.1167","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1167","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7580b6192defc1e6d39f7d422820586b830c9ed5","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1167.tgz","fileCount":25,"integrity":"sha512-g4jkbrDGBCXkCaYSboKxnvLL1Ckh+Yf9YFWIEQ8ANduiMCA+hYHjca8ipzgIrmMQGO4PnaRBXlGcjh49Uz0iDA==","signatures":[{"sig":"MEUCIA7BNoyBXalsjAJ/MuayC+rfTRuAfseuWVy+IRSxHIlTAiEA/VYvUczk/qZodsZn5/of8qLiudxh658Mqch0CFVnlYs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetz4XCRA9TVsSAnZWagAAxPoP/iHAzWPuKZC2+w9Cw1CH\nmRJ22NJl9qw0tHFQGqrw01kcskCiI5YsPr4gk4xNYlTXtAELI/jYgGcp3UBV\ng41ufpzJun8H/Rbb+x9Jc07E/vPkgdjyFGS8kg9Isap3dFRi3GD0qAitx6gx\ntLWHxJ+hkGqAZwP1W6bHc/Fc31mgZtp3X4c5wrB3E9fIFBa5AFAJijLFOfCF\n75LbSShjVfBCH9wZAhFFcCsNfRHK68CwRquQQ+8IgyrslsQzW0rlIQF2Ngl0\n7TJ85mAxGmt8oXTXRka3zbyNOPuBqhauj9HXVuU97VGH8n6myuJSQLlo9pAU\nHOtCb8fSDohukJYpKquQDiVKTKRIUPmUJaOwkkA1g4prxd/3L9hUDNkZf9me\naJ3FBmUOhHYXGXUt5yNIVg16lhBWM9TOGZ8Ln/jV9p77zUUUcUJj1svd2SJt\nu/SczDx9R+A+zcw4irxtQnj44NXJ2AuJL5BiAauweOPhOkJJeD5e/ms7Xe6L\n5B4OzHS22VxRnivqm8WY1EGS78J6AF4/4so1BZPbw1PX1xkS0Qx9NvuoYkR/\nKwJG8Q0LkWBDFAXvJAFs1DwIo9k6ToIuCsuU91YMUoD3qq56QWUBPd3zbr4p\nv+ucxA8vxlC7INxgmn9uvDHnHLloMlaWwDDqoQsEhILN/NAssqXFG4Ep+Doh\nddz2\r\n=QMOZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"1950b265417698707223cd3e95e1b49946bc8a02","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1167"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1167_1589067287460_0.031988872176357486","host":"s3://npm-registry-packages"}},"0.11.5-pre.1168":{"name":"piral-ssr-utils","version":"0.11.5-pre.1168","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1168","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"79dd3042e9d874b67d3323ba0a512a321578fcc8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1168.tgz","fileCount":25,"integrity":"sha512-mtNqdKUHYSglfcwJqb42GTQFxtonptZ8XMGHOycTtWO4764g/p+njaxY/dTEFDO1ddRlrklwDuTEW2RsMVzONw==","signatures":[{"sig":"MEQCIAFCUuq9Nt+e1xOA4TqK0WHrT55l4XO3ozEbZIjPEpZwAiB2a0edC4igQoxtt0Lgi6VnBSKt84xKVTA2FNdSqsRU9w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJet7jTCRA9TVsSAnZWagAAzHYP/Rza4ooJLtB3kBaEibW4\nKkPyqvKJVermxWLTN0fffii5A4tgmexOOX90GDPpVoQllMEwyC/rLY/2Z0rH\n1JPPcmXpFgDABvgZgcOVmU+H3cTogd9Yh8P4OiIeCpROc2uQd8EfWXEvJkAq\nM3o2Rz2VrbSTSOVWPNAxMeuA8vbvKDBNaQi8YVV+jRboBGt4zBU0pL0wRJMJ\n+Stu5FUIa7JfVfg5J1ULSpWQCTfMH2Kr8DKHvq847yMPFZG9aezGjYrxKhgc\nUBf5A8RFbiNnQNqI/eCJtXUttMMckO+JICcjLDjUMg9Uuzse+2m47Kq6jZqr\npj8sVKkblDdPoH+F0DzThwjFsY7PUYqTUY2dWiSzGleSHDn2I1sYdQbMlnqt\nG1+XV9y8clzOAKzASIYZ6tgDqOlDxD0sFs019T2cCulA/uzbipX0xvL4GC4N\nsYtjsLXzTvzbBsExNU9k3d8ti1fgzPRP4mj9ILqhtgR3ZgexkEJPPpTlNG6h\nWkuxSA/L/X90q0w4tkHbPIxWVBGwIXo1rwi0qzSyxiOL5tKBX1EWzyse/mG2\nW7WBmUaIt5IxDZ4ZFvsGMMbIBEOH0iBVgAM8wlK8XsW/En1WRVMZX9jpjaFu\nc0Hs+vZlEzF2ctkQAPBgHG1rXPDDNMqpqK7Yf0+IEs+m7mg3SaCcr3Xp32E6\ngbRZ\r\n=wdfq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"20baecda67f124622a31946239d077393dc78cac","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1168"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1168_1589098706729_0.3677138994686233","host":"s3://npm-registry-packages"}},"0.11.5-pre.1169":{"name":"piral-ssr-utils","version":"0.11.5-pre.1169","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1169","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"71f200076ea2f653d0096629519209960675df3a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1169.tgz","fileCount":25,"integrity":"sha512-2PypW8N/MzmvdCACDcGFSZfrEQJLvSF3VSPpni+3YuigXOZpJ/mwgpL4k844FZmE4mxVvPgH1D9JbV6g6VkIRg==","signatures":[{"sig":"MEYCIQDq2/I84X9PNo3wfgAKUvZ76fHq2r1Ha83azYU4+W5AWwIhAPRN6JUQd6GZtOWWLOY+r/hrvSGRsHRWAhetdUDN9sO1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeupkkCRA9TVsSAnZWagAA+MsP/1IWbUfNvRX4sRsytoaM\neIRiqsedcXfhvE7RCt5yFQmfBlCL3RYlqxCKXBHdyNup4QR7iqhtncUzgvW5\nkMFWXY5JU2erLilAl+lJwBaKkBioGtIleiBjnAAifzVbLQ//7AR1CLb4jpY9\nJ05rI4YyfEJAo7BZwheqYZ6nfQMk1KfF3DtRsd2mOK3Q8TCa7b/jFgeOoMR8\nd8rMqUpkQhpE50BlLbFWeEynmQ2Ja+C38Kvf2TBAX2dlvyAh449lfYUfR2qR\nMXd/2EyDaRvVAZcBQIG06htCB+DPL02zV01RT4gfm0ChfoSkONFoXLhBs9NK\nCa1CyNW0rnJsPi/HXOgP8wNjvohnrr3MrOPxQd+AlV7W5G1jIvGYQwl6djoi\nqUlW63qva43nkw8L1PniNvB8muGEBpTxpOA+EYgKXmakJRmrazyofnGBSmVR\nKjmFCiEG0vyvyShNu/hl+fxAu/tD47u85tnOgAgG/fb2yrtfGoaLf/RyyJ9g\nWuxETyCHCxj0W4SFKqDsPuetstFUCUCpMX+nNrtgHKWqhP/eQZAzWDTtoeE2\n4ZsEKnaHIAygnGK+mzh3DHtWcX4auyB5UQEL/qkhfpZ5bETPibPMOLbnY7/T\nZqmGSVYjZuUr5dfS6ErTMfPExveqDpJTW6czOjV9FNRlmTMCRUgMfpJ+D3oD\n919b\r\n=CuEf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"0263b1f8c975ed206d4b0d33b3cdfccb69d707ef","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1169"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1169_1589287203712_0.3625388074149509","host":"s3://npm-registry-packages"}},"0.11.5-pre.1176":{"name":"piral-ssr-utils","version":"0.11.5-pre.1176","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1176","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a2170cfe07a17e5df726e4f8b43e7b686caa5b8c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1176.tgz","fileCount":25,"integrity":"sha512-ptAsJdkVFdcBh+zrkyAlmp+6PtU7PcKLAaL6+G4cbcGjxvolQJ9uk8V2y4DemX5IBqPoWgtw4s7t9roL+PgT5Q==","signatures":[{"sig":"MEUCIGj5LJqd86w2jQobCvqrhVr/5sLsvf7rgSgBNhpaR8i4AiEA6/ASTmnGtO7drIUuZREW3LKOdDd/BsAWoR9cmJjpLdc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevBrfCRA9TVsSAnZWagAAbm0P/jzRcfnwLG/SOsam9WTJ\nCcVTQZ+eIhMOLElJdDC2bYd6x28PGXZYD/e3cM4ywuIB1MEpC1NXqvtHHGN3\nkV8qyQL2wifGxHQt9aiE/FZYhe2MpbnvbI2/bCYe/90AeMV+4gUsgyiY4JJ2\nRccqUFzhc5bnohT9DwoZG8GT0riPxUdFcFYjxz70RfjY1ThA5amUVSU/rOkj\nwisqE4jz64GeSoIXAUwekbYbbNsNWwAvRmGuvmPhLhzpx4kttTgr4sDw7R9j\nhmtMH0EoaK+lCtL6MXp9jv8YVtTVZWi2L1e0/gDJApv5e2oQH3yInrGNFkXE\nL6iVZ7oTIkzcKGQdx3I93lebwtrsPdLNA/N04XNAdZlpE7kKULHR5EGxO3/B\n4KCZNdf3l8vYCMqPzovA6psneLfsyiOdmVKEp6idwElu7a6NmSiVOIN/yZEM\nZeZHTSAPnQCs0cEvQK03QFXicqwFLrhx/lDRWTMa6OJRDY8a3FsfJeTg/EL+\ngomZO6pLq2Chw0mxRC4AJOMXb7pipnvQWjTDJEI8IDZtXl4tfEhW7+79SytI\n+cblfHQzx1jmSUluQv1inqbueHeuthBTQojC+8O8Pek1JJcUxdfDxA2cpCwY\noOgulqt5MPZXcNJFMPNZyMII6ttBBRa3up2AB7aAlmqiJtHN1D5CVsygEM0H\njTUo\r\n=BL7Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"ff199927f448e971c6d542850184f5c8a1fca6d1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1176"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1176_1589385950395_0.3925826612690042","host":"s3://npm-registry-packages"}},"0.11.5-pre.1196":{"name":"piral-ssr-utils","version":"0.11.5-pre.1196","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1196","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1a26dfe296cb0f15353d23a4e82a254c06d652a8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1196.tgz","fileCount":25,"integrity":"sha512-3sfPV5tKcR3um1UZIg6pbWGzHCTAFkCneNcXJaBk4q7R3x9RfXpeGJOUYhAW9o2S1x5ikmQNKhVRnzn624DDzg==","signatures":[{"sig":"MEUCIQCoA1rQFRjjZ0RunGcvS/Xt5wOgWtNfXfbFgak0xBm9PQIgYd92lpO/cJ8jnM3y7nxQMHcfVH+VJwtC+TNCesKTQbs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevrtACRA9TVsSAnZWagAAZQEP/ivrVbgNQUeZy6BYjJrA\nOaCmAHKClMiVaCIKiiRRi0nySdPK7KAygFuim46nQzOHTQnQpKLAIKYoOSU7\nmV72s9yMsZ87PIJ12dibPsrr7gF1wGFLTyvQO+2Ju+3KbusAmbJoePOaFfxx\n7FTFAutjinOq98jVj6z7b3x8idAfnCJOeWGVyDxz02CfdcADBVqSMvvexvxR\ng8A2krmyx7IdIn4I3MlJ+bXQwvSg8bzL+n3Q21buQjh/p9o5XgwDeKWEIj96\nCQU7xBIgkY9I8QxnDLQgPs49+TinedOvM5LTBw9kXL764e5XfwhfcxLytaXo\n313NgffAxhZqXN3T5fUcI3Y9M8nqNvl1QDyOo/0y1RFBGf3CiGAADWOUVzBp\nxOXpKqL6TnuxpOwHxcNvNpTsW2SWx+vFkV22aZ92ukI4zwMt4SJZuQGugvJI\nFZLeZRU6EXmCbrPqyZ04gyfsOLQW5zP0D3DtuVsUgAG7YKrSeea33eVwRYFz\nsbXEq7PuU9toL3hKpKBmU/4tS40a9Eo9lYiyM7UpA4dNDNjxWNHodvZiK0Lw\nP4VkIi33wuTYZZ3NZ7ZSdpfi9eNFzPShZxP7xojxAKY3h4C3yz0ke1bRZ5D+\n9mV8cp9fWQDwo4XSjuLIPKasxjtnu4bSfO1Lf9vTkpZou/3zgZL+kNuEhggY\nGtfF\r\n=I3Vp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"4f47627b317e218147ab7df6cdb40673c94c80c1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1196"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1196_1589558080574_0.918743139971149","host":"s3://npm-registry-packages"}},"0.11.5-pre.1201":{"name":"piral-ssr-utils","version":"0.11.5-pre.1201","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1201","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d4184c4649535d72021a65fec7515e1109a4aac2","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1201.tgz","fileCount":25,"integrity":"sha512-dxupzpc0ckgiWM5WeiT3Sjqzr4dpcm2V9xPaAu3DLu6761gnbt12gb8+YDc+G+IodL5bvthxdqgOr824BYXSug==","signatures":[{"sig":"MEUCIH7S3cSXBd2BJxIpu20BuipXPWdfZZ/0oTt1SkhKCG6RAiEAqNixp2gTIiyZk1U480h7GIsyKeRQjbb5m02z4c+DFP4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewudaCRA9TVsSAnZWagAA574P/jhzG24qwLxLHfl+xqCD\nRLHatEilpv+BG/oDSYjXWzDiQDfXpRW9mIpfcfMrItO67bI2d9giJu1guw5m\nR8QF9gQHWIaCv9OrvNoYkXO6OzIv5orIK9W1qqk+gCf6CIu3USiOZknG4/MV\ngVB9yRs0rYNJeJBcpjGrWzjZY4lE7NYh/m1f/3hnGr+U8pn5HHeRRUqjkZQC\nL21Mxd1WTLoVzA2UfqS8SdNAwCp4zH11KuXWzjTbKTvThrbj9TmIshAgifCV\nbbefsr9eufF2WABnaXGXE6EJk72ysAgM0fy50xkNnACLP8BG/OOnoK/IL/XK\nicBOXgiKx2y1sY04b8EONj4XM5PjHkCAmIk1gnmT9TDqHKlY6YiUtcvYMS+P\nFTF0f24Jz4RIhUXrvIyMlYZD2/DeMs8Ki5HNL7JaXAoxeliPRch5EPvmcjDU\nN3BcYv6hFWU6byVa5jV0kJ434c5TLZ8iawrYyWuPJonfz6ugs8QvYTwZhBQ0\nMe7TOeDK1fMrNyYvhR7VAGhHoFfGf8ZwHQyG7pttSmBTpyJXroDm9pzWfS75\nBz6LXJd8drrzFsI5AmfCUus0UvjA20aq5ZpxqWgTlSnxBBoq/TXw3sCJSrSV\nycyG+AU4Oj4dTexdQv+UU7tODu7AztYJtkig0sZRgYw0YTKyx56YXUtI8A8G\n11oc\r\n=AfmQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"5b0fd7cd6f1ba29b9e07eef011ee0c158c722282","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1201"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1201_1589831513691_0.14223807891492846","host":"s3://npm-registry-packages"}},"0.11.5-pre.1203":{"name":"piral-ssr-utils","version":"0.11.5-pre.1203","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1203","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c4895f3e4992d02d297fdb8310da3ac5fd205d7e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1203.tgz","fileCount":25,"integrity":"sha512-nPvbaIQUH5VMOICbqCDOAUyeXYRJH1672mYJ6iysqbZvSJKrsh18+pX+lmw8p3pnwjVYL2+0EJWfa3aYCA4bQw==","signatures":[{"sig":"MEUCIQCnhWmDKkTSYMGd/Z3AXfpallpGBgp4JAGYAP5gQAnSEwIgNQA7p0mElJNjmffnIhWPtPm1vBvBfx9piXdkcJ2KB6k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJew4TZCRA9TVsSAnZWagAAWWcP/1c+TjqxG8mVwpBW34lu\ngfwbcNKWtgA5dGHqFnYz2R+HUUyFm1rb1XmjPlJcFd66QqSzmdIX5U279TtJ\nFN61tuBbbOKaPzvbWgq8qxPhNQ83cgFBOqugxfoHsrsVtUXouwjnoURO2exp\nj8t59lAMNpxcXOqbLka3mLc+VnJ+ZLcnqhzgByPy92ON+85JACBTBqEx4yof\nQpdspcSQcYTXC/8jAXNZEnDHhTpBFJoW9B1GhyzSNMppfU6fT+GnahdsEQ4t\nr+ILnQBtCopH1H8WRZ9dsR2lKIwmYBLxxhsviHre8DPwOQ6b5MGhMWQy5rea\nmajZNnwkRsWWhX98HGW/d7G/FUoSBGXan9mHdibw9QYtHzycxJUtvayl3iHq\nuNYUy09Ue2Q2Srh+AXTr2nLQtsUg0f7CSmH9NwuvfZzs64ShP6ahodwAomxX\nwdTpdCq/S2U6XfQ4baeAW4dOzvlquH2/wcOnDmx4XCCqMCg8SC1xGKsmfy9B\npucLcEtQRFa/CMivG317X74opRva8UBN+NW7NT2NsTp+82zz37NUDiDw80P8\nuHeSP6unXLFc3bN4VeotVLJ7t8o/MNTWfwmIAQfRkfvW4JcquYVa9nYZbb2x\nb6crfb6khlTEdmMsxOwYt+nUCTP2x6+DtCOxkgUqFiRcBb+SeXdt2PVuIMPt\n9lK/\r\n=V27P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"83412a884f6e0a29891e85eb059ff449f51bbcd1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1203"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1203_1589871832805_0.26261761750501145","host":"s3://npm-registry-packages"}},"0.11.5-pre.1204":{"name":"piral-ssr-utils","version":"0.11.5-pre.1204","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1204","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f822e8ed23582e7532f6a1253d751995987227dd","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1204.tgz","fileCount":25,"integrity":"sha512-pzrKSrtSXpC5qrHwGWXmHT3xpkbjhdQudLkrUn8KA6PikPvDuwGobBX2/XBkhomtUIR4Vx1Mkj7r9cVPBa1v5w==","signatures":[{"sig":"MEUCIQChabu6VzHG9vZvkpVJ0Vkw2uqfLGis35SBRBN0dnmhugIgVVP/byHGS5b32pZ58oRKOZqRTVacajZNyGrPglmrP58=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexDLICRA9TVsSAnZWagAARSMP/iCGZW6e8P4gKX1p0hNS\n/+NjmXFF3ubmr/qQ5euJYQFSUa1Nw9bfV5QMAy+EqJeWqCQ5iLtwV5SNXCBl\n1pmSe+O3LqT0oC6gbjsQ/8EJZLgFSiQrlbmGXId5ba9RUg0dvGxXCsRfcpYA\nhhQr2mYxtfKAVWcyZEJSXMgpfUVc2c67D7/UqWfwXCp+ki3zvKn7YYZgHP1x\ndiLeqAd878i/fIYCka6evLRj+EWDy2gj2Arngikwt/9RXyIEn6rbwa/VFv1q\nluX6B2V7zLOHPfJQGouA0gbtcQXzVvxslTM1G3VttSW2z9dMYJCqC35YWFOh\nK+snoitYvCnUbe4Qt8QIi6F+chXXR8hHEEvHqBD+SwmT8VAL1LF5y+BNJgDK\nR8/ArFwjwti5epqPAJhXIDlWPgZDEa6boJOU/+2YhBB7NJo60ltELyLULWHZ\na0BhK9dZszJdpqoZiaAYlp5wb6hqaB1jGD2/VnqCyTT3YLu4mXNOsTPkJhOD\nDaz95DnEEn/xSTENAwPFr4CKRHyc2JxBO4jBKpubMNdfNK/4/7Jb8CUbPs1p\n5uVrtZnecPn4ufckfo7/ZP63SMSKh+IPYPm6dEr3qPxMqpNPqMCScGoM5Une\nphLd+lMlC5BwC0+JdcQJOseGAyH5n5JEmKKtgOLcR1lecHjhR91xMQR7/nmx\nvfia\r\n=N7mG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"2562c30b2890a785df141d860398ae59ac935ac8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1204"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1204_1589916360060_0.8890541234095559","host":"s3://npm-registry-packages"}},"0.11.5-pre.1233":{"name":"piral-ssr-utils","version":"0.11.5-pre.1233","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1233","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4e735767c0bdd71e2f888ddd87c34a1086990e22","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1233.tgz","fileCount":25,"integrity":"sha512-kl+QSoBaZdOjVO0mosCdlCuu5AR/O/zoKeVXCx0reh79CuK0dUpfhRwPfC1N+PpZTjNId6WYd/wGzL+lGx0N3g==","signatures":[{"sig":"MEUCICpKl3W89jrDdhqYXtp9ZY51ywRYWaVNyj+zyBHx8FLsAiEAqZvrk6agtn8wiXjm23YHgeS9n8gEGxsuYsnbpU6cI3s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexp6GCRA9TVsSAnZWagAA3l8P/2YDB9BAgRHW7NZtPjIG\nqxO1OFKmdfvrq7HhKETYEuOOxOvf8AfxjBnEaquuPUiKjJUYoH4gTcDk+OXL\nQcgT/zyzGYLRwd7Nq2Dj/GX5HoscFWMXIfRxk1Y0aT7JOSZc7MuoymHspdoN\nP6VqhQvBT/OPcDbGBzDVerl+/LRr0SwnP4IfebTMYSlfWD0tLbRGYuwgbFh9\nunzptNbFOQZltQgM3zzq2yHyNuF3zxe2CP8Pk47av1DweasW4a+j34uN/zVd\neqY+H2rceYqVpYKntgqGv5y9KUnRmVKYHX0YJKNKu+tWCjWbwVWatx1OAH7X\ngVUdPgwDKihBvzCH/EiZHzvT0Cg7/nd44hnnR5c0qxxjfKbMMYhFPM+5ZOfr\nV2+moG9HgTzC94dwlv2B25ZK7ZiFVZSwsiAJlqR0AGYilF+CYlFCCXO5SQgV\nqWJkzB/H30RqkLnJw0iKQriITLsLYmUX2/q3+UOvwlHNHliiXRLZ00W5sG4F\nNBSGLc6q2QMa5wsKk7ZdShUJ6Eip2nQtGECSUR4PcD0AeQWP0nUzF1aEWuoT\nJHMOepNY+0oF5zhmqvLKdgoPXMP3AghunyPALhLMTzKBYpuHQbynhom5JFru\nSQb5Q8AMiw312hGj8wF765+hcxAWxR1MgnZBx7Gu2FeVh0pKtVM0ANPx0OTP\nvKle\r\n=6lGv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"8f7a439009e34b485bbb5f2a4e8828252ae44b85","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1233"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1233_1590075014084_0.879173944644257","host":"s3://npm-registry-packages"}},"0.11.5-pre.1237":{"name":"piral-ssr-utils","version":"0.11.5-pre.1237","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1237","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1bade138b54eaa00566483da373ef9664c09727e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1237.tgz","fileCount":25,"integrity":"sha512-cZUvhVlxbt9lxdhmPMLU/VXSmmR5HyPXiMe2rpi4k8UAf0/0F+2AITxEORjj7j/aLnd+BKvFH3ZnlXV8whhBCQ==","signatures":[{"sig":"MEUCIQDQRQMpYN8FIxYp8a4mznC3K9TpMAUWWzF80K+Xqd4ByAIga7psOsKoP7YIHZqsP2npIYZqijUg298ZOSa/9LndTI0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyCmWCRA9TVsSAnZWagAAAtAQAJZuixHtHjbE08ZmMvL2\np5cEKcUg6BJu84dcX8IwGVKZ/K5drGSh18Npc3sUsDc29mf4sbqqP39lu+QU\ntYJ57ZRn4e/MRTDRrv2G7toJ/vrbVBFz9c224PAgRcGGYPKAUNDe3ca30ULp\nZTwucK3fLkb/Q0bju+ZQeNJXDJb22gfaoMcbyAWCz09ORq+NXDCcPM24gSWZ\n5z1Fn9/OULIBAFyutCZUjEUMwPZFD9yRs20fQ6MgPP5FwVg+kP3G3qeMU6l+\nWZTvBJXbhyHR/cvXVo5hQPprnEaGZh9GNFvuorJ9zV6wTsVF79XGCcoJYU3d\ncaicYMTHzjq/SZbNR5of3uY1pJ6QSYBBBLrGTeEsN1JhqefzKN4kfFqKZhAL\nH9hpi5aHymECZdm3Dz80Txophq3unj2j+cBM59+aTxgZTtS4irdRdZFhlQN4\nfi0YHvMJoLaPiGa8TuH7J9kG5S1n1p3SMQ/A/NeCttSlC6Kp6JWQvxlnURh0\nbz36upw1B6LYO9wjhKqNoQZL8hMtGNaE+g1qBEJMI0KsZc5YiTY1SYHKTc6O\n+ELG7Tbx5suYjZ0Oj1ImGC+CFcEqVoKq+KCp87r1n1lW49TGgagFdU2Ho+jL\nkxru+a8+/sAPCyjajw/RDU9oLlmkohEYb0Om71OzoGv6/wcDpwW05/C3Ak7a\nbLdA\r\n=OS3V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"30ceae60248dd969ea2a3591e221b06cde6ea578","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1237"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1237_1590176149682_0.38473759487135917","host":"s3://npm-registry-packages"}},"0.11.5-pre.1242":{"name":"piral-ssr-utils","version":"0.11.5-pre.1242","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1242","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"20f49fcb226b8843bf120fe6a6786318cc00477b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1242.tgz","fileCount":25,"integrity":"sha512-Mzz6aPPuSLEWxAGbsPvJcikKPsy5N1j1UpkDfHcCAeKIcBTle30bAu4pJpi/1M9RrtXDgs7hxUGLaxHmc24oQw==","signatures":[{"sig":"MEYCIQCAtGQLOxHxO9Uhq2fhdLtFNw7eY0rtjIE9abwlUKyWswIhAL3RLNb1kUAt+kcFu04eKJlYQg4tamwPtWWupJwhIwsH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyRd+CRA9TVsSAnZWagAAyBAQAJiTE7l2VPjQ1mBkjku7\nU/nfpB3z7L527bLhyzVbHyAiQ7gcd0FsA5lyKcLx7Fnt9yU+6CAC6EVs655s\ncGvuQMGumWOreIfaGzbWaz74dCao8ryrN+CerVXgN6LLvXdNrBna7jZoS36e\nrHo2G1Pi8tUXqGwN5uZ62Hu1wZTPEWCdzQ+o4CpMer0KogSeRkmeHPgi8aoh\nrceNZQiRY6trkzXLVeNidpdWnX77O4PlAVSrTOMBEx9IGVX0eqzDWlmhnJTR\nDhh868lmrBxJFtxNGZR9s9UjC0t3kv1pnY0KiURdVe5ODl3HawCVMWt88QIT\n8IniUZiWb03xn1auRyOBZZuk4JJKs9LjpaGkV4bbqDdnzj0RO2aH5W9lezTj\ni8wG55xYGBbgTN+Xj+bzBozFeqtLx+avy4tGI1MHKCJ0ozMirFA7wbR/DSkK\nakSK1lHanK0RE4lgRkrb9d90vWDg72X9JI+TbSpY136qcslCL3Yr5i74GgBQ\n2AG/3UTaHi+xEJn74fu8v1jqv2N4qQjFgqGDRRlbqJpe0YRvZXDuK0XT7Hhh\nUI3jOk46LIBOPRLugFrQhefIJdyHGDDakePdgnLhLnqysTKToJjvgzOTbWdf\nSwmzTZT4U42ZaG8kCgdfasOEM2orGsvymO6LhOxU2Rs/ZyWSPnWh/TYuxmII\nIw0Q\r\n=o8NM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"cb5d5846435a0d111fe20c54cc899a17b173af2b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1242"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1242_1590237054224_0.7758257994922948","host":"s3://npm-registry-packages"}},"0.11.5-pre.1243":{"name":"piral-ssr-utils","version":"0.11.5-pre.1243","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1243","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"70305a4f95f328b7a1a13397466b7c20a69904ab","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1243.tgz","fileCount":25,"integrity":"sha512-zuBcoaLG1wXXXbMC/YYQdNe0sJ/Agvz63ny4wzhcF1atOd6g1sbUXJEyG75nGKDN7JsrGpEhXipK9yTwLNh8Qg==","signatures":[{"sig":"MEQCIGWpfoJGJovqp9ntt7j6mQ3n9VfHc/dt3wSfJgsdVUwFAiBDbz4DH+J86JOwdZQ9OnqKmpKfIJPKg63CQz81UDrlHg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyZqFCRA9TVsSAnZWagAAHasP/RnfiHyQQKT3Bg8IbxRw\n2H82jve7szQQ5E7t6USSUbSbsqzHuS75DgJaO3Q0P50QUigFSnmlwAhuYMPO\nMjZxX54gAzeXjzU9p7lbaodILahVAUsVhMtBtriop+QqDFGfr7tOo2AdKT9y\nScDVjHOFrHymYJoozR6nm/diHg9+DZCVNTg0KjvYbC9ZvWBSX3PIyrFal1dp\nnizenXvYpkxP3cm/T9qoH1KJVgZvN9kdq8pFdIIccwJwtkhoTrHyrO8HKvKI\n7qGTy1JHu32rTLvEIiBWP0GFoY3SBQae26eZCgJJyBi4u+YaEOkD14F4jxSe\nQCzQi67Nya+wETpVUzDjkdFJoOCQz24kfIOK/LEdeR1KFl67JNYEoM3R6yf/\nR7L+m7STZjIfAPMu9vgkFbCZySVYaPwKW2IFz/cfJEBsareJtdhcdwAnTPjW\nM4TSzxU4k4C6hf1YbOcqIEkidGhJrGXR3cC0M2UCNPUFsVEzvrwDaufurH1y\nPeoyvi+q1kDT2PxS//PdCyj0tg9dmfyBp9Ej+yFnOw2siLpEfduPkk0FFpxQ\n5Eb/tOrotHTtdgR0b/jT4U6oyrMtbZSIeLgIjEp2v32yfd3yvtQ9iDUCMGLB\nC0DG62VcPhsKnyWryULAnL93sIDI1thBsfr3ahMIMUOPxbp76E5/GI/hulyI\nO8eD\r\n=XXA0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"dce3c40b90d922f8123abff6a763c78b5fc90ec4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1243"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1243_1590270596577_0.4609754881110588","host":"s3://npm-registry-packages"}},"0.11.5-pre.1244":{"name":"piral-ssr-utils","version":"0.11.5-pre.1244","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1244","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"038ab8f1472ffc6a0051c7c8341d941ce18576ef","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1244.tgz","fileCount":25,"integrity":"sha512-9yYGLosMpR+PXZAZjLuvIYnp0AbOsqWW0JHAT/PLYbvgDHe2CTqMvYnsds+9iVekW06dbnXUpAl7mCw25Cgl2Q==","signatures":[{"sig":"MEQCIDkiEfvB7rNLsy4+c3UePdrviTo7Oeb5pBCZM1BAPjanAiAjqUJQlixAqtI/3MQvkZMnqbszTU+A6jzbf/h2iWBsRA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeybU1CRA9TVsSAnZWagAAUR8QAJWXQbUx92TAq3kGt3RI\nbGPYCHDxH3naDyTzH0v8/9+PlvvRn5Hg/CW0GQdgJU7lg42IhJcbAZCdCpd/\nhXISLhBzzxDtTFcgF2qDMTzZzaEYLXaonvDvojmI8Qpp+lXFtWkyMyLwMCu8\n5LssXRN5pwAamz0bdt04NUIusTly0IGAYhk0efJt1QShsRzq8DGKt2VORM3n\nBe7mjQdRr++3lNoFLVxrGk6bVkAVrz2A+Rgwa+q663K7/BWHufcsHHV/AmyK\nyZa9crb0PVCQ7/HDyLevvhNjJkAyQ/aEvbGaH3qqLP/sbANE3BQkiLn1nK4L\nOe1JP9ssfurioFvlIOkh9lFWq/BsPBQ0hfAUOrEfE54gFs8CqlHT81/nMU3R\nSaECT4BSUMk0nn3G4RKoX5cbr3cREcShokpkecRJd87Hlv/tEC9C9A6cc524\nCzbec/xfhxRFREVGrZk4VBCSGKmK2Gc9oUXTt7ybEipK1AP4lPwVpEjY7WuI\nZk3Qrcd6pQMIOwPaw0DVLHSLkbSPmOgvDf77rEdiHJVvWNssyku1jDNBvqPd\nwg4+1/wAJToX4RqXQWkmSLi3tr78tjIp1ig+WGzkQvNKezbMjZbCXbBbdoXy\nPJgXZwEju/iC9Gr2eP8RD+Jy2h0OgGDOc9N7C3SjMz4NFo32+06qsBn6kAZm\nS2u1\r\n=JQLn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e62a9ac95348f6a4ed5b5e9ec3a01075bcd63ea2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1244"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1244_1590277429427_0.03885822252278004","host":"s3://npm-registry-packages"}},"0.11.5-pre.1248":{"name":"piral-ssr-utils","version":"0.11.5-pre.1248","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1248","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e4948f9dc3f2701ca825ee39ae892aa40830f705","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1248.tgz","fileCount":25,"integrity":"sha512-Mw7uTDZUJkDZWu3EaNSw3wU834/8zdbj+R7oa1lWwDcNKL+kMrsaWu1YgInSvM+mfhNBNG3IIfOrQ2uIXQZm4w==","signatures":[{"sig":"MEYCIQDpXHIKgHvmjMOeb+rLegm2wQloZyfHEQVdiRPUQajz5wIhAJRBpSZwAVo17hKOXE+k3a+tit51NRqxzcVWtvs4YvWe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyqLLCRA9TVsSAnZWagAAKewP/3x2Sn+KsbQ9QX9K+hxS\nBjSSJM09Tm1rUEz/ITO3kF7/CBkMK82ZSHC+NyaG2qMX+MyhPgdTfmCtBCRs\ngcfCxy5AEWbGupH2hauCWlyZjU43qBi1QPIMEQZ5WRx2jKoscXBKieAp3hwB\nSJYrlMF1j8fXejKAeM6oKdz0XfJaATQjULopyXaV8u0XhFT2ThEFijlWgPao\nqcT3rHJWuD4TRBR1OEJtjFt1LfWUvzLpOYFng2xf4r624HJ+FZ1n8QeO8f9Y\n+WwirUYxfMEcSuhLgy0atE5xzKwiTICqNbiSCx+mVPzbcriCaD6s2pbhl6jt\nqiPrVtWNVDKikekgnvoAlXKbNDECCYveFfcMTkYG0phJ95wEU82qoV1e1KXw\nOSqNHT2dVBkGMKq81wKMpRLmFqM5n8rB/AzCqEDOS+CS7ubab+Qf4sI7j8Sk\nxP/wZOiI9mK/nPhamRPtFszvsdSjE/h5iYrZy9qFK3qRwJsu3aNudkzo0hZJ\naCipGnhi0Fz61S6Y+CbFQn51CDJoXNYKtfg5AognfcIMCgMfYd7VOzMxJoiS\nnI9lXYQWq2WWq73WcmDTFeNVZPVTkyCch7LK0PtLTF/VSmWM4839bwQC1Kly\n0OorytZ6LSbBO9JjCSBEMZ0stYfbM4ZqOh4XQfmpnz3f5XzFdqxk9pwYBeoA\nu2XJ\r\n=Ywvs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"8ffb74f782b7244d4aaac51f0951cd99ab517a90","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1248"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1248_1590338250632_0.7734816099191215","host":"s3://npm-registry-packages"}},"0.11.5-pre.1250":{"name":"piral-ssr-utils","version":"0.11.5-pre.1250","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5-pre.1250","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f4b02717115e9b0be1bd4dee03fed105f44e6528","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5-pre.1250.tgz","fileCount":25,"integrity":"sha512-T97Bjh6eRiLW8hbfHcTjTApym8XzHN4p/zlHUxnQvy/ELIOW2gtwU4gDKGH/kEBfWl/RMKAQ2bi+TWLLR4Btbg==","signatures":[{"sig":"MEUCIQDg7kn5HkUDG0/MnuXVQa6HopEI6TguxoXdXapxtptMEgIgEpPx8x6NStxrwFDVJwwK85wMf/cuWkgxLEdrPyxqOEY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyrnRCRA9TVsSAnZWagAAMHQP/i+WLEjXiswbhNOu1kjF\njRzQ3ciqhS1RBX5BpChkiXjAU8bLsPHgb+ErOj4wCeC+ayZ0OSe6N+78ikhA\n1jIc4oq28gaDWhQ3eibt1b1PYUVWgpmVfskviohMziGvPJjrKSyyV4QSHskE\nTbjzBIObZLPXYEbDfynAbp2lhsdSjnhtSSeAUBtQmH0gPgThwPg452BM3cGo\nyHWgoOar51AdE3q8uteRbw9b3Jefjt4ulYw/UaCM2qUGzt3VKG5jqiEPyQL5\nR7uGIs7CIfegR4u9dLE5xcOFo83EfCJa+u9/fg1K9dMnhzgKUZILQNfnPnVz\n5W57LZSE2WiIjXa+pj3YfYkl5DuKd3Mf0M9KBjVW3ekw3QxKRZUqRP1t9Qkz\nnXrSH0tSp5oZGpxE7g/QL4yHBHQ173PiowoTWSGZft5reI3Fw2DT81vIVgnf\nQt+LUXQpu/nHDPCgbVdLOppxIe9QBozMWceaviJaYy+fdh0iFK1+KFDXgbPV\nhUR8qyF0cGMvFDuheIq8Xot99yZjzzKH8etlO8YoYmdW+KQ/wXPr8WaHVslP\nuaMSHjWVKnBR/eJc0N6UZwZOuy771wfI1lrLAn2bR0eIcsRu+VJBrdeXaG7v\nnLtAkhMp6oGjoHLqHLGJjBDM0cGhKi4HVmWUFYNBaY9Xy4Ss17h9if2Va9n/\njZkw\r\n=QTbl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"3f61c14e3877e266b081c0b3f536546a52a41360","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1250"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5-pre.1250_1590344144524_0.5636264868946503","host":"s3://npm-registry-packages"}},"0.11.5":{"name":"piral-ssr-utils","version":"0.11.5","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.5","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d864ae78b3473fb08e345f7d3cbdcbb5b6ce5e2a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.5.tgz","fileCount":25,"integrity":"sha512-o1UfTJydOr2Z6KvS8Cb+y/2ZAH7/GqrE88J9WlND8+TeduhsfXITHPGPQm3GVy2QMMb5FtgkmlvsxjywXUB/7g==","signatures":[{"sig":"MEQCIEJC8A27vQuimegpSv0bL5AOH3VFDJDaZRUojqN1hbcsAiBmDXM0b15Nm8FsdJydncfqqwfmqNUQdfJmvmB3f7Uffw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeys+7CRA9TVsSAnZWagAABwgP/2lOdvnuqoDxkp0vPv4f\nexTQm05BLumIRgdf2wcNqfn7uIQ+NVFYY0TiKr4m5g0OMo9P8txkL1VoZbg2\nLCIoltX7AxqMjd+t/hOGxebyFwlaGDXyaSu2hs4Cde6a+CfEGMO8m5zS6Y9R\n1aNFE39ccL1sB/DUydjqX4Oi9Ee3J0zcV2ektOG+cGkt0DPFzqMLU1iYeemn\n1scpeyPvD8Obe5/OG2AZfyLjozHDOub5hJSXL9ITbWMXyzK5cFsMnp4fl0tJ\n1IHIuHKpFBpODd0wDJAgNLFObhW8Q14AYUXlRwd6P83JcYxOuJZ4/061p1eT\nxbplKb9K2FsX3uDpPfV8xjr44O3q992d87Qvz/PSkEP/weFAr+rcyXjanN0e\nVrf8BeFZtgd5XFlry5d1onlTs55/z/VO893GyCfPwr+O+We/JHmp6z/RvcLy\nIVE2u151vEp5x8S9PgqqJdWpBYhgrixm8k98Bv2BqSFkzxZEWRxyLZaQPzk5\nGxG86s9HYxamXevt9Cp99ZTC1uUi4wtIT2zjfO/qjqXlbVdw3HQbQ+oaOW/B\nNSOArZyfrRsJegyult1e0ugAlo42GFdiYHsmJX7xvmTDBZFWnmuXBqAg1k2w\nZlWIaGkkFkTev39D+eP6PHU03Vj6Pf5Sj3KDnQXst96X/ud7m4c31RtljvM+\ncKT1\r\n=oxPy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","browser":"./runtime.js","gitHead":"1415cbd981dd5f6da4822c9203a7ac6073e3fcf7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.5"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.5_1590349754877_0.811009941972533","host":"s3://npm-registry-packages"}},"0.11.6-pre.1254":{"name":"piral-ssr-utils","version":"0.11.6-pre.1254","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1254","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a0fa3fdc07758d3c793ef6d1b29d1ad076559d2a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1254.tgz","fileCount":25,"integrity":"sha512-3Jm/MwNpXwGyI+c/eN5x8tTncg3ixm3fceL653NaV+Jo/IOMSBT9q8WUyMdTn+xqt339XfLjAV/1jS0sfsy6bg==","signatures":[{"sig":"MEYCIQDTZNoe8DnToe6hmVflPzh5yk1ssWUrrEtn8r9RLnijCgIhAP86r40Oe1FnWpRGOf6AjqDYbbV5mgIBCb6pCCcUyPJY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyvROCRA9TVsSAnZWagAAM2EQAIPMY1ioWqKdGxh3bddo\nUiESak2cs9sRG68dL3zHgS+E6pxbsR/W5ps4dUxWmgAXqxv77Pk2XxtLZf2a\nzkNGxS6KD1jxhWkdMvYqNcRK+Y+D1qckSblGhXK5Glo/PWR1FrXa67A6KdYp\nf/QzvwEyGpZWf3u5PuP+3yPfTkVCW9h9qaacfZO7um3bjqUyeaehcp6QAwi/\nDYYH5ORrpV5yAMmQmpt0ILcdGl5EMd6SA7R4cnRJFdbqHNzJqwav02ta0xqh\ncZ00RgcrBh4+ydvSn8tCwL+MipaYzzTGwXMiFZRg7Bvmc8B7BtZxsM0YtjSR\nduEBMwxED8lIbCu79goNuLmFVeV2ElEQut0ka8n88Qp5dvqKRKYo5Ubafqjy\nGUS0NJoDDi8kiCRwJO8pki+3n64bThsC6bBykYj4ucIFeJbI/XDZxRZurb62\nWSvF8jZHQBl8ADbeHot+lCEDzV5Fh2sNEQaTjd0NEaOCl+Vvq4VPRFDZARyC\n9UB1k6dAWmNaXV35fl0Lcc8ALz3vVQgOXWy6vXlBuHoSnWP42ZIy7SzeCubo\ngfHUUlZjTEtaOaBQepCrXDpAWtYmyZ2fT8n5D4qMTdCLpS20+g9dbU1PeYcQ\n1iIixxEvzpqmD4UMIHr7pe5USirJQ0k/FDe5aiv/E6Q77mAs7Gux599iP989\n9kvO\r\n=bywm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"c3b46806b56de2b05e29fa8714becd1699184d83","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1254"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1254_1590359117527_0.33684802007743997","host":"s3://npm-registry-packages"}},"0.11.6-pre.1256":{"name":"piral-ssr-utils","version":"0.11.6-pre.1256","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1256","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f04b36b83772cf46964234cda09fd78b52fe383a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1256.tgz","fileCount":25,"integrity":"sha512-+XoZI3x82v8q6nOORjxBse66+uvD585AebwyUIma61BrRD4Ql8N7y8/u7Vwho70mlTFV1ejOVx5NIpykxIxHbA==","signatures":[{"sig":"MEQCIDzTGRCgkCX4jLFApkoPenDvyTMQ3kcNNav0oq6inc4lAiAidKyG9N/ek5d8rd0HjuMvNpeSThqQrWGgzqyWB14MyQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezEHeCRA9TVsSAnZWagAAZTYQAIvfvUGyqhonGH161y3K\n1hprlxjjmssQioMp8u6dfjH04nL2z4ONssyQHSbbGtiBmjwZ4KWhBJ+2vg6j\nMFidBqokV6MKn/ruVXcvbyDL2o4NuJPUkDO2NtR0hUoApw55cAmQ/nodnLAg\nGZ2vEYr4fTf4v4pVIees4dCkOftYvyBaIVDVIgNOeRibu4Hu8UiIcKmuhCMN\nrfTK/X00CG4dPwfey43OoTGMGFWIuwOKTaLX99Y/uPRWjRGQaBrTZFj6yHhR\npsZiv7RB4+8SNci6Jo75Ceyn+F+73zsjYGsHWJXofb2hpI4sw8JVWssXqzHs\nXOCAn9Mh8jB/5FfwVbLAcMG+8lnX9spuWuxJ6Zj3l9ZgPPhqJrLjUZH+A65Z\nvQ7zs0r0y3hHSbLizICVBPczMvHbNcN2rhhH09Q0wsPrAS9Jfz0u7O+/ZJHO\nHXSR7P3GDRqXzl4rwpUHDUmZU+xqq1ZNRbSUz8ZdyJs2kNGyTgll+yinYsaW\nfkGneXa7hhmQR4z6AIDVBwCZl3NHY/+L4PGIwma+e4JN/5VIhfRUHr0CDRe8\nSwPUwglZDG2Mb5BJ1NJzpy1zPKV2wqC2Unf8IO5oEFpA5JdGR3heeLPVXniB\nn3q2xeLzuPQJvIqZ7PUMgVvuRXpKWiGxwSexu72iIJKBqTFBwgEakoEW93f2\ntFf6\r\n=W/Cw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"9024f89e0cc7daa04895460f922eaf6de5a69ad2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1256"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1256_1590444510424_0.4060672868320221","host":"s3://npm-registry-packages"}},"0.11.6-pre.1258":{"name":"piral-ssr-utils","version":"0.11.6-pre.1258","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1258","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7d13b3088befe7468fc97db204b5bfad1db13aa3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1258.tgz","fileCount":25,"integrity":"sha512-s1fW+FbsXc6iWli5JiBWrY9Y+lzzanHnfo4Y5sZ+Up0NxEIMhsekyhHDngIbA9XVkfq2fKHv/+AitJskRG+cEQ==","signatures":[{"sig":"MEQCIHx3D+/h6bjwyL2+bUuuZQjk3o37VY0josEIoyuHlCWDAiAHfIa8gEVbb3zxlosvtxEO8+1DADHaap4HmOE4RDRVCA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezY7iCRA9TVsSAnZWagAAYQQQAJNHfFlqPgMiCFvIySwz\nzpVt1JnB23oKLtyDcr1QEN3OBcB8JsKSSXScHHI4kblos2Ni2qPtQws55Jgi\nXC7MfcIFoierleJXhSOFJDVLGJm1noOvuZVb24bLE3leYyJyfEgJ+fKXCI8r\nJPW5PAoiyxroXDliTwW/UZyOd9GrYRIDmYn3a8fMpVuvhScQcRwqEMW6T/GZ\npqTVV+bkNbT5ij93kV9WF2nFbYEuqZ26hTzRuTJ7SRIb9ECTXGdd4lAtTiYh\nrcTAambOUUWmh3OcA5t1rcKuvixItn1eKX7o4VjX2T6PMKsbd3LWikGCYqCU\n9i0rJeg/NSV0iZs6Yiq9fY8NH2isnlcIXNQ558XLMY3diA6itiXf1pxVysm4\nApIeq/JO1E2a0kNyPCwIecp/wx7S3HoVwVB4KPfjbXZS5Plvdyi3+c8N0qpM\nnAtxeDiUX5ENNb+8Uo7tTyaz1WfjSRCcOWw44D/ChQoW/GNeSdc/b49RWVK5\nSa7KtQkyYVB3V0yD6Wg8kn+Bdm5E0+YQNpgn374Sev00inBAFoQeCeOaxp+m\n29cUfMV+sP3bj3UWLTqzZrDr8x3myDt20BaGGtg4S7XBzybpt6VVH6YrAydP\nGLAR6BT/fQWae0awY49rmhouprbM0o7iYbyT3QBa4Kfzgq7p8xWHlR5wFFNs\nK2tQ\r\n=nvwj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"7d085afd4dd54a4a14a88af6ff3178eab73a172f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1258"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1258_1590529761613_0.43700619677157904","host":"s3://npm-registry-packages"}},"0.11.6-pre.1262":{"name":"piral-ssr-utils","version":"0.11.6-pre.1262","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1262","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b3836f7ab160e7082d0241456a7eca54896d4a63","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1262.tgz","fileCount":25,"integrity":"sha512-PyWpLgXQi8l8/srntta3jgZYTJMgxVG2/pAV2Wz9/h4kReTPla2I3I8MWs26Oq9bNtl8C9K1po1mW0GoQQ4r0Q==","signatures":[{"sig":"MEYCIQDGuVGUe8gEld82g3VyvowOsfri9SheLj956sDgf+aXRgIhALRIZsLbKj2PyqPl75cufikBqMLOUoZRwmhXPpwT7UF4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezmjjCRA9TVsSAnZWagAA9QoP/RzV4Lqfp14yYqXEgxk0\nnt6ftjhCsUSl5wMmLKl++Y+pnCJO3cGDdMUb/jjvx1gaaripAHv3Pr10LwBM\nxrvXNCFGKrEJmv3ZJlt3qFTozvIqXiji1fHpapmG4dOw/OzlCnIYP//FeP6Y\npg8ZpWufYd+DEpsQ/j2dcNB98DKWdWd9lMyn7WDruZJ7hyTJRMddC9iQu2h8\nxY8zjbX+MO+ZAf1bdFxhOC7vGg0cuBilXrIfyUyxdLnx11mkANtXBj92ZJ2M\nM6gbHVHm3W0pd8yFI//B83ARJXT1t9Rce6X+A9nB3OhUTYTQqdK1SvMTiGGE\nu654tojQXRROXv8kDXo9j61AW67nRTCynwTW5DUuZ1oy1GwtaK7wg8gfDuY5\nzGEgYuvEVRcSCfEWyl61amxLeaiwK04Xm6ixD+O2mKRl2YRY8LX7eJsZjJZq\nET3QWTG4inm4amCQeExIHTMHuRBVUg23s5RDc1OyGTCMK5DiiOtpklOcuDIR\nn1P0XDbhGxQ81Vrhh/mLBhLXCbor7OuqYV3kVcA16JjXRLd4mirk9x166LNU\nUfMu2CPijkXfTmsG0qhYYE1C892T+hec1cc7kHMfL3fxg8sormasv02AS5tS\npcpgnH1+br0VmY7OGJX7+cCJsc30riloc7AeYWe+tGObd/4hsEnLo6vh5izb\npEl1\r\n=LEXZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"57f96952b32108c312b6179ff23c85684f89a08d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1262"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1262_1590585571378_0.6334102765616989","host":"s3://npm-registry-packages"}},"0.11.6-pre.1316":{"name":"piral-ssr-utils","version":"0.11.6-pre.1316","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1316","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a5bc03793ba1abc440919e5811bdaff429c50969","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1316.tgz","fileCount":25,"integrity":"sha512-eJJVUbZ/LNIJw19SPK9i8eZ8duh62P7v2C4yxjetWJcpp2Txm0u6w2I9KfhERqsK0DyKKoL1B+Krs41c6AabKQ==","signatures":[{"sig":"MEUCIGSb5dO1UXgiJgcj5F3X47lKxw4Aogxds1RjL0zWd30uAiEAlyu0IWCrrbc6s5ytFgWNstr4mbKhmqlrYwTjGKRxdAU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0EQjCRA9TVsSAnZWagAAEZEP/1XGIsB+6mXt9VdqZw27\nQRNGtuuTQTJZV/MpeyOhl6bF9FiTv7Zgfgk8o1e+RdKzrvt8O7+iINd0CHDu\n/8Orq1Bwtwl8VhMMFibBAD07Mn64n+j/BAgpWKTy/Vb0fdNjf/9kkLdEkOLn\nLESEHzKNAMMoKRhwNSyT5Ydmpf4zStAkhVvhc45eX16rf5XvdELpNFkio5Cc\n3Dp09iT17FSvHBuaU9L4F/43Dlye4Je/S2HAIB8Yhl3szXVQk7MFhwVTnGVu\nWuOUfbP2Nzu+9mRWIEgiqDsXdLAOIetBvQdw/YGFgY4xkuBiKLkgIceX+GmY\nVNg+C0FjanNz3RpRdoy8zvWAQgrFPWfoA+3r0d6Rf1GHTuKPqwZ9pc01OAor\nCJrIvNb4PwRKgIAojjo5C8SLEztwX7upsBiBzXnvwNaJcAUSgOZjGF7kgqrh\noxwyZYnTG88TmYgHsFRXzZ291O9Gs94U5Izbhuo0eaXXXFHCCcAB2ys4XKTV\nw/4nD54vCxngkgja4Hwk6stE46Ng3DQFYkL1P6tlyPRTYS7song8YjR7u7jL\nF9HNWHmmyOKCIS22KSaf/IPPvpwq870DUuZJ+pu0bovwWnQL6xhJ07coqqXD\nwapi5B+/LgQ7lgQ7FkfeP86UkPxMOEkBlMchTCr1SvEsZIyT/bDW8rOSZt8T\nh4nG\r\n=CWPv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"eeb85280d8b6c1975c043abb12dd2436ed409fe5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1316"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1316_1590707235206_0.9574211683253824","host":"s3://npm-registry-packages"}},"0.11.6-pre.1320":{"name":"piral-ssr-utils","version":"0.11.6-pre.1320","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1320","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c92f167fbf58733d925db99df7bb0dc9060a27f9","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1320.tgz","fileCount":25,"integrity":"sha512-FKstxBpKvq+NncatZcGa4SxwrKR0y0uK8OYf5LpObPfRkIdufA+dAZkzccl9R4An3OZuM9rYrRwLqdvdd8FMdA==","signatures":[{"sig":"MEQCIDzkQziFG+46/oUEQDiCm/pZpyViC0fP8t0s7TGfrRG+AiAKQChRtNWLIZz1m2M1290/Kr4YX1TOsHCPhzJTHEgB9g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0TlaCRA9TVsSAnZWagAAFX0QAJVowmrngRwC0qOd+1RQ\nahckxEYUxZxQJ+GHNWDOmjfzCAZI8bzMyI0rewsdS9VGbg3oDMJEgzZpg/UX\nID1IDUhw5Ir3pSDVZRO3kYAwPvhiEnhN6dWRs4WExbLEnjne93pIYKNEgdAf\nenCIoitL8OAA1Z0eTObyEmzdIuCi2lko4ag73B/U0x9tKNC3vgknxJyo5MDl\nEg6wGt+tcGNATXjNY43mqlr0Joft4zpXTG65/ghxrHQiTBTVbcxQERHx7Ebw\n7QxamK5BU48YclLHDMoD+XDVxCPqKPhyuJD3Iqn40N1FmL2NATYR9yZ48hzd\nIlsH+ZBzP6c+rCdSotb2pS8hc7ATo6nYrKX6kSlFg5hRhbkbPOmUNlWad8Ya\n79UqCuyldfkJIBYUKAubvuzrUuQaQ6Uc1jd1DDPrTePfvyHGWyRaZBWRQlZb\nj5VkAn//Xz9xIk/MFmC0RoDONqeS0jyxQaW9+DePkTWT7f9M5tdu1/sdbifr\nnoAwuphQ/7ay7JvHalPHGnDT+03wN8bVBOVpvBCpc8Q1Oyh3JT63gj5hWfSJ\nZ4poC7tfEMCjZyt1KPOnB66DBGIE7/kxyeeiYn7KN+41pwl09/epP3/oE8fq\nu6eUDRkdsDXRY+tm3CroDLmIlYP5XbOj57UoaU9GTC36ox5b3t7ar1dkEIPn\nylCB\r\n=H1xE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"0076e4c666c530008b7a820e18e1817012c890a5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1320"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1320_1590770009895_0.041360009903223194","host":"s3://npm-registry-packages"}},"0.11.6-pre.1322":{"name":"piral-ssr-utils","version":"0.11.6-pre.1322","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1322","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6cfecadd9d3fe22905a775ccd96c2e34e98a3baf","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1322.tgz","fileCount":25,"integrity":"sha512-br2RQQh+kdqjwPs8zab21JhkhzgNOy62SBe3MuRsxcd5OY+UmfyASPy0FCqtuzJiqYkMkLtmDE5UXdiP/8Sgfg==","signatures":[{"sig":"MEUCIQD20gEUuMgMYhsALSsENY/AQsUOceiPVJ9EEOoWwBxOVQIgDU3nFC2G+VNn+raeKAzNt5VgpDGwIHG1DCh0BbDRZ8U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0XSaCRA9TVsSAnZWagAA3egP/28AsvHbivlqR/YQGgFZ\nyd8Dh4DptYjktD94XSxd6613odK2QBOubJJ14PYBRLdy2m7ZR7nNboOj6jjw\ncTPLGaiRDlPbjjUo7m56g68FpqyxnpnL681knt/VNG9YEeSxhgtxBhGpFEJP\nUAWxITQMCV0nVhdNzLd3klnMz3mTgop8yTe9rmmRZwWdMmDcSrcwIPtiOb8l\nQ0a7GY821Idu0ayBA/ap9dICIg2eBiyBNvQgq4F+E5gyt2D/XFctXU/WRytk\nv53NDCSiE67L3DrMhi1EGyXFFlNE3W6l6CxzGtlzggVw0IqmI0DoqDLzCGb6\n7FShUtfElZmIBKdO1dFpEeD2uJTctcNHeVhzO+oYzEGESQeD9y8EkinCjErs\n3UN8s9CaWDkzYxkmrH+JJkPfyAjZpHobhYQE7GCEiM8wMFEFoQC4xVh4RHX1\ncmyslsKRSI4WyLhYJKPEC5yRXTNHIpmcnis8gC6NoVok9XTVZenHtkNH/F3m\nQP08XlIr1GHFtyTILf5PVfnErJbfzICNTo/qXzlsRHmFjdfFW9T3mpfNuoyJ\nEj9RTjt2KfqCQOh7sORgf4JweX2ucLHISe8pup/5VoJQ7s6P6Pk6k02R8VgE\nmGileeqqPT5KmTtV1TQqH1wN9k+CWd9J7CwiNvkU7EEmsfENhp0rUOaNlrgD\n9Uru\r\n=3urk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"da50b6a8ac845981a5c38cef9f86d1c400487648","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1322"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1322_1590785178079_0.5238881007158851","host":"s3://npm-registry-packages"}},"0.11.6-pre.1324":{"name":"piral-ssr-utils","version":"0.11.6-pre.1324","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1324","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c223df1cf9ecf3c6d51f46cbcabec7c0273110be","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1324.tgz","fileCount":25,"integrity":"sha512-Rv/snoYsJ9oLFrWnGqJv3MygAohJvOsfsH8Dpp+SXB6WhZcABdQ8sT0knlgEmvFGyOcOEeV2CJdEKbilsnzt2w==","signatures":[{"sig":"MEUCIQCZ84A4USAmv1sC/c5yxVNN5CCy6zoXRvpTyQn0NbNVSQIgEq8ji2pSH88/NWB7jEOLnyX/L576N+xEOEteGbj2pjI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1fMmCRA9TVsSAnZWagAAEbgQAJ++Az8KCnX7SZoFdZwF\n8EcWHvpq+9aOoU9TLXjOYeqPHdvmuoi+haQpphTvJErnAtRARzY7l5e9aBeI\nanc/6h374kQdp7pcEZFl2U46hYUqO6Jay8fhVgUaeBfsxmmKrXqbDorDPLi5\nF31JlNYuKpKq0MlCYgnUllsUkcRZNma2wZPb32eW6yVRcqqF6h4Hn9nT49sJ\nsaDC/kTuxDjIfyUSSNlG5rZi8rgrazMiorDbkxLLczOEuy1s6EzicakaJ7ym\nNgVMN/Imgl3Gs73Qohw7yNA4RSEZZx4KQqm9ZBgQ/9vM0yLQ+y14+MyZgyOd\nG9aiK+cm/EVhfSGaM1PAFZnHNNjGI9/sFYI9ApU0N2pqsq/Vxz/EuUrj9zGW\ngEyBli9AEBXs64EATrCr8YzSkM6vu4pbT9Qu3PLOZqKOh7EkUevZ6zssWfog\nW+IRDtm5IztLeYS902cwHuNAo22q29KuP6ZumjzqcB5WXu7fZ+DyssFOYVAy\nnwoeQsYDv/S7y6eQkY6gEgK4tLu/lCrTO/iS1KzSlEeQiXl64XtXGtJ+3/uL\nsiN5RbfaLbMP+xb7wXxvfvKeRZXojhSDVNHbxdLz7Or71L5o3x5+hIUCvGTl\n+Gk2R+vK1oJRNZzCM2rMlVz+Rb9NylUX7lV4eGSpUD844DPNInd5CFKojrFR\nRnlk\r\n=3Sda\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"310e40de68efdb9b25af6326ec0bf156c3ee9c13","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1324"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1324_1591079717850_0.48011423899387906","host":"s3://npm-registry-packages"}},"0.11.6-pre.1357":{"name":"piral-ssr-utils","version":"0.11.6-pre.1357","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1357","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a94b339d4430f373c6db01da273ecb878e9f1dee","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1357.tgz","fileCount":25,"integrity":"sha512-6Imdliqvg9BlE61rSpIMpWmjlMnT23kVm0Jv/Isk46JRcvBm1BvUz/a6re4nqeVI0fw8Ny7zY1+Z0svHx4mNCw==","signatures":[{"sig":"MEUCIQDb3c0pZgyqnJwVY1eVo4+0jRC5sPtOoe6+9jkciMfMwAIgQrRKgqtpf1W4Bf5d4JPW5MCkTPDDxgc1TBi0YDMA0dE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1mPhCRA9TVsSAnZWagAAcFUP/2rxUDLfPre3J9gUWNTf\noH8vJIV6M6qqiccTR4gC6VBWx3vyjuudulFTamuItsUCzFue328pvclRmqOX\nBN7RFJePZ217QcK8MnW/3CTxn4qci4lTiABPnITMPwvREX0DABX2iIa3Qbbh\n3T6rm1rzL0YORIoxLZgjLG8Mgcx5kssFMgIE7YGPF2f0LCrHn7OYwhU2y0yP\nJ2rI2MBZx/zTwt9xRHSLuuLcadSJ+fqdr3zS9t+gP6fOPqK5bTVKO7p1vJl6\n2KDogNZ3ZalvBCygEbxsvw3bSDYGOXEUTwDYPlhsqC3TqcpRZGn7YsP7nkWc\n2nWCDGElJdzwO1vbA2BHsed1pgg8fsN1plRLuvcj6mx1gzUAieP2RePg5tuZ\nAPSLYvABYLhZimq2yFvYnAt1jVPHtq5495Ii41leAavmfrItUfid5Ej8Fs5P\nlGaPemjXFTux+UiuVTnvo8NQYZDXVXL6TwpFsnZavucGvW/SaNusVxxSxZQV\nGbLJ4eUQg6Vb3mtlLJSkCg1MlQxrteEmS0YYoHonzmSpMnfbV+mbVIeehDY3\nUy1rhJywp0b+Q1VZ3wmQspoLAmJamH+QPHsVTwr2XQa+nYIGKVN13TbSmLY9\nOG4kbe4fdCWnkgAx+x51VWB3z1O+G6+QdvfBx0meSmqrv2vVHcX0sspRFf4o\nruaH\r\n=BKfA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"12666232b5aa8dbdc1972985620f4efae5c1459d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1357"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1357_1591108576949_0.1193844223977949","host":"s3://npm-registry-packages"}},"0.11.6-pre.1361":{"name":"piral-ssr-utils","version":"0.11.6-pre.1361","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1361","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9f7a4579fc061fa2de49a90752b2b949f6056041","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1361.tgz","fileCount":25,"integrity":"sha512-42WtMJ3ED0QIgFDL0T/TuxNhM+4NOZrbSYj0KXLio2tbYxzf7Way56jwMiVFj/FYOH1VBZwSUFiR281zR68QXA==","signatures":[{"sig":"MEYCIQDw5RMzBnTPSjb+HTcBbCglXlsZNT0J1VdiRsUVxSGd4QIhAKnlC0UM2djMzDNuDhma94OKQz5tVbFcWxiAO3HMODIq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1m9GCRA9TVsSAnZWagAAClAP/iFPVYK4lMdMgxxNoKhT\nC1MczJDM/73IrfnMp4WkaLspFg3f+/twenC9bSRD5taVTLMGwvXm4djC1L3G\nXW1KlZaG3Q056lj7S2N99iMZMhWokU4FH6AIHwt1g3fDJptZwVZ3vYJbiPkZ\npxhEQtIrGzczPCfuhRsEjlIHzfCz8Y0NaVd9tjfMMtNq8Adwh7MVV31h3x2H\nIbtO3kVm9StW9InsGv1KOK/7INcFaPWtpzzRHQlajtgySk+KuvxMf28zoLa3\nLJk6/R+pLh/G+xwjO0vtIlMDdRWGrhh7o0Its7Rr7nBWmW6FvXpEz2O/fq1Y\nJm5TYbcRMCuBsT8zoNjbg0Z+b/PAOaIWeYoqN7WdeOU1ScuqZfBR0NPVJV5D\nhNuU9my9bWo9GPf0ux6Oh0rV8fqXq8MIHzn24EYKlIETLVDH32dIULf0qqon\nqbmOnRR9089ky4obI9nwbcy/inqcM+L0VpFWTcxRy5Jr8jgcdBbNTVNtmmIe\npssISzfi5t8kt3GmZjc5h/wA8rXzAnOutobd3AyOdPScWJdt8sSdmbHmTEkE\nVyIBKE5jquqRMaqvt2DEDG2EP9x2M4N/+SDMpb8hMoJHb6Ek++0i4eLhHF8k\nV7vdHP59bD2dzOM7vvJa7xvUeUQPZDnc68jLL0oRdCXPYofoO3asOlTNsWJy\nCp9o\r\n=C9Rf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"3af9e744b7700113ff35217fa06e5c2e08113c4f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1361"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1361_1591111494029_0.6041423408418434","host":"s3://npm-registry-packages"}},"0.11.6-pre.1371":{"name":"piral-ssr-utils","version":"0.11.6-pre.1371","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1371","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"32a296e50e71e8dfd816b9059ddeb052571dc5d4","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1371.tgz","fileCount":25,"integrity":"sha512-Pdj+nnYw0LGez9BkIfOu8r9gVEtoFkifOEugWXBKSF1EVRm2V6hhGmU1IcLv63OLMm/utNFler+VznYtzPGCOg==","signatures":[{"sig":"MEQCIEhpgTdyO9n9OaIN4dnb15o+HMJ/kHrM/DxOvoQknsiJAiA2RwThJ5Ar1o+33e5J9VegF4zx2Yth/u+C+pqRWY9bCg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe11DjCRA9TVsSAnZWagAAJVcP/0OKBhNNjP4QgIwuQU54\nMUVcgw45N4IGc/RYfelqgfRvqy0oMtqfRqa1z9VN8pcWWMme9ERHbeZaAC4f\ntxQ7OuPuO3i8np+2oT7GF9GRDyZrciuZjmMS1Ojv7KmOvoQ5zjyrKJ55PnMa\nV781VnEZRnBbItgrUtXJRT63e/zvpyvb14jp3LQU+TJNywsUNHJm2UJKXvvS\nYcyIo+WBhX5jOgFSdCAa+BHIV0HpuPCJaJ6A5y1NBXoKcOeABhUqntKDnqq8\nHfrbdpPK+bLnW07idyvzKZRBbc0NWf0mQLF19GxPMFNB76p6/cLljg/0srxw\nJNDTXuNGE4pJ09kEWuwvGvBFSegBs6VY7qryJtPAHb6yJi3C1tH1670p3kaW\nZqVCR8EgQa5etyNwB0lGH0PLSo0oioZPkTr/GnPdbhIQcguE1X9/u9YmEGnB\nZEJsspwRTZnsJ29rNC6ca0Gm9bJHKNj17V23tJ80TJEjucGkb/4euQDero5W\ncJc9sUHhM+eNOabTKPJ6yn6OLtL9FEfi6FecmDwv5jejU8md9kB85qyVgkl3\nD//h0Epu7/T1g4m+DfTJNKCta6uk6bxmy15hi4pdf8oAVNZPov2GUxBniQ7w\nZdwjzowhKC1rUk51TgZhRnpQn1+78gnxAeO6c5FIdWHzrBmJLVTxGKFeCbZK\nNUtZ\r\n=qGjp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"03de236167ab3eb62fe565fa7d6b4e2704ccf1a4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1371"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1371_1591169251542_0.8004074000329584","host":"s3://npm-registry-packages"}},"0.11.6-pre.1372":{"name":"piral-ssr-utils","version":"0.11.6-pre.1372","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1372","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c7cbdbfe08d92f6a3037d33cb342c094fa5a6d0c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1372.tgz","fileCount":25,"integrity":"sha512-q1oWqxcZPw0jlWg1pq7x6qtBkWkButFcoQGyRUKYebtA8AFacr2GUzqS54MMdgf5b4vPlTTDjC4k5eRvgkd9xw==","signatures":[{"sig":"MEUCIE5oX5qPEGjxolj2JrztquThidJSm5pGigKpyEqv7++DAiEArJLVebo3QkAkJwu2dhsW81u6HpbPtJQ3UpU0HAzFwaw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe11WQCRA9TVsSAnZWagAAlzwP/jKxtytoUkwC5BMnGaMB\naDt7PGs73/D/7GxLS5N9+oZ37NTlF+37ROIXyGWEjRFbteuBXzeAd2fhHeAX\nnVtd3AV82UAasd5ujLgUma1PYPUt24RoDl+zgAMwr/34xZw7uatOWctNKHcZ\nI+Mx/zjbmVJp8vdGXOhnIA30R7cqbnh1IHOEwBRY3HBj7kZ3rUSyA6YixnyD\nWCQ16QeFmKXwbl9jqC8+/tXbMJ+bu7tntwNyWprtkQ7W26b3KeyzYDnpu6XF\no7FvsatDQgf2K8fSFt/0cZmsLEVNUXDRVqEctArB6H2+xab66IId2kQ6Vxjf\nGM05kegZyvKuW1PXtHMZkDnRz6i2bVfMVlYTTLlmhj7Z2TqsRW5+yWO/mPIU\nMqR48W4FgHndLjmdeaiUWACk3lFDMhpdMb7woAUI1o59zB2h7Lu2Y88bNnng\nP5+SwzgYTsJz/AovXhF9DCcYLdmeOwcQXFflYYBY6E3tq1+4TjFApnKsJTKS\nhPI78A/c+MCrUAfAXShd1QavZMLc6p320j2qR9Vv2cQUQOchZ4p8Xjx8Bz6w\no8M8AHRGCad9uCtHVtKNMh8uXODsV8d5zh6kjHlgtf1fYGQR4exoKAOVcBfW\nNaxifUXBtG836TuCiRgTdck95D9pXdwROvR2GOoyMCHsvWZ4z8MybkUVBBE8\nK1yD\r\n=bgrb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"3d8cd3549113ddc046ab13bb8086e2abcf1d0799","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1372"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1372_1591170447825_0.1407664479021593","host":"s3://npm-registry-packages"}},"0.11.6-pre.1377":{"name":"piral-ssr-utils","version":"0.11.6-pre.1377","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1377","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"81eb4a6722448ab07d61c1952225c9173cbcd0a7","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1377.tgz","fileCount":25,"integrity":"sha512-g7EeVw9MehC38Pq4dG3x/ZlIrGuydjs3pbZXGvuOiA00v+ajkNWoPh1iXEyZFMDupnPmlC7ZomHzW8JaYdELEQ==","signatures":[{"sig":"MEYCIQDZ/GaCQmC9Rnm6eMFCKs/pNkaTHJRBBbzEgWEC4LT8dwIhAOHAvompUcQVSErfYkbJ2KM/e8rSiaF8vWH5dkMdiQ9Q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe16MpCRA9TVsSAnZWagAAResQAJm25mqPNPRWOHbDCLwa\ncv1+EnvmpX0Q85dnsDdzanW5SJNVXu1poA8ql/Nk3bFxYBGkqqdco0wM3rC4\nbDpyVZinILLKZyAGSDbu1NQqZfrpoi5A30r69L7q+l4fHk1YDNyLOccHSVCv\nnApkH+o04on0HeiNaNc8eLDhNpB+zMiagsw/Z8RYgcQ7eddmO4wEztT5xF7f\njL0yfYKXvQ/POMu0TS+Nr087nbHo4naUwy0tb3aM8MY60i+gCuTAGWBwxWAo\nC9XsJ35lWQmIhGbRpwoNgG0wpYct+zFXPjlWhQLk/2Cov1pf5/AkqHaRomq4\nXesxiGZuc6zAISQLPQl7uGxA1iPTCr427tsN87jrwdk6eC4z8FRpC28UvFf+\nx+Lwcvfn5fNFoyQZoOjMUjXTbCGtLLxAmst1nNIZ2Y7MOAhldMq0LyBTA/sk\nN5hWdrlU2N38vBGbjW4nbdha1T4vzFOjMkrb2TaY7lKRYBlegFHB6dNWe6fW\nTOrgUKxfMGfPiHGybIHocFg4jXHpc12hqkGgbFuN7vDuIx+fntpCGzo65kOj\n7ESBqsswcntKDGeBb7AlIonfYyH+96Ikm7NOlo4M/TAPZ4GsVdyzcsDhhxdP\nJQGYleM2WcIGy9GVBRW0xeNx4Vw3ufWf7O2csAuUGw5A1SLTrLpvL+BNNX3/\nrPo3\r\n=xXti\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"2b6ca04d37512ee8bd1355b40cbcdc3bbebe2226","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1377"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1377_1591190313359_0.11437264591688745","host":"s3://npm-registry-packages"}},"0.11.6-pre.1380":{"name":"piral-ssr-utils","version":"0.11.6-pre.1380","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1380","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"355cc64550f11263b52bb1f62b5d7a447b5c53ac","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1380.tgz","fileCount":25,"integrity":"sha512-NbjChGrLpD3S6ymRdG7mqqCt5Y45hefdaeaOBDZLhJmSUUQYI6rdBp8aRjzA8+IDU9jNlmACcu6s2PV+0XekeA==","signatures":[{"sig":"MEYCIQCBb8Xiwcs2SXITPNY9TVXs+trW/USpY4TEcJNHs/8LwQIhAMlRq9NLm0cO5WEM+A4Qoz4TI/gvV423NFxqk5pMQ8YG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2Jq5CRA9TVsSAnZWagAAUfEP/iPEWg9g+Mld8+xRTdsc\nSK9tkJSpBQc3Va0UfoBxkeJGEViuz5rBqG3v2AfGqNfG2gV0lrq3EdVlLlY6\nP439bWBdq/IzfRTFM8SkAAhBBTxAm7YtaIciwJVuTDFG5iulxB6kyUpicEXQ\nTeoYYJqIinUMzxaCKRVYZkpZav9SHNpxicXYQovoa/59pvWwCzom/oJdL+sB\nbdLkEX1bZ62IZCns1AlRJBPgdYSUXVP8FlapZQZ9DFszWYDGhp+D/XBB2NE1\ngEEUdmAEqwWKFIIJEp1xiGRlKF+ZmpXIUfc+L8sUe7Rmna75HXsjYzEXHqwu\nWeBvTZyzxSJLAZJUVVjKrLI+RQF/Wi0iOZEMCuACqNHAJZeo/vQzmm9W9RqU\n7v3rLe+eiijbyT5vXOGEZQ4Ee2q8CSNYWjO2m+VtDgDbIJi0hYdO9VS+h6vW\n8BY6QyQtDiHGBrM9DbFRL6Y1ndh2/2dFA93r8sGiXB+mtWZMPbRkAAsZSZxt\n/22u73jg2bpS9qhm8xhUmuURn7rph57fFSSVn6vIxgbzOgBJ2Xz3HRNFNjXB\nyw62wsElU0yUFGzCl298KTSNO3t79KveK5vG9Hkgoca4vHijG2OHRmRwxVMp\nDMtIycUcthXNMTFqBrmiDLzhDVTu179vD9sReMPNNC/CLYYWYJZo2+6llFT1\nlwV7\r\n=Jmf4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"46e964f9f287fde8db3f319434b9dcaa439abafd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1380"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1380_1591253688962_0.7916627350337517","host":"s3://npm-registry-packages"}},"0.11.6-pre.1391":{"name":"piral-ssr-utils","version":"0.11.6-pre.1391","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1391","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"99e89ce3ca7a5d805d361475d32ad1dfbd983b7e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1391.tgz","fileCount":25,"integrity":"sha512-oAo3Mec5KNSpTrLlb5GkCQNWQMEpmQ4FAPz161Mi8d0FkZ7tEIhFfYgowDpre1jc00OeIk0DN2XHuiGZCWgffg==","signatures":[{"sig":"MEQCIDVRJuas48wjMAFGf77fnRDZv/0k8Ir7tmmd9rKWji2zAiBCdqT92w+6hIMZvmFLoe33nlBL/+XoPeSp1skPIQaNcA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2tENCRA9TVsSAnZWagAAd/IQAJW6ljl8cWWMJOgOh92a\nI861GdiZer3ArNeHYZ1mo/aI6n4FBzPICahPYjwkp+grrYfRUbLUkDp4KXBU\nL/IU9ciCivZGKV7/y36KArYLtpAv2JfqX1CKnOFT64yvePwTf7zI/a5LlTYC\nD7wc9OHJvvLfNNS1/HbpSkNX+tYCAEBQ+WKuK/AkRiSqGFqCJPlGU+Iws2Eo\ntu5hRdTgXCLdK43EEKThmsm1iXHLsXPtTgcpFHgYtnVg0TIDTE0+KNQMQgAT\nwcVnWJI6wfkiimxnuNbZ0L0HZ6NXSFbYMROE3qijgqwrr7aL+10oFXsVbPFp\nF/4H9N6cD+w+kAs3TU7AemREvgZfBOsDRHGhUxa5czH+JO3sQ7mY/Kw8dOQM\n36R0cr4nvOOtV32e2tASKnqgNeddDipL+iglqlsvxBVvzGS70FrZodRRIHon\nd9TZzyB1B93J7qOyae/Gic7vlh00x/RJ2C27lO550SSXX+V4VUwsa8rgC8g1\nhykBRzbPQ2ZHMtr7Jn9TByRqtpdP5pO2x5oDt+4okR6iudhCtIXOUzyrGRbv\nGJzEbBzFNoRDHLfgRPy9dZyOZAu9xTugi3+Fg6sMvgfA04Mc5uVJB/yVWPUb\nyFDhC3+X/T0pURgsoy+UM9ObuA8Ywj8iFtMvl1rMUq0T+pQmQMh6mgTXIZb4\nDMEd\r\n=zt3o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"39a70ad2cb9f6c2c588f1c1fff536e4d408f1f21","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1391"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1391_1591398669199_0.16776565407678556","host":"s3://npm-registry-packages"}},"0.11.6-pre.1393":{"name":"piral-ssr-utils","version":"0.11.6-pre.1393","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6-pre.1393","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"eb1407498a891b89efea6a0bd8628a3dd8c54efa","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6-pre.1393.tgz","fileCount":25,"integrity":"sha512-mesKJxYFONeA56HT20yOug+h+4SxJD5G+FqRdW5LYHPVOoDcPWoYhJ9O2Y8XaPPJLe0f0MmOjHe8cR1uG7tGHQ==","signatures":[{"sig":"MEUCIQCVvhSuRPKJkORJCmIfYW+ha1S5bpCPDwoNhj33r199QAIgO8XXqak2gDeK/4NrSdAmZgNQ71kWDTkZ3GiEfQ1ZiF4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2u0MCRA9TVsSAnZWagAAcNUQAJmbyyKxsYDuPTF8oK+s\noiMu6zIPN7iO7NxijLYY4tC+Yf0K1bo19c6B2WtE4mXBJCyWdrOwRBH1mK2j\nZHglxYHpis6ACOOVJR6uOGBTSDgCUzf8p78K5l3fIyA2ndtbJsfYV2e2cYCk\n9YKawxnzqGRQoFxg3NYf52OUhUdtz+ubqubsj75hi5tNjKMo0VAxdGOUAxAF\nF9zNSmkpOo9LNhr+uwS1rMZTXR3Wtk4Rhh/9ovbrHZ+bdu/u/nujZFmTs/Ax\nCLr37Z+xZvYIDqHzVYGazlJKKfEsNfuaXH10irU2YhyixXk9Di14r4Bh71YK\nXK2f5wMaExPNHbBr+ur7J3eILO6kRQag+e0nA6RDe9JMpngxcPfXxIhvk8Zo\nde5n16KalFc4OpplJLYP3BHAsBnXg6F+H3tmoO/ciKQ2gC8Sg4IDAcq/1vXf\n26t9zZseLu8y0ICzd1IugKqdugVHVUyog523oMaf6qUCfs4kGj3tOlUabFFp\nnR8J17lrpMi9eweszkfFTVjk+lXA6miuqSpMKGX+zZofvQtmMQ6XzTJxXqWG\nHMH9EvJbDYImB6sNhfamsLW3F4xsHv4vXDBKkoPlemXEh3ufcqbT9AfLn+Ia\nu8mhqX7eu8k6MV8xLv4HXfO7rHC4eHOFUnV7iCRo/HwHrwwo6I/uFtBDzYbb\ndEKa\r\n=yEzu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"33b8cef3ffe2814edd98123de6ebc938390dfca9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1393"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6-pre.1393_1591405835852_0.17199600881551502","host":"s3://npm-registry-packages"}},"0.11.6":{"name":"piral-ssr-utils","version":"0.11.6","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.6","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b12323b5b5cf70ffa8c01f9996136f11586c32c6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.6.tgz","fileCount":25,"integrity":"sha512-5RzbfVGZg86lsqPoZUQyaGoUGqR2IfzSRkZ1LM9KkL8RAp7pJ1GOvPwQP5+zS6Zc0HgqJlk9Dz0f6sFStTVwJA==","signatures":[{"sig":"MEUCIQDYr0L+EsxfLXEiABurbndTSjw/cAZ80C3L8bdX+t3kSgIgOAYq55MRr4n8Mli4fBSFS8lqnkvR3ELhOJmD8QJu/C4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe261CCRA9TVsSAnZWagAAF0UP/i5GP41rjfUQNnrp0lz3\ngYuDV1MBAbTY0FXgRrh+sevbph9zmT8f08i5+n5OwgHTndU4yDE/jBckX5Qm\n/+YnyYB9La6k5tHKY6r2XvFvMLujS3PQ47RJ6HrjWPsl++/MKKDoN/qT1707\nMBBl4IVD6OAvH7sNpzXbLWh256hknuwWKHhYAuxzTjUndF3EUGfxejVMWA4+\n6+ThuJLWaC00zSl7wgN0g8Uya+JEOE+kpYnMLbqKDbUe777jUmiJIA+FJgVt\nhPWpYt9QJ7c7fSUshpeH5O01ilsY4kb+WphBOII8q1132GY+egojX2E9OjWa\nj4PsB/P/75sl8TZ8HaW1XX2f8a2HZ2mVgbDtK7RiiIjKds0KR7iWMuuCS6w1\n/ifunrv0dstcOb4b5B5byyKarzLmobSxFkna4xW9aQ8aJO5f16yVxdeAAhBB\n70PXPOyx5b+4D50vLqIhRJRUdmC7Qv//XwEnA/oet8cd3ClOliPpT2dFLCry\nIloOU0mOO77/Fcact3fqt12x6Eeo7+Zrh61dfKzcB942/SXeFsUv0+d6BKD0\nypVxFC7913kiMGf2WCY4Cvw7u1jy9ZfT66g5muYUySSinUR6qVg4yoU5+hqd\nmGAwmeMQSByVIdfZKTfJ5jaBokoKkgzOzXOEcEfiwuzjkQBz2YoGDLPrilYP\ngDuJ\r\n=Flkb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","browser":"./runtime.js","gitHead":"77f45e01cd4c1ecdf3ea49968c305aeb3279a0fc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.6"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.6_1591455042451_0.588060452352116","host":"s3://npm-registry-packages"}},"0.11.7-pre.1403":{"name":"piral-ssr-utils","version":"0.11.7-pre.1403","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1403","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b444a9a6e408d245b967ca5491dd254484eb373a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1403.tgz","fileCount":25,"integrity":"sha512-z+H0Y9bsYPdbtj18AnJcbvFRw9Ys9BuTVNGkRqyDFZHm4BogxMd6I/dxSjv8LIpaE2BqA/4VJvqXUS8VoC6EAA==","signatures":[{"sig":"MEYCIQDQ6MBHX2vrh9jbNxJn52NR8w9wFnxs8oddtYCGiDWFcgIhALElrv5jdiJpuhce3jqLZRiwpEdjJd5+7YzhfEjLwuh4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3OzUCRA9TVsSAnZWagAAZ4EP/iRrtxm6LPu8SmEh35QW\nRZyYO5XJJDLwVnqMkKVfkjOiMUfT5ew2SsE5Dp3vs08T8PoNHhnqRucJfvNp\nT3el4HRg7hOB67W+kKXdYLMOxuEtWl/9kQVvL/SE9dCnjZRNBibaI7BFOGSI\n0/94TsDbS4lO/T4iDHjDWfqAUoUbTauHzeD4iX0657tiTjt4j5rJAi+z0Nm5\nyeNmsqxHjRdW/n/5/jV2AQ+bLS0cpTJ5pN8wuMYTVQVQofLF6lz3CpyvD/x/\n8QHgoY7H0s4Mb9p0qcihAJfsYMJx78q68sRwhky2cLzlB6HYVKUQxdeGDNkS\n4aFH67vBsZ5Np7AirBqaUtFRyWNuYv8F6DU0XiIL1QAkZkI6dHk82m9cSksN\nKtXVU3CivTt7uA1whfyo6EHFNipMJv3cn3y30FOAipaMIjxr68AXYfYRzjtI\nHWcV59pFVPqBqySGO6J2MxUiXN63oykaxm4bZelz3kiCXGCyoSon7UeMfEx2\n8CjUNxyQflPIMpYoXRbVyqFBVwy8Br+JOnC1qvv7roRIZSvZ7hQetaz7kE5D\ntj+8OykTe8UQCij0CM9yCGboC5F/DJELLF+y9u9KviYTjZKrdj3Qi8+nLgky\ni+HSEF0rkcFz8iq3hCkR3i6qum+Wb3ve3e2XMa8a81vmcJgmEoAt+j0Kpyfw\n+7NK\r\n=Rgre\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"cf57c1d8e95abd14d40007893d6fe864ccab50dc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1403"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1403_1591536852027_0.10182860229451185","host":"s3://npm-registry-packages"}},"0.11.7-pre.1404":{"name":"piral-ssr-utils","version":"0.11.7-pre.1404","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1404","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4e1e5f01226d23fa650634e1d3f4c3fee90c75c1","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1404.tgz","fileCount":25,"integrity":"sha512-8s9b7SN+pF9O0kuFrQxNQ5uYFpb0/3pITBagNg3Afbv/bTWZafuVzCnaH5yCtWSMhXin/x3qZr9BvmID/ypMAw==","signatures":[{"sig":"MEUCIH1UefXoo2PmJU3uEKkX50mubzXlc3Ni1zvNulGEDIaiAiEAo30rhZGCi/cBcfd0pudtANHOKOs1bFwHiRutwSHbd0U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3RSnCRA9TVsSAnZWagAAyocQAIZ+nZxV3AesjwSw2iYB\nCJ5T/cgvkSyg4R3b6tsNalVirufhy93cwFLREH5VrQdu0bslryvjoGhCkUp9\ndYsuvrCWKMuJYc8cLAbPjj3OPMWR2Bil7jdiydTjupDgtmnT4WF+NyflhoDX\nlaGcvcaQEsj3Xyk2OU62kCnQwDQfpf/Zv8tjD30wUXxd+aQuYkTbuSX3O3ET\neCgE9NGZGUCtEpPUhtNmx+SFuGrbqgDPpiKOcPxoqXrniik5xf3Hdv4eSe90\nrVgiYjCpzIuLu45pqFnzdcFxZXumAvy6Mz4H3hHw24fOzmfEuuL8mT0MJl7q\nsgKB1VD/nlnEXGu1GrOA2sbTaslUo9XWND5ZdKfRUQC5xx4nYdlu3mQVCcW2\nQC22wYA5doFoZxqzkvDHwGXR0bSFP5K1tfs4mc4xVO19Bi2sJqsM9EJNLo7K\nWyuYYYIvTlo3cvGs4F3G24Bo4O/Xow381EnQ+PcJSOB20ajlyPKLFgXmty+B\nPh7Feupr8q4T80S+MflgWiWYbu/C4KjYLKRTL8eKCN7WfhDGVljAi843NofC\n49vvX6mpd/5HOfhmqCPyU+kH7Bsn86IWjvjeeu8xPeIlJGaOPDyJIrC+weF/\nOvvzu6HEbaYQ5mGT5X4FBjzyTGXYYF+AU91UX85yRvIiEzLQ+0X5rqdVkoi3\nsjCj\r\n=jN/4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"9641030afeb37eec2c4edfeb3e5bdd830156fe06","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1404"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1404_1591547047086_0.4674347950141795","host":"s3://npm-registry-packages"}},"0.11.7-pre.1406":{"name":"piral-ssr-utils","version":"0.11.7-pre.1406","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1406","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"87a79565ed5335a1e0bf70265ca3653131d316c8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1406.tgz","fileCount":25,"integrity":"sha512-+y1csWZh6z3g4NlD2os9doqYL7r7h7SwdK9NfmfgxWMaaC5cHfYVff9Q/8Zp5eikXlMQqfIeUKDY7Dtcb9SyhQ==","signatures":[{"sig":"MEQCICVyVlKCNG1p6i3+INHJlTVBXzKFcBfWR2ljR1C9xOTVAiByKSVzQIaowIbVG6eP2wGoEkqxCRprznd9VY2D9ZAqPw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3WBKCRA9TVsSAnZWagAA11EP/RClWAWu59CXQ9oJi+pI\nswTJ/i7+7vut8aK6uTBfElYzspzdnujudVaGEBUt7cVD8f+b+3sV9QBRnQFc\nhK22kfRiIy5t6oU2ujjV53DxzkP8bfqBL2/+veVtH6/fRUOAuuJ/GI0HEhl4\nyXxr7LwyqlsfYGjZ2quIcVEFoXePsJh6Nf0toFoLxHBGANdhvUUadd2GEqdl\nyE18+AhKLH4gm3ASbwZYWtm2NlRdKKwpqmyONXrvcFMWkPRPeLMc16IXeu9f\nq7JvsYrROt58XUrdqXH4uC6SUcAbH6wfgyB5FuUZ+wfB/g1tWNo3KINoybGW\nGqGvMCuqptRKv1udQgblhsgc+11ZiDN4xQwklRs7V81DuJAiWh6pbGUY9bCj\ng6UDGt/YE+/ltJxtobnlJmwnW3jkIiA6P9jelQom/owMGh6Emov8xIqY/F/h\nLrNG9qQkzmEQNwQqtBF3/oGUqkfYJEP7INrRYdYBKLh6vffH/CL6C057eXZM\ncxNdOaY2ypWUnBA0jYc4zU32w5fsGHLPGzXZq0WSFtMNvKJsmfIOj9/BcRvu\nkTivCZ/zOLY9jltkq1yFV6cNa57Zl179yPJpKfOOBRL4lQNYtM83PJoSFtca\naUKagM7CTPtZbL5w34CwC06j/wfWMjJjy8At/q5zlRZaPorCGiARiqf/InL5\nsXDq\r\n=e3+W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"b819942e913b703141154b98ad648faa4ff2abbf","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1406"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1406_1591566410153_0.6287326645190325","host":"s3://npm-registry-packages"}},"0.11.7-pre.1415":{"name":"piral-ssr-utils","version":"0.11.7-pre.1415","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1415","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"94835d0457f18a3280d284b52abb0c1ec337c635","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1415.tgz","fileCount":25,"integrity":"sha512-my06xupK2wMT8Ye+FUbIi27AXM58KqDdAGDHbwZpCRluHC82067dlcFF5lKNoUqLmdOoz0m4x7LF4BVzfSAxOQ==","signatures":[{"sig":"MEYCIQCficU5jG8dKM9iTXmS3nAeOjXrF4EhNsxV03baYfqfuwIhAO87jxDw1Sk2e/eEl8fwiphXncS/YMpWYvnAA1SMh0DP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4IdPCRA9TVsSAnZWagAAqu0P/A1EO/1IFd5S6BBgi7nh\nwNtBdg+qem5oVo438/JzBMtyLCD8NyhHt/oHreMwsaVE7DqPyHM4pNjSIcrP\ns3E+9Hvw0vMd1kQSSlTvwr4TCH4dupPglkJyORy2PoQfYrGH/cug0YgnWEeH\ncscCO5uvqVmfDK1tFHOKrtV3QbzrcpOBsM13K3Wa5yJRuLwTtrcwtIp2H27a\nh74SZ3IuDrn6IuMLvFk/wrCQgYkHvXxkxChMhVsTy+CQvZDym1b9TBhP8tGj\nTGEE0ARMz+99ZpYWLSipJ+1S6wBp0mC24YwycWiCXFT8Eq3GKaq/+qscuCwZ\n7AD+8HCZPdRAV9I5Wx3ydBqYT3jpAa6R9HG65eDmAYWJuscgfLjrPdkPqU1S\n5WppctTPcSMxVcZRptgYCI+cqLkIIWxlArDLdz9aXlkGIJRi8LmP1OG10hb8\neWzzIkBoQz5QQpEFoK0xJ/GdyBuN1lP6DXc17nvVykF/NmM6sOLx3/iISGK+\nW5oGAYXFvJQsmdf8qApuBk6ZcS9zTJ2+JY6m+9FyW8IpCBcu6Y4aqbkOXsIm\n7wuz/1zk8ipjYjas1qwrs8Icmt/57iHi5D+g0zhExN6OT+eNz/DFcNk6Pw8q\nhZY+U8A6kBvOkf9QZYI4ErEl4mU0TlE6bg7UvtDJDG7p5PljGi5+PrRIS/5U\nJN97\r\n=Qzp2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"d23364acb75206d6b542cd48026e377c4c34d59d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1415"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1415_1591773007373_0.22782751817444646","host":"s3://npm-registry-packages"}},"0.11.7-pre.1416":{"name":"piral-ssr-utils","version":"0.11.7-pre.1416","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1416","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"bf17dcd177c548bc61a6745999cf5cc10cb5fdcd","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1416.tgz","fileCount":25,"integrity":"sha512-TNPqcU2tHIZqhDcwAU7+/y9FaapcIW1as9jROobcOk1J6c6u7OIA2HMG5LY4DOASVjoEFNWElkRr8xY1aFG+Hw==","signatures":[{"sig":"MEYCIQC+YJqGolOW/a8WzJfRVhPwNz/e8+xtgFxJg2rTm2ck8gIhAIrHQc1idvptIlZXAast5N1+qxNud8umtF9HAPYLxbgj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4J9QCRA9TVsSAnZWagAANUQQAI4Xbl+TeCRM3XlUsQPi\nBuBfiRd/Z819NC24nNtDR55n5VT1dyilsGmY0WtRn+344FYZJrvZL1+Vs13n\nfeq+QHxA5J1m7O3ChZ2lNAO0M+6qLukTpim57aIHxyhstqY3b2wlx2Okygfy\n5SKVSUCquLssrCamDimaLrGq31OLAk1ZIAVuocZk1yb0UvI80H9skcclWMW2\njQkIvMy9NJkZGQgXQ0o+/TD9a6j5RXK+WCMBrEs/hcE1k950Mzg6xXPY7x9j\nKpRKUB+YAynq9jNzinS1I6CfZ1HXrzv3M7EnwDiBcmxL3CgVVUPyK63fEK25\niaSFhTz9V3ddgjTxbq9wCbAFtpyj5tMh3AUKeKRp5oCOcvBNjJvhaP+Fy6Gh\nyJxYAjAIOQjM0YcY6R8i3LdjAPzqvsmHiA+ddCpuRWy3Qt5Qw/UW3Ov7RpCz\nnKHlP3Btf57i2ppvg+GHaDCVYbbWoG5C3C5uLYDQ3ef9OI6S408+gioLaAdC\nL7V4U9qfPRhIWmxhkQTPd81JoMBk9qb+Idg9UyR3aNuxJoq0K8ycyeSTuciz\n9bOXqNldSoPXvSHTfneyFWe0rOLeatQLjnqSExAWndVW8+PkDZ2wcu0W1m3M\nVwGc4oqbpHByAuGpYsyr34MgnOWOSoZztW5YE2ADlihVGpdw9WwRVRCyRwzs\nKHc1\r\n=JbFG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"8b42780c2a66b8a76acecc1cb61e072f49622de1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1416"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1416_1591779151742_0.7941200169101776","host":"s3://npm-registry-packages"}},"0.11.7-pre.1417":{"name":"piral-ssr-utils","version":"0.11.7-pre.1417","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1417","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"61e5d7f69550cd1504c03c11d0cdb88ae5356899","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1417.tgz","fileCount":25,"integrity":"sha512-FRYo47ugazLRvHg2NFKPFRmoGcX0fVsj2o6DsspMBQ5UIWzDvBHz85LSF1bVzasAtxX+VPEwfPw8ng9QEKrTJg==","signatures":[{"sig":"MEQCIGDvf2eN+DXVUX6jb3JCV+wV8bX2desLQikd66GThiNjAiBLlFub580HzjzpQmH1fM21xXGl0Je1tR+qD9DiJCmYsw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4KfJCRA9TVsSAnZWagAAaJAP/iqtxzkcfWe+TDXtbzks\nUqx9APLREObUjboZrgVvmSSwDwjthJO3yxrOy3B6OO9bAlvW2pXFvdzAkz1f\n7Pj9FTQGTVvbwpaIlBBx37h5kG1SgH5XdsZRElYOc1FA4BUNNRucNvoBm1iD\nH1D5niNax6Ny4XnNvqAt4BeaHcYoZpZi/YyNB8Uf+ZDoW1mSceipnmsVpvSu\nbdQff4PUrvHGa5W98Ekd0yLckTfKfHJUcUOgFzWioKCrkaIYdllnsElKkv/V\njoEGE7E5etwsAVP7HiUp+bK901HiMMpR0Yk5JhKx7qU/5iljCPZoROe+4r86\nmS0wWShfTdpWS7bd1keEayN6sMGfvOnkaHwZBaOnm5atZBAlSq7qbEfjUOfx\nEp9VmvIGAMyKi1BfH8Kh+F+vOG9C5+QGPHC+z3/qKF2eyHSaq7Lo23MqRvHD\nUF3ObJVFd2FIQbOrqxhIbZ4h8BWWc+XErnc+4wHYSAwz+2PvGgExTAH37z2Y\nOgNeZzr6BU7YsK0IoVIBBK2om+w3Sbslft7ip7A/VwJJAosOtoaF0i2f5vHj\nIoChkrnXuu11i8uFnFxIMhTsTHpVe/IiQV20Qkg1/26VyTk/49o+0ytyWUVT\n0lHgCxxNvYC807dK/DL0W4teaHylNJLSoUQgfKIIEtp7D84Dr7y7jNROF6bF\nmPjg\r\n=ob3J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"00199cfd5cdc12e23b981bf3b3849ceb4990005c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1417"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1417_1591781320609_0.7848625723680083","host":"s3://npm-registry-packages"}},"0.11.7-pre.1420":{"name":"piral-ssr-utils","version":"0.11.7-pre.1420","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1420","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0cc87f51ed39508ae124bdba23bbbb77c1ca27a6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1420.tgz","fileCount":25,"integrity":"sha512-PUxKGtAF/ZkjehoPxW5YPjnW43iZf6IM3pC805PcXp2xVzDG772c41nNk0eDFVx5HiMYREPS8kzmsB+WL/i93g==","signatures":[{"sig":"MEYCIQDMKYALpaDGnMD/gdQp9DjLivIYHub9s6tNsCiu1QlqqwIhAJEugq/O+Yg7qK71Yf8j5KfytvjQ3BxiQrTrw47LEh/e","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4M9DCRA9TVsSAnZWagAAfd8P/1kgS9QKSQ84DcKswfqQ\nPehX27yJtM5oZ/h8FI16Y8IqilxPUsj7BhWhSWE9NBINSD7E8E4bS3MgXpqk\nJcyi8yWX57la4yRZsIC6W5v5FN8beUMrjTpDfaeEktyWu3Zjy8HgiXqQo1Y/\nydKiGjLH5BmxkgVcVeFtQv7eub57KM81fIIU4r/ke3DddoBherpsxwLFRXLn\nBdRGnCzw2UuwpJlCdf/wlonPmbwvMEXKCwuEMkAFyKdMn0j00DjfBsNpqZA7\nFBV2lfsm4tmnTJ7hDChTlgb/Zy2S+FHerz1H6CWYSg9vAJAZ5tYe8v6lfbd5\nE6XDfVBLPXE00wMLx3vAPAS9X+2EVh/Rlz9RuKQsX+3N6joSsaXFTkm+27o8\nQbmPEATOmU/712q4Ntf3k1aMd7AaSpgPxQvmO9sIc3a7GlV3dIYEyzdrmDHS\nRQ5E3+7dika/1qzsvBR2F98DfQIOX5HtrYQHyAy1T3bs6DqgWAeXILmmfK5U\nBPfQSch0el4nSo3rds4J/fbsAwxYucsCOWllTSZGxTLHr/L667iEHSRsvDXy\nUNuudDrI1NGa9TlM+PzcBULCO/ospGxbQKZlfbBdB5WmAw63A+Fvi46RalVh\n4xBFBfSkn4v9cuQcLN2xVzxueJaZDtq95ilsji8NjTO+SVqMq4IJiMXfTDOS\nuojJ\r\n=h7mU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"8e7837ab12a56161240940e5b746d6625a826ff5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1420"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1420_1591791426927_0.4261135573743209","host":"s3://npm-registry-packages"}},"0.11.7-pre.1421":{"name":"piral-ssr-utils","version":"0.11.7-pre.1421","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1421","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1cf69d9057e51ef284c94f9e581f42bebb53f709","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1421.tgz","fileCount":25,"integrity":"sha512-jJT25PJiujY209O+l31jYMqnt/gDxc/2kN5qquSKKPwG6dTlJbkFJvxZMxzvUoOH5x9q4SYg9OY19Cs5rrtY7w==","signatures":[{"sig":"MEUCIQDZ2nqCqKR+um6UREfNEzeb4/FhNHyJgpt3cvbm/0hlbAIgMPnalXi0cPzDYz4CfQC8DtcyKx7bk99dt0ek0mMQU2I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4QC/CRA9TVsSAnZWagAAOaIP/1WISkcg2DL4w8y7/91c\nQZ1jmqt87TLlrx7SjGgG4OghGItApBFC7xq9lXWUEaiKihzOZ//AchOPzkkJ\nSZ6AGq7au5i0vKbT6yoAzZqLDMtZ+iLLJTNYN6RgHgArWIXo5HKNBhZpPWoJ\nevWuLLd+C8o72ozxGgaOLxr/feMLiAkczFxK4PO8tDSDrtVyLNwAMBxrFx47\n/mObKeXF074c3nE0JIvsUR5vlgS8JZ8OkVz7ezLr8C8xd1mC2f4LpchjdOkB\nAq6tKgk01WWK2OimHVzsFK7TNIxXdVTC2PK3uTfhQJFgV+epwe+jY7c2Z3h/\nJWgIN/g5ZRogpIbNHispCo1vDC0hOPEhC7XKLAdHuq+9DHwEiAwJRO4ieCH7\naU2EBVXx2be5n8HmOHgZFyboxrtD9ZZd/TSRfG2m14d3B6Z/A5eZt2pEvIl4\n9b8w1g9qAQUmwaB360fD/JIk/2PTp2E/LNo93lgl5FpraVj29bFU0M/NQUva\nw+GR7zS5UctKBzNsYBe+Uf9/YNvv9aOQ4Smt2lK+8+NBv/hhpen8EnU3qxm6\niChKKXoAZRfoPwocZANFdpmWNXV9cWatQ44/mIqEDdbJ3QY2Dljma2mqiBJe\n2xkQSja27wxAlSmftJ73hmTKGiZV4hR4RG2sYV/diUWAhtxTuUOD/ys42L/Z\nFRjv\r\n=6Y79\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"f6cb7c22c8a663f0c6ebc8c6ab05f852a6748b9b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1421"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1421_1591804094955_0.3505208804715252","host":"s3://npm-registry-packages"}},"0.11.7-pre.1423":{"name":"piral-ssr-utils","version":"0.11.7-pre.1423","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1423","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a75c97b3dee0225eb7a1d478e88f8ffb4a3746cf","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1423.tgz","fileCount":25,"integrity":"sha512-NzWcqLnupesEYMaSLrB42W20bv97fm6ZoCqgESaNJnUorKDwkB/9HuWgRCVv2OPYiP64H1CTmjaiS2eyk4mNng==","signatures":[{"sig":"MEUCIQDkWevSKr0/0s+ps+LIpEA9/6b9h6uQRc8bw7DgJAcCmAIga5vYwHqvoDVGzqSSVfSJCf/WdD61fl08yCX41n0lwBo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4yxVCRA9TVsSAnZWagAAZusP+wYwSxwkReO9aruiiSTQ\nsH+g21cU/wq601v8Ir6FUMegVGTbp7ozXFVEUrMEYQqX+ovl0ngU7DWiAyBU\nVobGBupZZNs8+zxsP9dJ3aOMWlUbPjiOkFHigoM0BFMKlf+YUXK6OeBU0o94\nb2++E+vJ2Dgwg8R7b5mPqDBGXO8d260IuPQDTLC3niZl/ZtLWKkMVlQuTqJM\nhzklFEa4rIIHKfwcguwcIkwH5e2IHdF7zFUgUKRhSXtUKTVhvBS+rq7O4rFs\nZ/KrfiT9K1LwY0WkrbLQveuVm9fFxiW2mf7ntQ9lz43zR4Zba9EVosstPawp\ny2kLrx8Te4ZZThjKR8U1kBuV79tM1Tphj/JXWGHzt7z92y3m1kHLTUYV2Av5\nmXnZ5xc0XfwvKO2GvJnyeJF6HpqXawfzyxzayEUqzA2tlKdJnF73RtRyA4mM\n8en2QT6y2E3UnBMuG9GMIqVSVTc0WuPF4/tkJIjTNolm5CYKZnqt2YvkNTqE\nKLqKTTDNjUm9MnOvRwFBVDymZZauauOT1CsCqcDBR8U9tjloaokSdTWDxDKf\nRMcEJgzWATzig2EUVSjAue3CYygBUh8KOU/mX+xMXkK5oHVFBhv7aOvUI4Ef\nAf9gXMWCjQz5xa3DYv+j+gMB9kze6nnuCZePiaG+gzikB4ZgNxmgRxFIQ683\nauhL\r\n=hdag\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"f0e7891a9e260c6d99e1b0418f2f877b98d7125b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1423"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1423_1591946325499_0.7520509819637309","host":"s3://npm-registry-packages"}},"0.11.7-pre.1424":{"name":"piral-ssr-utils","version":"0.11.7-pre.1424","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1424","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c7ee647b09ca6ecc43fa2c40cfd8b395491eca29","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1424.tgz","fileCount":25,"integrity":"sha512-RUbT6USFM9FhUqPQYY7qQl0blKXVUIYKyhInD31BS4+zvy4ehRPD+Lj11gF6wIsc/Jj2hvbFUAnSeQFONw68Kw==","signatures":[{"sig":"MEYCIQDAlu0nxQDJFbyeC8iSxnH8nSTnztfvhFPbmKRG7Nn4qAIhANL860qmcpbKUMejvxqjmC45u+v9vwNGPgn5m8DlNiVQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe5paZCRA9TVsSAnZWagAAJsoP/AmwLvrE052BBn8RBITw\nTxEbcwVHGIy1zEjDXgtyBerM0DHPfuub4xBWy8DrOX3BzpVq0YSfacsfpA4P\neq4EDXayEO5Vbx0fsHDSNC+1b6cnkzOjteN5joMpoAV349HK8zUvSUPDFzoa\ntm64N96V5dwKtA4Y7/u6psevtL1HksF6Bklw7piqa5PCbCeigBC7EeNkkhIY\n18udGoGfbRZuZMMwh6WMUHXfZ0DJZhBbiPMq0GNcJpLEQmgb4qZCu1o3bIS4\nVorRaJb7O3qJl9hbPsDfZyM9khHRHAjrKXgBs8SVP/SwKyAL4bw6SyvVIB5H\nZj9tEqC4HYHNQMUKxwFsl/WWDshge+KscD7Stqdz1axhklp0FDbduHOG/Csx\nClR7Wa2rVDnmfAawE8/yuVW72LbFvylOFgmJ8spEpb8JSd4/MNcfbKaITyqh\nzp/b0wLVVom5ZG2i5cHnNuGUONRjMssbj2FoyM7ggVjOB53OfVGw2wM45NDB\n8NV3yWtG3yKn11ozDnYJpDGKfhNgK6EkD2CRHaNItlzcElmN5BMDNx4fw+FG\nUv3ZsG+kfA18/EN9xOhJFUAjA5r6kr9skG5g34OnS1/9ofOgUa3TIoTJOQss\nV22WOOee1QzUJfxM8+BtyCoC6ivNewSAUUwSbzjCapUM/5jbVFE03EbK7PBR\neLOQ\r\n=SkDV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"9c69064a69e8e7faf332a8ab069be006afeb9274","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1424"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1424_1592170137473_0.07471804945167859","host":"s3://npm-registry-packages"}},"0.11.7-pre.1425":{"name":"piral-ssr-utils","version":"0.11.7-pre.1425","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1425","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9b49fe2fe9524300c83c11824482bbb614d33390","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1425.tgz","fileCount":25,"integrity":"sha512-AdfUg6nokIRn5DxGTnkoluZnMmKf0FbYypLuaXEoz81RHRutrwRisALOY89glrf33K/4PMii7Wwlg0NM1Q4Knw==","signatures":[{"sig":"MEUCIQDSsP/FXNHHUhGF7NWHng/Uhs9kUpXsWkhMIl6ZpVDX2AIgJcYplJ3zd1QYgY4fZfwpo/0S6RK7IkiRJcgYwhOsf8M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe52kNCRA9TVsSAnZWagAA5qYP/AyW2RMAZ2NXqEZsSMz8\nI97FawDRhcHjqMdR5ldDa/WWT1QKv0rDeqYzg+QNroauWck4kcHxA8DH1wml\n+R9hFyyUfmFkO+v748bxpl6V6zZzj+E+Mr6gmbVkmxc6GarccddRAg7r5wPB\n4TdHKeQ/yxsRARgaMdAF2ihatwP7TQHDG5TdYgFPLQ1b3UCj26KqHAgRF1q+\n7FAPZB74DfOlz1IGMwNjsJ9gLJIMz+Uaimo1RoU2F7mV8GNAzFJ4djgxeA7L\nvpQX1n5kAhZp8b8armRpILgQQAfe31fK+6P3RcRd6lx+OIgKxc7uA1zcYt/E\ntH1vuwL/YNXqnlG4sXEXHH70rNF45RHe6uEpgO0Lxdh5XFYD81H4EeKPkgcf\nzAaHcruemT7UF+FvYfIrSyeXcr9ou8Tr61qc4dDqpemHg23+2B44iWtEqiQw\nBCPLYlV4UNUK1ExlM/NNtE7FPXUTng8kK8795kWeTtNJG/XreKg5I7nv+EWz\nXX6zdmCx7dopg16PjqAc3WXyzY9ytLRRnf4DgENMbebyXNvosDuPAKxHOJpn\nZ/48O6jDW1tAPZmRqyD06GBwIkNSHGbpXocwnqaOYSeomHfJPnydbLHYyWR/\nC8iaQ8K8F6oSSINvQDmb4uK132nbdWe/4FEuF7NP07jowr19DQqGyBXaZb8M\n3sLp\r\n=YX8M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"1289a0e81dbd2bf9034e53d74a992e488b409a6d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1425"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1425_1592224013409_0.8474367997942258","host":"s3://npm-registry-packages"}},"0.11.7-pre.1426":{"name":"piral-ssr-utils","version":"0.11.7-pre.1426","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1426","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3291306f366b3752868e46ef4b299c10f0e48f7a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1426.tgz","fileCount":25,"integrity":"sha512-8nKbCFT7MdK6sdxTYojxDRidOsoz52ZrhkBUEOva+qKyMZfeTs75OGFtjyrILWWYd4nreeVyQHA1oQOCnyiwkg==","signatures":[{"sig":"MEUCIQC8qaqikXj4dWiddSb7TSkD5vqZ41EAKt86HM+HSYqwZgIgFi7G5v3+ZLjQV4mTAqcDvjydufZP7dDmsWWWXN1vrcM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6AOrCRA9TVsSAnZWagAAM5MP/2FMnBozV3chcG8XwTce\njNOD8X7EeGYYB04gy5QNepzjxYMvHeimAAHC/LNdLluCNTuN18MoQ3tvNX95\nqUVjUYCvb5IJIaWJkAXKCtRSSwAw/5XDmBGDGcPiGkUTFEnW0yqRuXbWBGmL\n+JLRLqbQg37MKbuQ3eUoyIuzqhC2cIQZMqTmnRe93xBOZYZk6tICde7Nvq+W\nsd5nR+b/yXLL2lQ2taA3v9uJ7n/lS4AoBzBG4Y77tG6HbGV9QEDRVvdMk0yN\nnFP8QwLyr/B8sRn2n7sz2ZE0hf6U6LYXJCw+KHXrblLmopC87qXISIsFu1Ct\nKDXWGspjheGO7ubRRPw6NtfjX6Et2cuBg25Y26gwPIHuh9JX7dmHsKwod/Ye\nHP2Dn2AkcsXKG+7S+SOdn8iuewIByKptdwkx5zz+jVFj/WtmeR27RX84nYZr\nNJiSf2DPJIYjK97PNvI/py9ZHraGRMMtls8K5MK8ZOfFk0+9Ep0ABGHn4ps4\nHM0BrHcakL3qhTMo+8rpzubuId9oJj3EYYIhEolpTTf+HgtElPhDpT+d1nJ2\nPCaJl9eEVN+h76fd9kRqhw91RMsN73sNL3x7iRKnq+bXWkngjZjzxh2z5+v5\nL49ZltBFF3JnomCW/qv/pMoccLnPowfbrgnWAsekJn1t/0o2FBE6YEsaSvRG\nznns\r\n=49NB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"1716378284edcaa468e24b8f88f5b91f6cee4121","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1426"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1426_1592263594866_0.40144164991184494","host":"s3://npm-registry-packages"}},"0.11.7-pre.1427":{"name":"piral-ssr-utils","version":"0.11.7-pre.1427","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1427","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"054dfec13f72780db7d810e54d887a69d97539bd","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1427.tgz","fileCount":25,"integrity":"sha512-ygnSEkuUSRzBPGhInxBUuQJx9rthMmQDMRr0jiT7bYkmQRVEsF6R3ZJ+mmIut6dx5Qv4lyY1gYXugan3W5maTw==","signatures":[{"sig":"MEUCIA2d3L6iL2ETYgwsolSBg75mn3BkO7gZrvKDK0oAJR2+AiEA8ainHsxKjkv0kbiq6EpEXbDgXJmDuD7LZtOtvNVINzc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6JrPCRA9TVsSAnZWagAA7VYQAI/2SGyNdvRmpS/w0HcH\norcqleVdFRS8C+vc9Gk3IYUbFPQlxqb/i0xIqeHazfSMSfgrug0kw2P0y8Lr\nFHSN5Vl3y3unKZ9gGbTCa+Nb5Lt009giq1yKB8BLiTPmEgNuVGR3rFYCGlf4\nYoLhVrrBBJxepae/ecMVsEEDoacmqIKO9zN+qqYNYIfuDzm13GIrS1AzDGuP\ns9g37rZjHDld04QDOOEMq0dh94NOWJgInJGz2wapW+LeU+oVEl3egGEyiiHv\nRKZa6rfSxur0nQmreqT/BQC0CcPsaSzBu+CMu0b94NpwjC2Bu+EKH9wLCM2l\nlYw8pMwslrZ2YIjHWFxdbWsjR+pWbY/qsDB1NXvzUugQaEG0o4wRhdXZ4HsM\nBxdaB2hhxP+4horHa3zRuy7m0AufhQfYpAotip3pjiIDeEyjODoi1NYjpYAr\n8rqPKvaNHGgXdatKy8rIaoAGYuWxCQcKt1ufGs2eIaCRbeamVuJh+s5sgiB9\np0KgWhSeH4cWzMEQjOhOo+gz49fr9c848VFi1+NMKatPn5NCjS/v3VJOmkPB\nqoYU+4xqMWKw5+0ohPYptB9qBtCep6cxL5wEP2znsARXvm8GAtTd7Mcde35n\n/CqEM1bKGuoV5xiiiTenaV6JFOU26xZE3NLZiwzlDyRFmnlHyhUsLtSQ0N2E\nopG2\r\n=GX8S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"55cad63de2a3d100b5594513c8c3e3a6e15f6a00","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1427"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1427_1592302286661_0.5959349378125567","host":"s3://npm-registry-packages"}},"0.11.7-pre.1428":{"name":"piral-ssr-utils","version":"0.11.7-pre.1428","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1428","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"943134f6c1a265f4a4d1e9f15e468feec93d542a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1428.tgz","fileCount":25,"integrity":"sha512-C2SFyP5iFL6wqKN4f+hfmkjKtrBFvSZBs2P6Ia4XM1jMZ90R4L93JODbyL0SEg7eNhgvch5yp8uER+aSIgezqA==","signatures":[{"sig":"MEUCIAJnAbagF5GCUDmHM4//WuZshP2kI2IEHqlwPC4dG7a1AiEAjwlGFHanmuhv+LJ/AWxnDl/jb7ceGFsR3ADLnFFfLp0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6Nj5CRA9TVsSAnZWagAAudgP/A9JmoTW5cG2tl0lH59j\nORm4HQ1S0WwOrU5gbylP2DvS+ubKhJVYNz3vOmFx82Lz8zs5nsmNhjCa/RJh\n0M8E5vvfpjDGXhdntSHZokQHDzM0uEzArsmGDPZVBwRsEkeCyzU8yEKS7GtE\nrBTW+DIPck0J8jnpHRTe9eJ5jQMvZV8Xy6rnBkPNuQFEaa71l690tMLzSFXc\n1J9HCs3XZhaEkiRBNQh+xE438XYU5/XeVH9hk2b9SVLG0c0BfRZpc/EBkr5W\nIm6mxLMLlI/VYE3g2yTuonLtCw+f2KHoe5gl37svcYhUxHeB4MnQoVBrtPzq\nVTrcOpLKu3LjkqUw1c5wuYSOcLgHF41smbH438tXAyJ0xSJs1k5CA2NYrh2X\npd2f+XueVHLVCpe+sr1ZnovAm2vXEPCRosph/Zry9o6Hbl6HrDGSupfMRenY\nNn0BYcUK0lCu5VQryidWoB2k2hVzDWscv20u9knmLusQLnPfEMmuq4zyx7Jn\nDrnEBi9ExKut17kTCHvmpnkRoXDvX7ioU6vDt7SsUIMw0SXEX+umig1XsEtN\ng2brMcymss53X4ULTIf7+kpDuLp8saGPyaeXb93vLoKlwnw8vTvGkBbpgeTF\nYablYGl8TtN5nFAP9mZNrlfIZU5mh4cbxIlOHIBJVZqTdN5ueriZQ5tDxXZ6\nHI7K\r\n=WfB4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"55cad63de2a3d100b5594513c8c3e3a6e15f6a00","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1428"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1428_1592318200939_0.15609811829360787","host":"s3://npm-registry-packages"}},"0.11.7-pre.1429":{"name":"piral-ssr-utils","version":"0.11.7-pre.1429","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1429","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"17d31879777ce41e0273908c87ba1a912c6a54da","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1429.tgz","fileCount":25,"integrity":"sha512-pWIFMLjlbtFVNI1janiaEF82Eg3i8ra8oJReBqA9czyUkeqQdVr6D+gyUFSHYIPrhBH2V0iLdOHxCNsRmLPhhw==","signatures":[{"sig":"MEYCIQC8ymR1ajkHCNRpGXhStR/bT31GCZGV4+FoLgLjv+2gDQIhAOagafLgdcud2TU37Bxa5GRClWQHn/PF/8uu1NtR1QPx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6S4YCRA9TVsSAnZWagAAe1YP/36gp7/dhQpn2TCBpyY9\nXxeSbw6XVCJBDv18Wd9EORV/Bg5O5nc1a0HD3UajQaCFR4EjKs0S7KKlN/fX\nndz0hL1wqgJWO6BsstGIlhf+xWX4ct40iuBF+S8RLVm1Ww0OtIu0NDI8e21+\nbDL1p3/7TSodIcM0eYHHrDQJadV5kHiiFYuylQEXDFEr0YrjTyLGebrIBBrJ\nfbcTTuzKaWlLXm5tdIOe5c6DANlmVaOiqrNvWqu0EVcsa7o4xjJ6lQfpUOcU\niYEP8Ee9wF7dMUqyjiznOCAuDEQov7pBMdiwh4KSYFWgNE8G8V53h7hj2cPK\nQMpbuhytPf24vxjOV2XjMpJTbqBbStJNs1FfPH8pRWjmVvNDtnmYZjnIjRoo\nsG+9YENx8wraTVB//UfERs2SVX61VzHtjpQPv0z5ckGyOJEhvrmt9wi61r/N\n7kAR2EtjIqEjwlVNmKwNptu6cwNwLNkJ2o5ugmyj669pVHZ7VT71oXufJlav\nBKnQEA0vewAeXmvD0WB5SScGUIzAKcAHzwwqWxnd9vS9iZVFuPGGRxO4U1c0\n/M2iiqCnKlMx2zgSnpUT9M3BuBPDbzZXxQnjzHc/t62alUebhmEMqOQz5Gxk\ncJDV65e2zvDfXLcj/kNcyfODr8TZKXXq8uNTAYVmMYvPDuNmHRRdArYxTm+I\nh+hD\r\n=yO8O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"a90898fa14de3452eafbb4642df2ab3bbb49a7d3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1429"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1429_1592339992264_0.1230014505676158","host":"s3://npm-registry-packages"}},"0.11.7-pre.1430":{"name":"piral-ssr-utils","version":"0.11.7-pre.1430","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1430","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"91a461b3eae13ad9ec2bfda655fc1b199676f011","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1430.tgz","fileCount":25,"integrity":"sha512-E0tp315agdQhFK6hMhzLDvEOoxj416TF3FA6813di+Ao5uDqIjnbMAcRTIh5oEtWunKWFe7LYJfq6eSqV/96IQ==","signatures":[{"sig":"MEUCIApJNX+TMFlYOISl2BYxKosrLRVp+yMe5tySvN1APbHVAiEAqX+l6wQt+Dur4G2wGpNtFHz25OPq2mcEEaWjCv3Jpfc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6q1kCRA9TVsSAnZWagAAPbQP/1Jbcl4Ui74AtjDXIq8q\nrc2qZWanA2lSDsTtRV2tyfEsNYmtEr0B1UoQyvf0XZLgfk6js0KuAdn9Zep2\nMDWiIx8gC2FzTs2M9EJLRTqF/grYRXqWqui6dma1bgkPOAAtEnGA+sI2GZeI\n6TWPUOr42nPmx8mcIB3PBt238X/L+0EIZ7fTrwyfL6YZoCdIoyhx38BdH7nf\nlJAr4suXiH6hkfXI/VYahHyzmZkOeYtVbI+vtXvR4gEhLbZvKRRGxAmWalRX\nqEzTVvvGrHUT0nqfFvKuHtWsRo3eWxaTS+SbX8LXqvVaj/3toRG96JAWl0kD\nlUmVLuhq8aHBJg3GOd53WM0zNUd3D02Z6GPJ73p6GwN/im2ubYAenXmPqaZD\nnUN88A+6aRj+DcJUZNds+Jcv4wnZVmOke44rWfm2uNB9Sj2Un2vcq8NhIKEi\nbkNJLi9RMHvbSjSQjg8muLVUmcIZEqlZEMrgg32hN42B/Il4/L4LkaPf1RPI\nTZRODwQZibdrKvRbgt+GQmdkCSdpADxN8uRP6Of38O3dJVp/SMyMDqChelh9\n85Ku4H1O+sZUpqzYt1pLGsJSkzwNaIL/TMHmRHWkJMNARnVclFRVT/GYI1H6\nB8qX8eI9tkp9g8BZXIZYqSvXtp2q8I6+Q9+4UQxUOP7hJcF9nW5jvq00j/V1\n+qYA\r\n=ysuU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"dedb7a52ca53e7fb8ef62b6093379229bf2f6c5f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1430"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1430_1592438116001_0.13996993652769718","host":"s3://npm-registry-packages"}},"0.11.7-pre.1431":{"name":"piral-ssr-utils","version":"0.11.7-pre.1431","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1431","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e7cb3a326af5ac51f56cd40d5bb0b9d5259287c3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1431.tgz","fileCount":25,"integrity":"sha512-PP68THe8NnhC1V5di1a6MGPmbc/2cCfl0uV7Cf+JLHBPGODh2nuM7WyVeN+jfY8NRE0IwD4F09Mr8h0e2W5Cww==","signatures":[{"sig":"MEYCIQDBspbWQDaufga5w/wFi28nrN2WJOSzaHmcV/m7Nz2U6gIhAJvCrPHYtTa+yYgbeC8i3VT6BuHs+1vfsAlhnlgYxXud","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6w2OCRA9TVsSAnZWagAAiJUP/3KRBrzub9Q9j4oY+5AS\nyDuilMahfeEN5P30k8RqAr4Jk3IhGlkixO+Mt08hMgHxw/wrpRRJHQlw21sl\nx5ydx25/dgQKlANTFpx1CL/DK8qnTgehGKSGPeWDkP2CsH16QQd3lx79+rmQ\nLZ7QbN24V/XsGaTMlWvZbuvccowHgWNdMJuJsygM6XPGsePe8d8MLNQkmgCU\nni35HQlzxPwrMglmARCF/QUUN/3JoL0TJccn+rRj++nuItRqTvFYHsFGJL46\nc+GDflbg0rZ7NyJYV8gm6S7BV0JFpGzFx5EQvcbHfnZ91FDK6JKos28mHXcJ\nA9rBr28IwX1FXU3ZR/DSSj2DK+YZBtCkwCOGCeRF1AAda4gKuYvv/xryDWBI\n/iKa1IZYqd9fCm8pfWdVmpxd7AIQ63Hl6f1pGqxMCbBbubArrwdoN1NQvRnI\nesjOuS8WaZ6vXnJBf184XzQsiIlmu1H6Bue4lOth6awDAOAbNXv8wPs8a4tb\nzZSAZeHYrnTOfYhY/QmFYYpKWJDq0NoUsUmvRbVDhQ+T9cECFpT1DShtU45I\nwjVSu3o16ge7vTfZTb/HRu/XH7LLzm0FZnhlB7I0Azk7n4RfB1OOTWC3fs/e\nJ6OgIlE4W5nmw5BdqJYkw3qiXunMF7MAwBydysoN5VnOk0NGd0mchcCdcW4Y\ndOKN\r\n=k8fQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"808520d8a271ccf48d0d30c390ec1b678506a92f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1431"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1431_1592462734333_0.0475900392582429","host":"s3://npm-registry-packages"}},"0.11.7-pre.1433":{"name":"piral-ssr-utils","version":"0.11.7-pre.1433","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1433","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"18c5d31d006677871c5d144dec96733d4a079e20","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1433.tgz","fileCount":25,"integrity":"sha512-fUW3h2u67recgPrB3lYCfzy5wA7DqueXbzoJ69kTvry2naecA33Jf9CG1YmAGrxeyYXZwLKrFbb1rqfRNzpy0Q==","signatures":[{"sig":"MEYCIQCroQsMbhvyhE1dMCu6PrwJS48urvXWQK8QFnJ/EMVO9AIhALb12UGvWYMNru//hGeK4Vl+nsgqApXTeP5tomso+cnI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7CjKCRA9TVsSAnZWagAAZHYP/3OCGjYZA+5g8YBL5Cik\nBeHKSPYSOXMWlNHfoaX+JkA3G8Pm79uUHWY5R0aRNEVxYbqCb7rdA23o/Rfy\nCfgbfDuOEf7kvw2IMQmvNQSZShZa1K92lYmxa7S2mtpUtVQKHwdHcaostKmp\nKFZ1Tv6+WeYAlmeoGyhvefQ7fHGhOs3wg0FHjzBiyEgf4menbDtt07M03pKB\nloeoX6sc+k1881oBbIG5FBEHOUmeHJFBSLE3ztL669YybFpvwKKVWFHnpftT\njhJvT8L/1ZnRF3pVWxszl7hczoCnYjiByEuM5IIuC3wcTOkyyLkiU/T9MR8G\nNgcipn9e1w293m4cjwVHZQ4Se4NUZf2fsFDXrNRZkMji9qPiCaXsOfBg29b6\nrsHQJnR7Np1laE/alZusoiE7zPhVr8J4gJSffgVLM9ZLUbom7Lyy/Hex/WOx\noO2EHpBgx60QCJ7nUJT4ov6/aF3bDFxmnRJ69rjsVtvZCjs2KCg02LoQhe9c\nT46klJ36EZ5y85ZQSjlwmJkLb+dbNnnlu6BZ0YCZIvMf98vwkXHKPjAs9vsS\n7eDfWUB7aYpOkqFmSqqGO3vnSEjOQQLjDp+4jWAfTqChL0Z91qcoLz7bcElT\n5f1606j9igjlbfU0Vtvw3cUxK5ZVB6Cq0TGPy5z7IKmN7A7diziRODhaRDw7\nTYSf\r\n=d6KC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"98e8cc1dc1e2680a7798154f033e99bce9222e0a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1433"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1433_1592535242022_0.7751781367470918","host":"s3://npm-registry-packages"}},"0.11.7-pre.1435":{"name":"piral-ssr-utils","version":"0.11.7-pre.1435","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1435","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c3689a19d144f507dfb299efdb1042c32ee7be3c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1435.tgz","fileCount":25,"integrity":"sha512-zMy5hoAqNZpZPoUwFKMyr7aIOOW2XrgcBDOQ4qf+99S/ov2xLjyzeSNhqdXctXCcLqm/hUDC6H2arhYg4fwuxw==","signatures":[{"sig":"MEUCIAPorl2zseVm7CsmZbshgJhUXtHTo+aEz7Bzd+Ryw3XIAiEAv5bQhpL3ECIU4v8SiZmRABfBPhA5w5kkwJcF68cRYro=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7pdWCRA9TVsSAnZWagAArMAP/35GIMJ+H3YhBZw8+utA\nNP+uPStY1I+8SNpwUclf3oFwa6s9oWM0bdwl/HbB/E64uKoCST2pvMID1hPD\n4SHAjyJxKLUZoytd2laaFrxDmaCE0NnPLHMJJdOmqf7X0zNJ1HEMmMY69b5K\niFnp1leIUvwE64M1FRuIPMYNECouiqIdgzH3R2wf18qCy1kJu7ij6DQ66/pM\n3MgYARoLoY1kEB+RMbLGvFpQ1BE3x/ZAkXzSedPmuiZFdtm2NPNH8KptlhiA\nEwKg7WgKoZ2EqSbM5U/Tf2QojwO0P8ki0mLqaKBxI1TOJ1d/aQ4RZROpruqU\nijChTvZQCbagBufUBYrdVmVKUe2mKdzkSRBCXjHu17hU7XeSQF9SHCjSXGSb\nMSDkeVFygm+U9EXszYaUKMEnd+GFzWgajf55hQg8N/lywcOg1/PVYbs9F245\nbk1AhNNdWt0aNXXNTFsMb4TOExyvpmfnsp8WHIi7+WP9LtviYKfeQWnXV5zv\nMnKshWBt+SjGoIpIFbasBQU8cPQaBmCtnPToHypWOQtERYndjmZpF/ZsdZGs\nXxqRc7EhbFzMu5TK15+Ow3U3JvYrtOAEcU4UwqLPIkVxYOJA7UvZwuEt8xs0\n9oawXnodDMIhgvyvcO539MNhWYfPXEEH/D4qOzQcZiu6WJI3Yhct417ZmM9X\nFU/R\r\n=fPGq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"81ac39400bdd054cd87de9b33754a74420deeaca","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1435"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1435_1592694613706_0.1653622179193297","host":"s3://npm-registry-packages"}},"0.11.7-pre.1437":{"name":"piral-ssr-utils","version":"0.11.7-pre.1437","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1437","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4c08a63af53c13e5d5bf3d1ca1a64920a8c130d1","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1437.tgz","fileCount":25,"integrity":"sha512-Z4iuyA4BEOGkijS9bDK/TZ4ApmnFaGn93KvNzzxGxEY1DObj9oy+9bt1DGPDFoLATNc6OrwqHwbq49GC0XwQoQ==","signatures":[{"sig":"MEUCIG0vTpV6Gx4x9HTpllUrVxYXbFfhGeJIEUFtyT0UoomEAiEAqYkco7kkUXThvw8EvVtp/ihUyt1sTGvoEt43ENU0XVU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7qxjCRA9TVsSAnZWagAAiQoQAJYUc7cQcNSkcKNPmGrW\nFm3q+e8ZxfCBesWhk5Xs3s8jeBOryG0IGAz41KH5roo6M5DUdhxuvQqrGjQh\nbopUVkp+n3cVmfIGOFYbzPcQWGFqik6788lD6aLXVzRpN4TGkWpOUPgyB8VX\npgSwL3CEoNNV644bSL06wfcrmxaq9v4ZbzKU34bV9gVYa1L3rUhtMOJVL9g0\nNMGC3K2Mrs6QvK92RxwvjMaMLU+1Jci8a0Y5Us0ZqeBwXCp03h39HapIgSvS\nDJosOm1wD2QkiUPIgnCoQklRJ9fqW7zLmFOqJ5Pv3g8lX/dqLQQPMj2D4+cO\nKEW1VXAI7OsWwzmsLZY9Vbq7EfkXrHi+gjbQyxRlIpP3mjF28ODLqFEn76Yq\nUBR5r6e88Vp6nS5T7syUeBjWK0g+ngH0gSbnZ8u+UIM3Ej/Go8ou7ahkHfu6\nbS6zMwcEN65bJX3FzwPFyRSdQ4QVw3pN1WYa4HN/+iHFGXP8w9lvbfR+r7so\nRYRHJfSCBncxzkF/1XcKP9rN0zGofEN43UReMcCvH6edMOEIzrAVn27csQn+\nU7np2kAtbNfvpfsK/VDNvE8QI7R4GW0iaD18caze69mnwnWNN8CjXJIcC9Ao\nzS4AcFTj+OLit28w8tTayZG2Gg7XGngtpaw7iXYsOJ/ciiDnXRVYjKMTWVm2\nKTJD\r\n=KAaV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"7b749bd6b074f1d01bc765dffcf8df521b4e5921","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1437"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1437_1592700003513_0.8962355454442632","host":"s3://npm-registry-packages"}},"0.11.7-pre.1439":{"name":"piral-ssr-utils","version":"0.11.7-pre.1439","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1439","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a7feaf8eb478cd342f526e2bd6b8677d00791cb2","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1439.tgz","fileCount":25,"integrity":"sha512-VGzRIVJg7ePTmPjAiMglWmJcPfUvJG7rePYWAPGUaQGOofKHExHsD9UrS1Aviz3bmZ+2OHsPCtdtJuablVQNQw==","signatures":[{"sig":"MEYCIQCUvr+K3Ksz9TszblkSSvwuyg54M6Tmypw488yqHprOJgIhAKy2BTTNMGcNZ3tTJ4ZsChfNZVAZYaDpcKWcN1UbhQ3G","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe73UbCRA9TVsSAnZWagAAt7gP/3A8XGjOrtWfqJ5Cd2Uv\nWartBBDZ5coAr8+FWkN3qW7WZtCQyCp2HkxpsL2oYP7KAzof1Bjn+Cz5F18b\ny2QD4ETJTE09tm68Kx0ZzvWLlf/UvRwh6/ElPrTBavOS+VlMYQxsG4xak2bT\nsvq/8fW6/uLPSUs1ZMoKr6OUHZQsOMyigQSBB/4QAc35p5ivnsjCAclKbJdR\ntNCP4xThv3KvSiMkW7VAzT5cnkVogf6ojzVQhg8ZTHl0wnaP+Z2JTK3mrr4y\nLKavA/efBbkyQQs39x5JngDu7UqY/h0x6QehZaAzl0/qh3WBTMLAcbck3LfI\noSwWXT/UtznI56qO1I2iZvYxEOYNTOm3zrWwZLiZfzaNl0ZrItmTbCbMUj25\niag3XKnRdWWMOkArCkPL0h4p1u1ysQjLJ1jl2ureUIOixyDWFWTzSU1C5vQo\niTuWtZVUwDPOU/9viQ+nF0vkdnECyhvtnDA6Q5fcFMIp7gdbRjNn1hqdubPK\nhmGomx22LMN/ebOpdkkxFJwdJHjOknwFKHKY/jhuWHzYbpr4D0TM1PNPTCKw\n7Cyfz3E0Y5n3ze/hr9ixJd73nuQbN4g4T0mMM/8BRH6E2OGOQqIgItAfkVdJ\nUaZ9B/JyMMWWs/aU2P3myB62RUpiqNMyuChux+cmKTqpSYjHX9yxHqmMaqDd\nySd9\r\n=PdMI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"7eaa59e8d1420a4e02c93868d19b09a5486cb23f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1439"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1439_1592751387224_0.9780488506830489","host":"s3://npm-registry-packages"}},"0.11.7-pre.1441":{"name":"piral-ssr-utils","version":"0.11.7-pre.1441","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7-pre.1441","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3d076d00e3b58ab2ed4a6ceade341463bf763bd3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7-pre.1441.tgz","fileCount":25,"integrity":"sha512-DVyqmUS6LRfeHX573g0Vdeiddi4xVWIO+aiOIfWlFRCjIABpbp8SGUqMKiiaQCd73ZGWzvJZdWrUZOrDhZcB/w==","signatures":[{"sig":"MEUCIQCvYrg09T9CaSwEBAVA/bK4WI8Q6w1jZy3IGU5kTXYhDwIgFa7yUuZxN2VopyJ5LTE2lOCE8avUfeBbRsqJ4MlAh5A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8DqxCRA9TVsSAnZWagAAm+oQAIHiygsrOg65f0Ko/boX\nErTQB6XZKo+9BWSwLCKaQYJD7edjd857TNgyYZYf33ueQl+NxPblY2nhPEo7\nbiknORmC7jRZo6I/vdwygOFbhI43MHDMlMvsb7tMT44vtpsyoAfNSWs5RioZ\nhRrjLnYvGle+CJwKUXj9gY1PcwDVyF4jBH1dLYBRNrimC2UzjiK6tRHS9SEC\n6lzvGm++O/S/S/Q+3st4Cwh9rrjQIhUTTpIY0yGEYxE7P6jD5ogABFRYtKsH\n6XoHfF4ZN8/nYHOohWHqKOM5q0cBpi3EuHIr8F+gbvf30/xrw7oU93VU9M4H\nQj7zZ568b5e68elW6uoL27NCYWUmvEI7QiJgbRp6C0cgX3HCoyx4V7mZvxif\n0GIwtF5LYPxzBOcIX3cnDWd2byxopibRtugb/g5tVkc88oN4s0WtCZQtgXH0\n95fyekOTyIzcDkbyOFWGyhMIH9OtYSnIFX27ixLtZpaxFOs+Ju1sy420T8EP\nXcPT6bZfuKMQQIXL34jzfsA645lFogPywEOxOGqv0SIGZUeL3zm36G31SHpb\njJMOU/4gZCfwnZBeZfCDik5oYIN/tmtpJr/ESaxNxFFvURN6OzqTUQaRUMvk\nsc6Ja6AkArwodw+34aHPPpHQ/mGAZIKSQ2nwJwABymf4LNRqHPcXmAJ5KpVR\n02F2\r\n=mX/h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"a03d56268723e670c630ea48a4fbb19fea7ec09a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1441"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7-pre.1441_1592801968765_0.10811082932338123","host":"s3://npm-registry-packages"}},"0.11.7":{"name":"piral-ssr-utils","version":"0.11.7","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.7","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7fb7a5327103400194946b57cab44596d7874271","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.7.tgz","fileCount":25,"integrity":"sha512-9eBCJAmJKM+vCxzAYk8VO1tNH1x+s1SYPjQ4DCZuSm5ipe6pMFpSM2REFs54hC8+v6Md8ERz7L7kzSEby3U0ww==","signatures":[{"sig":"MEQCIGMcXI9DhlzjERusP+KkSPJzO6gIYLKXymWcA7xaLPRAAiBIs6/DLfuDhaoRsIMON1nuFqcZhgYmJCmvh7MmROafDw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8FKYCRA9TVsSAnZWagAAbfwP/ii0wWX0mnLP/Zxf4vxe\noiN5vploA+q3hcOm+n/YsqZf0eA7VScRwquBcbFYMj89Q9D+wv5jtRi25A9s\n/Rw8LemJkcKKAm2f0wH037PALiRvu4H79ImmUebAxi1Opaw/A8lQm8p9hGWH\nU0ySrb5Tt4+Grfco3Qmvr4fgyUIi8eN6hSkssQEZuDkzGpcv9VPUyTDv84VL\n967oHqHARn9UTatyRuyKVBhp9K39YKTbUg5COFVVGNDLAhs2K81lktsCNtjI\nirLMfP1Rgh/eLYF4fZs/DPiwHQL9zXUnygHYpSPusla8LIPwTWJYlsZ2SlCM\n3lWVCJIsulW6CWnNQ4Wn/r4evnff0dexv7vEN8ke3SPTwgX9G/cuK91VRhC4\nio83OPAjHa9wJQIMQB1DiLNEQw6w2h/GyTWQJo1I8WZbOes1TLrXcn1t5JG9\n872BdBgHllEQN4jSh+xC53Q1/Uvpu1GHrOsfuxkoaWTTfmes/CENZ0jbBUmm\ne+cuFZ8dJkgHTVWzeekmpxQAhdr0slNWAl73w7Tz8xKU+bKFqO7heLsabFI9\nTi6iYhRUZ0JAgB87E1MQOR+z7fJoNcZ7Ezw6/oYY3V0f/P9yGLM2kPzIE8Dm\n2vGFg904nj7UjgGJvz5ZtAewLGmeUm1wO18JlTuEFmrxElymTf1KY2bP7Eba\nVRfW\r\n=pTnK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","browser":"./runtime.js","gitHead":"cf59b6f518e6bf63f287e7ad918a633ac60cad13","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.7"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.7_1592808087585_0.6788572989631292","host":"s3://npm-registry-packages"}},"0.11.8-pre.1446":{"name":"piral-ssr-utils","version":"0.11.8-pre.1446","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1446","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"09084d548a99da4251c70c8acbc518d655b1ee65","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1446.tgz","fileCount":25,"integrity":"sha512-nVSc35uO9vXjRosxtkNjzmmFvI2nmEYJuZQ4QJQwLWYuEX7LbNdEG6P+0X3NyuJFoI9C0rp6Lg/sqhTFqSqjHw==","signatures":[{"sig":"MEUCIQC14uMuDWxPul34a+qwqZ1NKDa8fzNd0kc5wMQchDL1ygIgXivwCqtTCJveDaE5oUDMvfa/pk/uCFv81nAW9HghwXY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8LW8CRA9TVsSAnZWagAA3bQP/3LEG37gzGT1+PUfo7zl\nJibPfCOPCQ/qtNMbxK4cBuai1COkRv4JAqcl1JYJijg1Mko88ZPmlEoZsWT5\n5jQg9aC451ilpSQFWqc4e8K4RW+4XghevMg6fgBonl1Hl6JA3du+2cpXrCac\npd3snIkc09Ntdj4c0rMHzTuXJhFVTF53sC232LtckRbs8upFdzeJIiIoKNoX\niM6yt6xpTd9S+p+BpNU5r4KumAs01p4xfLw5EE3O9AnDYc4lQui6WhWGzDK/\n7FmB+uX7f2ZYPy3VhQL7BKo1h+7kdeP8cpu/HdX8xuSqOA2ngXVefM0Io1oD\nInwwzFRhD9zn3ZMMr5Vl7WJENM1SOOr2TuAdq76JD92a+Rn5Idhzs1IxwLOj\n/b7IgQSe8OEWHbqYA1xQbyVi1QwpGYY900mZMZAc6hB2yJP9kTgIww88aV+7\n0xjL4Wl6F5US9byrJFjheZLHoKMpgeseLhfE/Uq4VoGTqYUnx1zdztRdHer3\nfcvAbV8xILqTJHJqNk0XMj29/MMnpcJy71O1QlgUtx8Pn+/Q8L7rOo0OYRPy\nGJTx4qjEsxZmgibYZeBQqL9AAjHjNtfsKg3r2r5dBNklpicRbvasQogY4GNT\nFsSlIqKdYSrNtshQFMY81xbXglrsPyRn+W7rAebOJx9tv/loAwInX5QI6WAC\nphnP\r\n=27O7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"0abd6be5fd40d921815e6c937a2931c0e14d63ed","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1446"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1446_1592833467364_0.6829983069865495","host":"s3://npm-registry-packages"}},"0.11.8-pre.1447":{"name":"piral-ssr-utils","version":"0.11.8-pre.1447","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1447","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ac368d6e8733919b31f2accfaca7d1d5577c4526","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1447.tgz","fileCount":25,"integrity":"sha512-ohIt+A8PT7HMGh8GQZ5VkKub5yuTDXbLd/sXEpz7ujBhb42hYOmYKjFAJq/OjEBIc4MdHy9qJ4hhHJBRzdz1QQ==","signatures":[{"sig":"MEYCIQCnrlDxc3wwtIrN3ZaBB4PH01St5g0MRhVy5CGqueTtnQIhAOT8l7wp8z//Gz//iX875pFYbdp1VHiyG5PVM4vVz05N","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8xRzCRA9TVsSAnZWagAA3LAP/2K/Hv3ToyWvNERyZvDK\n/4lTgfSnjVxgNGnIpxWt72irpNqUO6vD0FLcPjKQRcdHZbq/MA3u9LVVELlQ\nqV4rA+XFz0DedxeeprstbV/Dn1PF8H+1xdQAeHrk9ZwL74XBIKwb/Hk714ny\n3TuXpamMfgH2T9epghfnEGfbBpyPOS/88F93pts82MACgR6D2DVgQCnhzrMw\njWj+q+LDwnm/ZDwspl3A2Sr9NdK/wXTNtYBqFtSybN3XtvH6Q6xIz2T6Ybnr\nJJzRMi8D7JQOmKKm+eN0PTuDzcMsfFQPMXT1yPTBQWfONr4KdXzxu/ea+80I\n8SR4NuVafKbxC1zaWDE6TDX+roZf1mnYTOJ9ml6NrT1R1WKK9fOYKDyerSIk\n/r40mMx6DNOBvq2esCkaMG87M6LE4DQHC4aB65jwLvmstUyhBmMk3HMDMo31\ntydpdalKto4+BdHmdxLaSu3rhRwuJg9ZVnj7aiiwMbXsbR2FNEo+NSRM0MGz\nxMvK4501XzrI4LhFZDU7s+mkYT3fQc2Tru9AzNUiRr9dLRAKKCYvM6Kjqv2D\nxmeeBPnJUDeNBA3PNpbBvaz+LOV1GZivwNxctPuaajA/20xuwjxG+9TfcCst\nuCRQMnNcTGHrtm+VkSnvSz/5ZNIlDx0ZPmN7bq5nTbgm4o9EHCf3gg+Ih6HC\nKDFM\r\n=VrwW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"5ded0c1cbd61cc1ccee9902e5bd2a7568357578f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1447"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1447_1592988787137_0.838091160197072","host":"s3://npm-registry-packages"}},"0.11.8-pre.1521":{"name":"piral-ssr-utils","version":"0.11.8-pre.1521","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1521","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"551ba3b434d060adc1b5b1253b1556262c8e48f2","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1521.tgz","fileCount":25,"integrity":"sha512-KIO3DRWfZei5Bff4eYnhemTdQHBzu1CEItO0cRlEN11ddvVt4/QEDuzmuD6tCS4ANq41JEIHFpXOIsxSWungvw==","signatures":[{"sig":"MEUCIA5A/GHIpRi8RPMRY4DeJMFBcXFUiRlJg93HMNfy2C2gAiEA5Uj60B1j+c95ucgY0L2NB8wSoZotQllRrwpMkY1ODnY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9aiACRA9TVsSAnZWagAA9dsQAIcMkYGS266Zjj3I/bB3\nab22tQyvHrutkib9LXtmKW21RSRh1+uKJZoCHNo3IW4/tXy1TqTM6lRXdaAH\nl1HyEIe1panYyDEpkd/1vvXDbRytS+UDneFgiIMxNAh3X10vC/yERtrUZ9jA\nMDgfkekFToGHT7AJ0GzEAS2rbBmD0SBiNOqSd+ah2bAOhExP+SnLholYowDr\nsPowihEPxMhRsM07QEs3L+HlLyIKgheO/cObkt+Vl9s1wnkUucAsoLGlmxf7\na/5ZhUVfRK1MGLc85fZz3EFaXEAzZFv1+q/mSc4EPkQkcb7ty6adGLGmisQE\n9gtq756u4P/vt0VvHoOEM1qLyJNfNtibzk8mtg9RoTEzJMXhYAt5N1Ng/eb0\nxlI0TNI4ALBtEXuf0lpz0IHeSk5cBwzNrSL+KTUMj+tn97k4ytV7deQjXxgQ\n/t9m7dDOfdXOnwi2i2DbgCSMThwNFtH/0Hin1YCzfHAfA8VvNvkcZgzKf4Bw\nXWL/YTAti4zPSuiS3N9ybXVlvZZDr3y3fu3CBd+4izBwFwZYGrENNYci940w\nTySdh5amo5TJuN8exwESo8uMVODoj5QNTjhr6EkRwy8TTk8Ki5agSyg2iw0K\nGBGnJWbObhErLYmmelZmJGUcxfRbVsxPFP1KmkKOW3aS+ulprEyMfaH/VIXX\n7uZl\r\n=Z/wS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"d172b778da850708e881a3128e7315cc8272f68a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1521"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1521_1593157760443_0.9159301011099279","host":"s3://npm-registry-packages"}},"0.11.8-pre.1522":{"name":"piral-ssr-utils","version":"0.11.8-pre.1522","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1522","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2a06ab3c46bb75ef6578bf416450e4c7b8bc561d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1522.tgz","fileCount":25,"integrity":"sha512-kRGauetjtljLGrNK4tnsBzeiwoq8XWHOL/6IMEuUTD9sPjQrzBhvJjlAytEe7ZQcgdCK1b6br4OqCsW4GRNzOA==","signatures":[{"sig":"MEYCIQD7/i7UUH1jbEerdMu1yjj4zPZ1CIuy8PERh+G01NgiEAIhAJ6mpBCweSNyFs/Hen1IT9I4jB/AYmtPf3c1RgrHVdJP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe98+yCRA9TVsSAnZWagAAfqYP/i2Q6PKcCwACsWDDv+lh\nSaVg9BfCKFg+e6mcsRB1M4V0N5Z38ffZak9AHFc+I5VO5LBYKwghIKUK9FhW\n0TLyq/jfucHcyHK78ChisH/Xs1k4pcfKkN1KNqp2UnkPXej2EXo8T8b9X4vZ\n4u9cfQiavDX+Q40PwwCEon1cvlQALxlyHc2qr/ZlIXv0qfg+88BGOOM+DJzf\nt/QcIpLa50s5RoEJ6kSipTPtrHgax/uqdKoCAmH43ZxwAaI/JYDpGX/BditG\nYG9mVlmTP0MBMguaPFJN/m/ycdBcrs2cP5EycsrAWDOiGfM/yPOS4fLsT5Y7\nYRNi4tjlnV8O8HJd0nf8I98oPBW2acn+OkdU6PYP1/3aAlFmA0/MlqHTF/Wu\nkAy50lqJy0grELVB7T/wkByox4KH8nV5NtbQOXR9niqYDiestg57LVgHKBbQ\nihKzUQophyCnoxTY5We+1nRtVV7eCNn/4q7dMY6AW/34NBLukA/c9VquUUdu\nOXXZVf5UD08YT3fmSRhlhjht5YHYdqXXtbTWHZYA38WDAFng+iNR4mDhUrZP\nuqIBS0nzcrhkneXsUw+lHUOMsbPMbnexI1T1NAgD3OJxUsrlfSomJpzV8WIr\n4XFard+JZSp9hS01uKFcJC03XOEjt85xfqyPWBqjLAiQlZ4AVzz12OGKJOBf\nWLWC\r\n=/2EZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"b354823bd0a3be383ff31c87bebda57fc569188f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1522"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1522_1593298866224_0.7322186175292462","host":"s3://npm-registry-packages"}},"0.11.8-pre.1548":{"name":"piral-ssr-utils","version":"0.11.8-pre.1548","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1548","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9730978bc88bc28969bce2f4d04c517b8c46fc42","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1548.tgz","fileCount":25,"integrity":"sha512-LOjJiKe8iAk2oEuUEmLI0C/i0/MTfvc9eOpnYjRTbQeV4WgKrkvr+xYKJTOfPY7oIjGTs8Md8irFU85dDRPH6A==","signatures":[{"sig":"MEQCIA3FLJ16lFOAQn+5y7NMaKePTnC8Ddj6f6lEJP5+2MNJAiBj2MhAtqEKJ/cXthbvr3MTB4I4xzBhhL0v+qMFsxY6yA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+m/YCRA9TVsSAnZWagAAmcwP/isd4qHJDiR5KfuWKNDF\nZ6glY41lMixXL9WLl5ic/RLrirv33nmVlL2/b4A6h6pX6ux5izi/P1mwth1o\nVnYRW+WxA5ZyjQrtk51S62/CJK2Z8jeSblO1trWEp6/PN7cjKOVTfV7vGH1q\nY9d91IV0ELkInF3HEZ6nr0sHaPXgZaBGVoJe9XPd65R0BXj/lgljIeUWxt/7\nSzAEgmwxNCAMRsyankqIvHVa12+06mvA+S2/1g84DWzCnkx2vib6wnZffmDG\nyyXn5Timer5R31CL12/X8rVob7P270wsacTH0Q+j4mQl/+dmZ1xP8wE9gmEA\n0jrr4sOk+ME/vzPsUlnUM8NkpvY/XcKtWrv4rhX2pDzzCSRoI8jY/8Vwi2V+\ncnAQayuORXO0zBUTlvY8XO47A2/aVdpsduHzFtcpK81dxECK1dzSseUGoUOe\n2yiC5CCkQbDxaCCkg+3oluWUxanwIhvpmHkhntZ0TCJWKVnQ4yQ56R72hZyP\nLc4GzPP557JHJufyIxzVBbQL5md92wAnwAvTbLWHbcGMc/nNsd3sivPLTBx4\nlwHK6I+Eu64jcNo4konPoBB/tRwXkRBEvD9DI+7qWz26Y921udOvp2JaZrSx\njDOOmrcevXGW8431K1XN7I62nB6F0r5LWO02RnfIQDCVpOvaRY2o85RXJEFl\nkGkF\r\n=b9DH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"6971747d4506137f579597e1ebe6ad4bc2488acc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1548"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1548_1593470935670_0.29067139081238347","host":"s3://npm-registry-packages"}},"0.11.8-pre.1560":{"name":"piral-ssr-utils","version":"0.11.8-pre.1560","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1560","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a4ed17ac598bb0b2ca26846881f6d2e2d6338731","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1560.tgz","fileCount":25,"integrity":"sha512-quXOS1A5rbUJCC97O/989LmF7N3S1KGHYu6nYqlAWah8VKatCKDS1cU9K4RTuStot6zZy+hXZ15Ny58s+p57zg==","signatures":[{"sig":"MEUCIANy+4t6PLET2FOWfDauwa9qWSKBYo6OugLf/aT3P2K6AiEA+s4nZSwx8WTy+8vWHolpocN3i9we/T8I5YCYJCmWugo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+04bCRA9TVsSAnZWagAAZ3kP/3/J6cz6WzfdBRmiNoKP\nbhsHxf9/tn38+EdlPj1dY+Oq83hVX3pURpUEJes/lMr0IUe03f7JLXIHtkJQ\nX9zyedjelY96lZg9UbawaU6eaBr2U8W+H3Y4xXkFvfpv1ETmoZDjQaYtc17M\ns111WklrSa1gVOxo4T+V+mWw+t+RS641VmqmtjCkyb4PIFkILO+7qzUZ+ESi\nudJjdckeUAUDkWCvb2PfRzS0fVLGo48vTyC88QbjMvLQonUR+M2X4KZHO+dx\nUn05RuQv1WW03ZWjBn+FI/nMButr5h0SkOyVxj+mD1uluKIkrgfSkAw19KVz\nb0dQRU6AmhcFSP09RfPyE1JxNXWQ14hx2fXQ3cJSnDGYdSF3vYxV5BpcVJUv\ntU2N9eAtYhMh6qYcKv6caZaxzNAibTCSKkqY1AEGj7XTEh5KFUylXxxIz9nh\n3/7zpjzI8viLJYcvt60zgh1LYSo8horeaDG8eB7cKKipt1brRXXtReN4fAyp\ndsCRiiP8l6KuepSVYPXAGUJ+XGKLctWlULrOLrO4d4PqVi8msbJiK+O6nSlQ\nfocga5nrn5D1wjOqE6VgWs2XShsZ5eQ5wwZsmJ+7W7jSgPNt05cia9vLbiQS\nhndj2CqFk0sdMyH5fzuxnMp2iamAg5VsR/48Jhk9UG4o+vWCu1PnyKzejAaE\nSP0j\r\n=0hdA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"be78be619fc808f782fc21983131556242bde503","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1560"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1560_1593527835180_0.30545725137690405","host":"s3://npm-registry-packages"}},"0.11.8-pre.1583":{"name":"piral-ssr-utils","version":"0.11.8-pre.1583","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1583","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2b2d4d85d24101d1c379d5d33ce92ea672f3d30d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1583.tgz","fileCount":25,"integrity":"sha512-NBbNvVtUH+Ueb30j+Ik8WtYsyDVMYtxzMxQiDMiSQDqTrrHuYpA6+qXKGzz/wYCvMaJjd2bQvstyMem//vE1zg==","signatures":[{"sig":"MEYCIQCklGnZoHQr48TcNleRaEvt1gLu0ui6cJRNDtBCfq1TVQIhAPVaXQE7m/OJTfaOYMUIl3E5LxSvko9lZwNOil+OdRC4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/ExdCRA9TVsSAnZWagAA3K8P/1E2OVZJxg8jPvYocCYC\n7HHy5Cw22VfN1tLQ7DR6g4/6tTZT3H6uAnctbgRwp+gu5/DOYDhBDfNZLLkc\nmiKUmyusTOQ0gerMmYHvzP7f4sxF/4JAqFRTxeFJLMjYL6IMjKNLg+9gWk71\nePV5nLYNh4sDasCY5nmh7eifF747ShRZnu0yiBCdUuI/pijiaIEJtjZpMZnz\nE11eNE0pjl7ZP5ZgLrXU+4FVOyBofYv1oP1r2J92kmVRFkTk82+HEsfjiCQk\np/jvv9mu0cD9IDKOnRHGUG1O9GZ1Lor6Jb2BvPKtfSO1qJxi+mtbmSCZ73nS\nTGn9jtd/XKhelJyBR8OVBQtlJYw/+eJAOD78yvhgfFOyGSHCFKk45oybfyI/\n1/Wd8Aui0DqVFTZRPRHKhvamPKRYQCxzR1zhAhTrAd5oYg37cAMlDXTqChje\n8A79eIIb5bfqfE7IJuRaZkw5Gd7NqAi83jcyVT75tpCQ7WrBr+6gVOj+fx8E\npmG9cJYrgwVo9OwX7hOsvsRiTyhYdlF3TYEC5qdnxhN7JxKA4YRfrv6jI7RQ\nIixMbtUVrSbLsjktRL3vt8Y+4mBOYQysAE/3UdFXNoTvTfEfzmZYX5xIEzpc\ncWETHFWV7m//WIhMoy9Qv90XfGmZo8+QpeA7YATfy4UfG97gO/Z67cP73ine\nSWL/\r\n=KmBa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"67ef5310c88379541e595e4818cfe996cba1f252","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1583"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1583_1593592924810_0.5234452856197362","host":"s3://npm-registry-packages"}},"0.11.8-pre.1591":{"name":"piral-ssr-utils","version":"0.11.8-pre.1591","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1591","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c9a1a3f7099b927cd4846480cf0996ff7e497f23","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1591.tgz","fileCount":25,"integrity":"sha512-Sr2UJNlbd1fvUX0FsphgJCSkp3Yp03hsACIi8RSljo4Mv5uVsWk4sJVQO/0yedKXi7o2M136JIVOyqCjeAWkgQ==","signatures":[{"sig":"MEQCICFCCM9QISf4Ftv/mZATIvNtz/FcECCIPo7vn2jDL646AiAIKfsRG/1OxlgqOr0Z3+zz+RMBkJepQISMAzkdAOKMtA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/JwgCRA9TVsSAnZWagAAv+MP+gPZPuGkofnJ5zOKWzfX\nuWpd5a86nxqzX/GoradMaVZXOhIArC0WW4hdyAbmpu0MHTektIqXZCdsS3Tr\nf7SboTNEq65hLSLLgv0IehvtpOvAGcdz6mfJW+Icz7vSbRwhmSyack0myU0Q\nnV5Hwmwm21rGWbu2QsmL96Mm1BCjeQKPedmGQljfH/sjPMDz8exo41pReLaX\nlTFXd3e4OON9ImPFcz1X1b4bAazV8K98hh58JuDFOw6lZFw2iVnqtV55+5Mc\nIC9kHOwpBNlmzYUwx6qkudDV7Jg/zfLpdrzTMpgTjmDAIAK2Ep6U/xDfOn1C\nqBgpnbEgb6mH0Flm7hRFx1nBKsxrIMMQL4nxq4K/Nmz4q+aO1o3rQ+2bhpap\nHo+IiLGq19jZxNYhq0H8137SNFEfVa24KqVZ48u1cmonZmOjPeLx93rW4v00\naBtaJEt7zYWiaSmmQ3+h/nBpm5z7qJl8autwkfq/43gv4U/o/iZsoELX5uu5\nVpiWeC78iSF8ghs11qlADDnxWPNWU8Rql5rkiymb9Ta1SNAa9RWLt7F07FDT\nUBrA0p44OF+X0OiF2OYmqEmjquuoXCqU6gOkB98uEmq9yrRREcoaNq3/j1Qx\nvKuO4fNG0g7jQtwl3aaY4e1vS7jRpypDY1JVQprB+gkgy+fzV1HW6gy87g2f\nejuu\r\n=xGDi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"4f994ed998506d367e90b99ad2ddfca8091f088f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1591"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1591_1593613344263_0.841102801554301","host":"s3://npm-registry-packages"}},"0.11.8-pre.1595":{"name":"piral-ssr-utils","version":"0.11.8-pre.1595","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1595","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ba97e8426972ba24e379f45796b7b39ef0a24268","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1595.tgz","fileCount":25,"integrity":"sha512-qUXWvanwJe9Zj35XvxM0hA6By2aJGixfPvDIzqkhRFE87FgEQcUM4tgouH22kGJTghA4YMbFlGmZoU4NAUDujA==","signatures":[{"sig":"MEUCIQCYnA8Qcyxj4qiYxlVI8kVm1dCxLx/+bTaPP017+tJogAIgQEv9nCl/A2ANbUPq2tgnGW3ICBk1yw0kN/8Kbq5xD04=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/MfGCRA9TVsSAnZWagAA0a4P/iKO9bu0iKJnrulK+nwh\nXQhvgAceV6uLpo80z70NL5ijZRKNpRQiKgCyEFntMjeUgVLyvKzuwocXE0oP\nMEuok9+wCbaFFWFJc7cz6htV+lBgX5zqY9gQjo67jd8GQWSAPNqghqT20y5I\nZwaxRDp8nOJBvXJKsY5D9ZAXQ5gZxrkx6Ltih0Sci3n+qn+IZikaHRJ6oFhA\n1Gq/+7fOC7P8HfE7G/5gW89wDnzAoBTySmfRc5JaI4FCR73R6ltEc8yymmBB\nXIdc1+ApVMokPyplGrL+r4QoQEELMbpYrzIvu6w/7frP+heZr7I5n/zmaDOs\nH93CXTT2VzxOoMKjeaJ5X0vEMMJVXPJDmPRt8DB/2TeY59u8YU1l5OGCUP36\ncUcVM2AGRAOWEqtadx9wfIEcR5SFgHd1zzhm7aYvo6py5mB/W9DQ97BJ5sR6\nbqGYEDdyZ7Ge6UYI8L9B4b2nC9Tv2h6EAaTu3DdalSGz2HdaXTGp8H4/9PXq\ng27m43+fZfTZmtXVznq826ddxv5524N6PTu3vMGdjy17PvVCRXuctIZyMJ9y\ntlcJ81H/dlBZfMgIHa6qE6ZRxEGvzDtUgoQ+QrcNfnznb5BDCpUH2aRdXri/\nJF+j0JIYgrTfnZVq/grLujBKae+xd0dmItpaCoq1nxmuIjZv4iHRHcHMYjJE\nUbh4\r\n=LtbB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"be1abdcc074bcc6f2fbd04949bbbe06de0fc470e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1595"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1595_1593624517761_0.7750057111930717","host":"s3://npm-registry-packages"}},"0.11.8-pre.1596":{"name":"piral-ssr-utils","version":"0.11.8-pre.1596","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1596","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ddde0933219c8e4ba557f41bf5077af4e278a06d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1596.tgz","fileCount":25,"integrity":"sha512-XZmmXuGGzslREffEyXWwiX/lLMTh28SXNOJ0X2jrFLMih6BYUV9rp/IXHoEgv2UVGOqS0ZzEanJyfD3TzFQr5w==","signatures":[{"sig":"MEYCIQCNwD7cZurIae9K34WYN0OC4+KmfFZ6zMzqEElpEJecVQIhAPsiEh2MBU7opCJrhfj1jBU8a0gpeTw5ljWBEPT1N9HY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/R0wCRA9TVsSAnZWagAAw/4QAJMiJ+W7d8xO+J1/BspH\nxzU20p09Pcf+ehtq8f51fDfrwoAypRflZEjZXzkApqqwrGmYOL6023O31YIr\nrma2y0Ag7czhe1K8mba0WUWjpfnVJYCII9JWPoVyFk+dqlyIvY00WvLvKKFf\n9gTq+w4Doi2C4BTafkVki2jLOeWGiURWD2hOc0UaeTIWE1ID9Qz0LSzCYgwM\nWlPt3Wn4iQCoxOhMNDKl6w3uVOncVlzmPk2dGo5lLz0oVGZmJpawe2E/M7RN\nktzRoIuuznc2BHiWc/Wb9ya+pw/Aq4WrZPd5v5uGtn1MmmlM6+vuonK+TL/f\nHeltKz0qEBlgZu8IAOiuNY5/xULLmy93Ce35qaVbdjsgn7Hx5lVUxBFYFlOT\nlXD7smnlMleC9omGxtAdsn+Sp9E7ThJKf0/ikU74mro0r2t8ckyWYbTctS0y\nf9XyTFPYd6NohBQ0uky+SM1sArCOwvFtvHEs103PjE+3OJ9M3x8xQgJAgngV\nSAany+DQbYHJoHDXPYNO6F5HeOqQrowonTqUNJ0xiw8+/0yKUuAOjB6S+I9z\nv0uRHdKNUjfvdyL9x4r/F/hQH4vQ7XVXWDZ1q5UTS5ILRtu88ZH2Zb23Qf3I\nT1hMvlHOTqi/sprwc3MnFbVloGo2PRTxoLARUg9vpmjq4UkcnaWj/J1QcxyW\nDahu\r\n=4EHO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"87719c35ff19f40e26fe55e63553920607c7732e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1596"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1596_1593646383850_0.18144882537576423","host":"s3://npm-registry-packages"}},"0.11.8-pre.1607":{"name":"piral-ssr-utils","version":"0.11.8-pre.1607","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1607","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"bcd78fdfbbe1d4dd7dda8ee544a0af05bfc483f9","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1607.tgz","fileCount":25,"integrity":"sha512-aVpQkRM6npzbU892RtEWUdXuiUzsMciovEF9aNj9Ybg0t0UDqfC1m99dLGB0aHXBWAe70fIQ19FjnG4Ts49zHg==","signatures":[{"sig":"MEUCIEcQDNEic/n0Y37H4qriBWKqWYnJ9w4EAYAMEL0NafOvAiEArbVafmQI4TErK+q6NjcZM9/0YWOlsIV7yKqy/oqS37M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/y+zCRA9TVsSAnZWagAAetwQAIwuAQJbBKBOdZCQVtoJ\n5mIsaexSCIawwGcepiamnPoIZb4XtoFwb/lFJgcSxo+zc2p5HnvhudWREIXf\nnMkqfrIwVB9kwOHLwdowOoDKzxNxtcIwUn2G9c3aSpIOh1+PnSlDwhvqUV/b\nLO3COhnq80d5eBUGuzrnWV5C3xrbtmhlccaWooO4b+FJIgA/YtuDqIv9VW2+\n2qoU5Qj5/FS1Jxv3T+6monRzIZQI6FQ5TZ4MRIC1sMkflNKJ1pAT0iT6Bj2T\nXgQTmJKG8mZlrq9CM0Wtcd34iuH1Sfnie6OFhjKI7gDjwMsK13nZLLHatQDG\ndZQnIXIc5wR28fCWJBfHqYegK2BxGQYkcnnF5zp/ptyklSsk8btSpJnwkBKb\n6eEHVVsYIlt9eUrXgi6YA7izicv5InGkQRiIyCiEz8Zd+fGA+E9LtFkoBAMK\nonjvE3Odd5bEBi+aeku2TMvh+EiB/qLpNPK14Cf2EHR762u7zESJx5GUYtAI\nKFesJVFgQ4fdSA8WtN7RYXrpwCJJRkTh2pJo2L9KvVXBo2wH6RnyqIW2zrf+\nJ0dLgBfJBmjj7BSIhEW5MHRTGyNEiMwAwRh+Af+2Dqp27ezpSvwu2kOEqtIh\n42U5s/F8BI8TZDjFi9uxPruTIGfYJEBvvZS7vqWTTNDvSMZpgqto9qwGkHH3\nlsWu\r\n=nRhG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"cedd42b825516601cd989e1493381a91d2e1e5d9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1607"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1607_1593782195351_0.8588348386318494","host":"s3://npm-registry-packages"}},"0.11.8-pre.1610":{"name":"piral-ssr-utils","version":"0.11.8-pre.1610","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1610","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2aae068a89ccde076d1c83a58c5f687e41ebc152","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1610.tgz","fileCount":25,"integrity":"sha512-OSJBl4XwfkIxwEYOfcm9Dvpa7D3Y2iHv3mfRNjSu9BAF04HdGZ0/8Rc+ELrX8xKlvZZFuAM4iciCEAxewmjBoA==","signatures":[{"sig":"MEQCIBX+E2ZFrRnq7QZzL6tIN5ug5jmfWJJAWWl3unt/LUatAiAuvR7LSq2lAWEm9MJli7OD7kk3I06XWNw15bWmq2is7g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/0rhCRA9TVsSAnZWagAAZi4QAIHNVmTc6FZC5PQD2PDI\nNdkb13OJxfkEtp3k8MwvcHsjzOLR6Qab/zmgkbd2FXoQJn1rDId+dGVooxE/\n57a/84K1Ag1vOsQCu68iydGzYQGI0MKFZc36Yh357nz/MNVEXCEZlKkLxFhh\nBz9eBsFcuXnGa+kzhCKVFPmDp/1DgXlZgXguWoUWeaQH7eX6WNpG56CP+Qox\nKtPFukeMcizqbDOj0N2KfH6jf1VKpbsQCO2G/ynYLCb3MN/+owXl7Q4CcABb\n9UrMVotwQYhn4YdSty3TwBvdPtt6tC1x6HknkD9KyNk6gXtBxZSvv5HxU8tu\nWTRgrUB4MYcsr/IFgFRh46ynPcXXTOt2Dqc7b6g7BS/TjoE6/IzjVu9YQ4Jv\nhqtdJ6lh+ukzAHcu2/Xmqmu2rDWRMFVpXeoxFvsiTlwHJ8H2VdNQ5gzvj2aR\nN5wxqwHxdElmPZAnXzKga0VqtJKb123zIMT1oIqRg+BDYva+BUtdY3J7SbRi\ntTdlQUt+NctrOuZoOTPBJ4p8513IhT65rJveE83V7POpFITyv1D/Zu8XGUmZ\nz8cll0qGopv0zkxFB0IVZpd86/aCrIsLVsAnnk/Fbj183PS1bcmAAKY55TmV\nsTx3htFvjDt+Hy1pi6i2kgDHgL0/fdsO2ukwbUEgl514uE+GX+Pu2i9Fus57\nHAdn\r\n=c6qW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"655b59b19f9696177163f9bc91d0a1aedb1c831e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1610"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1610_1593789153253_0.15873055947017667","host":"s3://npm-registry-packages"}},"0.11.8-pre.1611":{"name":"piral-ssr-utils","version":"0.11.8-pre.1611","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1611","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4ea8f3d28345d5f55d28b1727f42499417cc7c4c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1611.tgz","fileCount":25,"integrity":"sha512-BMq09yzrDdxJYvH9V7l3ALPInJAxI8izYJ6SJA+tqVv7Mmft5hn2hgMKMzxc4NyS2bw7SSYGmEhVigp6ACP6XA==","signatures":[{"sig":"MEYCIQD1sTbCB6y77Mr1mP7B//qFOG6Wpp7sW5mjxxL6Jer7lAIhAOnit0S6D43CNHFB+IMugW7lZevtyC4gegL30xoXIcAT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfAf9LCRA9TVsSAnZWagAAyS0QAIP6fQ9BMPJUKOZsYli3\nyScBu2kMX1zpEVw+y8Q4OAxu1ah+JMaFKYFbdzn4a4Gfvlm1DGzHQHOJaONh\nwTfwy9kLa26fY6rG7dCLzrpLI+QwP0pmuZZc8brmVLNIrRllzj1QbH9ylaeK\nDwEKccWU7D1z2ja+x7BJaSfQtN3wOF0vgSbGfqtwapSFjvDx3pSCfDYTxKJV\nGT1ACfsz2D5hbKceqpJs6Hwl/2qI6JbAFywbhr2i6opiQ0820uU+e2+jiiyB\nNjLp+mT5pJDNvrESzV2kGs8Dg9PfnLIr9+RAs9bjseqBpbk1YteIsywDn30d\nQD3AjAUTq4Zc+LC+l4AZAtX6gB1Y2usUDKJhU1EWNKN9kWt/1X4TcZc4p3v2\ncAWvA/43mR8j3gyKnuasRzxpSbmWjLh37vvviKCsidCF/pNcxYHOSBhoTOiZ\nNk/WxNf6Ho5Zmajd47f8WKqZfbS9oDUW9xMDcbeJAbUybf1oreUH2Oe6P0iX\nojbOhGfdMyYa/AIqi0uD6fQMHepvPvU/vwhtC1OouVh2aaK8YqLxDBt7jkYD\nGm9PVn9iN36EkK0YzIItkjbAVWqrp5QeGvEgDuXJPLPk7RMA+Gqaw5Amkart\nVnVZeFPz3cc/tNATXSsjx6XhByHGzCPIpgp4F8hIBPMOdIkALPdn/WI+d8cH\nf24Z\r\n=9Zwh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"1b11dc71bc8ed0f058a68a19810b7c9460142d3e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1611"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1611_1593966411111_0.2899525030293164","host":"s3://npm-registry-packages"}},"0.11.8-pre.1616":{"name":"piral-ssr-utils","version":"0.11.8-pre.1616","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1616","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c44e2f4bddb07fe03facb607e54dbd022aa23711","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1616.tgz","fileCount":25,"integrity":"sha512-tFXBC9EwCzoOzayD2MxEe6qVDK4mHlC8D8WEV1iOdXC7bVxJ6amhP9rYiSHAF8Y6FDVYV760mIdrI+U18eeOlA==","signatures":[{"sig":"MEQCIA4ARkqJ/joegFnsjQkl6AvLIm/7Nm6nVMlHIc+ETxP2AiAFxNIs/JA3nMq4evVElA5d6QBZSPDMECovE9uD/amuhg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfAzLcCRA9TVsSAnZWagAAAHYP/AgnJ+LfN5bzDkgMVesc\nrVKfBNfc0S9dttXpp6PIbmRReJv8RAUOzHt+NUz66CMngFR9JWmR8fNNP2TH\nYTKStXdcxuuRdYoQeCOFg+sT+CeD9c6fNXAslCDgBYuaPjA+jKLks47UgTBH\n1mL2d1Uz9dmC1CGbO2S+Oz8iTQmf0ZKibkb9AOJRYc0VJ2nAhe3cwPd5HWWv\nAj86hNKl0k1i2FBiopAayf6f9Wh7OLVWtuMrXXzJ4F/sKBFj6029JZ3GlaV9\nNfSyhRSVp4h2lx7ST8IC0cTnyDmerOGDnKJe4erWuT9ovNlfNC/b07zONO2c\ncgkBKOtQUG53+sm6igp/fsfoEzCbVFow+/t1ETS9WCWmX++TVh66Z49FtVeh\nYYKmu53LblHOIbi6G7Kd5/X2vPJ++pqzW8AxTVd6EMb33yuId2kHbvKSlBEW\naqV1gFWFXlCYxuEcac+cUcsCwlVGDMt4vykhyndOeHFxKRq08baMoxEw9II7\nXEvMGw5c2w/5mqUErYKV22WAla3K3n1dvgFy/aOhKMASVTnvkop89Jrpm6BE\nXX62YmNZW4dipNR9GG6KuqTlYlreWkkV9ZHGahJGRXXLzlOrsErMxcR2BWma\nENy4fr1P5alRSPNY5bO0oxJuvROFPEgXlpItiylNPqOjuXexLhEOgOvavqix\n7j1Q\r\n=xzEy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"8c804c01c99c45e0931181fa755117c4cf3a7a9d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1616"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1616_1594045148075_0.2212839483982909","host":"s3://npm-registry-packages"}},"0.11.8-pre.1618":{"name":"piral-ssr-utils","version":"0.11.8-pre.1618","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1618","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"97cda4b24eed0728dc3c002071aa8e5f1e2b1255","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1618.tgz","fileCount":25,"integrity":"sha512-PPSfkOweazP/u/8LtndoJ4ZOy+HtVr3QsCYU520tCvdMNxNYILxtNBaF2SSfClmUf3wJv5ibE5cF0ygLGJfcAg==","signatures":[{"sig":"MEUCIFoPlWzZLa1veACJX9hlOZF1qwsMOQK7BJl9bO+CUNLzAiEA3EY6tEEudsGK47WZxkmB90yHn0zMiCGGY8NiWg0JN40=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfA9zACRA9TVsSAnZWagAAklQP/1VphMAw0xWg2LFAH4Em\nj2A2sEaf1skFO/UpOn4ISp0xPhjO8qefDxyjhxKZ6gZsLzB9dvacjs7mDpOa\nItg1NimYEEaEowhRINKMMn2qCdisQ0jK3OPNlaxg/OwGfRlwJ0Yu2yDiNYeQ\n258Md5IirGufmQwOv63+IxWNdAxzz5bIvQmccRsL4e/dreib2KWvn1iuMjW9\nw66cesgVymNJ4KB2CAOqqtL1+fA6ccpq2V4fXKJZ4fhWMFEgDhSQMbPJZGtV\npeRThl3HL7k2qq2A1edSkkKLuxL3vKbUIlXDmWZy6QcERcUz2pWQj2QJIq9x\ngRlEr+VQ+u7xUqJ5Qrx+zwxo70M3/juDDbsEfkN4GBNiDtLBPIssmCiGaKBT\nBOycsLHaZa195W+Oqzuq8q46MxN7kqtnEVpJtlGk5LhIPjvPPVMcyf9NY7W1\nLHO39mWtCr9/6fw+ZQG5nkscnK7BNI108aObUoQbWC6/bItjf/vw/dGZBY2S\nQ4WqIbWv18XjyZghxUfIEJj9dqa/eUiGBOvOZq1PWpHQXwvTAKjZ4IKsHWxs\n5tvd9Gyj+pu50yVg8Rn+qMshJrp0flpcZ3ceKR9MmHMPYF90ygv+O1+0gexB\nqcSbUD2TeaLGmkPCeRlRTcLbnojG+6msLRoSPd6iRICvIg/E4xzvPe0OQby2\nichS\r\n=JCoi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"01bd7ec7c065721d3779103030b25dc66c20a0ec","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1618"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1618_1594088639978_0.25107116426025367","host":"s3://npm-registry-packages"}},"0.11.8-pre.1620":{"name":"piral-ssr-utils","version":"0.11.8-pre.1620","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1620","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9096492bbc938d814397f36c92b9c07e754b7cb3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1620.tgz","fileCount":25,"integrity":"sha512-3WGsTfJ4H/hbITo70qlzsGna4gqv4UiYxE7z0DIgXu/GrvdJuHb6FNKwwjqir3Cor7lu7N8ihLzs+pFBEM0M/w==","signatures":[{"sig":"MEYCIQCLpiDlbpNePfQ8bzJn9YElcOKHVPBTypRv6v0cteV4jQIhAIjZwXQeMuDFYvWmLBL3y6l8c3zuH8B5MQsnnXk+3Goa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBIa0CRA9TVsSAnZWagAA/xAP/256UkVkoJixTIPW26+q\nUHSOXF50/yzqFhzGHzlmK+WTJgAYuvwi1k1I3EF99G7dmKDJnGmmRRjYc7eP\nMP+hCvwtMAoN1IKV9KaHn9QfqgSrT+lJaClncBKBXkBFxrqWa5cH8qYnbAQ5\nttgztOVugKs40ZaYeELAHwlZzRqSz/dEYjZQ/dkVZRM4hKnABmF4DBbsvnRd\nzk3GRqXx4WbQh3FIxjik/oV+Y0hPOp+n5xgavr5Cx7Q1GdEzp56YyZOVo/u7\nX23FU+SRKOphN+IeFdVOva/UbFtTHfgsjazN3LK5cEtekPPv7Mz2J5a9KY9O\nh7t5NtO/6wVyK5OaiCtdEuP9DPwMn8G+eagUwTcSmMktYKH5idAzrSQcm7IZ\nSP9ShxFvYHKhp1LKoCOS8yOJNrytxQjzmA9K3hDj/BA8W05A2lTSt4TVI5eG\no+p937mXKsSlVXXGGSQ6oTNF1CuwK/+VA9C4NpJzQqkHYCweP2nm5OTDXq5g\njCjFcDc1+o9SZTH9rkOXqkaRQmRUttsQcileSWrd07l5uvyeER32ksc4N295\nROmWyPILUHqahrPtiLJfNDJcGvV2szGCXvFms6njhEXPuKUbr/3W37OAqpyq\n0MCWkDxBah3jqyGMHT2wRALBYEy4sHCPGdOcC1jkYC+zKkEWPm1qb7bkh5ar\nsK4S\r\n=42lz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e027010f23a5a9fbda79a2c6443d08a378bad1d0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1620"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1620_1594132148496_0.7694860744314105","host":"s3://npm-registry-packages"}},"0.11.8-pre.1622":{"name":"piral-ssr-utils","version":"0.11.8-pre.1622","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1622","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d9c0fc9e770cfd93b6b4e0e92e7d5764c030a022","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1622.tgz","fileCount":25,"integrity":"sha512-MeVJt6USEpZm7oKPx8G+UiNgOJ17/sLqHEsI7T8jzhpiorbiQeyblJBxPxvHUQdaDpnCHKfhgOj4Go0/9qr0mQ==","signatures":[{"sig":"MEQCIBhubN0umIUf5GVC3pLL8+FrAbL2o8VhWdczUJ/QN7znAiArgHnEhbYXeSiBUaIaxvQSaj74EwXnF1ECQaYDMb6pdA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBYPnCRA9TVsSAnZWagAAiFMQAIAIV96I9vHkrfldLsb9\nK5Lz/vvkc7nYgwv4Mhxz9BjkDdN3mDoLHQ+ZLc76txUZOqgixC8+QsBVB+Fd\nb7w/41MMH9g7fKY6KDJrzv+YChmU5Hrc18RztTY+pv/lJ4Fk6J45nkKDYUdi\nRSRh5LV64rrxCcXF/HJqv1n6ZBM+Cvo1OT5Dzl2HGoYF1Djoi5C1Ju6wUIm1\nFCIG2NfVsCbbjraxDzgyEFuF1QQxC5l5lZWNoacM2GFqZoB4IZTyYV8Fr0Ls\nRecvgIP0K44G0Y1UxDxLSxX9LXFwpZ6hqvsmRkPXl6pJGP34zJyYKVY6WRIv\nTIw1xPm3Pe//+93VmNvFxjw+ym+liFyBMUxi4A122Lk4V0XPEqVwnSBtnViz\n22PHWZmQ0Enw1WjM/diEmi5Nfms0rL9tgu2qLmsWJ360/VL8Tli6XsB4sBN0\nJbvyK6ZZf1UvS4Z6NspybO/jpo2SzKpDPo+2mcA4kCBECOwM5lO/ABiZIux4\nfl86LL6H6bbZ802Q6vpKfX/HKwragwuqm0gy1pPa66ttptEfI3f+y7r68+0T\nz7fwTflduzuG/CD/sHs8zJlZ7p2drEzSVT5qsTaui+7+hpgHFeoKRW/gaAVQ\nAc/QR+ibYpSmVg99V8XeEfpKzj5zMOK0Q9N7WiYyWZi/KLZglMyi0olpDBOo\nR5ay\r\n=kFA0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"1a6dd01fef8c367fccebdbdb01245bec0ee260e1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1622"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1622_1594196967360_0.9385714859079057","host":"s3://npm-registry-packages"}},"0.11.8-pre.1627":{"name":"piral-ssr-utils","version":"0.11.8-pre.1627","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1627","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8e5cec3b2762e0132589d733884cff028e64f36e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1627.tgz","fileCount":25,"integrity":"sha512-tW5JqhAUa/Y1gIIXfoFZ6Ly12XBekuENyJDQFU+yW8DdZp9Jmbg1Vm58JTTx6nTFjgokQnzrPCCtYVg6p6rJZQ==","signatures":[{"sig":"MEQCIBpiMhYPRlvMN5J5kHr+aiuF+fWRg17N82n/ZGriprXMAiA0iHiCqahLGzsmtTzVEEVgi2Y7glB0rQlsLlHiCQ/qDw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBdvQCRA9TVsSAnZWagAAgqgP+QGV++JVhLuO+8Vhvi91\nMV9ij1ANkFVP+1O3CLCf2o0/Jakd27HtHM73Pe1I0xLbUodwYQi8KKZvG9z1\n96TFqroSpb4OzODe4btxOtGDimqgMjYiNfDfaHVYVO7pCJZ4PTNqoKDku+IH\ns8GQLgHsR6yKV/Uyfvq5k+No625a8KRXTi88/6unX67NBTEt8nUaxPHR6K9w\nqbfJjTqIq0h2QwIsLGiJurccTvZIMXRXEfTLpp+5xvLPhACKw9CN27rG/cD0\nsUaGPtItrj29HNS0M+1f4SEvVFEkFPxK1vHcWuvADM6Exp4hIzwQuWI3PM+f\nkdW7To8kGgFk0iMSaJIfH/AMNXA0BizLPcb5M55h4H54tQwqRIVZXNdi/FRI\nMatxxJHW2q85JULkVbnEnL8cu+/bnZarw6dtjCbVyHjLwE8Pv9f/Cm2J28L3\nJZKuyJ5e4IJfuO7bcepI6F7DpLz8eDnYvD1Gqr0ezK3anBVnpKhfHBsN0pCm\nuPjOIALliXTJe7WJoQ+6I5zMvk4RrDGSNI4ZMbzrtUSi09GY22o2t+iYY1jx\nXn32vCxmWohPzDlcy2KUIS3Rm0fFxiT8RBeCMx5ocB9YRLyS5AQykcaSmEj6\nAHZvb0ZnxwppP+3+81T4uYe0cHNMXpxJsyGKvQI7X2K5Y3E49hd5oY104IbO\nThyE\r\n=9jwN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e9219a97ebc4918a34d06ddb3c9e0a8e4288c1bb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1627"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1627_1594219471916_0.9720461183209008","host":"s3://npm-registry-packages"}},"0.11.8-pre.1633":{"name":"piral-ssr-utils","version":"0.11.8-pre.1633","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8-pre.1633","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0035d7c266faf90c05a4a6465f66a3f13098e30e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8-pre.1633.tgz","fileCount":25,"integrity":"sha512-oU/B61GYLhD6Q5bOjiUEnUOdAfCtJcXGFKf0K9JfMBl/QUKEaOLDqhnDncWOI+tSVqrbTqLDioJGJRarfYapuQ==","signatures":[{"sig":"MEQCIBHm3E43g0TGVlTZNV1jOAkgpPqLzPv7VOtdtpXmqJIzAiBsO7JvLqMgUPAJWwxSI6BBSDQ4fozxtX6SZl2QNdx39A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBrTZCRA9TVsSAnZWagAAL30QAJb553QkJMjcTvvop5In\nxaIWggzG1jxcmBEHQLXx4enqrwfFOleJkK4qgSsnVMP+ZIJ0D/yYrYbT/Ozq\nMHa5eR/Hmge5jJhtlREIfo56AulnVFQITfZXpEgGhdUk5GmfsMA9WA9X5w2G\nPcRkTy85cNiCRsfN2xgvOtGe8tPIZkT0wgX9WD8qc9AK/27HO09ory14e53H\nonCTs+dMckergGfRQ5j8365nR22Lr2KOhBGzKZcYclWD+usSTfMwtqaImgci\nkCxtNwo/JrxEtP1gmmJ92xVBW9/EHFhU246YBxuxBhFPXmvl+HLkQgVlnMJi\nxOTgNN4ec1yj0Cf6//IxP5CZemXynsuPT4bsy+WHPoQNozQYOfXUHUkPVLh2\nZyDd8ZWiAbpTcGQ9PCbED3iD8JBMPmEAU5tV3CERehh9DtJpfB4AvgEFpEt3\npcAc47JqR9pRUycjCEVk4NspSFmoRCWMeUmYDYF6N3Hj5jbdl+luJIiq+S3m\nimhZvV8gz4aBHJ93euc70pwcM8iMbX/MiZiKetkHdIXbEM5GXjarlYceuDVG\nws2YHZilmVakDe20q9aQP8v5PJjJfxJYFEHJRLH/wVC/i+8ChANkqdWTx5yQ\nix2EUgN1d2HAvAjk0BYMmCOTuiRaaVrKBEceWGj9Y0nOMUx+Gvqnh2ecRksr\nz/+q\r\n=7uIJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"7af569dd3ee4bc88bbb53f4231943b5f382791f0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1633"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8-pre.1633_1594275033496_0.549573045405209","host":"s3://npm-registry-packages"}},"0.11.8":{"name":"piral-ssr-utils","version":"0.11.8","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.11.8","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ad6fa6896c03ed211b1c7b62d046c834f513b519","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.11.8.tgz","fileCount":25,"integrity":"sha512-YdzXpCmzoCh3/W43Jk/WmwJldlhJycw7Yuv48m/vxV0sX3yvBR6nMhrz0hdii6s5WCw+5gMl7iLRTk255PDkCw==","signatures":[{"sig":"MEYCIQCOKLZvv5du+vX9cL9cDlVJefUjraR80gAYDDzMmLNIJQIhAJNh4LQzFHx33F41JZzIRuzncJsg9sjlhGo9Mwjp5oWK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfByruCRA9TVsSAnZWagAAMdoP/jF45mDVM0aHPkN2w1xa\ni8zoNOi5R4GOpvvDhJTYAHiJePCkmriCCTzURr7QIUm7fuVBM7AniuEEb8PM\n5z4ZnRnaju1RPCOW06tv9MU7QK/MGpsskfne9Rf+7eIETRjeK6/jxIxRj/U1\n4/vDODLKHxLwywN3NLSVQR+ok6txl0LH9Fq3r6AtCPJRg86kDLbgvYs2+XMw\nJHh3N9Jc57E0gSfFfu2eL6RbA5Z3uTCkFzB49ie5QoU5MVko0SI4DZGnr32Z\nBjxjrhbXcuOxXPXsaU/eH2tbls8c/aAxMpRTCU5x9VYNZ8j6g32JuYuTvy87\nuE2m05vOY8vL2urhXraNtUXvKqubc5sfqscWwRk5PQtgzdPTnANMsPih53NW\nteII25WfQjZWobwCjy2H2ibuiKOEeMdiSaT5PDg8bcjBYKfSzvBaqi61Ds/b\nNu3KfZSlT6uz0ooBro3Y+erDHEPGLBiIHysm12IPszz52mmQGY7kjPwlutXY\nwdw7PovvqmVqN6OI12VPpkyuBmR0beDb2YV9gSlIRaw9TV8/n+4l94ds8vOa\nQmmhmy65W5AMQcxpCFKBZ638D29dBe5e5vCo3+dJ+mgrTYIRCDu5n71If4/a\nxLeW3Muk9A9I1o8Jpk2wv+vG25Xg2yCu8nIHNqEO5H5ZJd/v3U5hGBWkcd48\nuM6+\r\n=3K74\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","browser":"./runtime.js","gitHead":"617df77a2d553e455ec66b04936967ff3ce21a47","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.8"},"peerDependencies":{"piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.11.8_1594305262106_0.8717412879557076","host":"s3://npm-registry-packages"}},"1.0.0-pre.1657":{"name":"piral-ssr-utils","version":"1.0.0-pre.1657","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@1.0.0-pre.1657","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7e9c1caf9ae47063ad12ca49fba79f4fe6b0677c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-1.0.0-pre.1657.tgz","fileCount":25,"integrity":"sha512-iYun8ZIcG/Glx+wozxoFjgG2CKJ3EEiq6LgTI3iw+Jh0VlUNOOQAsdhxmIleRkM5r1YYBolyRwhO/0UBPkmbRA==","signatures":[{"sig":"MEUCIQCbXMvb9KE5LRS+IX5QVG2bQnBtjWeU3RH4yYICsRvM7wIgdIG6utsmHtXGPNLnF3HKIpTI3RDq0ZzXlG5ZiTOX61s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDWypCRA9TVsSAnZWagAATXMQAJxibp14xHpkHAPPfBJS\ntdkx+MJEcn50qG+ZPWbNq0hvVKuBFn76sDDYMGVt8KULUE5CEN5YopLSelAk\n/VHGfqVeVHkAJijDo2q3dUSeI6qmLsuxGg+aomf0Mg4KHS5LlxOZcoWchOab\n8tTxDY6Ais8UPRRDEhg3x4FujAtfwu10sGkDB8gtAtkoQ8e1D9m1PsaupoVP\nWBppwC7B5/QCgRPyqoXhIdw30Vep1wdUEH0iRq8Fj6nE0SfAHOAUgpWVn2lt\n9/8AeV8YvVRfUOhf+IW1/JFWrgI1qCbwyscdeUnmtoSbfZfYN8FsvxhiJ+Sn\nycYBwOVOfmhw9saWS6p0I2tkgLxkg/VlLNcQjc7cq0CMr0OmewjhPJifjs1N\nYgzd6GL3Kc1O/QjKqJ5JFGU/96pWexhsH7quk1NCyBYOf342tWT7RqNOvdvm\nmbPytMCLyVjlnkJfFRGaT2ORqbUTsE61WzpkBJi98idUs0tIORCxVPEssKZn\n3NyntVjyDeeaI5JII5/afZxSixmIP8vMXLcVVhyDtIMGudcfiPWqSjL2OQfA\njEW4/ql8JAJ96koASXroYh/DR0b9JcZD2NvDUsFzC/l7iMEwX+751DbgV4EG\nNM7LQYuiB4foJ8GttvDRmatHYw4HeiFsYMA8+rUGhIcq/Q37fbGsZsRPVLLb\nSLKV\r\n=YE3I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"793a4aa660d37f25c1f7eb9951935f23eadca798","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1657"},"peerDependencies":{"piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_1.0.0-pre.1657_1594715305256_0.1485106418647304","host":"s3://npm-registry-packages"}},"1.0.0-pre.1699":{"name":"piral-ssr-utils","version":"1.0.0-pre.1699","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@1.0.0-pre.1699","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8ae4303ef350e796e06f59bccb1b6bfb818add76","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-1.0.0-pre.1699.tgz","fileCount":25,"integrity":"sha512-IIlaCh8REwgzUwSX3vDRTjnIhWRQ3Cxtza+BnOoGjv/2JmCXZqR+Q9jM19TaepofW/1xOanb++hOy1Lt20SzPA==","signatures":[{"sig":"MEUCIEzD1rrzdbaW23kERZaiQCdRvmMdQiDEfGtK11n+Um1xAiEA0lRjzwmDnbF0vmtHvlUv7q8w2LbnkW+IGRj+bGnrJlI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIKpoCRA9TVsSAnZWagAAyogQAIsRX18tRKTzv9/63cRu\nYpTiklKOy3py81QvvQLg8BSax9jx3CZqolJZ1ss8igdvnWgQTIbYnQmxs9ZF\nnB0BOqUN8xuej3P+2wWDX1qF7RbaQ5t+gipNoPTf0Nvr8kuJZkXnByZoII2Z\n4VCUW6Ps/DgoaSkrmBrWldiAXdxpFC3JxqOPCBJKMyYZc8EGno99EK67QTr7\ntJAt0RpqAYNOiAy6htjw12kMe3CENLmz2AeCDXcRN8wQx7jAP9pwlDnQj5mp\ncapBcM7vIDM0a+613dHvet/ad2FsFlnRhvvFlD10ke5KqDjZIJg7W5KSRRGg\nDvPcipKQaFs0qb6XqAkGzQQ17dD2uv23TQ2r1D6hViSL4FZv//0KcU+SJQS5\nh3f2xjgDs2ZYVe2CQHFt1znMzSjrUMu/aw8wMNtpvH60fnZlwj6CfxsR0Q+a\nqX1PiAEo3nkvIlZoFhvR/HqWceyqotjD/34J0SPt4B3FjmARiou42k7bIkru\n30ojet3Lqfyp3Dmt7+64FHjJKoD/F+QCBUnoMova0mzduydzt4RF4R0/Qv8J\nHCc0RbIlHdCzhTjGvmbL2SSeOYfXcBby3c7tdu8q4ugGlcRGPg8NgvowjtsL\n4bzLMSRobdljYpn3Ft3WWRrfIy4cbyU2JiYoOelU/vYRym17xbR5rgrIfK9C\n1kmb\r\n=OOsa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"317680d30bf226a6c54a4e05f9420fe666c090df","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1699"},"peerDependencies":{"piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_1.0.0-pre.1699_1595976295601_0.8231685100699684","host":"s3://npm-registry-packages"}},"1.0.0-pre.1703":{"name":"piral-ssr-utils","version":"1.0.0-pre.1703","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@1.0.0-pre.1703","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e454c44bb758018d86320349cf7d02ee90421c81","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-1.0.0-pre.1703.tgz","fileCount":25,"integrity":"sha512-S0UH8FrizAftbxZdxz46UWQuuiRDbFyUugViOl7Y9BR5LEIPG04wRyWZ2++5aq0fRLcexESPRxdLUPKH6JfWqQ==","signatures":[{"sig":"MEUCIQC3eq8o8AFtLFBqovzfTNwn9tZNbYFANrv5a489fN2bBQIgTntgB1cZ4OtAu+VwpTDorOZqGUNfbhwu5Gsvmix2nMU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIuAmCRA9TVsSAnZWagAADLQP/3iyyBw6L0OntbaIxch2\nASxo06TEkqL6POAxC2eghgdNF64tbZTXSbe1S7I43CCB/3v4It1wt1BD2BgB\nN16+HBvnURZxGtHVj3ct1Pi0udacyiCSdInkpjq/VG0pcvI/JgTWugZIdkIy\nuQfhr1hifstKLXLkxC8zBMZbZvswsmyTE+O2aF11t42BecRu93wxIXtPdfMR\nHrgu62xK/lCUJtuUhGiPkyRS9NYC87jwvU+OC3ue0zze3nVZeOzNHqxEvfiW\nY7aU2L2ljDH7aVzmWm4VLeFm3+swkCKIUCpLmHYrRiufyqrnd+UP/XrLR5Jh\n7DmGxID28NcTkuSnp89FlWwELY1+K5scx3pUmMnIMFm52qi8HpTKQ+eSM2zo\nRSDL4Sk/YLQFvYICuhSi6xSgKugsQZlNHZjjRaLOgU36Ypp9+UV7wUUC9u3Z\nuD1o6QRrypQ4vLf675DWnS4oMNSUWXviacwnnsoNtG0/emEEJfQUcBtIIhSQ\nryM6ISmhPsaVcUP83NO1bmT+pJ8kVgbV2NmV1Te+udOJP0fnvrQmPTf7sRFp\n3OXqL4Bymc/FM6XwFdYreS4V1ZwNPLoTL7xj4RqC01jMY+U7jgVanAzP2aZC\nTs3J5rF8cL8WNHBFum2wRT1Ml+me9mkU3iwrBfHIXqo6kt/r6GNXJ5X9PdOU\nOSYD\r\n=B855\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"2136a78aecd16c9d2d5317ac4a0e17db6a789e1f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1703"},"peerDependencies":{"piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_1.0.0-pre.1703_1596121125648_0.7853868453458899","host":"s3://npm-registry-packages"}},"1.0.0-pre.1731":{"name":"piral-ssr-utils","version":"1.0.0-pre.1731","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@1.0.0-pre.1731","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d4cd1c9cce5c667eb7f711e9b11145e576ae639f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-1.0.0-pre.1731.tgz","fileCount":25,"integrity":"sha512-Vdk4nDAhXVgNx5uOalTI+DrDZtMpQdMUQscJ6S/0wlYwCrs/kyDYzQTzV26Xi6S4Nf1MHrQjZplfrbYs9NeZAg==","signatures":[{"sig":"MEYCIQDw7LFwAjSowJqxCw5XwuyUNKOEZxe/+VzpWFodZ7Ja8gIhALtgTzZmrYmz0eZtLP9qlDoHrRIQ/gs4j4ho3KqYrIU+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfL9AFCRA9TVsSAnZWagAAbtMQAJMDBRT08Zz3Gfi6xqQ9\nYxUOEf8B61gOUnaRxZK07UO7zqsk2lcghMNrah5GHfH+iOGdO2n1I7bKWa0e\nJ5IlfWDmSy3gVCa3/cW5x22DjgYdIfbN9hTHw7oPIunY4BCPAcsBL9NSj13y\nihseOkOGl6IVPEQB8zv/KsySV6G3xErSVtIW4+INooe7+u8mmqy6F4i5sjGF\nS3yGlcfET8cc/HnDvyid7YvEyacWouD3D5Xgbwoa5FfX8d/vMccPw5ut6Yge\nylEtOaIq+vcqH5fCITqXBl6Xsx9jDPtWo/+xy0jF3uFSBxYnqvtZvlhvht62\nnfJooXU4g/3UeIOdnsRk3bpJ/ktqouEV46IhUbHnlmiTz9xKYQcZK+Iw4oUJ\nQ3jQyhJm6bpiwJxfZ+lx+x8SKwQJjpG1Azmypom/M8pKbYztBNXxfiPTgeOT\nTHW2kPjy6bsG/AZzFL+a576vd9PHedTvhWM9LV2tddDH9px3YZSlgAkp0vq7\n75wroFCO398Ev/iaUfQBFOHd/cW4eAQieUUNPVGS65ExuGmmBF3JftsqxMWV\nyhe3AqDMo9iihwPP7f/RqEaPZ6xZjijF6ktaj6hh6AbJDalAgySiaZhZUmmN\nvze049BIwTo386nHySUUsS81m5eUUL2qeLq8+vZVOgestR9ROiv2BxbYy96+\n4fuA\r\n=5ifm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"be0f6d54a50d8093aa25997ef800c1dbccd12562","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1731"},"peerDependencies":{"piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_1.0.0-pre.1731_1596968965301_0.48676096648765443","host":"s3://npm-registry-packages"}},"1.0.0-pre.1741":{"name":"piral-ssr-utils","version":"1.0.0-pre.1741","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@1.0.0-pre.1741","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"90464a56c2384a1c949383cba11759e3b9ce7b66","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-1.0.0-pre.1741.tgz","fileCount":25,"integrity":"sha512-5jL7NYz6GAlPRvPttHSt/U0Gjtt7qv1B3hh7ssF0Dep/fR2nUGhdMSHpV3T3cXL82XOlJZ1VF2LPBrrIoP1MkA==","signatures":[{"sig":"MEUCIQDVxrwW+KE7eycX1+/nbQWKSV27eZPxuCVPl50IrR1W0QIgQ7Y4Eg3qW5L9LQpac7Rmu1OPGBo9aNeR7DzOZBm83/A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQEiQCRA9TVsSAnZWagAAWWQP/2fA/fX/pSaTa2x3F0aj\nywGWT7jqAgc6E3Sk0d0qeMLBBeYRXgecN8ciMWMn+RPSFEze7eFZYomwsgfy\n40afl0zsHYBiKyEZlb6wkeFI37Gk97vufWsMeRWe4gumoCOJm8xLv3nrBq7q\nZCY50az3rstxBq2shr2b/xxijg6lLZi3iYgnQ06VBIMETN01hU9x/mKfC+G1\nfzwEiA5FiN1UbcsDgazevvAFhLMhTIy5giBTpYobq/BlLoB54jQ6DxnTJ10m\ndZ/9a3xPmmdDFtImYVR4FCiqsA5fTMlQ0YPLiIRbSHl0f3DUuVwURgT4kFWY\n7nvvRVWWEaGV1Mkk/Y3U5sJzSFVb3e4saZR3vrM0/rCuflZYIuyhJBNMoG7n\na9s6i93Esq2cecjirdmjpNYLrwJiYb8CNQ8Gxx8lMIwxBbuo5H86aC4G3340\nhY7bDlZAeagT0fEcgLoW9ot34lAI+S3YNvDsPgKNJwkZ7WTnrjAkL7NlBKPb\nDNFLHtMLfcl2NxkQCo2oaxfVynMSstuIYxqQuPRFRH9wN6QkUt2m4rBHC+jU\n57oLfyudDhf8I9hL0NOo7iTm+b1J/o0jgIvKOXLLgK3FEeMbKnGZLLNWZV7Y\nfQ9UGGj3RuqvZ21/ZPhnNFclw1DInEo/J15F4vA3ovXunw7awE3UGc2YdgmU\nP4wl\r\n=vw8M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"dad91d985aac8beab53b888bec45553d70280192","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1741"},"peerDependencies":{"piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_1.0.0-pre.1741_1598048399721_0.585435216163229","host":"s3://npm-registry-packages"}},"1.0.0-pre.1742":{"name":"piral-ssr-utils","version":"1.0.0-pre.1742","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@1.0.0-pre.1742","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"44e974b481a6dc231c3037a93cbce4c5ac680a55","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-1.0.0-pre.1742.tgz","fileCount":25,"integrity":"sha512-EPqcKzkAETtVqWsD0rp0nqVyGF8NNy5yzEBQamwbrFvtXQx8ppTPWBwxI5BHVaBqy88hxM3Mp8FPbCfT3csrfg==","signatures":[{"sig":"MEUCIBnyHpxNYf0/AtOJtQZX1tJ2S4MBRDk/S36Io94Y0nkZAiEAiZ+oKDYmjxuntJ6s4u6kliIzohTNd67c14EfwB0ZbaE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRYmpCRA9TVsSAnZWagAAbdoP/3ZpwsNU8wK0bauitRA7\nZmcUJuCjnJpKpADC5seqXWEuycDYHnwDPA9/Z5Li/03DyZgvjj+d34YrVEGO\nMF5ltrIhTwvrVb3id8vIDTrIKy+PoYf5gobLe0+6L1nVDkT8Fc0siN4RctSz\nH88UJwK6+OWb4MwNpolVrM+YfbONKeW3WhHZyAB8B6ibM82bMQKqoky7846R\ne33wgQnV8kJShm9owcM7tUGAZkbqXBqf54FCgK6Of9mAoBPHdzGfvS8ThnWn\nDniySWhEPzYkjkIZcCayMYXxAFetHYtVRe/3L4tXLcG9qAUoMco2OHC+el/u\nU36FntA1YvudmImeHOqFQgwoUjLl7zUjvF2uhNr39ox7EnJ0xvPkD+7DQ/LZ\nmc4Ku55lqdsjkhm47K2aChBy95URUkZvX/QxgJ0IGOfIJ6m8zCwsUbUTIuXS\nGvJM9aXO8o5pDcxKqGhX8VWdCKkmIh++sWcBPqb1qPVdeIdaDOh6XvXrzf4c\npkq6NKbKpJP1F9edJIqgYqmF2kbd309T8Dbad198Y3NkazLuD+MFzhggn/zY\nc/DVgFWjq3Sa/391MauLVb02PwEDxsEFRGz8OE6RAdbvzmBvb9vATuBPR7lv\n3KYjp0kD/jLicemzRsQbVhB4v3va+Rf12eKRdkal5yRe7GdF+n/CTQRxAF6g\n0XOt\r\n=ahI2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"256e47bf1a506ea653e2bf53932154f717fd2787","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1742"},"peerDependencies":{"piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_1.0.0-pre.1742_1598392744730_0.7826968948170374","host":"s3://npm-registry-packages"}},"0.12.0-pre.1747":{"name":"piral-ssr-utils","version":"0.12.0-pre.1747","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.0-pre.1747","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"752ae2d0eac0411ef38adb69f08ff66ccf6fe3d8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.0-pre.1747.tgz","fileCount":25,"integrity":"sha512-R8ehnSs/dFiH6ZEo2SJMZSLIYcy+FL15D/LVSKxVVp/yqMBx3FjTZqJvyVAuYaLVQ71TuGrJnxY+iakSIGzYww==","signatures":[{"sig":"MEUCIEpwF9T6e/gXPJ4exCRcu7bPT+krqewnqD6KuwCX/XIVAiEA5t61CZeT7V2yE+1QZYu0TzWVMnkHnI1oUe2bz8IP5Hw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUrgiCRA9TVsSAnZWagAAnAkQAIw1/e4Qrg4WFMliO8Dc\nLWOZktRE/o5C85D21Bv3zgyrnv+gAoJqezDfz0p6z7Ud3ISR3iOKpQEhw+EV\nAIow7TO4jnDyu41FvkTKWt/kS0qTw9f6NA/wGyAhaUXMNzCKrUPHK57qDpG9\nsvO6XxPeaS0VB1fJUL/ArX3PUqqoN/G2P+LOeRKGmvir6dcaLanDgzHwg4I5\nqV9GZodhaCcmIJmPIfw0XVVI9UkI5hg7I2BuEQ7ZOl2rztd4QVjW4laxATph\nwq3Hg2R7siSq8UTHVPiu98mYmYKKBudW2RtCsu5812ySPYT40xmbL0/mK00e\njC1JAEVzB9faj6G5gr75f60oqjJnrEENxYNdqvXzhgHCMImhLRwTxxYiRdoL\nuHFg5Sfa3RQ7wAcvUICZ9RfkvyjU8pnysha3gRDJAvis2SzbD/v98q22o7Be\nuPoa2EqHzHPD0HqT/hCWhTQUcWKhl0k2z1r9CSAJMv13IeTXR8mGRdoqvVn6\nP3G1ry9FYU1jWU9hkUAJwRQX/CfkXPypvwYRgjrPSO+kzv6LszgERhm/KIAA\nSIyHtdNBXB467+6354WgHxJL6DNyZz8KJJKswJ89O4kmWuDW7FP17Nl+08pU\nW9gnzoYrcaHWTDXgCeEamQFT+hpZzeHMNk3gM8UYD+LuoiQfuDriiWVwFvEd\nMXcZ\r\n=NeP6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"fe6d8ac1e84c1760cb54355f8fc627bda8625ef0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.0-pre.1747"},"peerDependencies":{"piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.0-pre.1747_1599256610215_0.6881619697547028","host":"s3://npm-registry-packages"}},"0.12.0-pre.1748":{"name":"piral-ssr-utils","version":"0.12.0-pre.1748","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.0-pre.1748","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b34e9091e0726b9b301b430ef44b28d5a1b8bd6e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.0-pre.1748.tgz","fileCount":25,"integrity":"sha512-jrM1xeW4nKDsWhjlv35JFqN+HgL7IlbQ9F8USE67hQ8JxbxqXi9vXorMv4VoBXydikK5Ab/5icxSSEY84EG5ow==","signatures":[{"sig":"MEYCIQCu7GZbyt2E/nACQhVD4ibpI/3esEfZyBdTkuBvWh398gIhAPTXYpr8rp/PDAyvKqX6BTM+IG2uAm+MLx5soi1RWyK4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVri3CRA9TVsSAnZWagAAGroQAJagEfrR1hmonIuCh5wb\nmMlgAgZ+ZsG0WoEtnpVipRR6Wtg8qE1lw/bOYzYaBnO5NNa1to1UdieYxHuO\nb8GBMJLDGl6Sr/gEufTWhKKWRLHsrwJKNc1qvI0KQqb2zbmC5N0D0gTnl3ik\nKPgbojYKYCJ+OtvetYpmXm6VdYrh26MMHtsdjwgCUOOplXOAqSWE1TPyGEDe\nYoPBDpm+1fjJ2PdADWvd3k3c6kHVw7oXEdGuWBIb372zXnlfjzmT15o3c32a\nLKqYmgfTTuIYuPiFvLJ7zY3RYLg8baAwiDmdngCj91JMs1kvRBh9KoYUQRRO\nTo0q8xLgQkjZ9o7BzDhLo3XLhF/+v9IMoBEHnsh75IC+8YwI4Yn2rXNcd72R\ngMzyjbg6RrSdxfuVixo38mo1DxwDdLiI7DPu2OycQ9SdnIzI1Yxd+ueEWw7C\nm4AT9ujW0RGUzYi/o5rplns9agGoSbm3J0S/5jeSSynIOXPwSAKXLLC0d35k\n2qA7lUnbq4YvMvHz8kYWdzT5B1nCkT9ACXufBolgf3WRAAtVaH97/sWnwfa+\nKs517E3/zh/rxULUH4f7d69CYr48/3X61D23keKRx8ym145xiZnOf9MYQODD\nwIvfOMnhUQ3DBUCn21CnDPaw2Mc2/n5eM9cP690+OJBRgsJCVCjYnty35RSx\n6XfB\r\n=XZXP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"d34d6d2ba17aacef87ae945fbefcb75f923562af","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.0-pre.1748"},"peerDependencies":{"piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.0-pre.1748_1599518902931_0.4384470877942195","host":"s3://npm-registry-packages"}},"0.12.0-pre.1750":{"name":"piral-ssr-utils","version":"0.12.0-pre.1750","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.0-pre.1750","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a63dd755e05892d9621db27e62b51c0ed09b8800","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.0-pre.1750.tgz","fileCount":25,"integrity":"sha512-cKP0wlyEP9p5ZKXPZwU+Q+V5/zAfPXRQjFv72lKm26oymB9uDn4Pa/Wv3IaLEZW/aWUDm38+8oYIH6UaUjkWMg==","signatures":[{"sig":"MEYCIQCWO8SKa5Ort4EGTWsLirxzzgTB+fQXboEFcYxtBeuK9wIhAMfF2tqIadYDODAE8lKOWmNXZRIScIkwY3b3G9Y6Kdav","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfV1jJCRA9TVsSAnZWagAANkkP/0ESRJs7AokeX28Tor9L\nwvB432Ou0ZjCGp9L5T28Hy7VmtsBeo2D1QHBphp44pAqvG1oMIfRbqVrKGkb\nXZvHUOIRZkLsjYQXBQE99q7PFfjx6QQmiWVfxtlHQTnCth+eN9pvXwDM1eiB\nNJyEKrLUUBikjOQkBr7CqymlQTrK7+g6jvUh7DxKHlkPOhaA9EceCfzH3WJT\nqeqnaMI3BpSSwAVc5W3Qg+3twCP8rQ+qFqBCMy+Qay1CJZxfiCkUAlVG+2Px\ns8+CA0OTKuFzf/vFx3jRnNhE9PQ1jD5aEwf2qc2pIBDLIz91gTYUz1qPBTti\ntgvFK3NRlOBZUWY0ivQ4T59nFPqMwR3SDMkFmlPQBgfQE9WWSAgsSbsIJnhk\nmgwx8So5QLlEDaoJDJWsEbi/s1x/jwOCb/6pjzgoB9j24e0MfPF3QwQWK7JZ\no7O3U19xY2FEpORr0yCHMGmLlzOH93gypYYjdM9w2HpzFAMbyUisUgYM1HWb\nKobbtdkHJZQVKJuEWOGRn0Td4msbTwLzy57s2Oxe2J63WwU3MnAkfaHZ+u4k\nEVcU/uB21X2h/CTlK7Eu9JXJg6+s3L7Fk+xgu2M6yH1cFdN2tL1xpgy8MIW4\nqQSxXmpS78sxtMPtyfi8syThCIHg/WJjfhhTiQDAxDsjwP0m5gux8/ZXPL2J\nUnrv\r\n=7CWP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"a72888f51ad776b30e4b7fbf86da6833a5f669fa","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.0-pre.1750"},"peerDependencies":{"piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.0-pre.1750_1599559880832_0.9482502836533626","host":"s3://npm-registry-packages"}},"0.12.0-pre.1754":{"name":"piral-ssr-utils","version":"0.12.0-pre.1754","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.0-pre.1754","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7e57296dd9ceb909a89634a0998ce73bd7d0a6db","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.0-pre.1754.tgz","fileCount":25,"integrity":"sha512-pFMPg62uUBmzAgbgtGmV6OxQ8milY4Cdwksv1mPEvMEM1+sr4IXw1oZqTQRp7LN2fRgBQrL4ltsDzMfH/VRskQ==","signatures":[{"sig":"MEUCIQDyRNFiT94MXUxbrbBOD0yf2JmtlJhgN6vgh7nDvFVVIgIgIRbPHZ0F+TZQ9sUrigY6Zkht9pOAn118+nRN8u8LomI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26097,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfV9s8CRA9TVsSAnZWagAAWv8QAIiVtuXTzyJZghS/B48p\ngvCXyq6vFwzBTksUc96T1xFM8/6AgLw147HOS2XU7eQRGW+nX6C/QMC8H8JA\nJ+XkYfFUxWtgPkpanqXZOQ/A03ui2oFemBVuIEvn0p0ffhcs28rd4TTu4ojZ\nmgKD6eQMgvlU9HbbARoJsUossPJbt2q1cgVvagTCDlBFAQQFq3lwt3DW/XPH\n4q9yjWiaX12MRcxvSrXUAAZTjQ2PCIGQdW3daRE+JgK3mzoeYwv1IG2/I5tq\n0hZV6K7aXTwAs0/5Sv4yGIfP5ZNPsMVNF0jbugZvXheBaaH7iH9U+qUyLfpP\n7+32CjvpmmZ+Qf1Zlmng7VK55e7G5de3qOA9p+9RC1PWd5J4hcuxNNjbXc0E\ndDgGLp3K6xV0yp0/HhvUM9RWx3xSVgd69ySZiUv32gV0+izyWdn8T5ArhHEj\nkWmjSK0uDq0zFcMTdamsJAodbzh0FNCGO4NFiUtr5mhmQG8nbmt4/VkQ+F7m\n/top31prjeW6ODGeAOoz8o2pcdyUiFpBioTKCVaqPPtWZy5GxGUNAfskXJ+/\nKwQtMqpvw6oJdACuPriQlq8pow2N2Zj6xMLf7YfWHaT0Nwhb2ubJIs45Ilw3\no5AbTg1yQD/zOHtTYYdvdeDabedKaJWeLHF+DnDYoBam7J+earJwa1PudqVv\n4EYM\r\n=EGd8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"7ed660c31b0ff8fbd83beca98c947f159417d27e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.0-pre.1754"},"peerDependencies":{"piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.0-pre.1754_1599593276066_0.44843843533166927","host":"s3://npm-registry-packages"}},"0.12.0":{"name":"piral-ssr-utils","version":"0.12.0","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.0","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c3490303d17c55133224c0c7b4585db6cdbd1fcf","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.0.tgz","fileCount":25,"integrity":"sha512-eer7xFu/pDZWD1Zgh/Tclp/lObSBRb7vVaC/0IQS3aeBEoqZHxPrLPMhtBxHiSLt6rhHZ+xhsafeSewdXgTumw==","signatures":[{"sig":"MEYCIQCbpD4K12lFf13Du21yioQ0cd8C8kKhADbVi6g+QCQdfQIhALgkUTAgq63sbiCr7V712WHfjlBUsIy9+x8fU32DrgS4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26079,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWJfWCRA9TVsSAnZWagAAJxsP/RTT1x0aD3TOqozVZIZn\nniygfVNquHgtkD6uoe15t12UhwTxlWqinsTcPUwZqrnX1U/ksMdZX+0muVWg\nLT+9zE0/g6Ohcbvgi3Ljj/EKGIBB2CR8qG0FQr+j6rx/uTSXvUXD3z69Lv5h\nCekUZ7HR85wZzz58kvewPJ7ooVgTL211yZIR7SebghumkyfdJOBE2YrMTePM\nMzWAzqraIx5MPQ8kroaJ7576OxWCTjjv9ovEuwYyuNd5W2CI8jM5mI0WoLDq\nLBGO1t2/gujNMlsPM7A+Uj/dxdICXPxsjJUYaabUfgYV6B4XEhMtxd7BnrWR\nefJUy95MzAnoC2WIb5/joeeW0kvuDzZ1IyH3PVxIXMbOcrM4BGsutGAmmQEv\nNRAMSgNjz3T5uHYzgeUZNwKw76ivT4TX8liFJ5HcapR/xgtF3B3tGbVKiDQQ\nvqlQn1g7UF5+G7+1lgIaFbA6OYTTEeSe+5y7qiUl9WXi0UarO2HvVAFMiXOo\nBAO2CWvCWu3C//Y2YFxBMIEvj808b5KjdaSfVkPuJ2Ai6AdyhuIgyFQVr4/b\nUf9ZZBkamRQlOb8nyG/msqIP+8LteoRfIljCzBMvd1uUd5iBy/DOVIFBGjZH\n95eDd2oxp/72rrJgPy2jQbnnOa2/xwTSeUT/7rZaSsS3TEZifK5/tjJ7hhOh\nrSji\r\n=iNyM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","browser":"./runtime.js","gitHead":"2e08688de476cf93fc4b63d1cbad4a27230cf6fc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.12.0"},"peerDependencies":{"piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.0_1599641558286_0.4149403594723644","host":"s3://npm-registry-packages"}},"0.12.1-pre.1768":{"name":"piral-ssr-utils","version":"0.12.1-pre.1768","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.1-pre.1768","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d246e0130da38df8ff813f6ff99e736a15b23e34","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.1-pre.1768.tgz","fileCount":25,"integrity":"sha512-R4jQ0nhM9N/D58jY+sdol64nNzeZdLeEQQFkQiCvSufm7tX1YRNUNTGaz6/iHAkEy7Vk4FyH9/HikDrXDcIq7w==","signatures":[{"sig":"MEQCIDfBnI0Gb3P/sZeQKbbqS8GMFIVxBd5z+M3IFFwoLyqvAiAUL6gq3/LBY9XVm7x9id8kKz0IqgdsPS8sbFYDPoJvXg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYiQ6CRA9TVsSAnZWagAANbwP/jbNBRJPm/TJrrVzdopl\n1JkruQ7QhYn1RaqNK/KrC3au+o+viwf1W+ioKyrZW6COa5tacfRj7c4FRohQ\n0Hqjn2j0oXsdnVNqDv4E99UqSi+kp58MoKxCIBevy8a+7EZ6bogP1ye7AvVc\nmaQ2hquaXuWA4TV/naKU71WIpdqjX2Pr6ZeAKeolc8yyZiXeoJa4fhbZCt93\nauRrnk80mi/fy3Qlq+/q0/TPoEKP6QDj5jGmN+BFE7q7F6UTVTe6TtIZ0qCK\nIjGunRHbCM0Gz0UXm8p6Xr5lSKGTn5wtLcFt6Fw5tC0wUlvnrQ9zkL8QL8BZ\nfOXhkDYo1UxYu6LoZMG6C8e3KB9hEGAVax0IkUhpnwdWOO/LxWcoObENOTWQ\nJ1AaNA7WA4YeGXlxPlJXMBUciJ8qXNjLtnKduMVnqStTPctrITvyAsdjTi2q\n+mW1UbNwvfQTYpo3LZajZKizxYmV6dtisq6Yr4uQyc8WcGMrqQRUKOcL67oW\nPglTp4uPlCQ2tBqb878DSTFlqSALJv0qZhpTyLEfV7BwJysfWpTn35ASnUOD\nN3ooYqZQl0MEoPrl76DrZYsq330eM0j7pgAz1jW7FoQz6dDjLFwIbBGjaLGr\nB0JT1iB8qPgvZ/ddp2AM4VnpYAO0gmxN2yXpOqn2Hnvp+psnLm5mfFS3yyDP\nYpnX\r\n=kD8w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"b3e94d1fc6a541a787506082f6fc9d0b8a89c3f5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.1-pre.1768"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.1-pre.1768_1600267321564_0.7572125436828225","host":"s3://npm-registry-packages"}},"0.12.1-pre.1770":{"name":"piral-ssr-utils","version":"0.12.1-pre.1770","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.1-pre.1770","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f85b77f11e0fc442446a7287aaffcad1c5f50700","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.1-pre.1770.tgz","fileCount":25,"integrity":"sha512-ZDmTePM2kp9HI5/OMGbFWX6xG7qLf9H1dwTWZUsISBx1Qh+c2MF+vAnD0xyqUuo4MMQgoePBF1YdKrPkF9Ypqg==","signatures":[{"sig":"MEUCICMO8lo8YSi/211B6Mv4jTn10xYd8D6sIyD11js2/FAEAiEAhZetmAuvvxy0jrtIMhhnZQS0Dm+23OwjUnHkbFdpbTQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYjGrCRA9TVsSAnZWagAAyewP/R7lwVp8nNKR8d8RuaYU\nC03ufgbUfFAPZ2/68HC90VUy0AV3AyC0W8r0BkKSCupe2J3eqQNvo6r+xcn7\nVl96qmtrCpLapiC2GdUDEyHDZDajWly/Z65OTD5rNzTLAnuNAYbqS/xi7iH8\nFJgJ0RC8aDp3zpA6meCt91NyPmrcXGze3R8x0TYSl2a+PHTBmaWl1GYLEgXR\neVQc7MFRluhWmrq24/lo7RJEyk3+aZ49KR3uicfjUK7AL82bAu0pLIXuxwMA\nd58CXMEzuDSv7fpkMfVsa5lSwZKzvnhKZl0bJCgNTmW0KXCLm4xad5cFfdVi\nljq/YjcyMcZ3TU0VduJ8iqBX7E9KeilMLvStHgXdZI9JF1d2LeJBi/uJpJmO\netoVPhDPdyY1BNs4z46SgqhiE8H2mLxFLUYaWq5PQ4lwYqArk0kEV+Z3eBPG\nVgAgDb6Tgtiwv7vG0JarCBAbCnMpEKc26OsdWYy0CUQTx71WVwpiM9m3Gb6R\nlala8S04BDiMdyefU/um7EMxtLkNKwStEdZX7wNarfbRyAs0JPGemfntWzo8\ngEXYvDNz2+fHMFwwPEc3YBEUfF2WhQT6D+ctCBeH1nNyAhlLnb82bp9V5rfJ\nuscOMWieZzEzGAL/0jgKURPxagV1jTeNUBd8uH0Qb8ylLwjkUtJlm0uf/I8T\naJg9\r\n=vthk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"b46d5e5464e032fa25c1b9bbebb83d1856188b9e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.1-pre.1770"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.1-pre.1770_1600270763467_0.44658411804148934","host":"s3://npm-registry-packages"}},"0.12.1":{"name":"piral-ssr-utils","version":"0.12.1","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.1","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"257a5df6c834e0e1c6adee86aa4b2cfc77257112","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.1.tgz","fileCount":25,"integrity":"sha512-45y/T36D2dfhjWd6XRnJvZgYoBXzrZdVik/CfR/gWcgqbw9jC2dD9sdtabr8zIEGFyjsRnVesq0Mp5Ivt2Y+Lg==","signatures":[{"sig":"MEUCIQD4niVqu/TXAARLTSUiNaUv5BWh1a186QeV0WgcVzuVMAIgCgecfEW9hvNMBOmop2soYPtLqEreb9uP2u3SERrT03M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYxrYCRA9TVsSAnZWagAABSYP/0l2jl0QsvdcEI0RzH9C\nbbhs7QNNO5VePwMWpNlRiCdh5lKxKufIPyVwv+p9rONGUiBnIFp8KPeeD3do\n8BLMAtyrUpvJaKEcfvKxg1fsIIJvc2M8DezFAHfvBT0QX5hnfLN7zp8r5kHz\nK1dAyZqKrdlZ9er54DDe7Y4SOCXQ7F0lFSsVgUpi5AJr2WvCYES27VkrTMYt\nKV04inex7Kxb+ym/n7iLTmpRuLlqzytdnj7KUE5WC4Q9td7HnPM7VtCZneLt\njV9kMZXJ1v5qXkB+8S4vzPFgHuWyNWbdoluxRTaHLwBI6ZkU/Sa29eZwR1Ms\nLuwizcrciKFeTiNkZC8+GwxbZ1kDDLcJ9J+opeFsw73n2HCiUtXtxujsvHdC\nzPtEEDkUqa5tCPzenYvM+7tmGBZwtoILDzH8WAsr+zE/M1auTfp8sAJiCkmD\n+w5geQODIBfSFcvSLax6YO6BtUlfwhGdJesDNRvroD5ya+m7a/NguF7j8q3C\nWlV1aGrd1Lst80/lk4EIfjl5Oc2PDe5rnoXCmtefKwNB0BJYUbAWC0t4fXxD\ng5LKfWM+ZAxM+ND0NsOC+ASsDr8QcpPf7H8AZWYh5aHWhC/1qv+HL/wxj86i\n9kaqw8UP1oRKAChBR+3TeZn0tDDkJxSz/GPdIwCUnZTXjoCMuUYgPw0q7z/5\nm9rj\r\n=cV4g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","browser":"./runtime.js","gitHead":"e49eae16f72d7a735f922d47b64247c71c2a0ed6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.12.1"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.1_1600330456468_0.5817021632070478","host":"s3://npm-registry-packages"}},"1.0.0-pre.1779":{"name":"piral-ssr-utils","version":"1.0.0-pre.1779","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@1.0.0-pre.1779","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7df6064e324d8475452dec6bd6bac0234c91110a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-1.0.0-pre.1779.tgz","fileCount":25,"integrity":"sha512-6uf9UtKfdnivhwjgC9GW2e109lC8YYVvNCFu/3d91bO2VYmjfz9gD/tzD7ILH1sEybM7wJm9941vkBOZWSm8iw==","signatures":[{"sig":"MEYCIQDi+W6zYpBY9lieFNe4UVhBu++8QF3nIbrTEQbPJovMEgIhAP0wHw9g7BwtmYnY4CIbFyogacZCbCZcokeBqs1nq4MX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaJf+CRA9TVsSAnZWagAAbioP/1ZvUv9K2s5ODnAuCEJQ\nFONrUlLpjfRMemIx9IPgkHSiLrjbZ42Ledm0HjYLgXxRfZ5e2GMm2e6IGpVU\nVTMFjJvRlaoX5lZGF4AarZ7rlPYkyiUZ2TDbwiZnV6srNVe2ZXh3/1LU379e\n+fD96f8ztOIlnrFErtOLty3/aSwK7zOECXbUwbqxJChfLEZTLcVBFzkXTuFF\nF8IQxe6+33RFe2mRiKXXVOCigie/XFbQkTEbNEdJ5KwI99NkfXUDNNFKJDHS\nMdNVk1dg6W6LtAGTVx9VfUOqv9a0WllLYvCbWcsmb9Q731inF+NSr4MFLBiw\ncrbsh7fCXjBNjPs0MeDP6xkLh2uRYBN504iR3kf2q1IPWLjqGpdJQoA2NH0g\n9FZ5eHdN64fuPkrCZ85IMfPt5ajGMg+pRwzrjL7bedJtIIAEQ0tYlaqIR8rW\ns2s8KTD7ehJLqfOzQDwtrEPq+wQ7+x3s4dPDg5BCjnLHypH1rJ4CTGpAc4Kt\nRUBBJZxW0MVcKhVK7ZnXVL2BdF/YN9a9/sUdjyksTA84vF5QDeccEPGRtQKl\nW0v8yF0zEsgI8sQKMms1xDIBXTTkOkuc5gwtZT3FggmN1zmJqspqNxqfEbCS\nrMfkAi4fbqChnI510GaqJWRvAD3yI1mCmkd8xK/vnTZnpQQlCHznIqyWdGT6\naLF9\r\n=YSiX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"a0580aa5ef2345a2091295bff1244676cd4e1f5a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1779"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_1.0.0-pre.1779_1600690173938_0.8694186809802726","host":"s3://npm-registry-packages"}},"0.12.2-pre.1793":{"name":"piral-ssr-utils","version":"0.12.2-pre.1793","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.2-pre.1793","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f8d3ce622623dc1f35c1c7464a76ab1fe10efcdc","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.2-pre.1793.tgz","fileCount":25,"integrity":"sha512-3OHRoHzUr2/cpdotm7Oxdef+4WUxhCnMybrM3c7bgnkbmsw/hCSpc09bIhJLv0LbiYOtVN6Z4U8R0svEviXSqA==","signatures":[{"sig":"MEUCIBJILy1nxFWpEyA5Qehz6D8JNWv+YzcrI8ExOvOlh2HOAiEAwgG/RIHcEMhWv10xDNSkMIIIixR8FGJ7nQPxM2ZQVHE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbopZCRA9TVsSAnZWagAAIbYP/1tFi5yk6e5dtIa1Uty6\n4QD9/NjfPJe+76WOjbxPcKALy2WiqIhEfaVxc86cMCtpSJc4gWrR8XiGIFc5\n8Rj+zOIHm62cQ57PZw1uL+fE3O6TgqguSO2SMlK+qx7M9v0JLnAOovw5NWaW\noGtbQ/Kuk6L5Y3zXGcZnrHENGYAzzN2US9F7uZ+LA/4sGev5AeokgZ8lgXhJ\ns85FZo1YbeAKiusPCnnDAAjNcVq65A8AlFkxJMX62v1YeYDpwu7ILLinelHl\nrTmiD/i8aiQ+qWeOxn+NXGQtvukvG0cVEpRvZdmmvaLSGZU/c1rMeRgaZ/hN\nSgtNhSCnMmk6gJfIXaSs1TZ2GaMwMa6jeyg8/3cVyVvRYLPbY9AapT8wz2uL\n+Ue9ukMt15p1No/niIH0LBZGKyAW0Ye/pXtQx3tJH/aGPVYhE/5Yi4txkxq9\nMQIUA67luimGXHzbJf/wmqsthouJWBZAHyTsE4vlgVDcZ6mqJhu67P092yEF\n3KCbLJZiL6CoUldn2wyKE7VEDkg0a57KacPz5epC+QQHPRsZPylNNimZS034\nd+7UOoqMpc/qTJtzcLLm6sUQe2Ywb67/D7eKyuqe1EyAhCZiPyUSn0nbeJrI\n3aX4CiqYm8zVWyU6NPD+PpJFLC9XI57JMnjJ6WmoVbPgka78EbthfVTFvghs\ntsl2\r\n=mNws\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"a50f6184311434b296b084c47b8eb844d8a47c00","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.2-pre.1793"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.2-pre.1793_1601079897256_0.6188600590619124","host":"s3://npm-registry-packages"}},"0.12.2-pre.1794":{"name":"piral-ssr-utils","version":"0.12.2-pre.1794","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.2-pre.1794","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4340272c598ac8cc1965b0fbe0f20e751e8ce196","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.2-pre.1794.tgz","fileCount":25,"integrity":"sha512-diRZ3gIO3gd60SOOLa0zQBjbbOXgcEO+ZzQJuSWWob8GWUVyjdetikcFU9PFUhC+VQl71+vTAl2j0XiEkmepFw==","signatures":[{"sig":"MEUCIQC48c1w20Fci5IJZtmIOZ+xDbKYUXu7MHj57WkSTLEDlQIgI5nuGpSM4Mq45kNEKIS1Mbve/4AF/XF23KgYZHbTaNs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbzdGCRA9TVsSAnZWagAA1BgP/1q/5t8wz/BTl8NMze6h\nyiVMGmPXc1ZICePdL9M3YsidDSxkFU5NQGTGtaCxXuhylj+22Mi98kUfu07p\n3Uu/yTzas+UW3d9SaxVefFdQg3rckZNwLX80x+yWmpK6DoJPir30jw9ezgLo\nUalrYGQzHjU1dV15FNhRHK4xaeTOXZJnHxdVGuu9HbCZFScZudrIy7ekqrka\n5gkSnoGEu4Oeb3kXkfQCVkjBZWaeDaRquCBrkhs+bwVTAen0oG1X1Cg0mXTy\noEB/OJi6cwM0xuEKvfB6YLK6dqQjubnduK5fHBrBReLAbttvcb1EEko/HkvI\neLWHi8uG/2I+6Zj9mmTo/6Om++tvr39usXcLWJCIQBsUQmssiv7HhXk8y49H\neXxyP/wKNfPr1/a2JtKSpF/PAJ9MBlStk9cFwHXhvil+MHtB+E2LAshQEkpF\nSHfvKctTWHT7uPNDTPBFxnp3yyCuZkJtw2MaZcttejDxWhcj0Kk84U0l+VfS\nAUjRtGthd5zTdhX7kWh4SOAfjLahqng57miCJAGgasfVptfP+1AjvuAXTAbA\nflbk4OVt1fiLQLbhX6EUOz87YUmL5ONS630crGM5JG7agndYVk9eLL149Ldf\nQeREOAgHWGSUoS/EOtZtvE90rzHyThLbuFwuLZDjbG7t6a7i85AVVKgNz2tq\nYQy+\r\n=cYQY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"2fa035d4ddfef7335619a947a89d94991baff445","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.2-pre.1794"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.2-pre.1794_1601124165901_0.3362549030696016","host":"s3://npm-registry-packages"}},"0.12.2-pre.1795":{"name":"piral-ssr-utils","version":"0.12.2-pre.1795","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.2-pre.1795","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c494c303056a14a6100a022db0df788312394fda","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.2-pre.1795.tgz","fileCount":25,"integrity":"sha512-4/ajVBcGbXaxDmvSy9GN75mMbeLT9OEwdp2g1yUorieqMM2dKH/S6jCPFTJiy5EL4fWZBf4HymZFd7zkm3DTbA==","signatures":[{"sig":"MEUCIQD7PQDvPxwT2HWH67rDcca1bACLoSCceSNb3R8nHq8KkwIgDAfk4FNDVis/Ko5cFglfyV5qiOYZXiVQlzDhp0/tF88=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfb6KECRA9TVsSAnZWagAAPnYQAKMY4qNkTp+xZLu1fUEL\nhDV7bewEi7Zxo34Y+tFnPBGAMNlf2um/d2Qms6e/WuRd3/lhK17q+yMrV7Nt\nkCfwzOjqZ01jNGvUVT3j0/OeGZtJVzLRJm3UAQF5jP25tPkPTHxbCrm0vtol\nxBInIAsPlEc+if5ziH9Xq/9sPY1B3J5Wmj0SmfcqrthW6zou36o1+baGzzD2\nqsFfzDIQpIW5Xs/O6c0MZqUbaWyUTLP4FVwbnWOa7P7Bgp29sRvuAb0FXQBh\ngDzb6sZjfPPsWsIBRv8ORIlYln7HGwVaLl0dxhz+SYXM5eTQIa/aclCDAcub\nsMTzKKKNBxWpUkJ/lUCVGYjJTS3l2tbFvEsMma1DVTL3nn0SM0zxl3d2mywW\nhjK7wdH09yI/bXKE+YU3h6JsViTqhof2VRXOjS0FURn7Is2x0j60gog4JrFk\nWZKwjUFPqxTx4EiL+eiBRpC/uVqWLJntRBZzdaSojxdZjd0eUOP2K6lNdp89\nMLLuhJ0PqdF0rkKOuN28OI234CNqDd+dFreEaoQJydq+KllvsrOHmZC4+Gxm\nWnz4vgJs14oyZY035T6xpe4sqDCZ+oWQB/vmPPBe6yeAyAHjx5k74UvCZ7HF\nF9C17+Pyf4K4F1SKIf4oB48WL22mnvV9URNrBGpbPqwZtERX8t2J7T84MKw9\nb81F\r\n=uWXU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"f7669188fcb7364cf457fb0de1d3ab54cacb1699","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.2-pre.1795"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.2-pre.1795_1601151620299_0.7896469406253404","host":"s3://npm-registry-packages"}},"0.12.2":{"name":"piral-ssr-utils","version":"0.12.2","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.2","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0ab5bb59e1d99c9f417f4f3be911ece211891a21","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.2.tgz","fileCount":25,"integrity":"sha512-E8asO4+3aAqkjNWEj7EqX/A8U50d5NbKQvgYofACfcUL5mcfoa8XYGNqRpI47pUfrkcmkTbkFU/2sxYvtlaMqQ==","signatures":[{"sig":"MEUCIQC/8EzUACTJ2GGasDXzpbD51xaiEFu8+edaJaYUtEBJigIgBKnT06YUvjMIFZgO7Tb422fHBU6gQead2wOnMivqCeo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcWPlCRA9TVsSAnZWagAAgkIQAJEnI3wxvpvJKfTVcmbX\nokTKA02UUySbZQsGi7SRp53tuyl0do+mN5PAkreopuYht2EpyRPek8vuKP5D\nYaIEcboyHMaVT0XI4uSYm/OWpaldaWVtsO/CnFmgyhXmNjiN46b7LGhZpbiT\n2dyifRB5CC4P3exSCOM7cyqHrGDpsDJ/g7cirqyro771ih4ufk0HSYlc9mlz\nwBLgeJjfF1eVN7S1gle0mhL86Aa408D53Na29hThrQAZ5D4NGbPzm2ScVlxA\nEO6161/drTbgzMgzzQYImMObS5lf3PAwUyHrO1uuXpgN+G3Qi62XD8T/Fid+\nodJL5PAPPD0pCLfxvmYLzOnF328BQAwDL5IhuCU3NFxObiPFAS34xZHLzbcT\n5jJo3ts15Cl/6tdHUdGcRRNxUmlwt6j47rJxIcfRYtSd79j7E6AwBTczQDsd\njZsYsB0hLCchkuKXPV3TS/J9VYZTQGjiy9lKHV8+zKFuP5XdaFoNJI4ge5ib\nBtHNpMx31XUp2zzKU2tuZ2XwaZgFaRTBvpLt167ql+VUBfx5RpaUOz1cDxNL\nF+EJmrsxMbi+RkhIXW9tmagkX0RbcRz2/lu2YiVpb81iwqxSeUu9YpnnNf83\nK0PaHzyuYH0/f5DxqEQRm92ggZFcnudWVybEyPlmh1CJTY5DIrcLEEE22eBI\n9njK\r\n=7y2h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","browser":"./runtime.js","gitHead":"f80bdf8bb2e29d6f3394567f9607e6607f02c80c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.12.2"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.2_1601266661020_0.4212036307199223","host":"s3://npm-registry-packages"}},"0.12.3-pre.1815":{"name":"piral-ssr-utils","version":"0.12.3-pre.1815","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.3-pre.1815","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"960348a0db7c93eb8cb2c6513f2da20bd548ca66","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.3-pre.1815.tgz","fileCount":25,"integrity":"sha512-kuUuQur774gk7pA6RFhJWPwKwHAVMffe4Oipr35P88Q0qcWBuJwZrxd2PWbFm5lrXw/93m9P/ceduEJI+WUOCg==","signatures":[{"sig":"MEYCIQCK4DkQCRFWg/ARMaS8A252aQgFO1aSpjBGg5WoKYAvjAIhAI+DGvGPVKFA67hvN5K4yZAD6EtU4h/YwLPifbM9HqZ4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfexOuCRA9TVsSAnZWagAAaK0P/18ohbM6uWjqaAW3ygBP\nPWftyVUeU+f2qIRfE0LdI6O6FZE8yZpcdLWe21Zez10y/jiILkLyY8KuuWBs\nwbY1+Y8H6NPgd+OqUUw5vuiEgj1ChoQU5enSiWd6zkWFnzwJ5pMa0Up2dp/+\nrJHWxPZfhTYC6se8nxiDm67Y4/8rFoZ19bHnBhJzAmrJpwzl2/TSPLjtdAiw\nyzaNJHmvfgd95LWupcRWZCw4boBxGcV+yg1LyQXA0oaGoiGcx+5XoCJTOQw3\n7fmV7otMrLLp9bzLwN0x2lQJ97lQSxcULD2yzUGaNP+UzOVCYNHYsJRgKD/S\n2pDBvpGnP0vJokBMluVYU0lzeBTquiWmWv4Bnk/kZTAOEsSvKdg0frvP2HO1\ni4ogA8c/2Tl1NdGA/zRS/UM4Vc3/djtCOl0EGBJ8w47C5uXbJKs61Jat7BOK\nRrAq/cgX7Lb1T2dql2PQQYNDUHxhuSglMeLdOLB3F3wj/xlV5P6ivDaRA0S7\n2/OHgZFE7Wgueja1PZT6C6NTabXKY3qjmuEvHc3g267F4DOzrrYT3PqynPEq\nY+Rrnc9yce2L2H3QTMCRxFB/iNjQ4QcLwI/HhxXrPnrZo4FU2JvhcIplXR2d\nXjA3AMmiQEouEDmDhrhcrvnfbbg8hQuuLMjBIyO7vASkYTxxcacXlPBTb2Jn\nP/Vg\r\n=U+r4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"032de6a264fa27180ef96fb3a6230316ff2d3732","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.3-pre.1815"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.3-pre.1815_1601901485877_0.8231721429471668","host":"s3://npm-registry-packages"}},"0.12.3-pre.1816":{"name":"piral-ssr-utils","version":"0.12.3-pre.1816","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.3-pre.1816","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1cd582c177895389fcee0f32f2192384975ac2b8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.3-pre.1816.tgz","fileCount":25,"integrity":"sha512-UFOYDglVJNt96IJB8mpxHKboFF7sp/EuiZ23cyYQoSACk+dQIRb2IIXCqV+4XivhKarkI436ei8lbPTYVp2nfw==","signatures":[{"sig":"MEUCIGmkywQ/4jouAUWOpm6CBU9Wv7Nvd8UoCsZ61oxci5zLAiEAzBr+7JibedI8SaISWKukI7xHiqoIgZlBQxiINs/pWuk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfe8DYCRA9TVsSAnZWagAAOZcP/RPY8M6N+V+0ML09Tfrh\nCiomoUFSedcdRDuXeALhB6RXRQFfxmCGg5Cwf4HKjiYi4BNL5qXxFi+ZRrva\nJ3eFnuQhFocRYBcRgMwu9Ki50x9ZA7xBGp5/sFlSigj/JL9h8ySg7WlFcCVq\nrLw/z6V4z8lUiDJUVf5KpipKlilRXjHSkGgFp+WvBoNA8wQNpZ+nEqf4GbRY\nufi74axN9kWIwB97AfP/M8yMOadoiKRSCtJNdlLJAlNdj6io22cxZaT4IuFn\n7i2A+dCwOdrccru4XnvlWEOP4UmWmIvuzp0CTdu/bSOJTxk/n+mVhBMH3dC2\nMXy8xKLg+LsffOKk12wAwc6VaZggGnuK7Z5dMJ3kvqcJbj9lLd1z6qj5CSdo\nA8R6nQUs3pg3FylAZkBWgqVfLTap2nvBADhvcaOPVNzUYSM7jPm+1iTWNClg\nRkff5AJ1hEhRiKF4AmVQMlRC1WwF7jxQUUV+TfS9yXZHaGjDWlfQimnVWes8\n2bpV+4hYmk/p/4k4JIjy34Y7Y6RiW/AP7dvQLA/X3MyVNv4W2fWnxEZ2VLmN\n38a/rb/nZME9MoRPS0VqjaAwODLmeBY3PQ1T2xQ9fU0Y00UuAQpup93eSS7a\n4k6gHLmLfrRQdCmPghTSnpICdx+Uf/8YmTCDJrlf1NVBASn4nBfmSj88pCH7\nNn4c\r\n=DXEq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"14e3ee3b98760dee8a5e305cfb52c981d1a28319","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.3-pre.1816"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.3-pre.1816_1601945816221_0.5565746959778144","host":"s3://npm-registry-packages"}},"0.12.3-pre.1817":{"name":"piral-ssr-utils","version":"0.12.3-pre.1817","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.3-pre.1817","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a8d3df9fbbc6323fe0c72cd29bc55eafb3b82928","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.3-pre.1817.tgz","fileCount":25,"integrity":"sha512-HFB+qf0RXHShrMn9l4gBFZtXc1Ko7pFZwnTjnazgKTikMMbPmzplxM0PKl57feT3BxAPB1uZGHxwbpFhyJ/YBw==","signatures":[{"sig":"MEYCIQDchIbfApV0eYowqjwV3ONsURJ9AyO2yDKZimN/EIXo+gIhALdu3jj78WHZshSd6A/1Ou1XjJPCmiBK8jRZLqXuyS0m","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffPcoCRA9TVsSAnZWagAAHWwP/3bZ6aRhY44g2OnuONmB\nfqPPSEiGD2fbNF2U2otT6fkeB79RyJ/xSfGZzfigqU5IK3g99xeXfquLWbwf\nRflPsixooiUcOvak4TieifVa2H+QIanpqYOq2d4o0IHJia4gsDFYFjVYiwXZ\n3H5RoKbWI6vjwXobG16/YJmQ7zASQ9Jwes5L2Ne5ggSBW/yK03iyOPibjsw4\nEonT3r0438tzOqtGHNQn+urmByGyGZdNXIZMcotVRnfFG4303Ur3DKYFusbQ\nihZunF4ljfEN+SXQZ0HP/VyHs+yfpAsv7yy2m7bsugOsn5gJIv9T9rV4y1a3\nwJQi5oa5FOGK5JRLqp1jdKPRCFSAbhIa4C9Sltc3WFq5CT6ZVFpBhpKK08Lh\n6kczLz/u0AD2BlxRmG7VBwof5YNF9BDuszedM0y1ROfsVOKdNKAyvlCricQO\nlNDyH/Orao4Pm8ANyrFzUyQ1ZVtkKvMLrEqgy5gjYW7BcTaBsOtMX9fSCHgv\nS1DZ7PLM/7aIgWAuI8ekTM99aqmtyCL4CBB+67ex1PVe+MDiS6LsH/u8WQIw\n0OGKPWYY3VnXuL3EjydiUMQaO92OKzqVk+ruMxoyx1wzaLNSFoEQ/+aLK6jc\nrAeyRdWLtpPVs8+nzi+G0rlq3QF5rOtJIu0XKH9/EtgM4efPIgCoqe5DhNdn\n9/Pt\r\n=rqbG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"ac0489a1f8590468d3b3669d9246d7fac1eca763","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.3-pre.1817"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.3-pre.1817_1602025255889_0.10540435209432264","host":"s3://npm-registry-packages"}},"0.12.3-pre.1818":{"name":"piral-ssr-utils","version":"0.12.3-pre.1818","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.3-pre.1818","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6b999184416705000affd7c774a51c842fd1a609","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.3-pre.1818.tgz","fileCount":25,"integrity":"sha512-XrX9anScKcEY27mXiVc6EPmdTfGBZvp0lswfxIpv0oQK7OocamAAcH5nD/gCOoR0PPygjMEX0Djl1V532AuN5w==","signatures":[{"sig":"MEUCIQD1q9FGOB+tp++Ng8b55r6z5ojnhVskjZ/VTfaaON0aiwIgUXvYRTOuCIey4pxU79mequJmd1vtFybYzEnZfGGg22A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffu2nCRA9TVsSAnZWagAAFlAP/0uIVUdxb0M2vVv4MJI9\nxwVKpVF5Qfh1dVISgTi5xOUSB5SHTxlHAPw2FsWuOWaOoD8Ipxfdojv5i1Db\nvxKEC8nro3pBx0ycdg4LfuFaZjAWGD0onhyIG3BO1UZBrN7UjZblgPX87tGe\n5S6xjdEGP/9QbrpvU3nwamcDQLM9/9ARik+MHo0217KcxLZWmC9DU4a5KKvZ\nNzS3ycmJPJEfqsLjVwSh2I+MFbTWMop0cUicQgw4fCtXiIDsX4U/AtC2Zaxv\ncOZBIJCScNJLhC1TjF/8RM0K08HzbkXs+BorZCw82Pkzds3Y8/HvPt9DQBiq\neeC/02LxEeXwxJ96xyazEaLO8QoMqL7Qnw2XovG6Mzo7cSLzdqBu+n3VOZ2E\np/Pw90xXPj/TTT3lgWZtF027vB+sAs2ytlKZVZYQq3U7CN9RyZWOGAjT8ORN\n8v861LGzX5M+ZRUFW2OQwAByQ0Fkh94/Gngab53sHIlCkzIHTs1pwq4Ajh0q\nXmANBdoRo4lC6Q6JS08rGaqZkFSiFqg8bL5wp+IgCzYsUfoiB0iZ4FclBcnY\nmq7m4cJDAehzvBDrUVUPF6v1Bo2ogfPXEWda8RkasI0h7H/jsZTCLnIkkye9\n03JL9jm+V8rwr+/JOpeCOMenUDuJQe8BTQNfUn20Sl26Qr8mjFGtkh7kS2yW\nX44X\r\n=n5p2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"fe5379d49d1992767f3edacf4098e3613386a71e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.3-pre.1818"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.3-pre.1818_1602153895514_0.4507546602115986","host":"s3://npm-registry-packages"}},"0.12.3-pre.1820":{"name":"piral-ssr-utils","version":"0.12.3-pre.1820","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.3-pre.1820","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b7f005f68de1285f5bed0c773b0ca8a5721b543f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.3-pre.1820.tgz","fileCount":25,"integrity":"sha512-nqNYGcbXxYHW2HDSnam57KyY/kBLJuVIk1H8b2+kxwzal5h0XzjVb43KTXPVrF33sGhoLzheOhOptrLU9rlfQQ==","signatures":[{"sig":"MEUCIQDBULm2X/wLqId/Y3QM0il7Dbo51nCcplo4JiCundXEVwIgNBXlev6zeYsYUczvoJjW93IMU6gmHhCufdsBGawg3F4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgHu/CRA9TVsSAnZWagAAIfgP/ArYgFVnM+aGAw6nCkq3\no78MJd6GWM3qP09zjY6KphQ4r5rcFArSUls0YZVJm72s7yA8w0BP4Qe6f+Em\niahKGJ37p0BF5zlzSg6NMOy+i8UyLzyyQT+cb1DeRt/zias7H8sFb7NXVZi6\nrJyIhbEgg88wYuxH+mT2au87r592iApcUcQKM2ODNprsy03wodUnK6jJVgPZ\nV4hwq5WE5kvlAeNS4FAXpy4sqJ1IINNwbONsDnyP5dI0mUxhIUAzv8/mDj7J\n+pmWrD4t+BjRFsy4YS2AW+TWZfhCcLR+UDxLhXJYYC2BMtboMpZ7nEGibozj\n9ea2E5l0Kt9QZmJhQS/T/h7hkpiybenDoaSe1fG1JwtYgy+98OUpIzjKXFMW\n5RInt/mGd28p+9/tY3NxF7POBoJQM9Gka4djwlYv6YCzEea9G5KR9bLIn5WU\nTKA4WtRwkDSATflhMyr46+AUdMJPYyxB92yMz5S/pk7kd5JgO5PiLdP4vdz1\nzKsC+AWqiApfBkgRZN2H8H9vR5XAb2ThkGIYr/yj6tOAot3SnG21S8r7Hxtw\nHbj4PbCq3rceEkc+CjL5+LG0FKzx+kTsdWh1kSJjdZ6zPgMIhtK5k+L8J2Fj\nAKwwt+kzDUuMVAPdiareIHqboJbIeXQSOyKSRAX2xBueSplcdVqKnQoRmL6+\nt/jl\r\n=xWKT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"b1da7ccbf75b527abc897a8c5d6d33c63f156774","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.3-pre.1820"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.3-pre.1820_1602255807254_0.4966565813401611","host":"s3://npm-registry-packages"}},"0.12.3-pre.1826":{"name":"piral-ssr-utils","version":"0.12.3-pre.1826","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.3-pre.1826","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"273071bc229cb95ea1c39e1f3f26cdb594f277ee","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.3-pre.1826.tgz","fileCount":25,"integrity":"sha512-SFQu/nO/mddqpXX9b3uHExmpa+qgbwv7Rvk97JoSw8Z9Sr6SLBnlRd0MunJalUyTWS6da49OmtYUbvaMrVsSog==","signatures":[{"sig":"MEUCIFSCjw7wAZ0HcPGEp0jzKrqMqw/rfPlvvEtlrjyxtSf8AiEAvq5jXuPqmf2b3J+W15PlhMYz3l8qRaYuP6MQgy94REo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgPH6CRA9TVsSAnZWagAA7KYP/RJGOZF4ewPtB8UQ4/l7\nkFSPuxa5GHdhfWZWBmokIQn3DCnPneyIRTHueZlfdUTiQRWJG4I038JJZuB0\nmHrHRPnsj7JQHx1pYq5LadlNm7Sz0xQNydZluPKBopsyY04EHlTl6t5MhiW9\njjXre6UlxbQSm/YjnISxHW+UTIUwfrPHcnBIRwDL7ZjiLCR/YelYTsmlRBEK\n6lAPm2czqRITgwIvxBpjVmxa+lrnoB8JkNJtLC0AD75x6It/wYAwfz3rsJ6X\nAZLM2ZJAzYEcV06XcrVzvtF96gUlaBiqBRx50/zTVBysieQkrTOBjoB839nO\n8Ki8JIYAhMt+O26s4SfMPgGun3Ap43uPeI0zxUUC5Xl76Upbki8jjnSR+tTP\nJ6OeSN1nFaaK0Hvegz4gNNNq1iNXidYc3U41sUMuTDAgu+xWaztIWRi5zQ+b\nY2jhJcvtNcDWcOiFU6HYlUxAiQsnuakHSyHzYb/6tFG+WUYvXAY0IM8ISXeZ\n7Wd0+Z252Rgij+dq/RMf5Kg0vZtP6K6cIQLamS845RQM34J1bWJY+tUXwq/p\nH86PW0kshzEM/juYTCbDhdWaHYi3wWlxGiKZbrNbIP/N69DJgF//U1hNRfDd\nu/5IqBDsjVAeVn/c9FJ9UZ0h3ceRWAweQaABsUmS/pURW0yA/ouaWxziQvyR\nVf8c\r\n=4TqS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"f986877e0ddda18086ecc83902118def1f43140d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.3-pre.1826"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.3-pre.1826_1602286073703_0.23253890495173102","host":"s3://npm-registry-packages"}},"0.12.3":{"name":"piral-ssr-utils","version":"0.12.3","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.3","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"becb8cad629af4261771fc1effee56547d4e32a9","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.3.tgz","fileCount":25,"integrity":"sha512-EZQOkKDiJaThBdrCCJLp0c5dIsm8hJBcXhjxHXxS/lpSyOK7vEfmgDbSQrzcVrN/6zXaSrHO1z763aYAh8kc0g==","signatures":[{"sig":"MEYCIQCzm0GalvKJGpbS3skGSntjscDuv98g2LH7MVPvWtdnywIhAKlZftTfHzIUtV7/nTTYQzKW2ETMk26kaFmqOI5qll3f","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgPpjCRA9TVsSAnZWagAAdRIQAIUe7QV8l6LfGJfeLmaZ\n9zJiBeqFWze/46tfNQB6TEyT9S7R2G8X59qL3hGb6fGt836R/42I+pZBeLN/\nn7OrmQKZP9uRPwlNKS5i+5RVtx7YgIurJj5Y8QYdZF4wWfQbO+0CYzWSChBI\nv+hdYuUdflUay99BLsYoVT3n3xSa/vtA3d3lM9MufmV0Jt5NQQCZ+Tl92m7a\nks4trEAPs53w58nfC+foz7PX4SP8Je/AniioMt4oWjUjc//Le2J+kwSvE6zA\nASm6sq0TwV26O0hvlEM2XREBDSX9GGbWoPTY0iaa1PJlFIRf9wYsU5bZm1Q0\n1L9sDZRV4Gro4NcaafqL/59iUhWMMxV2n3dpy0CJ32vBMTKm/yD2gD26cO0I\nJeZoPF+3wIiLa7+03Z7O2EY1szXG0DUwM8gYUoSL8W9IWHCwk4m30NcO9H8v\ne3IbywmZ5zZ8S3c2B1u18EINhuZoSQml8ld0/rp8rD18lLHQiFG+ANbx/IeD\nSg0PNIQLmNuJPpXZGrRWfViz6PfZAO+0PXV2qjP1xteikgPwy6LLorXPVEdm\npZwV0MIWLAhcA2MSeqE6tM0USw9H0kUWgcj4Lzdw9W9m3o5KnGymwUsjXbxv\nOrnmOMS4BCeZVI3nHoXwKZS0IGLVcGo1DzvRn4yDgsA/K9G1oQuWJXHzIy88\n5twr\r\n=GKNr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","browser":"./runtime.js","gitHead":"64f9178b0eef6c6ad78f3aa6e410719dc88f3ce3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.12.3"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.3_1602288226831_0.533396803609135","host":"s3://npm-registry-packages"}},"0.12.4-pre.1830":{"name":"piral-ssr-utils","version":"0.12.4-pre.1830","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4-pre.1830","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"981e30d8fe2ac09f2b067c16a6d7bb66d01accd2","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4-pre.1830.tgz","fileCount":25,"integrity":"sha512-zZLc6yoqxXZg8Kfuz+Y6IMulq+hoZTC1d+n8qgzXdO2XtXgKkI88GGVC4SKJzNct5tmqX/60Ap4RagptkvGuHw==","signatures":[{"sig":"MEQCIBWQk6fKoCz3nNO+APTxdk6i5ikhzsescdYXcW7BJ3vUAiBkZi1awdrpECm4yiwhz2VZNt0WOtbBb92ra1LdGMHGdA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhWZxCRA9TVsSAnZWagAAbv8P/3MV/zSnzHVDZYVTL/3r\nJrgGqwKEjyA/VLrErmXeTveqd9zOkK5CUEnDbLWWwApGfYsjfrR3GiHWHfqh\nTkPDDdYIpsIAeZxT5mQV6G5ynxG5ELn5t8K1FxFupLzejilIBJCb75qYdMvL\nrIhVnlobi3vocAefbwXMT1xQ7me7XK/VmxTT9K8oL8croS1feyrwVQZd+3OM\nZyUnRN/F5SPL+E6j/e1WIzYeuczydMHkJUuAFR/MaMk3PovSHI/w4YgTayI3\n5/vV9JP+cM19l3uQmicdBI6NM0U599lqSrMT1tGi6ZU4mqGenlKCifIdTS60\ng5ZJ7M2WeSudFevhWjk6O5mEqFkAn2oMjVmYJI/goJGnL58NtQFmSTRbDg5r\nbYRjGVcgj/kmmk3qFssSqMy92tvBFXv3WosFnwNJ+8P99y5e/PY6Xp7uipkX\nydfpX7Vg0vW3qGuMK+SReme3UgG4TRCrtT9HHqaALyBf9W5NpjwoJGkLfwEh\nKAoQ3xto/ItpjEE8TDIZtEw5lhK+V0Yk/11g17xQ0sXKyCmPPZPUguPw4p8s\nkV3u4cLP4Q0zjFZ5HXaqS2r7tqB6lxKiVJFu2by3Wa1sDBIgPL4Klc5cVPxV\nagihJJdj19bJ0Jn9B47M5l/hrpXOOC8Tn4LWoZLA2AtxZOJmS+cE0cKG/0jp\nPkfW\r\n=NcMQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"c0b0d25095a1f4d811b837a1adaee65a4fdba445","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1830"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4-pre.1830_1602578033477_0.17158488725031007","host":"s3://npm-registry-packages"}},"0.12.4-pre.1836":{"name":"piral-ssr-utils","version":"0.12.4-pre.1836","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4-pre.1836","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5111d35de068bcb952c866a7c4798795baf5df5e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4-pre.1836.tgz","fileCount":25,"integrity":"sha512-x2th0MD+m9hcBtNcKipDZqgA6MHp+h9g0v3Pm3nMxwwe59FSgTXegsm/LYsYA7vVBDbJQTDRp6TInx30gAEK3A==","signatures":[{"sig":"MEUCIFLlgq9sQ3xqPpYBGj6w3RrsbJH89og6vdZSf5w4SgnyAiEAhTLgwX7cAjKHuwNcvDq9y+addjMAfG/1m3d0y/pA2QI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjqi3CRA9TVsSAnZWagAAWecQAJ67Wojfl9yqMi4hW07M\ngJiHWjJKbauxA+rMskXyyLYcRZ2CERudV+CG8guk0Wvg6xPY+NUI1HY9BNu6\n6Ylms7wBBLHwj5JusbZarzyXJGhAHJqV4WniyTyOAPDIaUoV1MNM4dqx1R9o\nszkXxqtO+VFQreAk9Z+lZeFuhjFgUqDobVFVOtBpYH+EXoXxzpguQrPLrb5x\nlXwcBmbq/JXy+c3qt9Sz5T4AGyBmoVzWkVmiGwAnZ9gmqauOMHHYmAOpaoL1\niCqYpQhhQY3CDe8A+y8jVo2zPWWkBl72p88iWtxeUkKr3HPPYmOj3Fo7dZ0C\nX7gRkIow6ipi3YVLnerkOv8Gq9Mqz3ABHscnM7Y9x54O4TqkYwHIsAXkPvfC\nio2b/9UF0JfJKllT2g5IVslPps8sbgIcYlCF3GqOiBAsye0gdIE0yW8gbMsH\nLdRMlBi/ivIigWTh25xK+0oSal8RPupbny+07ByCqc5YAraFvm6/vZkKrA2h\noH3BbtJ3kWhQqSZohDLGydOKAk+b9Q64inuupaBsSWsC/5qF7+HZ3OJC4Zfu\no/VztHsYNp16nLcksA6M2GH2ygyRMe0GmQOoKd1AFEzmydyeYyPKzcyd6Nzd\nPD7hIEsPoLYEvi/PLFpvSlJBypsYMaqWafEaQhPBMWqb3NDsZAICk3Cj7oQk\nLlId\r\n=mWFZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e7e6de252d0a3e1356b0b3e644a3101c0e067228","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1836"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4-pre.1836_1603184822793_0.7856490827279614","host":"s3://npm-registry-packages"}},"0.12.4-pre.1846":{"name":"piral-ssr-utils","version":"0.12.4-pre.1846","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4-pre.1846","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ac5ea95641213c849b998f71201620eb6741dc15","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4-pre.1846.tgz","fileCount":25,"integrity":"sha512-K7f8Vb6l87whFeDik/WebvI+NOYWEmH7Gqwi6l5r6rbKTCjovif5/pzhh0Ec1s0GW+TLnmQFJMYDsuYbVDRpig==","signatures":[{"sig":"MEUCICHEqoBHyxntxx/hB3yyAMKqh9RlVMXApWIXdeMdmsvFAiEA2IGg5U84dEveMH2xQvY6RRv3s/WI4vflC9IiRHAmrSs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkJ1YCRA9TVsSAnZWagAAZKcQAIbV0TEtxCwgLBR80rN0\n+IbbSX3wnyRYNqe+6FjFZnCB4qd87RS1v4OEfU7uIvdyptl4g9wcdoDjUq/E\nMVrroQkM9akgCprR5tAO34Kyi+pxaP+PMLpOcbnicgkfxa2F+7mesLz1Rg/y\nY34r6RqexAk5JZkcNm9RJEQm0X5yWBY4H4V2w8XTjzwUhUkKhZKc2dz9o2Rc\nejQpiq51C9xM5HQckVSad43VMnlRgZ2tRRA0Drm6WvItl9LNrK4tmz4bE1tZ\nESsyx2w4lig1lTJOhf5NuM5+cgY0XcKPLecMIUB4HN3SPjClDf6tzpdqAXiv\nMULICWaUwK7j+E8vlLmI1WcWXSbOQlYCMTEoWP9oZVemjjTfFjt8lOiCvrIx\nAR6LIYWhBvUjeaz0v9aQrZvzIGKbQzF2izdA65/tZ5U8CVIHTkPi+F/ibpkQ\ntL3tDFUl8Oa63PYX9Pp792D0CYZVvlfCK4D7jrwW2YrU7HGvVQW83Hpx4Vnp\n5ehXo7IgNuCXBiQC5HSPyq5OBVC+1umJGh5Aa/ikWSJazAXHAKs5QAdpr3S/\nxla97cLaIqa/kLgxUKIWzD1BWx2kdvvB4BT1L1SXkBzbhH2w+7RvW4vWaVZY\n0agAJKHpxVU1yVwe4A4cr3H1x/MmSt5SudeW12EFynJjzIxwvTHJtRJdDmLh\n4rJC\r\n=L88y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"3a062a650d5956c981a353ebed506e3fdfa22025","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1846"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4-pre.1846_1603312983600_0.19359613285645905","host":"s3://npm-registry-packages"}},"0.12.4-pre.1854":{"name":"piral-ssr-utils","version":"0.12.4-pre.1854","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4-pre.1854","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c2409324de7bf3aced46834dac21fd84d48de98c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4-pre.1854.tgz","fileCount":25,"integrity":"sha512-Dwwkzcis0mY39hOCeNyMZ7cthSeFxNxd8bPHxxur+qdVb/gOTVFS4cao6GkSKMWn6EfkQEIgcl2S9PxpKmk0fA==","signatures":[{"sig":"MEUCIQC+ft09grWRloxSXDD48p/0syRb44SFkvKbZVMWl9EOkgIgUQv223Zb56+UArJQWhjdWNsWQjBj2lTnh4vHD4C9tTY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkuGjCRA9TVsSAnZWagAAHXQP+QD8m32yjowOqjgkhcsc\nHzvNnpCN3tzq1EkOi+5JJxYdcH71QYZFO87RnnMVJe2CAorJTgKtqH+Bo49+\nibB1eaQO0v4JrAN/NqoNZcT+gM0AKylujNmITaSrU5w6CVVc/pvbtTYMiuK9\n5c2eGiNZ5ESO+ogMshFe2GKGhU8idwAA3lkyncSLwYZZdTS3qGCdAzHFZE60\n1TyASvRfWrdTtJQHMqngl61DE6GGmw6qV74IBBM41f6NFSecnrgu8+infWVH\nxJKU+X9yJbop/ohX6h/MpU4reWeiUg5dngCoL3ZkcycJhJAxQBxDHhNYwFn8\naYRiF+CbB28O9OKepvMtVWK/8FTxAcasApTe/pftvI1YzyWzykFYZBzzb/EP\nzFVdfTBPollNw+tqGHkqDb4tXbG+LUDgzUpd1oW92Nl5AMYeeRDhUoWiKwou\nhWrodM022mkhXw3bwGDzQrcGx4qavZyKglowpl6pWazb25l37cXo3h5UcvcB\nTZo0gbHcZ7EOzWG98W3ycyIQuSgLERz8C8q8BnJWffW7RQZN2HIRchtgBmkO\nUp9YaO9KrMWeUQcSb0kmL+BnUxMRj9563Cdjziq0teJuHC4JPSxz9bqr6YYa\ndvRHd6Z7Z0Pq0+9Kd/FLne5C1T7OJbUCO7gmA+6ELXobTXii2mAhSena8/mL\ncTdT\r\n=aofV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"771c641f18e6a3719f3121523261236f7e55dfe5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1854"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4-pre.1854_1603461539451_0.6366999549960499","host":"s3://npm-registry-packages"}},"0.12.4-pre.1861":{"name":"piral-ssr-utils","version":"0.12.4-pre.1861","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4-pre.1861","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e7e6a1e3e5bfe89be4275f7056bff01f521af2bb","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4-pre.1861.tgz","fileCount":25,"integrity":"sha512-IjDjw0abTpf88ut8YcEqyFxodEPIxMO7TxHH8RjQxHggkDipWNlffvtGMBVE/0E9hYBHwyqDNuNNg3Qp6gvg4Q==","signatures":[{"sig":"MEYCIQDXKEZXzEOCbnTcbCf55YR2QSVNV7Agt/PUAC3gC2RtdgIhANeyuDNsRBMF3Wnx1AFVXUHaJRssnzN77r7eI+UeRdbX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmKSYCRA9TVsSAnZWagAAVxgP/jzu2VaD/RpuwGaQw8fG\nScN2Ppkkt5cjQ6QH3WgvN1MYUzYOYZ4miRrvCJtYWURYXuSTXGXrvTwp9ckq\nuj2bSuryk6wAoXxaSxWe2HGhim5g3tjHOU3Q5sNqn9+aSjKkSpA+o8gfmBWB\nzb7X8yo7idsODZ0zsZXEwei2vueAYErWfgZdN6HiDrleABMtUQ362n60a20q\n8HTYRAAAsR+P700viJ9IytTqaT2FrbJ5I3WG2ZfA0ekdJOAv3o54yHFRMr48\nRPWzvLb/bd2RBP39pLzKMe6C4K2/1ra5tWDCY/fRyVMwEj9xFSlkXgI81QUU\nzWgLt0MxM4OB/r7OsoKUafsJQmq+bd5WrIfiZFIqGDfkkZDugemm8Rx0vEuH\nm4EvLL022gMt9wszTXHZwRxcDvxbr5izpD8GSJxAy1KWmIjJqQigjxgp6BLk\nvovdJZY2Q1NiGxAdpGpgL3jc1sfu2TokTl0qODlZyJUCuTyf2IOK8gHk5ohC\n5KD44US/cMamjG3ykCwOcX8V8YzAeiNAtOO9XaP/zaLUVl6o2U7OsnHwWHf/\nMdF8WGZGWZyl4ka2LI7Q08yHArftwiz6MDbUW1qbwvC31jAKnvt1uTImuV4Q\nFpB9FmTKA+kWHK0TRHkIbGiCZMB/Rtcp+GJWRk5PzZyQQGaw+a5R1vwmBbPG\nUtNS\r\n=ml0B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"6dccbc0749fa624b9528c4bb74701f76bded52e5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1861"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4-pre.1861_1603839128082_0.6447918356673732","host":"s3://npm-registry-packages"}},"0.12.4-pre.1862":{"name":"piral-ssr-utils","version":"0.12.4-pre.1862","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4-pre.1862","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8593b0d59648df425f3e1c8995f0d537a6068bc8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4-pre.1862.tgz","fileCount":25,"integrity":"sha512-C/POLhOJwb0o5db6zP83Ymb9A618g8fcFXUb5TycnSNGjijJaJ1ZAL88XJSDPo1ftvrdObvyePZupAEEcO98Cw==","signatures":[{"sig":"MEUCIQD4L2YIHjs81er6wJZycs7/r1czWOiSs8TCw/DcXidmsQIgSFKjtpCnLEhhDuzqr0ZqdrCnVgraier1ySyfEOnZbf8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmW8wCRA9TVsSAnZWagAA0uwP/38wtMhyXYnvOrOllgbA\nqAyN9TwN79IR66STY03QeAr7VgDzxXGeCVEYAT+oYE1p4FUH47RX9oPKOvYu\nvbVCXi9zIOFHnhmndlvAhfcClY4fDe17uqHRWFrZN/vfzz1B0rQeVhh5kChf\nikvRG0fLNrKOjqQK19NdFeJc+AUKkcXlqneO8g+YMs38a9AYlIf9fpseYG4E\nNC/ujjkFsT6B792Y7/+KmNtIoHWaT3WPHxyelS5N1jn9+9OcTdGXIALUwH+D\n07oGQvZManFJBHn/6GClti7rfcJzVfMbRoLCJBfRrIl4GiF6nT+637epMhj7\nAXOnu+buGluCsosSJ2Tn39epw3GDqpr/Rath28gzwzZWA6t1+ASFBMSTXwQN\nTuA1aRQx9WSP9t/FhO5V+8IeiLJXYy1i89ryyi2nwZcDpOCXni6agOWr5cMD\nGDnfQfKvvXWoPO05f2tS19jU8iopJgAXgMFmqTjBUrFW9/0n4djcD2kNFOZg\n6TYCL0UVFseBkbfoI777CIZMfQmFNPwEK7j8ycl8/9t9OaIM3I9Ztreo8uxD\nkD9TpFhpFUmYkU8PSOYipYpAvHNq9ScnJTU0z+WZSBV21ikXyiOPuDg9pxTB\nMUu3AtSgQxWrsZd4oT/nEtBcCzL00lay/sJiJa3JQWlpDCK2m4nLfUwvD5Cc\n6OVf\r\n=xat2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"f88e40b040a1cbe4c587f38c2ecee966619290be","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1862"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4-pre.1862_1603890991992_0.10391143434062577","host":"s3://npm-registry-packages"}},"0.12.4-pre.1863":{"name":"piral-ssr-utils","version":"0.12.4-pre.1863","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4-pre.1863","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"413d15f7bad5b35d6ddaa29d04f348f94ae7c3d6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4-pre.1863.tgz","fileCount":25,"integrity":"sha512-sq0Y8sNB8x5ZYLbTliOgYl3XXMDbbWTLvVJWaGKRYHr60VgJ4B2rirVnkpSQikU1bCIWXGgL+roV/wNlG/tnYg==","signatures":[{"sig":"MEUCIFu99EoVHYuTyh5uBQuh5b1ojPTc9bm27SKupCyPWrDsAiEA4AxoRhNzYGnzPgJ/6gpbfSLTRnIEp6O+uGbKG1swcGE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmZmaCRA9TVsSAnZWagAAOY4P/0x46KIWzAxZK+1RiXYp\np9Ka1lq4Quwv7YPc0fP/9IrHFB2uB7ijydpk6ji7W5ecDYQz0tS43D2ndq0x\nMwyEHN7GQRj13sck8F4vtG+RF6EPxfvC8h1YWBftGfEZ0dWH5/UBDIEzPs2E\nAGhW8LdIoHFctn1X1BrQ5d8lPaj/uCBtgE96sYI5u1p7TOfZ1IUFd6c1oRhl\n4egMYhwku+DwXQQtnuIdr1RnaB7H7HREXiDXRMcuBSH8Pbcex/obKOR9DDX4\nYfrz0xQm4+RFtpSruFSnSJhDrVEmniaRiuqgnWEfpxWuPL0Zwak+MJz7oE/N\nmZ4ssmlTO2w3PwMCnNcxPhcE1hrhyX4KDwAIzoGl5vt8wOsgWXNwduH72r7Q\nP/ZI8TfpcloWRJmjs/4Agreo3FdEpiKYR8bj4CGI7bjrUiQBUn+FJNr29pDq\nObALgy6uj5+SSTdVkCk69ru2gPWPztR+Jy3jWk3JdHzU3cM/NWsqHhNlbYm0\nIQBNa2piVTN6JCYnVC/d1rm0MF9VJmiiiqBt9wVybWHqXmogrmVGd3O+IJbK\nAiU5iG7CE90FZuWajfJuZhT2C6EeDf6o1VCpmZA2b3Nvm0OxwgnH8giGm1q/\n/+/uw7eqlPqhDd6wfU5CZgfm1vrgDtWCDvogai/sM+Jl9t/mGWssMYXChB7o\n36Uy\r\n=uJ4O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"5f65b95a9547e282467a4811b32b6d76c55736d6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1863"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4-pre.1863_1603901850293_0.269282067691909","host":"s3://npm-registry-packages"}},"0.12.4-pre.1867":{"name":"piral-ssr-utils","version":"0.12.4-pre.1867","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4-pre.1867","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"56c074f769f1c0c8775fbb26d3f552fc5114fc24","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4-pre.1867.tgz","fileCount":25,"integrity":"sha512-d5s48AfX5bTZbzYD0ShkD3YzHzEom68BwmAJWMO72B2OUOIscK8pbFFjTHVJXUsu3RSKV3yydVoIRLbE6CoOmw==","signatures":[{"sig":"MEUCIC8SbhA//8bZx0NkujD7wPRdt/O2jdAnIbnHpgyzSvgRAiEAoecO0GwZg1zXdRgOwL+YD51w3IqGCcZsVFpn2BSujwA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfm7xrCRA9TVsSAnZWagAAe/gP/iuIjdh8njAy/hr7zBoL\nHr4kXfJIuYgHKMB/a6noqn9TYQyM4+BBZwB+453yZQ2MsjO7XbynCGSYF4mv\neFzpH50VaWWH47ywEHtbyHNATfuXxgbXK8NQOElNWz1pr3tF/tX5MVrRqskY\ni/ZTzCd352+Jpwfgns6j8GWChzEwPC1LItpnL6K50dTJ8qCTwA18oZP8o2LC\nIbQOIQpiezhEMfg4pW1Tf9hRbV8B/P9/vDpTZwWJpRnLaTZHweTz7hPaVHYA\n5wV/jG0n+rfBXX0MDtqT/6sOXf5GeSXZPkvM0duvaRM8Alhxq1pa3odjREQ9\n5h9bbhMvJoZRaog+LV9VHxph9Xh3WFH/eq6WNXX82UTS7p9J4NWGFrHakVGb\nLvKa8GlAVe78BCQhzonvkBFaWZ59Df57NFAAZF+rsjR6udsnzZmIxSlyvXKD\n1ln9t+TNxyQcHJ69sk6fPS1cwFQWkF7esiN8C6c+SQQaWiAuw2O7eBW4hOFg\nTuHbGnHNAXim7VuscWKqmaibgrt+QhLMXLwje580KUIoMF/EJprIw6TFkGpB\nd6mBe7860cfHtY9VwIkrvrk/PYE+jRh3OS6uSuRXtYHyz5ryHYqTDSru2DxL\n5aPKZrEStwpoLyM/R3pScYIkV0Hkx1T/NzVIMy/EuoqAiECFtJFN9gZyGf55\nn6ER\r\n=lRSJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"c16b40a7f662e0937280fff145bea0a4f59e990c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1867"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4-pre.1867_1604041835095_0.01628792917345634","host":"s3://npm-registry-packages"}},"0.12.4-pre.1874":{"name":"piral-ssr-utils","version":"0.12.4-pre.1874","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4-pre.1874","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3479af0635bcaa3d2a9b1a206ac880085144b91a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4-pre.1874.tgz","fileCount":25,"integrity":"sha512-EAFVC1EvC7Mh2BGwGn6Sp7duU1ASSLH8BUXlY5nnTMTO6OqykOLUdFGq8cgeEMk6K1xtSyG9U17FTriCaOCnNw==","signatures":[{"sig":"MEUCIH4r/zeRCpIGxTbZl1vNYhUBE4LTvbNLPPUN99NsIy80AiEAwInkmGRNQ/qr2PpZmWmDUa04eMplHbXIaOX/LROSwiw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqy+zCRA9TVsSAnZWagAAyN8QAKH9eIpEVHcUxZcwRfFm\nk6MJXnoTtPswQNe6K4w3KesdriZW6bq9XiUP3zVZbgcjYcvht88aayBIZztG\nk7hd8rNUbWuSeDzzkWGJBS8Y9AE4KhB9//oOkEzEywEqrIDG0O30dGajKn/s\n4hqbVz7UmMbAxeYsW44USjWG8wO9LUjh6HaQw2dBj/9rdF4duYXpXcpUdsyG\nNNOtyoR01YqXUwPJsJRjRngJibIVSByd0+LzbHHT1YVGNKdB9hOGmVC5UUUt\n/xBCOJMK6P9tjq1O8s2UCGkXW3ejaKPu8I4v+gNaeKgSPiM5EHxUqBlvuvx0\nmBhkxZYgQ10sRytKIJko/ZmdPg2HkeVjF0UtEQ3vNZY6BNdj4lZXS1xTyxN8\nNN0YH45w5DyCQA9B530oTuOwII3y94AxMYojVb9q9V8eSos9HJZ7U1TsqHR5\n8QJFf12lViBYGT+QU+N5QzLU9a+1uGnMHyfcwhumUejftgmicm8m+mznswye\nHAIpJiPMRdD+OMXJGiDbdag4DxKJOsQTe7i0YViPctXbTwR2Gk840BZPJk4j\niCQfcvO8LlajoJfglMjhhZwjYiefYfldxQVwoa0qWK72K0YbjkzjLKPxu77X\n9nUdLjMDDO+G7SqNiyUGJP9v1w+/rWS8t6G8ii3gmcJ6t476eq4lY/NHD45m\nh+VI\r\n=EIZT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"fbf8f516b0bb6e3e5c4bccb1fb0b2b59b9949e38","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1874"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4-pre.1874_1605054387123_0.43749700632837585","host":"s3://npm-registry-packages"}},"0.12.4-pre.1875":{"name":"piral-ssr-utils","version":"0.12.4-pre.1875","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4-pre.1875","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ca4f00253124aaf2a21f7166ee3473e45a8ee1e3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4-pre.1875.tgz","fileCount":25,"integrity":"sha512-HZyNshXzmJU4Uf+fWOHbBRPkv46R+37W3CF4lXK9AnunSDKrNPObCcVZp20iBHVTTfBxRc4N7FNBwFkccMF7NQ==","signatures":[{"sig":"MEUCID3c8PM28pMjS0/34YsKZ9cQ0enPvkKwjxEVvIhMGlAiAiEAzyFW+Z9U+8jWRUBh9L+qklEfC0nL+ce2/Dy3vtWEnEU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrBF2CRA9TVsSAnZWagAAbHgP/29TZ/LpDmH1FZpwsJ0G\nHSIk5LDglIqB+S4jrOLedrjBLZ+5HIDjQdKfNI4eDPgCb14jUvEpDKDXl4qD\nEcC5gCnLEHbQYbeIP46gcj6TULw8QkXInNDAnalSoCl5c5t8pOyr7fk1m2aE\n1tDqDDppPaRJZlepZmAXMHTs0PC6mX2rRAeQ8/azkPCEl+c9fd918JI/sFky\n8uqBqzxECByB0nbG24+fFyZCZX4ZHZSY7KxLREa9XXoUJbpKdAw4Nis46XrC\nyKk5NSg3nDp/s4QSKaEgeL6M8uy4cW3+/hRPzE85XaNRt/V3/mtgRRNupeE1\ngQx29As48pk1FuVnHzAIDNGLeA5fRdYsvZEF3ZEou7C6vLrrVsYlGGXLbswg\nQtJ+sstw810/XI5pm80EjVadlaFSjpGJb1eQIwQGBbcXU98kWgynTXtp7awZ\nU/HboNkxoVYKdvpmFtBjnrzBZQKIAVzzIZxVdla/GGYXrrI2lr23g5jwTYFI\nLFBl0ph7yMGK4eJldPZtxL9cych6k8r9dK2ehVm2fDd4fsDF7QbbSoZ/gvrp\nr3W7gxHD2RDtbgdeDhQMZAsLA1mCXamQQiL5bf+8bB4OMzwP28AnnTj30wLP\nYdy/zX00QETahGWC1/hjldubbfYyZoeQmKHRo2z397RfSDBfZhpvkGe5gLAc\n6HBy\r\n=4l+n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"4cfade25adaf1d122f7485e1954c5d6fe2f600d2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1875"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4-pre.1875_1605112181683_0.1516591150872939","host":"s3://npm-registry-packages"}},"0.12.4-pre.1884":{"name":"piral-ssr-utils","version":"0.12.4-pre.1884","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4-pre.1884","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"85e55bad30bddcf10245d695234d098b014fccd9","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4-pre.1884.tgz","fileCount":25,"integrity":"sha512-6UCqRTKqweiIm8L7sh0zW2oGaAJsXmDWUl5THW+E5qctwAx7Aeulj7rT8KtZ8/6EgD6VdZ847ua1LrUujpQGuQ==","signatures":[{"sig":"MEUCIQC39pU1uxgeYgJ0x3DNn3Wf0yUD3T9TyKGXbPSxht+ZygIgOqR2313ZQdqtHMUrKJq71pmUU5snSUZO2VA67Xjz/l0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsrZqCRA9TVsSAnZWagAA5eEQAIa2d4aREj5t2fR8pSP7\naA9PbSr5l3tB3NV/l/9wrtQ54QkFOVT9y+qSzIYXL07DPmZ3eiHClPGRIH5H\n1N+rEHJkSDp4KwsVDDfDUAm3c9DwrOZOYRbjOYlVXBf8JfRYwCpCWuICTUvb\n64OdO62b7xKFT2hbF0suU2Rf+3cH5WhEqsuuPMVwOUYdEFsSWsrmW3qCfRkC\nqfiX+gXWE6tky9u1lltNzckgrUmituYHJg/DVjJwmULpurr8wremrLTgjnFq\nPMzxqVCBDCl4GpfLlVXCeHo6aKgIdhiWPCT02/XBcUUtwxlQyhQTAvUBuAOR\nZ+ZIMKUfT3BpVv14YhpUnkUaoVW0tMoDVG+5qV+d2D8P247LGsF20jZdMhNt\nWF1tZrcqiwBTQQ4VkQNR+fpJm8Y8uneO1/s/QGmEGGlhkvfD7rLcVWpl6So9\nIuFXSlm6GQHVtJN+smyfgPmobTF2mwbW96NRx7jKP+7IhaGeRxxdiOJ74Y7p\nJoI5z7T5vVuqtu2SZmqDtw66RxuLKWTg71a2T8fQ1AxwAUnNMCfhkjaluFNR\nUj7Wj1gvObiGIfj0Al/dxpOZYSxMt7JVEHM0eZY3dEBOzIAfOv8XiQBLHMp0\ne6wWyRCqibWxcWdeJ+UtPZJviDDoeKEom/W7RbS1OoFpRABLrn3oqHJv1pIz\n5GZ3\r\n=I3zI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"895939b3c748be94b8b6f5b726088406c9420de2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1884"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4-pre.1884_1605547626455_0.9525462178516038","host":"s3://npm-registry-packages"}},"0.12.4-pre.1886":{"name":"piral-ssr-utils","version":"0.12.4-pre.1886","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4-pre.1886","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ab09547a204cec759b7f3685b7b29ca09983305e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4-pre.1886.tgz","fileCount":25,"integrity":"sha512-Kvt7LlT27Zv7kK4k6N9vYkfIQnOCyVPPzMjqvD33qUzZ05KkDOA+Q+mUCooDFMv+rWaLq85f2CtmQ9XKup7LkQ==","signatures":[{"sig":"MEUCIQD4Y+g36JsIlvSTG4yuGY43wbqXeO9zy9fj30X0rX4ghAIgFHhn+03juwXWxxx2c8sYVhX+mCS0BGPxc0dnHAdLgiM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfs8ejCRA9TVsSAnZWagAA42AP/2fX3ocHTd06gmC6yHoU\nrLb/EpzV4M8DZtmuvJ7lgetXRX5Ov6Vk4yOyCIMYouoj5raJUSfbWY+2iW+h\n4uNqWVImubJBzmkyzJj2HcgWfQcUf8e9ozgK/7/BVMLmKJMpOdW7VbSXo+HR\n6PMZE8ICevm61clGc0aIfdh+UekT5GEaeRqd4r1r0gWLwAJE/ECy5LA8yeTC\nDQP7UbgJgg6FAAbfFSFIhiKXZ5PKTole1F6iQAGHhAwzXQ6NYx+PZBzV74Wa\nY9HF13NrYLtF/LCImNKtAU1id3qt3BGwt+bc8AzAhOzhYuLJU0bHt5KOV4/O\nhbYgRQyp2VUVTEFtuh8svS5fiUbaTmtxe8s6RhuI4bUcjZR1N9I4hhqR+1Al\nYQlhhJnBj6696qXeJW5vk3XTJITUiEbWLvcSmDF/meIV5J/Ovht9Bk4aXtyH\nig/DXf8IDyutXxok9gRTQehKARfzyU1pBLYuJOYA4+5nZqyNWMOw3EEy4VIB\nCxnqsipuXmhn1YQgjpwojRfXZZMqaah5rbY/SmwdgLmZYP83w3deVVc5friU\n2tcp4Cu//hvxaiXjtB/uy4WCo0lkhnjmuUSbhe6RiqK8k6rdLG1hlPT1ECet\n2by4zAIDB/T7+HQBfz3jaz9KGBGNMkBiOZZb9JCH6nX54BrBosy0LSyBeRIa\n34Rg\r\n=8s6V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"f7d1a8733ceb62d62905c0ceaf0e9162e70e626f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1886"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4-pre.1886_1605617571473_0.2500780888430405","host":"s3://npm-registry-packages"}},"0.12.4-pre.1888":{"name":"piral-ssr-utils","version":"0.12.4-pre.1888","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4-pre.1888","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1ffb4e5022ef8a63058be4020553fa4d0a3d0697","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4-pre.1888.tgz","fileCount":25,"integrity":"sha512-6EC8FyKf08ICEQPiqjL9C1GXCL23f+rR4aUsrxEcVIIMxEAs1f+EeuXZ5uRY1/NJeDMFN+q5Sp9LS9GCH1KLFg==","signatures":[{"sig":"MEYCIQCpbvZLLzOQAg7E2LFQK00AR2HiuLowBI+TrMW7158s5AIhAI8Y7tnfVQxxrOZ+yql/60YuBFjlBJHS3q0GHUml7dOK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftwowCRA9TVsSAnZWagAAMnEP/2FMVsFcIoe3VLFJdjZe\nHAKHW1XbLeiVqJJeaxsP9dhKcrklIOBwt3D+h1LlnBfZL1DybQNxf1ByaVa+\nZ7+fVvrbAlDD7Twz7WjPTFCUfssAL7TSFCLn+F1nlevMed0XrLb9ZHlXqllL\n1wkEFhx4A8V1f2r4OfV77bs9fbea1seg8IJLBJApGKAtAGsXcISwvRTwMXvP\nJFCy7wwOWkguwsxTc5KDlkX7ghM91ZeiWAHeGSkvHz47LQ+Noai+YDIdqpIY\n+yQGKVi4q8ax3RSDcHVa9/35rWAVud1WZl6A93abprFoNdgaQfUUuNIZ7k3s\n5nZlLPt1ePIBTq2Dx8RaS0fCLmUGmO0fb6wRCvhBpShmdETng9aprEIPPoKj\nfpmZgoTJ/eWdv7vQmU/TJTHdC1THfEd9N3/TH6fpCZjlQVMHhWeGfHOVhFUh\ngL0Vb6axplYNh02whtvmj6FGsDb6DVvEUQTHWfReAiET6KNW4QEV9Tqcqaf0\n9Qnt84/kY/4PIx3GhCuUoV4KT62KC+c7IiD6sVYMFuptJ2LYdUk9XNYKpRnr\ncD/1zeemk1Vhal1lhNEQswn1u8tsHpG0FP2eHoUv8yjOgttk4Y5fUElXfTzF\nXOXj6KmQqyu2ZSwPSBJ8kmqsFhJO+R886I39hWuPhh78Yuf/RX0Igrk/g4Bw\nsYPp\r\n=jbgU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"ceea58fa7fafc633dacc5225dd245376e45e5a37","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1888"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4-pre.1888_1605831216098_0.9052168240963783","host":"s3://npm-registry-packages"}},"0.12.4-pre.1890":{"name":"piral-ssr-utils","version":"0.12.4-pre.1890","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4-pre.1890","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5fd7c648c6d6c5b8401c10928fc1f93725ef6056","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4-pre.1890.tgz","fileCount":25,"integrity":"sha512-E1HBRAf0dIYUfs4MyG/83yfOMe6hb75c0SnebfCQX4D/ds2KYpNHnvfJ/zSXPYzuBOTxxawjZcCct3v59sWizw==","signatures":[{"sig":"MEYCIQDIRb+3+BsLXQeWAQSsh2yrdfojYnlNt1g3ICqFOd4t5gIhAIQsZ9xoJAVvMUfeq72CwK/5YhnbxDhg1QNfdrlssi+X","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJft6pICRA9TVsSAnZWagAAQdgQAKGo9Sgoq1ZY1ThDTCey\n6/il4IRJYQG+b0rdlkBISk7X3A0CdlFbWEY0hZsZ665u4Sh14Uc6vRpA0ZgO\npFu7Sfyv0yjBo3kaojiA90tEwwwQO3pfVWQQ0Hv3OMuRoygCAEHLPMBoJTXL\nA0a90wObGGW9P5pmo39JmJ0TkCrcoATn6oaiRdlkWyibYbnSr5CB2Fll+cn0\nD2M8TwMrDBn/zMUllboz2KlCHtpAZ2Ph4j4pFWxn0Rq39p6WCaHVGr6LKvc5\nhboaft1qr5Kd01e4dPodCmFtIAfhHiFHY62JyYOalG7FdSoKYg2y84JFvklv\n22cj0NEfzw68SQOyj3KmJgM4oaCi6C+JuKyr53biFijbWhBYU7Y7bBzhLHD2\ncrevvCND2x8YiKxhVB0X66P/SZil3uO9w55UmECd8Akb3ldes5Rt8ZlQiWnV\nGuZemaufOCJosEWuQ7VNDfodHS/SpOND4CcyAVPzMI142/VSphlWiP3aJvJY\nZq8AcqN0FRg61X96BqZSuHQOxko1n1oGqartS+fU3oPKBEZ6YSYwMaJxCwYs\nuTiEpehXdebUaod7XJ0z9QqfgaqPvCTeYtwcy4nV7s67/23m5aKIPDqzfCmc\neTY3R+zcGCN18yzeJShcYRc0IZagN/qnyfySEUEcSnT+bDA8sOLQv3t2jCPn\nnTfe\r\n=dY3I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"8af97b82a47583ff6c427ed94499df308149963e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1890"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4-pre.1890_1605872199680_0.5498878390591826","host":"s3://npm-registry-packages"}},"0.12.4-pre.1895":{"name":"piral-ssr-utils","version":"0.12.4-pre.1895","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4-pre.1895","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2d6488d38c629fc1e8ff5765d58d2db3e296c400","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4-pre.1895.tgz","fileCount":25,"integrity":"sha512-Teu21zqmIz0bcClU1l/2VmLaMg5AAz3u3GdSDRmcsx8nNWwY0XECgc+7JfPOy7e4vzLmT/v47DMDyzrL9Yyltg==","signatures":[{"sig":"MEQCICuMYg8E2NdWnEMRaPE+zZ7Xjieybr+KA0S3OExOOMb5AiB3GPE37J7PWkuPL+B9/1S+Fbc6NRIX9Wc0NppADaQ/bw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuHaoCRA9TVsSAnZWagAAGPYP/3bstYDnrfK0gblOL935\nNCmqIgwjhsZ6ZkEpOFiscD3lezNUZhp7PgOZQbkcLk+oAeiEVEiYJIcRSwMb\nzlrNtnZUYaHxy0I2zV3R2QnxBVZ70tuGY9M3ifBZaTV/TnIWFqUIjpfoxL5k\nwP4a8CYPCKGRdNmby5UkY91calN372QC6SoSXwMqkj+yd0nQqdWYPlA14WV8\nQ3ynRna4erjPO1j2OWmJCIZvdhyLiVmckTXX5sImFyjvqthLtCHxbMg4wS7P\njXzTv3OxdcvFvweEzN7Bf6A6K4Eg+U5c3SdK+caAWOnkgg8qCFfHicwPnuGH\nO2JL6CxY++0J0oKtjaSc7zBmvFfY87texAfzcjbox1G4fHErSulVXSspqjjr\n/qJjU5WF1Q/yAywn3mYcCOqAMvs4hALUfo5H3O3rxLPkYydkippasGWKwtYK\nvctLUMWCvrUES6pQcLceIqEnIb5TucNiAmjTn3n7jVhjrqaXB6KcMl/MDXfW\npr0xrFpHctwJ/XkTnmZISSyGRnHbSD2FmUGsRuj1hgl/dgBIVJo+DAXoCDZo\nd/4NSftleGHLHm+RqZRKX5ri5dvXGu7Hm5DLuU+yAef1O4lrYmJaEzDOqQZX\n8tJ9l7QuJyRQ2RFQLNFZzqUY8+xme3pAbHzm0OkwvTOEBV8Br1+MHHEjcdyN\n704p\r\n=bNUI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"d387a3ed51efe2d20cc172fa9d7c64aab5a16eb4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1895"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4-pre.1895_1605924520103_0.009166759102070765","host":"s3://npm-registry-packages"}},"0.12.4":{"name":"piral-ssr-utils","version":"0.12.4","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.12.4","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"099c96dcd15ff28e623e74559cb6b9059ee60dac","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.12.4.tgz","fileCount":25,"integrity":"sha512-OmQSEJ0dYpJspzqysVoE+NQxH5KqM3hYhAFlBw4MmuDVptOQ9vGL3pSZQtbNhn7F5vQ/k2nXGgqxuk2vVBZXqA==","signatures":[{"sig":"MEUCIQDLngShHHCpt5o0ZMEuSYToMG16KlDJyoKASk+u767z6gIgMAwxcfiAouHcencM2akFE9oVq/NpHQxT5QxDaMeRcWI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvOrhCRA9TVsSAnZWagAA+YEP/iggeAXd7n2aum5yo4BB\nDM7gd+nv89MkAck4vQd3cRSVxtbNyBr8R8i1KZwTK3fYrHtJeX8xVYkVbOrp\niGurKxjA2pIxguWs17gVS8THXvv7z8LTsxGYFlGVcd4t27KBArwsVTDpDaV5\nlEYstFc7gdMAdZZXjPUoh7KCfSJE1nzOmKoHWQyjO+s3ptMxNMbleiRiYged\n/6u4HWDqUrAXz1lHgd9P/8GIGsgo9YAPONWmmzqmNW5w5aoiyLIaTzNJmkE2\nlZVGorGtV0by72zx5cSDFrg84g3X1SN4DzrIxYzfTWx3TbmeuJogoGdg/Vtf\np0skpwqTXrqwZhyzPTs6fIIJhuOz5poUehIkl3GJs/io/Cw45amTfT6vjBRo\nvYo9ruJ6b+DvMUnr2/BYVLmpSxUMiv5f6e6uOE3nv3dUQvUjhgI/PCP0C2+E\nN5lh9ziGP89ywkZOs2MK6BQoSyrwGEBEWoCHTFkl6XGypmlFa3EedmuAlgvf\nUuuADeE+KRS7n1JN9coNk2UpuggCAletyZ6KZTibfKspIVyI4NQ1eeLJsqhr\nPVQv4pCqG+dQ05b5TAO6Et2UQMGNWWu1GthKc4ZWNSq9KxAMu70GnxZKlI8Y\nKAPBZI90UAhVGPgAoMn1MrrK6U/MrTXsEdmc8++e1yp/tr04tl2Wwi7vGMmT\n7nZh\r\n=EnvB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","browser":"./runtime.js","gitHead":"e288b5b73b5047fe43777d4220724dab12363495","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.12.4"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.12.4_1606216417375_0.4853778298836444","host":"s3://npm-registry-packages"}},"1.0.0-pre.1960":{"name":"piral-ssr-utils","version":"1.0.0-pre.1960","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@1.0.0-pre.1960","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"98302328204e8344a309de454fcd3ed9ad76bd76","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-1.0.0-pre.1960.tgz","fileCount":25,"integrity":"sha512-rTEmLECF73fXoDZWfWSw3X2zuHlJ0QQiSuCXQLZzIxkc7/PxcXRxK2nlarBd6EmV0EnGFj6OsjG2RsNWNVrRiA==","signatures":[{"sig":"MEUCIBKJu1S9JJsX5Xh10SJJ1efmjDb8W0hYm3peku5i5RtvAiEApyMVwdXsuWHtfZlNkRx+tp3igFZ0ryoN1tPo916AsoU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0BHACRA9TVsSAnZWagAAHgkP/2vkG8Si4Jm1GK/2Fk/N\nDy34lG3avxWVQE1lhdPbLrJfxE3zAK9uq8exGBKFnIAUl8rqN0wXQdrkniD5\nU5K2j2T1BKl1zA2x4/WFKgSnRRfwGzOAZoky+Z4lOWkOWoC29wm9GsMZTNXI\n9ytOChF7YV0NCfZCE5H4MIMXVXqf5tRX8hUhHiUYpBmki7KFEAwUdyOH2tma\ntOU1ozAIMXteS13VlrXspOVJHaCwD1p3DzCe/azBZMueD5G4yAYAhg/en/XY\nHzZJU0N/auBF9t+VdJVxl2ieSGEVhM3lYuqgp4LXvG6vxng+oEtej2gNZhmH\nMJeFBieT3VN/t8cAw6nPCXK2xZhN+OgnfBNuP7B1nqxnETxI3MvTc2zS9wpv\niInQEaiHZxLG+jRxhRsdDR+TXEnHYk2L3FK9Yj8q/a2zpRpFP89dvGE/2jgU\nwnZWFP0JjQBOnNtaarpC0Q1xF2F9bcGb4TTXKGXzOJnfQCXoeZ6YRl9l0ZW4\nlVd6LdBqema7E7/1hiOHh0jYPcqUZC2CrKYxChftG0UDiYc0CplYoVVT8Ibv\n0aFqEdi0j4d7NMmF0ZPQJnb6Lop8Fd4ZZgnTR4MgGpGBz12POqnyBcLG+pAh\nkxAf1MGjACaS20zlCKvGHRcV/5hbpZvffAORKsLxMRkZ7JWMGixXFmfAsn+0\nfiJQ\r\n=myNa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"ec5c91705d6fcf618d0de589c9b48943cad934a0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1960"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_1.0.0-pre.1960_1607471552260_0.10788084303636247","host":"s3://npm-registry-packages"}},"1.0.0-pre.1994":{"name":"piral-ssr-utils","version":"1.0.0-pre.1994","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@1.0.0-pre.1994","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"634bb56f4946fbb0eba36ca7bbcea2a0d83e918a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-1.0.0-pre.1994.tgz","fileCount":25,"integrity":"sha512-OLRIu/HYUvlE0YWU9Zpum7fDXMEEfSZSX5iR6wAcicK0pcSXPYn+XdLCjCn6e+Tq03M6pdpqLtF6v0cIQZCJvA==","signatures":[{"sig":"MEYCIQDoN76qtnXBTsKk86j0WrahIEFqyPHd0oFxcXFIaP4l+gIhAJbYdB3YctSSbwOPgfuvDgGKlxnO8uY73pDKtDpQmPPy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0zBsCRA9TVsSAnZWagAAM0kQAIezngZJ7L0IZNoGuUe6\n0mSPkU3K1wlVxWGf6+kC3wKCDnEP2z9FhpHgu9kDVJSivtTMzqwqCjeBldV9\n8RJuTM8SdLicL/yFwhQPo8ZozAaYiLQoipZJBKqJnCJmIUAF7sPu0Gla3ecH\nZFp+bf0uZQdM3KOAJXg0MUU5aOuMP4k6GSHgdH9jPBYihkqnl2fJLEMLx2Ni\nLcZyENkdqi3mPog5nRmJkpwUdivTsOhWEbY/2DFb0zV+W5qeuVEQPAkA5y4L\n9VMXdXLHSDHfJycxCs3lxhA/R46zAkGqUG5BcxxHivCDvffBxE6oe0eVnuwK\nDiyVrkuriQ7V/t5DKVlsvLHoxoNyR//0auhPYXMuwWXQMm7Ct7R/xH1zN5z9\nskDZH12jaOOuB+Zs8AEVeacuXRzCImBUDwrhls/EU+zLhRUCKpMZvLrSV2jt\namAOGNQgyrKTmDh3ch3KHia5YS1eePsF62EWz0qTYsxtK1d32TwhC+9ih38i\ngtQHWgmbZTD6uQSxVlo8+eLiWjz3M0LfLGkPP/9Eqf5dnqZpOvy9nnF+30U4\nx180RGaFLTfckGEUDqbdlvgpjq0OAKxS2agJug0IgTi9M46UGjPfV6q7PduF\nH8ZAz4QriiDP+ZsSgbkBSNF9BqE12JPbt3t6Jnm6QoAAD1b2vmKpGKAXhtD6\n28kH\r\n=spYl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"373c97b1fd6ad1c4944d71ef6a8699e417eb84b6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1994"},"peerDependencies":{"piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_1.0.0-pre.1994_1607676012247_0.9118540842493175","host":"s3://npm-registry-packages"}},"1.0.0-pre.2023":{"name":"piral-ssr-utils","version":"1.0.0-pre.2023","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@1.0.0-pre.2023","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"72cf44ddf63a6fa0ec0fa32f73244d95171f45e2","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-1.0.0-pre.2023.tgz","fileCount":25,"integrity":"sha512-igPPF9tJyubk7ueAmZrtIPfrtitMA+OXaCJgTDM7ekjcL7YH0QlURNsNFMZ7LPvTDABpvLwWoSz5nCjj6FdRbg==","signatures":[{"sig":"MEQCIBGxmUFn0dn0RnDscFm1YuwrA3hGxZxBaQKQ4Evii5kLAiB8SSwp56vP5pFimdyODYV3N5TC4eP79Et29kDfch4hOg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1RjQCRA9TVsSAnZWagAApmEP/3C56gK6Enr0cr4FLEVj\nnzauLO8ZciUSmE2+dPlzdiyD6UrT5KLztRd6yrzRlw8iU+XQrB4v1cQc4YHS\n4/DwRUqA+ZdZYTjxMce7yPDDyrah9iKEze355s5lhDdZzxC+3NLyrnCllEWF\nfmjmGJAl2KhF+HvoQcnl/1xerVFjivWnrZQCFilVAhPfWKk5OGkyoUuTMc6F\nt5BUfIsF3Yt+2IMvYiSoE/i0gw59bAeS4GDnjHOB/9K7gfz7EnIzHKzlLBnB\nJRdCdzSZO50nbQANy5CDWuPoYl0F7OddDEu7JnAsXHdDN6UtDpE4YJ4++eRL\n5pjfvkCuhL/OdMYkezP3/P6iVkX1l+MRNIC+VER6F5c8dsPVg1Wddai3X6pR\nVHDDOLA0/thIsNUbMbQ4N73ZbCU6ZpyR7qMXrDaGN9gwZwrckkd19sTAfNYK\nv+SfdEI8E/qaLuPxTta+YcQCS2KRVDlJIHPkdSO4nXpYz7dc2vMUh4zw8nQK\nfDYWV8/pBXeJv09co1kOjX2ekpFBjSf6tgkep+xEAi8Ye6uwyZ7yIywWUEoF\norsR6a3LeaXQvo1bZ7X2p50cr8ZAU9isc0hKKtJWtVpwyMcVWWxugIjvSWs1\numQb+Jy7H3LZfmV9CPZ2a9qwKl3sCpAohlYCEuWahUTUI3A5OkG32vk+7OgI\n2bDZ\r\n=dc0a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"2067d3987145f7125463072652182c8695224ca7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.2023"},"peerDependencies":{"piral-core":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_1.0.0-pre.2023_1607801040350_0.8878198810779943","host":"s3://npm-registry-packages"}},"1.0.0-pre.2075":{"name":"piral-ssr-utils","version":"1.0.0-pre.2075","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@1.0.0-pre.2075","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2a893bfea540e6fd05ba370872efc3415fad81c0","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-1.0.0-pre.2075.tgz","fileCount":25,"integrity":"sha512-9DQ8IZPSkoCYMHLrwLJGYhzi5t6F7xmnUbZCMhsbFr9RntpVMcf5mlgUbkVBHrf57fmJKzpwRqMf2VUoJygejA==","signatures":[{"sig":"MEYCIQCfAs+WfW3yBpDTBmsICNiymBCDUTzmqrxv5FwZ0qFsEwIhAMJvZFryBcJCwuQwsZ16A/Wtv6iIt0l4M5rkj8zxjgYT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9L5DCRA9TVsSAnZWagAABUsP+QAxO2QoLXHhxqunlr6e\n1dnDz5b8Co9Iym8lws3nUWorU20NlnJxeQ5i2JhqEvANrB1xo8+UCOQkoXMJ\nfSsiyWcZ3kYxY806SLzhM2KEQwV/dJ9ztmVlrqo0KONmZg6RCoNjsVHBOlec\nZ4xowcfaROKaxrekVNHJelPPMJrrsN3AKGpmte/Ccz+uvgUPRc1MqrMfcAP7\nvoAhh6xzwFkZchcrRpwLx/DPJ47WjeTzN9sUSqbxunxhMjpi9NNMFCnXm7Cg\nGCBdSjucbo7au4/hHkT/SswIt9yquzUp+hLkwo9DbDTkxFP+oea8oLEePem9\n1GKkabZZuBDamelkJH2UztFyOUmhZQODReAVo2Ak67zyV1YfyZHfS2kqoNVE\nCc5CNCk1cfBjHDhY5fRPzLzuCc6pl2fA6Xd0TRErl5MAavvEATZot2eXkw8H\nyV03KGH0vqagttsZBzrOMNoGBPEWm/5DNpV/WXIC+3zV4vmEEtt4CjJpZAVw\nPg7/BjXw+dUjujuliyDd7e9kJILwTfEFBImmXBHCrBWGTUAuvMR8zDo2Aern\ne5BGXPQH3Qs80QcuM6EftHNDnpzquGwEQlaNEufM5itltzO0NA2/x1k56fYc\nvqbq1LNb7DZGZK4+qBwau/XDdtOnYlCQXq4QuUWha1nfyhnxGq+z9USPWTO2\nB66L\r\n=u+Bl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"681cc8024b56007ae40423485a05b9f3365bacb9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.2075"},"peerDependencies":{"piral-core":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_1.0.0-pre.2075_1609875010698_0.9161531022350693","host":"s3://npm-registry-packages"}},"1.0.0-pre.2077":{"name":"piral-ssr-utils","version":"1.0.0-pre.2077","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@1.0.0-pre.2077","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"67abf7254d5374063f91eecc2e692eb8846200f5","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-1.0.0-pre.2077.tgz","fileCount":25,"integrity":"sha512-he+YeKr5nM3q3k5qosnh+GAdLmVvO8NFBQgOw9Ie79kG2PSVMyHV4lMjQ56BhR0qr+9YwnvPb8seXR6GaAd+vQ==","signatures":[{"sig":"MEUCIQDTNkynlV4L2689JcZ7ti6rG9Dr7GpOar0BNWF5qYWqMQIgCKqy4RYEZzf+diAGmucnF9In9viSewdlLO8R+WAvK0Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9MaBCRA9TVsSAnZWagAANxwP/RxbAThMDFt4SUryqppu\n+gnJQ1fnxZ8VULKT9y0rbi5o1hZZv/iw0bWdOtoOEpatxGAjOGZBHCBjm14n\nYb7IzPTvFKqfMi7+H7vPGQPzzjQrtT0gjkQPWtEyMMRscEdGnNuaBQrtW+hl\nTKeVObLEzcb9VL9gG5cqOeslR8EF1/INuEOmHRzfsKTxMB49BoTc6xJWABjb\nM05aY2Cpluo5cbKpJw0Tw1N4TKv5BrVDdJxxNoSWphi+0v6RE4WoB2QJ9jkp\nBC+EqxLylhnlC/UHmAoIts1jtJB4O/9PBHjqe1p8yZHPt17dWn97m8WbbCCs\n37jzIpep6qcxEIQC/8mN2GbgR6Z1Shq6jdcesLP5bQbWY60lbnqErbS9isCu\n6GDG64xfMQrPsU3ktOjTdkBEEOqY3oTpMMdJ2X9UiEzpwfuQ0CHx1HiMEidr\nQmbqe6C5cWCJRbX1K3ZVunY0cTiAHUP2Wqt5eZUt4O98Tu7b6hUL5pSrCFlR\nXip/KDJeu0oMxrm3K+LAwC3o/AIAfvWuloCA0pgDO/0FrbUGGBv2D7dOR70C\noF8sTI7NUnzvFdE5wq3umkSGUWLmz0YreabA65FPwB3BXWCPljrwTzNOKbT8\n3AL59tZC1byWel4M2sGeqCnxI1edjAwc+FItR+opmDUKccZvL6jLlGN0e5B7\ns6pC\r\n=9oBQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"fbd8be6a3bd530738fb342d5f347d25116e61561","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.2077"},"peerDependencies":{"piral-core":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_1.0.0-pre.2077_1609877120720_0.9076064460200508","host":"s3://npm-registry-packages"}},"1.0.0-pre.2079":{"name":"piral-ssr-utils","version":"1.0.0-pre.2079","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@1.0.0-pre.2079","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"bc8f68bb7df15fc1fd3b67cf4d04256318dab396","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-1.0.0-pre.2079.tgz","fileCount":25,"integrity":"sha512-I6EdriDVS9NP2nDDJXIT9A9ru1vSoLVn7KP51dnCkHqOhCXzzsCoo8YA2G4I5MsR9LavGEOw8hYA3iK89eJgQg==","signatures":[{"sig":"MEUCIQDdY4jmVvdql7bHBDYn3/D1TePYMqZcqbRCEuPKxoixQgIgSsIEiWtSkmeuTHbxewnvjGbLxU2D3xo6zsZwsaaDoWU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9Om1CRA9TVsSAnZWagAAD+oP/jCeD5cjx1N/vbWMen9L\nLKyjnoAnx5QPxGLtZDvJmImySOk6heWb0pLR+5QvyztfOfg/7nMw3Sfl1apG\n7QLwXlKj3gsDddik75vtHfhcQ1AOlt+ukZxJfhR1HlSHCDDWUu/R5H0eLfPM\nTggHZIND22bZaPhZAmSq92dc939Bich6n+/onDwiyUdysToFAHkKoH89Jq5O\npC+TWcJ755Xt11460uOezSWAxrjcCal2P/lm9GcxKG2Fbdnp2UVYtoTo1R52\nggURIzawuJOjWSg5QgAMYBcWWhhV78DE1V6Ko/ORoVEP9BPxKIolIxICvYLm\nzXefmpDZT1Uw7wKzG1b2WV8J0v2YRuv9YX25Q4l5mHoGIb1LsXey4B8gTeY6\nBcYoJoBdH+DNn0hcZrqienK1GU1aMXQPox2yT3S1vAKvPd/AswaYyhpcKIul\nSNV78iAX4hQWi8p2GyQVrj4qd/0LONdxm5jRBNzPS/oSUmsInnHFcJEJkAbI\nLPChcH6clvjlL5ThKP7u0EWX2v6LL/XFVX1+gE+0LvcwJkNs6tH0FiU8a7hA\nRd41gVcTFJbpPCv4ImD1fUzoCLVpwgW+5jFEwDwWNv1ssjPmI1UPMZe3VatA\nFbiT5GynSGceuonkTk4sBUiLArRHw5JodnToMvx4lXo4/r7PzLtcvCEMbPmr\nun0n\r\n=0DjL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"3a0234402736ebf25e155d5adf77bfc5e7cda263","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.2079"},"peerDependencies":{"piral-core":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_1.0.0-pre.2079_1609886133476_0.6827882515098469","host":"s3://npm-registry-packages"}},"1.0.0-pre.2086":{"name":"piral-ssr-utils","version":"1.0.0-pre.2086","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@1.0.0-pre.2086","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f3716c9fc902187382c524db985385203f1ad888","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-1.0.0-pre.2086.tgz","fileCount":25,"integrity":"sha512-S2IpDDCuDoaOIYocNqxWg0q/mIwplIcZjHR2wIQykbQJ7AJwC67H6Q8gH6nELF4EkFMNvfg/2H1r5fjsrqMRHQ==","signatures":[{"sig":"MEYCIQCTIlUfoReChbEkhNGX7XUwLv/eepSeA0NvF58JmHgCHgIhAPUKeSV7NEZyJKFoOw4qnmboY9tR3ATeXc2RVN+agyhd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/h3gCRA9TVsSAnZWagAArXkP/3zDEonIK2a2evUZ5N0a\nte5WWY/JIAa2IkWcptg0RyCVFdmROBrURAHq6xt5jOXxEBpgF6OwZyoUIxH4\nEbXvGZH/MnxffaPS5wS/5ixUSTIxIPJh3dpV1+hJ8chWyOR1/xM1xYnUSi+8\nKAxGBm6hmfR1wCwVHf5fHwf+hg5bLiOfOxozViftGi/oBJU2+K3PAzkFVU+/\ng0ZbhW5wA+KWKBil4XQBU4yDKoX7EPma00+kB3+vzBmO7YZVxnMZzWZxoUSX\nkJ4rA4mIzJ7Bs2k+9Ih6y/yKxI3b5fgCAZUxP1texeck5jw6zIz6RyYr7CXh\n+RQqqekXoKfa8KFLBE1LUh0PEa9q9R1oeyY6kQWQGMn70CgDhVAObFa26Gke\nmwm8o2zN86QXYrKQl0ehxums+pzTykkpLVhFS3SwID8zdqvIY5zVZgPFl+xk\n4Wz/3EOsilS6qxntbNbM+T1hQNYqfscBxrtgX4YHHTodyFoIP+EkYAZwq8ER\npTHB2Jex6a9iFtTmN7fMoTYb4EapjnsE371BiYEcnrEwgzsijgh3IqG5pRuT\nZYrMDoNxzmwmqxBi1NTpgZtGBLhFQi8keEXvjkBkVRGChGeJoMGraDT/HRMV\nJlBoxzASgVrZbuFLQulYSaQoBKtNzFdWsPqy75+ICU//Mpp29RmzvP3MfAUF\nJadl\r\n=YUI/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"d2272fb707f7342b62daa27c70abc07c5e48517e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.2086"},"peerDependencies":{"piral-core":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_1.0.0-pre.2086_1610489312477_0.4570161364058247","host":"s3://npm-registry-packages"}},"0.13.0-pre.2244":{"name":"piral-ssr-utils","version":"0.13.0-pre.2244","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.0-pre.2244","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1f2e7549d2dae37ad83e397e439382767b08a952","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.0-pre.2244.tgz","fileCount":40,"integrity":"sha512-WfT/nS6fDv4zZHA2JwkeuRHFXCsNPlXkLmfXhXB845DIHf6/NWPmJa0ifIs94Ng/4DLs5mgSI5MxCNW491IYfA==","signatures":[{"sig":"MEUCIDCzRElrnnNVtj2A9KsIRB56CjnfMeO9soIGw+EgRRG1AiEAn61FqLKqZ1A9pjKImYx3RmjJPKpDgC920wZ51kwI8Y4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU43PCRA9TVsSAnZWagAAc8cP/1yvcjISA8GYGgnQz991\nQI1Cc1C0KCRuTzYqyeEIXSfDwY1aDjiNmY7XOJSyI4XavBRQNIG90WyOBVB1\ngieKCjnFnmpM+rKZgbt+gGXi41mP0qbnrojEHTvsqwFeQ4JS55j0R+yMO00v\nNXlKzZi/1eSgrqZGZ5iIyW7hKPkV9GYXnQx4VnGOA0C4G4wCvLqzKjZogxc2\nS+9vdKZdpr07gVIFKRxn/anAYy4UtOu0lW87bH8qejhP/f/vCRGOuRElxsJR\nlfX4cPDbbu9YoUfg/LzRw2kyWbotwf0DnYOJ0tEQ+KJfjjCm1qfHxLjL+fQm\n7iobRxNTHQTFrNhrvrn5lD7Z3XWw3TXxkgs1IMXM3+WRukrTRvzVjBNpHh3U\nLQIHEw5DtzzS4s6H4tS66rtQ2GQR13pfWk27j+y/9Mb2tRB/vuXYJDWWwLtz\nV7zPcdSvne+JIS57mjeRWFIQzJTdYuFTUQ7qj04OG3PP5e5Xku6MBN9D2V5e\nMRXe/oYsrLL9ibWz7V48ESJW90IVEJZGa2LmYOfriBjn4Vj4i21y+w8igDtV\n/dNmh3EE39zb/X/HjSOfH+zLc4va0Zukw09YGLr5Zt7d8GeTHTl4NYeGxLwD\nYHHuHJNqblhVAXenSgRKLA8VzP3wFkVrOrY6ULMFQ2pQjhNIr9YKe3InfO2a\nZhoT\r\n=tOaR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"0fc650912ba35ea5e826c7fe4e70baab7d31c171","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.0-pre.2244"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.0-pre.2244_1616088526850_0.7723918208233285","host":"s3://npm-registry-packages"}},"0.13.0-pre.2253":{"name":"piral-ssr-utils","version":"0.13.0-pre.2253","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.0-pre.2253","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b80ce714fef94c7b318cf023c2bb686362ecb33d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.0-pre.2253.tgz","fileCount":40,"integrity":"sha512-NR/BwLqvbWu4rV2KOKnkU8Q8lcol2NlS+l5OA93DObzUeg+hmir1G+EHPw3VEohozqyGEh3ZaML8+Nd2UZ7uqA==","signatures":[{"sig":"MEUCIGWsgFUh9Rda/JcRmR8mW3LmUJaLl9+QB0QySPjtq78wAiEAxRUq2ADRrNjORMemorpr2uJdnwFU57wbF+oSGIjIfiA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVUVBCRA9TVsSAnZWagAApqUP/17cHElWtsQElL1K2BAI\nywY1McuBpJXpnzebX3Ohj+uTTTjAel/qouBS6R1pnp7m15g9SYGTsc2JC8TX\nogl5TmOCh6ddU8sxy+IH6B3vA8M8ksazEepQgxaBFwfT2h8fxeKxx+iLm0Kh\nQBzttr3inkm+28IFmQtOKJI++8YbzosjkfYTk0BBke8/LyZuukXYATTtA+28\njN/cLSXE71S37MpaFtKfD0jsiWw4cYunKVgCEA3NyB2TFozPtyYqy1bHTO9F\nd4gKsissvP/MJwKFBgngDhrQaXV8pRS3nbb259/xQyQsw3Nt0TLvzFW/EgsL\nO4+7JR48s2YpKGGnZO/EMIpqVbopF2AUrbI6JGlFqk8Veb5YCgqyzikXalna\nhTJ1xE2crkjruQvMTJAb8y8xsDEpJL/e7lO7kL7KOdt69XnJXKk7SZpydt7J\no47h7otlXh+VDdZUZVDMwBUh1WYPxBtStj8de/xWEcnwyMoOFZxLmQdlz6/W\ng9UeFZ3EeUXiKqC0ecusXZVk8ILiTKaLLWfJGOW2y52wgKrNO6gWTyCyPRoV\noAQvuObb7Gb0CbWoUqD0JD121octoB37eldWkZ6qZjuhZdlu3+IjlGowlYsw\n83EX/3lVSR2ZVWitF20tYPXCD12KMy7UyM7Fej5tLkBfvZeUNCODLVSPV4Gl\nFHy1\r\n=07pO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"c3bdd3a4b45d81a1844f71314298402384a8736b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.0-pre.2253"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.0-pre.2253_1616201025212_0.4686238560998006","host":"s3://npm-registry-packages"}},"0.13.0-pre.2254":{"name":"piral-ssr-utils","version":"0.13.0-pre.2254","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.0-pre.2254","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2e0336c3e388c3064e60f957c3169abd460b354b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.0-pre.2254.tgz","fileCount":40,"integrity":"sha512-3kuZ3Ncw5E/AbIppbkpFWzCej3jE68zSRZIlXMPu+g484Oz5iJJtgBY2m+PU5VzW5axxavrQJxW74JDRlzlKJw==","signatures":[{"sig":"MEQCIBJC5oIktjHOTlhzMpjciZfTNccSmwsoB8h3f87M5NGNAiAXAT3qCJTKwCGcFTgiQiFt6/JN5pSR3rthLlJNlVSfvA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVf3qCRA9TVsSAnZWagAAhgwP+wQD8BVMQsZW8NfukdIM\nxQQx/PP7LzV1OHlYoETN+ogDq2VzCzcjUP/grkSnQF6odEKxGtt2XInzi9bd\nD2UALZvFBPriS+SAti42a0eevmUrMca4K26Ugo0I3Doi5jMIrcJI0vAlbf0X\nfaWbjN9tTAgBLd2xqZNBNrWrrYkqjBVI/omzQLDOah0/wR/Ra2cd6/L8Xewp\nVuGRC/CNwpoSWXPk0BD1n3EneCj4k7MUxnwHAKqODrtlw/2fedKmB3HvbUsB\nS8uNpoRVyDNjc1VktA22tjToLtOR2KMROoyfPY+dy2ifg4XrClJrJQybWHUh\nwX6fVgIvm6dZz/QvmBW5oeQSEqd3QVRa3Mm5O54waRE26jRi0rRYDAaQf4TX\nBlSKN9u3Llb05ZwolighOMGzDZoEGb1dwRe/VyH8cDjlmB7Ojeqb4Ecz8nn9\njLVCXeE47vqRfK6lEDZcZcnDMClflhBP7/TqqZJsGMMDCicwMecdmw60dsol\nROCMwkTvkB72PLLUosy1dAMZWRxYlXMKEklSiOrXP/qIZfy6NwBp6/OG2qEr\n//ZWyN2Ask9ToD2D7X2ZqhNfB8HWYFF4pkfgoZiv8dlV45QfJMdlBoucy4MI\nlQcgc+0CdzOaU6bvHgpoH4bwS18gtDG+BZdaR89pVdpSN6mA4ObHKuoG2T4e\n9taj\r\n=BGVs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"915e66bdec60d70e939931bb4010334d23498d1f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.0-pre.2254"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.0-pre.2254_1616248298188_0.31279875373377086","host":"s3://npm-registry-packages"}},"0.13.0-pre.2284":{"name":"piral-ssr-utils","version":"0.13.0-pre.2284","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.0-pre.2284","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"515c5b44245237168211684a5706b24efa3038cc","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.0-pre.2284.tgz","fileCount":40,"integrity":"sha512-OBnBZXP95Tm4VteN75SF9Ofu/oAT8psyHdN5ok5T/wTUUeaq8JwO78cOsZ/su5E3bJmStppL/JxXps/dyPc82Q==","signatures":[{"sig":"MEUCIDhUVELyEowCzbCM4zaxVZOvlCYC04vMTKp4sRCFCa8kAiEAuZyBy4wvpu+0+3TE/vqgThWIq1oiNUW7juiO0armVmY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWhmGCRA9TVsSAnZWagAA3gMP/3nkBy/hJe7svg3t1+Bh\n5RU3izrFx31HBBO/cti3B651PH0hg2nANxAZ79zOfCWKwa4BzwMIsAcWx9vs\nKXwdMJnKAonJI1pKsWIXlCRygOApVWPjjeXycb3axDMlHr2pFpsBzli+10Ii\nj0Hr5HZhwzTjLrcIFDH6en0asl4sgu0fDLvb5nl6nopvFokGqD1ibxkS4PIY\nDf3fo32ENpVLPlFESZYqa7IOL+7clEYuAF6+lMH6hZwgq2qQWHFWovVebMnY\nyEYUWXbv3hv2OuomhWY8EixkunYbqiMpfPaAmuWFHcJFRgc63KFt7NW1xQ76\ndo3wQyOl+BWrCIfftnoWPAX/t5yQxbeVX7oFuBpq63Rv/0T4mViQ9p0i17Jo\nTmZ08pVpv6ZRm42kyOrGQx60/yKIkTFH0+lCl+fT30C8mOpuvRSKW08NgbKu\niV4NCzuwkHnaazuSBsKDO2xkBrfMzIav4RdgoDD+Qa6bs6b/ThRhIHS7rErJ\nIe9fZpyn1FFMoBXPkEuU+oWsDdj8dY2UJyZWvyWNlGO+NeV+y6ap+tvIH7IR\n/iJCUnKfwEkyy5mgv6ITuZNGprOk2vIM65n3Z+FKrpRgCWxV7sVtae2rv9zO\nJMGiUw8MU8160EtwAT0wPK7ovQf+duBlTmwvP2twk9lypyHsKNOdah0LBYHd\n9u6N\r\n=co95\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"3b1a2574193c413c7b67e83657c878149a410f0b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.0-pre.2284"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.0-pre.2284_1616517510146_0.1884214727585829","host":"s3://npm-registry-packages"}},"0.13.0-pre.2290":{"name":"piral-ssr-utils","version":"0.13.0-pre.2290","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.0-pre.2290","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"24a44fe220a80cf098afc461c3041f8ff7158951","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.0-pre.2290.tgz","fileCount":40,"integrity":"sha512-HHRmvIHV1CJqygWin9ccxIFwAwP5cAOCYfQL4Egd03Uv3VMFtMwKE1RIsTYxS9Yed6XUqxKVlHG7zJ+bILUdLw==","signatures":[{"sig":"MEYCIQD5O2wmLyMki5z+744HegBnBXmAQVUMOdtTUsrIcOgLsAIhAO64Ad0cuwOdlKuLdf8aj60JzzFzZ7FrRiHAMZPBlIMQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWlKeCRA9TVsSAnZWagAAsIIP/3GMD7duj7sbyS7iYq+I\nln56t1jhRAd1sabszVDY7mo9N4UxnT/tG9wYoz0BBS1wIHiU8afR4j63nOQd\nsMGtdS8rSEMobi+AnEhTzJt93anzQVVO6XKse43o0hdub61i5kwGBlj9nkc/\nwGQqIgPs0/dqrEYzevdW8EZ5/Yvj0M2v1fctB/z02FtCx/k38HiiT7D/ne88\nBmzbEjvVobZoXYff/bPVOg6ytyLwsPnL2sY8TxVV5A32Nn/bMoS9xjj+f2Dd\nwl/XbB7ZKUyHWfp839TC7IGtpbZ3Rh2VQx9FlGKR0cq10Wl46C9PHy5+F5ez\nx+8mPIX0B696wvxzd+ZsSmTOVxS18woKx3qsm3fsjOVqmmfaLspkhpeMTq4V\nP9/WnfhYN9ddSxcY4rlB+/TIuc2dpJzUvC7htjedGtLtRipOHNUwZ6pezqgD\nQwYMDQyO5kW//j5KvIcPnDO2IG190VxN7khgFKfTogfbP/AApTmdQ3zg+COZ\nnRNl3hEJ/kXJ8sQQPtbyxZ8UMDvDw3EGSwysBaoGFxqkKPdTS57TlHFMvn1Z\nWI+B/YG8qUOioOzZDTiQIL7YnzxAnFj5bxXx5R/BhwjEL9GEBngFLc25WLJa\nuOncA4OsOGqlqAbIoyJZr0RLXQITpkpoKbEJ/kBSXiRItAiYtXSF/NLEAXKl\nMpuS\r\n=haXy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"f5cb5b48fb624f6b9bd3afea3e24534f0d94b3eb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.0-pre.2290"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.0-pre.2290_1616532125870_0.3041295173130809","host":"s3://npm-registry-packages"}},"0.13.0":{"name":"piral-ssr-utils","version":"0.13.0","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.0","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"23a6cb5091ddf369fd7d2971ca43a106466dfea7","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.0.tgz","fileCount":40,"integrity":"sha512-WcM0+SyxBaVqSInAmQ585TnIuiqAO/B+Ul9uNX5vLLs6tXgMtMUmRywbNNs3FBDGiMYE21nkrQeWQpQAWqx3JA==","signatures":[{"sig":"MEUCIQC9fpdLiaJ+qAQZaxEgZl/dZSnvK2lRmNG/s6Ba4oPiRgIgGGOQV4sEEZpC5BciO4I2/yTxrlbBht/vbdrL5+tZ0Vo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWxKvCRA9TVsSAnZWagAAl7IP/R8hj/fMG3TTdulKzatP\nJ1ZhNtssxx7UD/wuruUms2ypetBTscBgCFlQz/nE2G+PgtBaOiR3ApmbMjqJ\nhg3DJHXHdDTEJMotqCyiqNZD8YX/YWP8AEKdheJTYWct2TZx5PrR4MBVa1Hy\nd+P96UM4jnr2VJCndQZTNt2qoHXVt7UXJKLXZGLP9e44sLvbK7PSRr/v2vwq\nwxi1SubAVbssV4jRg/9v8n9w/As05KYWXji/y1DufxKHY1G6u9sRv4p20ZYb\n8rbWZaRvbLvxisFk7sR9eA4BlixLLiiXk2hlS3npN3TiE5mrfyuC8+8ibUaZ\nOjHrr30F14eiMtjwoBqGZlFDpWgD7nlSbp877KJ5AvF9CmJmU/BLOgrtqFsm\nAfbVrb+dpc/+mnmKnMrrqeqDWFRzB64cpdIuMRGSaseJL++zzqmWQLGUhBN/\nrPZUkaZGNxcBAT8NoGX7AZ5ANLR/1gFBLqKOEueTjafVOL21zpzr84oJmlLj\nlATYAIcJJYBARi9VSPF7pbIkE98i8s6S47u22d+19KlUCbqMPZZ/Wxi1IhWF\nPadAV1Nj/b3rCyZ4U3ZNnxy1ChlCFEx/h8n9un+zd2CyBBLaYbhE3obflF6T\nq6CgbulgiyeMurMlHkELGWzRuaoF56cgfWP78IZ1HZoKoSSsJklN9MvnSYfg\nntgv\r\n=VhIk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"a3dfb71b2cf1e67755e6a3fed0784c9e8012280c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.0"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.0_1616581295192_0.08113011562159644","host":"s3://npm-registry-packages"}},"0.13.1-pre.2307":{"name":"piral-ssr-utils","version":"0.13.1-pre.2307","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.1-pre.2307","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6b606909f5b90df378505101b2399e387630acd3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.1-pre.2307.tgz","fileCount":40,"integrity":"sha512-cfFxaQf/+P2CAW431Up9R+kmWD6AgOkq6H1g9lTfWzIc9Z1hhcN9PiIgM17xmR4Y9PsDeamRWu+Tt6YSsN5rdw==","signatures":[{"sig":"MEUCIQD3QHQbEsMgGR/XFZXMXbU0Lvd4513IgSGTjim1+T3T+QIgcRm6q3MqgHALXlsL5OcjoK7kXkwGTaDulPkfY2+cENQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXMaQCRA9TVsSAnZWagAA6m0QAI+8DXrYlOS6Uzf15BoR\nzvCZubrPkAGWEZFQ7hVt3DC70x9Uz1zqjgJ3KjzMPTTDBwksMUBlLxNzjzMr\ngsqOQ9CX201NXORTiTDfoJiab/lwAL8fOym2STmPfQTIZBUwaqVSyHccbkZQ\nvaG6yhfXaGs/abTTKPSkcT8QOjQqf2DDjTq98mdxEV4XS73hISVRxdp/pnHl\nC/ZUZtV7zyg4XsjGiHEybl5cuugvRpzHLJOLhlZ5TZrHizDMld389ymVrabc\nHrtxDL+OT5R5zH9i0w/zADM4YMM5kyyjWHxkELneJ7hh3ti3Fl+tNbOoRPK0\ndMibWBmRQKRs+1FbwuvNt3OeaW/9pjB5h4bXiQhQzNRnsmU+fuKkNMQGyGsz\nnCfD7UyN6hq8/jpJH2vXkVoZPI0KO9gL8Gux8xCIQMXyVq6hP2Hz5ydpKl4t\nCqV/cuYjN7LZ0flj2zvXk/Jf1AarjFN7NrTUOfvKF4XnMo472oSb3IaNSOVK\nzqunj0zfv6pjsix0tuVlgcfS8nreEBn3GJbatu+Hkum5tI300D4sONcf5KfJ\nRQ23z83ImFKNkVZ2Xsr/6/IKLDlmwl38DQkinAAWxVn3eX2GZeqNDmIBMH/j\ni3To7MYf5GdoBMAir+093wrbTdWyix9qHPBlXrLPO/NYGEY30EYg4UFcyev4\n5eRe\r\n=HCI6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"58e51a7f4c0acb05117d380aab6788f2eb965580","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.1-pre.2307"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.1-pre.2307_1616692880428_0.5494172279447336","host":"s3://npm-registry-packages"}},"0.13.1-pre.2312":{"name":"piral-ssr-utils","version":"0.13.1-pre.2312","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.1-pre.2312","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f39beaba1ee3a903288edf39d10d8eccf0ba6638","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.1-pre.2312.tgz","fileCount":40,"integrity":"sha512-v06/naqiFsRMxyDNlqL64UQX2WMnvUl5iEpBn30rlEIrG272XQGmfN3wmX+j9p1DaCyxkdPZKvrR60MKXLeNrw==","signatures":[{"sig":"MEUCIQD1ewleytLMKCkbozVPMGSFSIbVDfMa5w+KfTdEBxNxBQIge6Lr9EHOJARxHqqbmDgX6sBVpu1DXXE99yAUalkhbbY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXfImCRA9TVsSAnZWagAAy5gP/36+YCnN1gmw2JUYyaKV\ngc60xfkArZlYuEOfLLOnZn+uLbn0BNYUM5OG4UEuYPjeyUb7JzV0DmGgUQYg\nLg5l/b6+r0Q04gLPcGrcFvNGXOtN4iw88/pMIRiwtnlBFlXmXXSv4mFaRgUq\nSKSjhyIxfeRLQiQYcW6wEfAtd0ENpid5vJmAwTg06hNWhuumUUONY8SJM5pE\n6Q7KJLT7F5coJRWHNBAXYGq+rGWatM8hX2mUwdbQH4+C7Avknm1DN+R6HPiF\nQqWt1y/svZtOLKODNYkJ5CgLmS/xMwbgEjEQc69yXXCsbS9g9+KzgzAzxXaP\nM/yB9PJ004T57UAVS3QCIq05blx6KYm2eWVlkTmoVib0NMEyp7GD+//or2mz\ndBowDih8DYloKebl1QKr7QQr3SYbPGWF/28AvikD4+cCPlAtM2spbxr/7SIt\ne4ocJl+V94lMh13+5r78Tm7sNOiJSp1p8qop67eMIMNAm5yOFIif7HlWYLzd\n+6sFEvgAUghtq6GHZ7dd1CGnil9eu7xbpa8g68ZDm/dBfCtKumUQBxrlWcjY\nVP+QN5ZZxlhBzj6wHVuT0fQmUt47I45abGpCEgoHoU8FUkz3r/5WaqHDXP9/\ndD0GhdxGeKPbSz3Q3MUQbcfVUJSuj/+U8wbkkx/0SZ2XZ17P5kmmIOsYB6Ds\nw0E9\r\n=WNU/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"30828c5195ef70d3e10dbbf23e5569ad2ea1168c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.1-pre.2312"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.1-pre.2312_1616769574080_0.7960627963232525","host":"s3://npm-registry-packages"}},"0.13.1-pre.2323":{"name":"piral-ssr-utils","version":"0.13.1-pre.2323","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.1-pre.2323","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e8b75526e2fc9ac2d6a56f7504d3b82f2dee6b5e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.1-pre.2323.tgz","fileCount":40,"integrity":"sha512-eLGQ5AXLhtTEVYalJJYs3CitzakAh9JExwqVBe1nD8H5VgC61TESEay1Rwp1opP7Mru34bIKrhSVxM6XF8DfJw==","signatures":[{"sig":"MEUCIQD3nIe1qXyKsaWqVcb2odKspKDP4HZSlGdrILsm42EVZAIgX+waa1z5NYFE6dNh5KfIYWIvivMn6Yy27hInLinOTDQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYzMQCRA9TVsSAnZWagAA50gP/24s1UtIHCpKZPsvr2PQ\nAcHg6WE6Q3iGFbSsI702zh7W61YsbExtR57OqfNWfTgUUgHDzlMp20m2VVCZ\nznVN3/DvOURVOXktISAbdngoOR12BzmMXa7iDhhqiPMMWsokyaEKi5eDUc7p\nSrGGE49IGpjycuiWjWS4sI2EwdZ2VkRf1Y+LfRH3kJE8l/FUK7oOggz8wI0c\nphBDgaA6+4ZXCTzftqWr1jsE7ETTKkpaRi/ncwv9ysZIGLCKq3RvKgSyQ9WR\nLL84JQFOt2+lgEq0bDZhAkAXNQ92wskUnAYgGI17oFIW9yW7fhmmxzyrdGBK\nxL6uJ3RntEmsU3cybSIKVlf3VEUKyghJlTkyVoo8CViGGR+qIrOCaPp6auxG\nY8yPuWelxTveKzhyMe+Iv8f23I13vuoTHzH4Fqi/CSPZfeEjWgUpiQdBiK/L\nJCSfGWI7KerFj+IumF7+8uXEmCBzq9RUt890nsg5T/JUt5eUaL+3VkQwL997\n/JIEqyrTICV9PbVFUXJ0nMcwSGB8UUjq7yptu8AsFIjRowjFglX9IazCWdo4\nWJhdgcvg6vmZy84ODZHREfR//X3oWRW7R/VlU54k2WlZ9XljULJrBxL31puf\n+D99CvyyGA0FBNRQctN4yI6e191oQgB+WCAC4PvqDDXUVH1EbSpZg5off30D\nZ0qb\r\n=Ewpi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"9a196b66a29c4fd0ba09fd95382d7340550443cd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.1-pre.2323"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.1-pre.2323_1617113872068_0.09616919723612427","host":"s3://npm-registry-packages"}},"0.13.1-pre.2326":{"name":"piral-ssr-utils","version":"0.13.1-pre.2326","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.1-pre.2326","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1c3b4a6c2ed2e093f449de10c441c55f629e8b4d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.1-pre.2326.tgz","fileCount":40,"integrity":"sha512-1YSoCdfASCpNiAuu1Z1SWovQH3twpfDaFlbPJJD6AvLH6KdWPvN2dwsBe6AK4TL3F9yRJgznpobrpWRaQ1LP3g==","signatures":[{"sig":"MEUCIQCThzrf2ypXHEdNPcXWW+M4qJGtPJ+zcvW7tCbknSsJaAIgHrsz3v5Beq3iP/NGIO4GJ3O42eiDFddsvQ/xtu68gq0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZFaQCRA9TVsSAnZWagAA7S8P/iDqnq9D2sebCFTHBOr1\n8SIhN0s4bHtZ6oZjgad6XTvqmOGiKhVu363H/xmRsIdGMDVdXrUMcTKPTw//\nh3iq9qS3Opea9nGUN8NoSKjcU+EqY+DDThGxspmaVR5Drzub5tQhzqRloHIc\nGSunW6dxwSJKr6d0vQ0m9SJivznAkQpzsG+K84qyA+V5SC1RFWXdqH2mLWMV\nMWUADadEzyFLTL9sVgqN42oMDQ+wKClshEtdbdDu9G8j9XdDsARvjwpPgMQp\niNOB22KnK8MQTNDUYDTpewZHEsrUnjMiidvLQ3J8LIubcODgqqKo8s4rY1lN\nyPSL6QTthPsYPqLPWsKwJEiIWj2FPztdlbzJw1ImiZvBloiR+3JIzjUssR4v\nUAk4wV4ZzgVpfIGt8mdRCcosVIWFpjUZ5AGt9pZwZDrLN8fB3dRfHVikFn26\nEuZFT7vFwVmuvbDsZtxbe4mHsmNs0xUGEjBLtmv/ZgpblA8C4DseuyfaJRls\nmKpqMUfe3Z7FSKlHfGstsSjIo8WAXmuwxqYStZlQA8ZDvipARDq6OHtSubW0\nXSCZ5GlvwnYpJliJKQAKqYaGL6eXlHArCx/7xMrkD6HECGSGmlzpv39s14oM\nGbLlIBOIBK/+5t2UajNmfs4R40v+d2QH9dgO5lMqB3AUbh4Vd6d5k3iUSPm2\nYslH\r\n=PfQD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"ea0e572e5985084152c4ce824ae3102ed1ba6731","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.1-pre.2326"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.1-pre.2326_1617188495807_0.32351513996484327","host":"s3://npm-registry-packages"}},"0.13.1-pre.2329":{"name":"piral-ssr-utils","version":"0.13.1-pre.2329","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.1-pre.2329","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3ae9997e44b9d77604744b25338471dc4a3acaef","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.1-pre.2329.tgz","fileCount":40,"integrity":"sha512-84tGvgbSWbH2UD5PclG7qCQ3JFxurIJMXxRH+9sxE+3I9iNciJg0Fg8pxKzAHdwVR1ji6hexjeMtNsWSNlX/Eg==","signatures":[{"sig":"MEQCICYAdE87ILcxR5RgC7ZEeXAuvCR7v3NdeDmRocvF0sWaAiAbd2sJ7k8Z6h2oylDR7rBM9FcA1xfrD+dls7GXqkeU7g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgc4qiCRA9TVsSAnZWagAAtEYP+wXMbzw9WNdrces1Gyx/\nIrpiY0K24oZZZ2tzTlJTdSifHkEvwzPDJRPLOIz+B+LXNhGKqgEjj2mf40N7\nPGM1aliitxo1BXgHKGsJuAlzx3f489fRRzeDDEBIZu8QQIhDVswIbTvufv6E\ncJZqgkl/xx8Yr6lft1Li6TMY95ZqcpG12Xbjy38UEiiqzH8i8T8hl4F3X2Rb\n15ZxjO7C0xUjn4z0z05et8BilOLTfzwoo+VPWroo8jNnYAOWocf+UqhsKPIt\nrKJH1U6+LZ9W+7o4IKkVgnAYCYp0Vm+kLBgL5EOtZWxSQZxyo1kQ4QULRA3N\nDj3++RmDd0wNKPisTiL7M955C1etrJjZcK79dNfrR0T9RP0eOSmSgWI5rmUT\ngimGKash8xTwkBO7DavyX8IaWtx3E4D8TaVJMfPY2QMHCW3Wt0pOoHGRn4Pc\nF/cWF4wTz+T9RCWEHZrC0zqyKxXHAIO8PAP+qrUI6DWg8BtnCc/w6W1xuYeU\nv8OnCPIGc7LvMSSkyU88OX9Wq9KnZyoSCjKpoGQFj8tca05L9IHLivu2EYf1\neTRDg4E2jmtrKFmaPD+V5N7nApJXuR+/RPiorKFB/3GYNwdkeHkF0X/lW2Mg\nUEDlgarVdrwIQrJKACdaGYtkhOuHpfs7ErQrIT/0RtJeXyo66l0WJCRHSiJc\nydOH\r\n=8TWc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"483fe6bcf7f522fd2d423d4d4aff680cac16cd46","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.1-pre.2329"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.1-pre.2329_1618184866552_0.12708048931338833","host":"s3://npm-registry-packages"}},"0.13.1-pre.2330":{"name":"piral-ssr-utils","version":"0.13.1-pre.2330","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.1-pre.2330","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fc70cef772684cc590aff2bb9763b24e4c033f80","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.1-pre.2330.tgz","fileCount":40,"integrity":"sha512-NZRDozxrKuXognnfB4fMgDu51M9mCWsINMs9smj0fbgda+ClP5HhvEjiZrpbEYkdDQoRlGz+rd30lt8H61LKYg==","signatures":[{"sig":"MEYCIQDQgjUqbC5+wr4sPdW1t7HR/ppaugqY2AJbcdfidGzjaAIhAPBaXRsJhytRll4S2/GAYr09r1ktQJSaV13iKx4+byI/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdEU2CRA9TVsSAnZWagAAF5wP/3utZk1pHEbbEl3uukIa\n2gucMNTT1lEHYM0GrGKGRcLln39N6LRcY7XZujk3/wczHasnKyEpxRokF0fs\ndPw1TcVIQ3S8Ow9U6DfNOLJKSyUnpL0ejjyEqqnp8yF6OadTykPnJ2tCYDk+\noNpfMDOSTs+5GS56grD0QblxiYo8/ip2FmjopNsmMAp7U5hOQD+Kevx/8YUg\nY+JHzxtGkfELki2VhqYW0fVytaWFfTL9LE4V6ssljggl6OMbF/fRljbKvtMd\n0oovXn2eqBeCRN51CrGNeVRXrOclwkuf8qlWEmcTU2OOv+Ga2l65lp9w6owe\nVF9+y4HP7SALvAOGA7m9Q4VQ+FsqKl9iIZEWd5i/+Pzq1DjQ9tgpLgAb65JD\nhlnN6PkKMAqCovZCosRfEjE1kFrC+Mc6HerQ2W9Jb5xq1rb88DQV5OnFKELH\nNfkNYqcI/5q11ZAPoI6B0b6re7wk8QGYcMRC+AkvNQELL31V3G0kyu1gL89S\nTYhi+hoTokIECCMMqhfw84whXTW19obzpNSE7PR3FEYrBKNwOcprh/DdLySn\nBwwwE5YAhjoYRL+iDZIm49WQz+VZXVd+Dvi9MFBc2U2oxs5y5jVcQ68D7HfE\nSyQMA7FG4iw8pLURablKtCMSjbujIy1+IyOsTTTQIV9aXFQnsl0T1c7YKUhn\nbpF6\r\n=O/b1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"89b2928224f69d0cc534f02f3a9d2d8ffb5d9245","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.1-pre.2330"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.1-pre.2330_1618232629756_0.847497897432997","host":"s3://npm-registry-packages"}},"0.13.1-pre.2336":{"name":"piral-ssr-utils","version":"0.13.1-pre.2336","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.1-pre.2336","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1659bbe60b8533f44362d354fa74faeece33c11a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.1-pre.2336.tgz","fileCount":40,"integrity":"sha512-50UwTuyCyLVolv10wRPOPknoUzqkYgOWPpRqIp+Ev5CwUjL2rOYNq/1Jsu2KDr4FMhs1zu6nST6dz3qHmKQPhw==","signatures":[{"sig":"MEYCIQCR5W5rTHPICafyrwZSWRAvKHmhircm/PtwdZkYWeJgmwIhAMAzIM9hST12Y+ztFJmHvukpqvaU+OY+oBgbEKVZMJUp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdbZJCRA9TVsSAnZWagAAg4oQAI2/J2Gj3CAjLD8g3b/V\nnMcTrxDwkjUDXpb3eq1iT9E+wefRSQa2Q3D3nfbapw07roU5RCkF7i9bF5oA\nCuJRhTIHCLJjct9fujFMlgtV5CU+HSgewVA1Ih9CyEDpLp/2Rg+tfQPJ/Til\n2ETwIS+EiQkn4LAQs8laYUy6IFt9gMvixPSzz9Z3Pxm2DFmFY8o39Co4VETP\nsZNwEaBOP+cvNwPnaSfqFpaMfWxWKF/xgE5sieQjIAZgjsz/EGQdGPw2YqmC\npYIazwC/TPfYdsTi0L86wafEg7A/YpcUgwQz8cJx3+QR/71pqfN8PqmqpMfS\nCN5XCkR8ZmIL2NzhU0MYh8AkQX+w6ypPv/92P8NgRqPHDZlSQUfaeKOw4Mp0\n9rv6KXyeYayhsccKvFJpORaDGOkywVw6U+ZtKLUR7kStQXrQvbsm195StJuF\n9arbkPD+fZbaqcCTBmxhWPnwFjFnwugrvJen2KvoGochv2MNCtskcUoQMWrC\nN+S6eoDAO7kT1PsVc6rQRciiVUJN9xHWHu5n1OydHmjl4zxUFhS3pOXXSBoS\nMfMFsX9u7iicneYKw4dZanzL1TZS0l9vewDkpWJXOspLU7UGB/MsxtmSOlf7\nc2/G896cthYM944EhI4NohiDvgG5Q9i31eEAPdI33n5Rhe6CiNdLleDIHb/q\nAeAT\r\n=0qrE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"fedc0f2d9c1cbcb9fb70cb4e356b639fd4983ec1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.1-pre.2336"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.1-pre.2336_1618327112627_0.4305111864986031","host":"s3://npm-registry-packages"}},"0.13.1":{"name":"piral-ssr-utils","version":"0.13.1","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.1","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c6bc54ce0c5565ce3679852a7a44da8923ca8725","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.1.tgz","fileCount":40,"integrity":"sha512-jWfFVYbmvTJllY2PgozzpTvkNgFu0lBVWWkUmKucw6esPNlus/7imxWVn25lYo8u9bz9J/BPLoChR2GoT3MkzQ==","signatures":[{"sig":"MEUCIG89S9CFzBSLFKx8pj8aT28KQaEeWavWOUljjkudCj+rAiEAq6EzBWl3sLZmLomBDMSPDUACsH1A3FySbJG0ZOXy6Vw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdcZkCRA9TVsSAnZWagAAS6wQAJuvTzUqP2HJ0zZZOnvH\ng6ps318k/OfpngQgf5wuosDWxvkipMEHiYr7aaGwn+sYuZbEJaVgA7P05jb7\nsYoO4s3VOgsQu8+BFIwBXR9L3nVk5ME52qz/GPX/Q3EgiL95PsS7vnNPAzWa\nzW+TVJUC628JmaQYifmtIpSnzGFxymqigBAYfmqeQJpNY7xj0hGDDGsSXsLp\nGmRiiNyFCgOlMOXXDfzQ5sIAwvGYi2W+d89FoQogKV1lqvb95scrV1PDM1jj\nCYjYVRe00s23ZWMsqxPaSovasX9dAYsGGJieVtGK+qG/qC/MPdswuWple3PQ\ntV+JYneSLt38vhXLxVlvkjmyN+tCq4BRx0sx1YXJDtTh4NEhyb4Nu7Ir69j5\n6r2sBYBsIqFKXU4k8D+PtEyh4QvGUPn7NE3xpN45ES8I1S8K2tonHh0jq92P\nz60IBneWCj2tlSu25ZHtgFkGcSMfCAoEWjpuQQkzT3MuTi3QEkzf4ub0dgG7\nR+gU0bHPaj7TOODwlz/nYl1W5CdtTail8iyJ36/L4wcoG1rbXrHKxNtagSRD\nSgbeRgkKdL3Y9IKUkKlhjjaaYsXCWi+clLqGsvO1NqaFU3wZcV0jmnlTd+Pt\nNAUx/q6Y19wg/vN2k6igaWcENl5qyX1vVxPNGcOALu3K30cGzGfZPobDnGP5\niQRJ\r\n=WRLV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"15662b1ed58b606a41f5fd59699720acc347ce7e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.1"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.1_1618331235758_0.13699685603435463","host":"s3://npm-registry-packages"}},"0.13.2-pre.2341":{"name":"piral-ssr-utils","version":"0.13.2-pre.2341","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.2-pre.2341","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"eae054b83af57428f5eba2110344c499e0bdd914","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.2-pre.2341.tgz","fileCount":40,"integrity":"sha512-xSNuLwj+9wYG8ym5ZhYA5P3zXbNK4nAaIorJ1z/T5KGq6IdH0b6V4WEzyn/2fpNRxHgx7YIqJ+uWYGhn7nCwQg==","signatures":[{"sig":"MEUCIDalCD2hkeF787A7iq62M5WheuXIVnuOO5LxHbCgNbx3AiEAqCFd9V8jcrvkgyguMhwF8+R++tn9R0JBKeun20xrNWo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdh6KCRA9TVsSAnZWagAAWq8P/1rNaUBRGk2S+TObRXam\nwxrXgdvm+sZIPnqjH4fA6wDiScT77T5LR0DesxCTnfpGL3+Bm0Ru/2dFeR6C\n4AIRa8DNQITZf51VBCyhwQTEg96jevnDwNYl5nqSq0VjIlWeGI/hIoqYgPeA\nCeVvVaXtsVQauqTgwCf0Z29+6aicARCf2iW8T6QP/dAmW3kXVZDeZJHsLM32\nohNjqeLIt6LVF8Rfn6Yo/aBKWozjM8UFVkmfLqFMRhd97xdBWdg+bGNTOkca\naCZKGUW0XhhCQYATkFAPsLWBAk9IoS67ErZqjy4OX9br9par6U1ML+0pBSEt\nN6kWkwEaLvqLADKpJ2VfNMYAiISpWETHfIhR+uFhPqfTaErVV75gP7YqhmVN\nBrqXFeMdjilipJNFH3Xdt3hnuARDAQft8dsjWwVxc79mMqEj08pzv6xoqpF2\nkK2wpT/rCVzpPYf21IsKFER+rhz9FIKSiNsM4qXXSH2pn/XBbNowmKVIgREP\nsnwlpwEOFqxh9GTqy9B/TzI/ZFgh9Rtl6k7YwueJrVDPG44K79oUCQ+6GAAf\nEee35JNwCaiud6/aFKIa0DxPHxluRlTM2UOF+PClUZMFvNIQAvGjbeneVp4l\niOuNIuXLruLl0qa0osSM46kdZX4GMSzkrcZ4ZBoQkQMmEHqlvJ0+pYnpaenq\nTKxF\r\n=DZU5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e049aa0620536d97bb88536f3e3bac233d03ae40","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.2-pre.2341"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.2-pre.2341_1618353802184_0.6443653379597838","host":"s3://npm-registry-packages"}},"0.13.2-pre.2352":{"name":"piral-ssr-utils","version":"0.13.2-pre.2352","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.2-pre.2352","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"37ebed525a53d026e1089d59e2619c9bc07efc03","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.2-pre.2352.tgz","fileCount":40,"integrity":"sha512-hhehdhWuM3FqHMLYX0xaAOFPS+kLvWNhVmKVL0tzaCEoNXrJ28hg4sc13Z3+LpSiqI8jWG4QAixyiGl+12Q5Iw==","signatures":[{"sig":"MEYCIQDABNpFyDTDnj86GfoynbGsZH4QpfVJ1YFutjw24MWcbQIhAIJhk2MK7kF/RWNgXjpqEU3AbO3mi9CEEkFPf5U3uFsI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeF5KCRA9TVsSAnZWagAAq0wP/ivQgI/ZYQxHcO2suyW7\n/6VuA0d7Ada3h3ERIdyxcX/7NGZmJExZU0JcjxR+dQQPi3o1jApUR+exKIkh\nj9bavgq51MnvF7cL07WSHeyPLX1EGWFfcO7JQzaDQYjpU5GpXVYF1rzV20z2\nzHdUAU8H7wtmIZKaGOPdS0qM662+2qAeG39GzU/5h5Y1N+lGR7Qt9E7QJnrj\nLDEfN+9RVvxSGgOQ0LM0eURbgMWWxpMzQ4cGUgYh1gb4TafOJiUjpLPQ8auM\nMtx/9RI5wONEsupkAqPlEZjZ38MIucpCUgHCTy3LWmdkUyPK5p3I5Zw6t1qB\nCvZ6OvqzFWE137A4d1kpUXqEJppKxuQdaBg6b7ywOF+UqiORcKyjy4Vx9xyD\n/9lWftYgIm7qEOjG4TZ9AG3qT5SbWVqJpq2RkdY22Ik5VCwrW8ARFhfb7hYB\nzojc0NgyGw0ASQyeuzyFynF4RWs/mmqeRIMudipuzMuNMInJb/k3es8Uppsl\ny2BBvIyVeVfRpnU9SgJ8qKptnRz6u6AEWLuQeikZqaN0GbJbmBQURJGwhYJc\n7ZANjDhfEQt3Sg+VjbjdzEUWioiniVwSJvjDh+xKQvHCfQMrCmK8lX9nie+C\nH3Xaz5o1gRTCvr+40RpI8Lcc44QNtVGNFs9zB7frAz2QJ+m/QQ4QKbrzme0t\n7p/O\r\n=99M+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"a24affb07e9d190d9a876258e451908b7763d4c0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.2-pre.2352"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.2-pre.2352_1618501193677_0.6304622719371415","host":"s3://npm-registry-packages"}},"0.13.2-pre.2364":{"name":"piral-ssr-utils","version":"0.13.2-pre.2364","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.2-pre.2364","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f7568f31defc924cb13a06f82482d43ecaf9ca29","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.2-pre.2364.tgz","fileCount":40,"integrity":"sha512-TGgWQxBCvcv1yI84KGCtyZzkx9qLEXlmU/NRZEVKi5umf537MTuURJ7QcEPm4BL2LCS+13ufF1oVgEPwJU6g1Q==","signatures":[{"sig":"MEQCIF+OqSCGoqWIGEkhLr1VlvQ+c/Nk82p4NwG4SgKkEQuRAiAb3chI448obLGSww5H4V+7rc0+XaCfr8PXd1V+cWog4Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgefLrCRA9TVsSAnZWagAAa9IP/jgZB2zFsETxxOj2Js47\nEaOsAqhMatm9712bDE8YfjIo14SrSene4xJRK6kKv6mqpDbtqcYY5R6mm35l\nxqdJ2mnCFugyBFMl6AjoU3QWvHqKxo+OgiXrY8Yb0Ffwelvl9+/bs+nbs3i3\nGWpQ9EmQ8e74OwCDsIoFpRdP8aZfRe7uMkfmGk6ypHBg6Zwt7+Ny3AlzbbOO\nAqiWIYm3/40LN+FEqw7l20qBiUS4XT2ZOZ65zbVuZRiyr1TKJQMiJcsEKvs9\nVrkHTm1W052HDhe5RRZOEg2H9FtaewgnjJCqqzMbpSjmNNql+jT6h3PmxZjp\nv2mEpQN4OBcfGdcud+6Tfqxix2Yo9IRwoaW4vkDsCN1+QrN29fMl4OsOuSax\nRWO880Pv298YmtGU27JgTu4pM7DK/3uQv1bRzkqg9+qcaN1W+YybQvRCXBo2\nNtcZ5EewxpJKrsyvNlgXLpUwt/zOtzAtno6AlH/roDT7KvnIcdXN/TAnfKbV\nxW7dR8vdgbjBhKgjirNyJH/hJOU0q60qHtPaGgTha/Hn2R5SfWHzpv/Dx4Yq\nPoZEYJuhcFmQnV5PFQzm0t29WJ82MT0EnOWn6fsXMDLRSVmswzFQ0rHoOge7\n4yMMkwBN7rVzfMKDuPcERFEWRS87yEPUpkaBzUAireyCjXTAiTnc5JnMf0rt\nyvhI\r\n=HaYW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"77ba433aec0e8ced646267d90ffa2bf7a64c4041","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.2-pre.2364"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.2-pre.2364_1618604778724_0.3077468063789357","host":"s3://npm-registry-packages"}},"0.13.2-pre.2383":{"name":"piral-ssr-utils","version":"0.13.2-pre.2383","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.2-pre.2383","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b308c5b5c1f0b9dd5bd8a1bbc4ec35cb997f9563","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.2-pre.2383.tgz","fileCount":40,"integrity":"sha512-pfpTgbHQdXT52YvQBMJA5l6vFUtScbmZQQmk2g+XX9yhLrhT5W/dVImy6Zz7rgYYjVpxAMHvh1DrwcdqDKjadQ==","signatures":[{"sig":"MEQCIBAGKr1HvLeeSgDzRL0eKe5CZzAUEkBXXiNuwGzoGToRAiBFNKqT3Hq8qLrvj57AURng2zGsztfYsDiyg5PQd00LMQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgftV1CRA9TVsSAnZWagAA2aIQAJVE44FndV8N/SIjy+b/\nDhD+BLW5vi0DsiTS/BkmibYyu0pVj/XuyFXaXq4YKT6hrbEOd8jOA4/8CMOZ\njKXHYfcTcPzzOHcgSFdYYgGnbexTEkYQUkOU09B85h6hlKXWv9tzzyqAc9kd\nfkkjithPBkiwP9WwzXfHECVgLqUCDhrQUIBYbIWlaPc1GjhmLBB7wiaIj8oq\ndfcdbHxOI1ZoOBZQutfX+sWd8vO95tY+MJDPHaVvZZTUtNAE5SzO2WhJ3aPC\nSSxFTHginSyFaf9bprspePLQl1nu6WEYZh1TUAMX8BFcRhrMXXRYSw+1Ysu/\nuZWRPLci8yBs0T9668LbgsCk2I29iRT2LtRRgj31ZKNHG11R4MQO3BM9ESwI\nnP7a5mlyWAoy1PiajfsHqeJFs9cwkPXnzJ4nrQAaiOfXKFVO7uOBULbW9/lU\n/YAI4aYftChq2ZTV/DDqwKxWzudsJS66GG/4A7basuyvf3pich/u8UePpJG+\n+UgNg1c48xa+8lecQoJRO3avMDlwROzrb4ofNLVaMfoJagP4dqpmGLOksG0K\nZXTyDthSNRr2OBJU1hGX2Iw2ua5p/OYcSnbXIcXK5Kv28mQKrEsVZ+vgof5d\nyZN7LWKwOi5AC9Lrl5aOmHehWdWqmztKwpWKYAGt3J3Jzsc2L2E4SkGgkxZJ\nYtKJ\r\n=iU7G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"0867b27ba96060520f946a4ac0155e569b64c151","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.2-pre.2383"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.2-pre.2383_1618924916735_0.34287819566708966","host":"s3://npm-registry-packages"}},"0.13.2-pre.2387":{"name":"piral-ssr-utils","version":"0.13.2-pre.2387","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.2-pre.2387","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cb0753b31b97eb9ded517b602551f018602af4dd","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.2-pre.2387.tgz","fileCount":40,"integrity":"sha512-te2VGXG1DcAoe2xc6/2xkh+VAfVt8w6G0v0FBERMO5f0syd1WBkBFSTdJmg/hB91FfyGbiy1kFC93bWpsT5X+Q==","signatures":[{"sig":"MEQCIDRQXr9KflHkx7e5144r9zbnjRgWlFPc3pm5f5+hvT2xAiBsZP08LQS/7EfN7uvxqEDlwiB65f5jdIrwXr0SHWqmCA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggf9CCRA9TVsSAnZWagAAW60P/iRCFKkw9BCCNsB7v0HC\n3S0F67GuAMobhQeK1g19+bgjyxAP1iSJ5Orcwqf/9Jb3QUbV8AWCxM1JE2wm\nQ9dJ3JmhMQutx4n22q50UqbQiNWyL7sYY/X0AJkgMGnPAY6F8ZICvK1wNS6i\nk2nc6v5WRbJfXFVGLZp+bs+QZSjLWGglRyDb+tm+85JWN0GCvyJ3PI6hAlb4\nutJ3e3RkWLAYhKg+wSgDxZx0d9nIe1TeTBn2Eme+sNCqM2n5+l0+53bAAnvg\nSA62KuM6R+tpLZCPi0OOHh/bx1/9h/mWzr6+wyjoD50chW4I+tE2XBCoumeV\n38EwAlLN4MT8InlK5bt0rU+EhTETBvd4PbUKZi9JImcDmnHfDiXQiBlgw6Mn\n+5sCUfkcf2xA/FIz4yj/4IJxzo2WlR7aibr/orrfBtIWqIgvf6D06/vjYE8m\n19xncWpsE4/PeGfin4uU+H4peKpgH/Ps5+d9ZQKRbVlRHt/LavB6ncTWPvsC\nXKdeovb39t2uXrns11KxMxOJDUIRAVntICtlDr/SKEfJUFTr1K2qV1cokcwX\n3OIWKgSFc8YyvTKX2T9Z2o/87LHmQarwGhlBHbDK0VyKl/0BziIsBYJZNDj0\nB24hryv4SGTSPbD9Bn6YQKZP4+sECG7ww9Z6F1x2rAWmQobCJxi1aB5uHWn2\n6RSv\r\n=ZcXX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"4647051168368325b28f995586bf49659b86efa3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.2-pre.2387"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.2-pre.2387_1619132225026_0.9769637839887155","host":"s3://npm-registry-packages"}},"0.13.2":{"name":"piral-ssr-utils","version":"0.13.2","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.2","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ec1a35b1aac51b183a5757dce2ae82689d7fe5e6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.2.tgz","fileCount":40,"integrity":"sha512-6vGyyek7ufeFGjPzfOliQPrXNvJNj+p3Gn5ahSKgBNsFxVzt//8ifpppjfvMMC0euXWDvB/FuEqpz6C/Xq5K5g==","signatures":[{"sig":"MEUCIQDDuQcNm7r73gu1319M3jO2DpSx8SfDciUiguRaL1wrugIgdZbaKkEZ0kS5ger3PLw3UevRrzMjcBKvnNs4+9VJUzg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiDluCRA9TVsSAnZWagAAw8UP/A44qR12X4aS3dsSAh2O\nwPNMs2/0KV/FSJ+ceD9loaDT/B633au88h9T9kvJCCXDuX8bUVOHpsVa8EZM\nAhjMneYiOmwfgMRWVA+7DATbQQB/IndD1ijEmv4hbaW7fV1zgEBLcCuWiCaa\n69JbPHnfZ55qPfzk0FXbWJe3+7w18wXEaQOIqr2i6wAyFyfAvNYr9ySQwQZQ\nSwI3QzcFiiEpVhoa03p4Cfngg6+qnvqkK1ld0q6MndoPN/M7NXCmxlcrXBPe\nYDym5DU3mw2Xyw138PNsy9uZJLc7Q1q/qVrKWB2cGbztsT3XZcSToKeaNiGE\njxeW9jdPtzSiaUVcJRqZ4HLKni6e016FZtcDLqjOqs+QfVP9VYQnpEcdIWb4\nCxrXQGUCVF5i0370t0X2Qrq6LSikWU1TlEzKTronph+FCpQdGUMU7LibxpjA\nu005I8kbxLm5vwjXO9X/A8Y4+vtv2nnYSrlTH5N47OstxR57rd1jeuWJlYxe\n9DF9jz/aBTrMn1Z+Iwy8bdb7MQxrJdwm1LvwCUBr760O4zCffkqfzz5mL/HF\npmiXsvlqfxq5CQSxo/iZ1q0z+bBGXffn0jyrrcSGop72/8fcz4A4zhNH35pj\n02yoQD82iGEQhzrRrdjSsHXwVFORYagiamTJi9Oy7qyW8mFNQTciNXlE3w0l\n7hR9\r\n=6Y4S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"4326e3f73451063ee3b531c4372a59c72e73b1bb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.2"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.2_1619540334196_0.2754691202353261","host":"s3://npm-registry-packages"}},"0.13.3-pre.2417":{"name":"piral-ssr-utils","version":"0.13.3-pre.2417","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2417","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1dd85ed7305f668ebe5b6e2213fbdf2b310f96d7","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2417.tgz","fileCount":40,"integrity":"sha512-HMtkYjL+QchsFSVkdGOiXwacEwhJ+b9/7i7L6TVUEm4KQrG4pWz+zrhtQDVp+3JOcuYxPMRS4L1/97LPfrKTVQ==","signatures":[{"sig":"MEYCIQCCcvK3WrloVus72QY82CRmVxO5SHyFHe5Elbtkm3tSowIhAOizG6Pdf203rUwTPFu4RwWdz+i3dwBa/RamxpQIBcQF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkRWpCRA9TVsSAnZWagAA0r8P+weGE41Grl5ESznLGZzm\nKISizhDiJshsC+AKFd7kgXNOWBqoKd29cHerKGhvGX+2Ivb+L4H4XL3rYCzn\nKM9JpFlWuTBmRfuHyrgPMCYwkKBn2GGLSyBy2tjHh8CYNAaAffIJ5DyiAG7V\nQTcCWVcqG1ibUYznq1RiRqmsKyJDQrmvK5FUnG0gO0QghihDECyIl+YiFz+P\n9DNGfx9cZX/cVo2m8wygTZXzfbMsmpSVCfE1QdWtfwpj56ItbZL4h8aR36du\nfBca89Jvq1hVkZp5461bztQ2AkXf+vxLmiv5UjBasmZWgY613M54qBay0Ano\n/YP7PmfMxpCAP31apx9PWjHttsVT5nlzMbR+9WG+t8BG+6V1pXep1lidGXQK\n8nMVtDUdvudlwp+7y6c9MNiZ+D7fxJekLACXSsfO5XBIo5NAdbYZNq8bPEYl\n/i/7JRXIt85cCshgxk5KTtxmtHBkY7WuKfMhPS/4cb4eHAD7UQf4XYKK07ZE\n9Eh7PWfr9UWgZcSyIY7zwRvIcPtay3MwBh0ARgXZ3Qy/6xYXyAm1DG3g9oHb\nvWTd/WfCFp4Id5C/KURBX/IOv9JJtTr7EVWVdFWI7CzXWV7JkbmEWyDgfGII\nTe2BAohpuYtYFOgOMLcytN3Jq1tjQtmAN80PYk+7JpIXepDCQ35FOPG7IWlo\nl2zz\r\n=0048\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"17fb2d8b6b9ce724a71636cc1521af928a3ba279","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2417"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2417_1620121000757_0.7106269037892026","host":"s3://npm-registry-packages"}},"0.13.3-pre.2419":{"name":"piral-ssr-utils","version":"0.13.3-pre.2419","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2419","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a82fe64e8eb881ad93fb865662e8bdf4f2aa0a46","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2419.tgz","fileCount":40,"integrity":"sha512-2U7JFMoFIday5gonSofh+xiSwZmi9abinJkMZdd11vWiuaTk5gJmY7Tlrk13nLKQiJiBBnfZfH+RfA/eAZXvGg==","signatures":[{"sig":"MEQCIAaOz968vAam6iULQsT/OfKefrtFMbjrDxVhx1PN6/huAiATUZ+cRw2xf24ORt7I/SLPyc7RsdUpN96uvAKWZNHkSw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkSoDCRA9TVsSAnZWagAArKsP/0VQzZNVkRXwCG8k8HS2\nDfE3CFN0HtDPZ8WxWCbYfarYmeg59E2e3V+fXOwbrDF1rde4JGxklcoFi9/U\nG1bQTpq7jou1LMkGcMKzmWCSPDhn7RvBs7lYA90mFOL0AdlXyPKWLofczgLI\n/qWStrmJECiY/dlkj7dM9N2uXqC59xJ1w17bLr/SmxhTB5+ZY19HSjFKIi4p\nhzMpXrOwS7DNghVhbUinskR7sgRIhVHEHDF7ob/3aEYUIYdNTSlEz+FoGyNP\n0BeTTNc5L5gIshMkWO9h2f0qL4FMh4jCnguh0hnHxuj/o35knfZZons7OcTJ\nypRitBOWZ/nyGlRdhdXXs1rxBhvuCpaLQmR58ZsSe81PwIs361Xv5Y6Dr0bd\nMlq7hI+/hP3EbRLbWMXL+HTF57G/F4CNMvhQR6m3KXUJ2Vq0o2Sh9JN8HJWU\na/v2Q4IVT7XFgAxwhTn//P3BLUfvD98cuTcL1YAwsQXyFZViqN1MTrrWtsw5\n2X0Hhre4twaaV15FL3rBOILArFhzmRo89mtoYBxqTg+s03Ux3ITFZ2uu+G+f\nEyGmCh5Juwv+gNrveqjLatSCw0ZnCWiVedYIO6U4Fi8jfTX5srdSxCAX6n17\nRb8vVjeU9nilkGu7PMNmHPqVOBQupzzKsBXEgdjYcLiYTt3MW0eGMFA0tSxP\nXoex\r\n=clR2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"8aac729bb51da8426a373d5e22f2e857860ba7bb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2419"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2419_1620126211387_0.8148841044767803","host":"s3://npm-registry-packages"}},"0.13.3-pre.2433":{"name":"piral-ssr-utils","version":"0.13.3-pre.2433","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2433","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cc79d1ce038efa8ed4b2bffa7b6d42809a295b3b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2433.tgz","fileCount":40,"integrity":"sha512-NN0Lhe5Sed3lo4Y9KYtiqWNdgObxLv2GxY8mqREtBRkZeSNe1hLRaW1fZzVC6gxNiANx4Ej0q1MQakkFQZ8nQg==","signatures":[{"sig":"MEUCIQDTYnHDyB3BSOXH7c/qa2esp2jMzwoaxXLd6g19ZruFZgIgS1uUDkpYYHRs3jK+5zE+VAn7iEfCl63WmFm9uVSuumY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkxHuCRA9TVsSAnZWagAAqqkP/0KIjfE6r25V8qtGP3Wm\ndWTow1OiHvfQ6VvXTJJ+AKfhbB+xAKynyy4k3QwY/66IwUzxgltiwjabgomm\nvVMoea322/OL4vZCu8Ae3/8WOttt74HqHQsj0cSNpDBhPwKb0RoNzIITO2zk\nR7PNNtvRjBx9yNoEz/oy/N1C+2idBgVybqUuL34JfjHLa5qFysZTerd/4o1b\nbSKVY/tObEeDYZIE/fv2VsGRZToeWJezrIQyA7bLRZ7k6ZozbLJ1sn6kutQK\na+hVJY9+CazDu2SNnWqa5vLW9H8UcO+IPK6SvJV2lE3+zBi3DYm+HEqeCTxy\n6wVL0f3dcZQx4BCbDyZ6gZKc76MF4fLV9Az6jK2en5Gs2rO6p4gpXVssjSmD\naxMD6b2pkozs1j7cYD7siM/f1Yb1j18htT2aQADHwIlQWXrW0zD0eSZu/+A3\n7WkzOKjDUcQnWSAwHTjHC+3AkTzBaZe9mlTd4H918ajJuqPhB7SbIR6QC2ao\nNCPawLoOGWwZ7yuIV3A4nzbCpMFtnjB3JpeU/3nnm9tlPgIvvOzIZMc9pbkG\ne+zwVTwAp0GR2bcuAATsSy1BuqB/9W32M9bQ+wy93G48lbjJybRj7cgY5NQx\nXrlCcD2SUxT2KcO2KUrUp4h3zkLSlvldeiG/eCszpOgMAGJbY1ZCzHXlRppp\n9DGg\r\n=7yPq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"9007f25b9a69f1752c700b6d57d0757631ecc2e6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2433"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2433_1620251117879_0.40448686315233706","host":"s3://npm-registry-packages"}},"0.13.3-pre.2435":{"name":"piral-ssr-utils","version":"0.13.3-pre.2435","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2435","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"183368e879779cd632011c0d0bcf856ac7643b4f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2435.tgz","fileCount":40,"integrity":"sha512-oxeF/OGHnzan7WE6jA6f9PpiWSUOHcUzOSQX5pwGxi3iVUVwxoFNLl4Bhffo7CLGCGMxIeDhzlOmg856WlbzbA==","signatures":[{"sig":"MEUCIQDfROmnYWGpsOVZ/LMvkf7nE44PU2I2NsWJ/6WLvmf1/wIgHWxaJ+/3NJi8cCZnA46Ef47FP+7dYFQ0PhNl9KcXiG0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglFcNCRA9TVsSAnZWagAAK1QP+gNB1LVaiOL0DF7fiVc5\nZQiF2/AQOPqwIWHhm329sJBRLHUea9LkM+xCvi6cHf/I3HIuezP8sTmMY0Pd\n8IzNynLmC9JGx5GU2se5aIo73M1tp3Vj3mJ7oYF8PBPVOoEDJzX6Axk5dRDZ\nKCFbsBKbIupIyY1PMeXTt7rPH4/L4MG8oRkqTcKwYhI4ZRXQQHPGPS1lMZ0T\n/GabyJZsEtEHJw7YaOqZu9X2mTsaTHdHhHcP5cHupcr5PwrXveWgE/nt0n0d\npDYDhSgsUVwu1i8SpvmgtYFZ8lNrPb9gZ+ToSA/NB4N/jpbeI0Jm0V4QWX1k\nMTGk5RVmWdS7EpnhuGt8N4lrjvG/twZiaDroTE2F+kZ38PQsPQr/lm//ojEo\nqS/p0mHc2x/YyrrrjcEGBTo7lt9TROv/RnqKfgEAs1VwDKZ7k2diID1DRLFM\nRPvPg++tfDOrFcgIoJ55/FMVBKPiYfB6nogF7PJ9lgTUcqUcahmfset6EfON\n4dKiyM/Ks+jg6WpzBFToXrcELqTJMIfE0baYdbKWdO6vV8f1ouWuBNEcP236\no+y9E1nSzZhww0uDvXHOAldE3lwd723a6eS7z37WmZSPWTMUdbl2cQT4tumR\ntvHjmQgC08i4+AA8XuKffZNwzrf/LCsfy7JraFcxU0CwIJeUiv4X6xghXxSj\nTxNl\r\n=n1Pv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"ee01fc6061cc9c99b2c4a8814a98a2e8151902df","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2435"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2435_1620334348805_0.8308851026997084","host":"s3://npm-registry-packages"}},"0.13.3-pre.2437":{"name":"piral-ssr-utils","version":"0.13.3-pre.2437","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2437","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e202ad4dbb6ed648bdb1a21a6f27fb74aa0921c2","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2437.tgz","fileCount":40,"integrity":"sha512-DNpHifovvYFVY7B9nDdWJU5jRL0tKlsy78r1X8Dxv1dwVmvpZAJRxHmvxo77s0SrBVcAOUwProYaG29rDvGoRw==","signatures":[{"sig":"MEQCIEwrpg/h/vmtiBW9EwmYhb4R1LQwnoeyNHS9gWSEGeSYAiBeeBGH6pbYIf93t9DiZOGymfeBVbY/W4MUKMyQxgHyrA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglzThCRA9TVsSAnZWagAAgfoQAKJN2laalY8VVvMdxnAC\naKHAxJ1fxUG4TrtdhyDjt4lLJx7ktq4W1gEPllzGJvcaKAjDGJnyPPYa89DU\nI3U1NSCltS2dHmU/G0/Nqs024Vfen43dkzd4aI8pKKvOTy3KiVhkgf+5p9Lc\nYzMxkaNMXHPh6Ulye8qholdXnKM5jmiaCZXsT5VQvNSxO6nellFnwwwXH9FD\nTWAg93lrW8YYoqkOO7N5RuwOpc6Dec/sN0gLZGUJt57+Gpn3NTBmWQFGMNDp\nkQzaFgLsbmHMc4Qqa9tMcSzWQZmqDUowEAZMVB+JyRVcpbftUjLLSI9pnUxC\nDHkmJ8/vJW8srYfw0psF+96KJzn9rauJPG9+lMQILd2Y244Bu0pt0Ju3so81\ny/KqKk8mYiPsXo2OUSFgzEdtQ0pq31n5TjDgaZCU0M0rXJHwe4bTfyKDixQZ\n54nnj3vLadimH7N8TJU7KgSpJ5w8cjsocOcrsTxK0qkqXO8KfMwe107J1oNc\nBGcF/gzTIVKO7moqPynecaP1aNp8IR4POcJhMpmWzBLHE/sDeR9AsO48whaA\nucbv62XUqf/Fj/V2pfFrnXzprUI5yySpXXS/psV5sAmK7AzCdPeOFtb+3SOJ\n9n6Aaqs1VHi4HkVc9PDlL3i4x4774Z9p4hFRF/E4eGs+PdmqaFSs4cED1naC\nT2oj\r\n=5nUf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"c66114d2d94ef4b00c2aa7c79c43444efdd9b953","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2437"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2437_1620522208884_0.9828429472336955","host":"s3://npm-registry-packages"}},"0.13.3-pre.2442":{"name":"piral-ssr-utils","version":"0.13.3-pre.2442","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2442","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9c52752074345b9cd3508e24c4715de3a9e62238","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2442.tgz","fileCount":40,"integrity":"sha512-6DsokWi7CuC+AwaM2t08Z7BY3jKpkZcC6n2nzT+aZ7EtXdQAxEUgdNVdFIv/kUVudUUlTM1KCzqPY9l2wBF4Ng==","signatures":[{"sig":"MEYCIQCXqVLzHPh+eeqoIJH/2efd8/lrKUXt3bLvQwC2NTy1nQIhAPhcc/x2z1gfLMzy2oSqN/vSTysdoIoRTErkM8yUhFHq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmEbwCRA9TVsSAnZWagAAX9EP/0DFjr9fn+axz7UKg2WZ\nKsnFWEckMMVy0HKG0aIZAZAewQjFpj+O+v4V6qiXHUG5Uu75WAikVMgvWpWV\nXSc4cilP+QJsVwKWw3xK69FN46C24gvIIp6TTEBOoMmZbVnzOLFBG3sFUdEy\n93oKRAb7E5y0XRSVGq/uhXrFaFY6/754koCcyNrceLcj4EGIQBHphZ+sD1EB\nOVdqrBYo6NwT//LvkmQzdFOQ1qpTSp/c2BOxqdGNXxymWrOnEnaH0SAJRLfd\n5IVBHU7LNByqvRx6xXQuY82YqwqV+SE3mAcc/9pRqrLcRgSsfX9OhZxtupA2\n3oNmQO0pTiWb2Ou/o5QDU2YUFaRfgdb8aXqx9ugvrzr8fNY/IY0KUVg3J57g\nYd/WUwP0gr0tyB/TOE1165FxQcYcWWgs798FrcP0RTHDDAxY4QufZ8c5Iexg\n7ruB8PFp1x/dlFJlAglsGwD3dTOX926ZgCT/Rd6BBnEkBu1qfMgLEqojxRX/\nAqqNpC+Qjqjksa7zpBn8Sik1pDpFdyuzbIFt5WnnlD3b+llUn7HqZoaBdcme\nLQXcCw5NVbvqyFKVsr54m4Gt4gHsnFR8z2g+svoujoMQRnnnp4e9bheaqpsd\neRug/3GOlSEjHei/I+GzNeumPvZ02cnbcf5ic+vlKgVlx949XS4eAhE41kif\nHwBW\r\n=UMLo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"aefa42440135d97abd710055953dd7f1f1f97cb1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2442"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2442_1620592367628_0.08035388244968256","host":"s3://npm-registry-packages"}},"0.13.3-pre.2460":{"name":"piral-ssr-utils","version":"0.13.3-pre.2460","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2460","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1b3b6a9e97b75e3a33b590c59bdb8d5992441b9e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2460.tgz","fileCount":40,"integrity":"sha512-4dH7TPtnEYsIyGzPO0q4ihK7DJbCHhPpaSAkBk52z6BGPf/DHHxMdA8SSGM9IpcJYzLDJEYuVzG44isCjjY2Fg==","signatures":[{"sig":"MEUCIE3u48u7PkF6B+F/s5Wr3K/Bbc9S89RVwuwG1yVT0cs9AiEA2sllA1YO3ryGGQL4eALN/uQJn1MRNPcAaziEoz0YFWg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpRSJCRA9TVsSAnZWagAAREAP/0Ohx0mn13bDEgMCUw4B\nm7fSmarR2liGxguulI7K0OTND06PJa7TzNZxoSieXuT57QD4/8IIAEP5yHCq\nWKzSBqeCQcgi66o/7BhMxx29r60ChtSMbIKMaJCtNLROYyM3B8gr97X25HID\nJllt7oK6xixO+7OPg8duNHHNTZpZfmW7u8HwaFk61XDCpzQpEUzboP25YpLS\nWo0CRHDc78w8jABGvLj+7eaADxGTSY3SiCbCV05pXZat9CV2wZAr0ekLy68/\n0PdaH4enEpj4brmWpy8PumWRFp6lERhfGSiMel05WDRbAr0lost5Cwmonmeu\n5itZk7x02pa89HxDFEsnDBnLakcSndj3KU9IYXWhsj0/OX+hMsm6XeaQlfJ6\nmofoqWUqfVd1BT6N6/7isJ2GwvmCB7aT+r5pHjzpAP37o54WUG7dMFa4yiXu\nMF1VXX63q+XwFoIA/s37PvBOAm1r/in7NZU5RhHl4em10FT2kBxAmwVRWbeG\ny90951yJ5czgNkY/g2WWHxQ7J5owzxzCNx7ESY0cePCqmE483fq8l9MtKS8R\nzRjmhZdP5l1vfl2DJ0x1L0JEvh4SHAKc/VCkoU2806K8MxDoT+As8RPnnSxi\nYWojwIxxAHl9+0VfKNM0UkrsMpGM7tbwIwYY4bfJ9r/5U6TmVDqr5g5usqnt\nhFlF\r\n=hvkd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"11094c1d3de1aa4a7b07f4a7df9148efe825ffa4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2460"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2460_1621431433343_0.4227201603586359","host":"s3://npm-registry-packages"}},"0.13.3-pre.2477":{"name":"piral-ssr-utils","version":"0.13.3-pre.2477","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2477","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b76ebaa37081dac8dbf928c5c575c635513986a5","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2477.tgz","fileCount":40,"integrity":"sha512-a4P5NAm/Xb6ahf3gjcdFO4xxtCHDFKZpnNnhcWpwd+KxVcmD7XVmsMo/HvKi1Fo1C3xbQSbxPUYZj+MMtw+Ngg==","signatures":[{"sig":"MEQCIHuibnhFqVZ3HWQ6urnbeRsqyAbOAgw3dPwhBvs8ZtfRAiBlr/qcIGcy5jlZGUVNbtejze1OPEsS4cs6NY2bmS1cJQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrQ4ACRA9TVsSAnZWagAAUZsP/igq727vhRDVjfoyjTCe\ny8Fq+Dq8kTKR1FRaoU+GihvlU3rjtJ++ZjEaTNbTVKvIyqFVdA4O3Gt3+aAX\n8c1cLSjaFHac1pycwHS/EShXahjwSu3sXO5YRAATO+/yl8TKFd5q5r1t7wxr\ntF9ffrJl6A1zSsy8TYR8ITI2iZjKhGaIG5aIRFrowmd0mhBEEKioFJ6gvzIL\nEfHRcfEuf9BZz0+YSrpJdfOiSXde6f9bfkpzggnvVKgMkFo+VhhJOtI56m0f\ngZHsN3MSJH3ltlzkfzZK2sNB8iarctlO3s/hGTkm/bZl9hLF1FVITrgQw1z5\nYo+Q+t1I6cJQ3y95t7eTJ3/rXLX+ktjL2/g/+5SGRE18R6DGOxzuloPAkLo0\nmX2Go8Cb7fz367mfgGtlQogjU1c1wNWdSlcLnXQkzfX2PXXmkBtKEckr06Hp\nX+4a9hmrigEd92+h6Jcz5I+8OOBnhQ6azgWCq+es7wy2XBotM7t4ELOlnvBw\noOwoknNuXmU8dBMqjssNKYoG9IgzsgjNVmg5Z9EiXXSsoTo+n1DOd0vKCtA2\nhJ9fBlFowRd9SdL9Z26A4JFSDtd4QjD+3twODty03O9K5h/mKbQ5cBMPWDtB\nHyk2YvOYfboBD7f6TBLE1xnJhfGJlu48gZ45wgdn5IHr1606fIuZ1R/cvZRH\nfJbP\r\n=fTsA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"ef4f9c312742856e05815d1eef00504e9071d1e2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2477"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2477_1621954048206_0.01040027678453015","host":"s3://npm-registry-packages"}},"0.13.3-pre.2480":{"name":"piral-ssr-utils","version":"0.13.3-pre.2480","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2480","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cf4277f4762f3e3da32c661340e4aab138539c7c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2480.tgz","fileCount":40,"integrity":"sha512-S5c7En5CXslR/ZSE68qLbZnOS6zA+6NcPArxeRSJGS2ClU7/wwsjoM8awB8u9MRyI7fH6R4u9D+b7FSScKlEMA==","signatures":[{"sig":"MEYCIQCiTookpOHogUX808X4KYklcQexIiZ1hLbkaKe0cVbClQIhAIV+AaAvoWcN9YYZjv/GeDM8QJE5kc4kSjJiXytJ6b3+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsJxlCRA9TVsSAnZWagAAAmEP/RyEvhe4JbFFuXBTCPuu\nDQ1K0UZSywYjrr1/44IeELgut9uRFgCyDf4rhjstUT2EO5rgx68bY+Hf4HFy\nY4ToaebhtU0tHrrsRcv5LDoMsA26pgJCoNXss4AY9Yt+1y1itwIXIxfaQeLv\n3PDUtTdX/Nm+y5kiRTl4KWOQr7rKMXYhQtDcwYJtprE15MuCfZXEVCcvTDn1\nH8gUgcVGb6efV7IxS79Ay2htzoKvaE1rRJRzkLcyDygt7J8YWek2g9/rCkeK\nLVaCv4jthn9lAxMr3ZXzdHgNXraZgurkYD4ZAf0SyXQPiTyMW7NOMQDjTGNH\ndZRD+N3nA2wsUW0MoXUOhmjlGy3UB0TfgszfMLADdnRPnbzf/flbSh7yOBF1\nk/8kbYO9D53YgeQqAY4CPZ2i2ERaG1tAxaID1FmAedH7pWYOuD8nYuX6AULn\n8DHdeoCRCF7KYLKLi2Zy3eGMRMbUBxHkuCBxUT0IFHI/5XuO183WBNG0bp2L\nt4sdWF+fCJaXCCtBuWB1/y+5tqyh06bu1rVAZzSgbILjGkU08YsmXRYtRRIX\nRj/14YAIApa02L2SlYIymHVsyhSw1GeQcRcsSziBx74VXeDlldBSVXeQgtmn\nwqXATlTc1lg/MsoQfiL56wbjmdJji0BaynEGqSnO/+Phjh3WdsvJHF7jxf6O\nsLFr\r\n=Xm3e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"28679daf515684133859cf6f7c54d4bca57cbb13","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2480"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2480_1622187109561_0.7612215505024071","host":"s3://npm-registry-packages"}},"0.13.3-pre.2585":{"name":"piral-ssr-utils","version":"0.13.3-pre.2585","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2585","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b00a07c727ba8bbe36affd5bd86e4e6ccaa0a632","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2585.tgz","fileCount":40,"integrity":"sha512-5CjVSQJjQB6IPVTQoMu8bYytVO/7yanTxmbuEc1hOD/PJVAkTun6AESiJksDQ8bidb0kToB+JSY8Q6E5AJ6vBw==","signatures":[{"sig":"MEYCIQDa7PsHBtd1wRkEFlXWoWKDbM4FFjttU0UITgpFGtqzgAIhALfVlfhGVyl+oV/qdz0XeytbgoEf3LjsnaeP3Xl0pYX2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyMilCRA9TVsSAnZWagAA6p4P/R3LuYXB3t/A0a9UcW+4\nN09jB5lJXJKyJ6/k0MocDMCRfXaUjeQRfYxqSr/5voMz4S8EbF+RQM9sagH5\nZnxBiZhO/BB8OfYI5PQMETmr2bcP4SzNVRdZQ3ypj5MMdcLkJRS5Zg5lHufR\n4DelwSr9096u9u5/V2GvkC59kxcOFwJpDpbcbLRS6L4giO3vXiRd+GsjAvxX\nCu1faPO92RAN5vmbC+yQx0gLryyewei+ocHSN8MV9ReeD5NaGbUpNBwriYNL\nj2u85joX0Wz9U2CIVDZLRLrx2+jvDdrR8fl2MZ8YlFgz2r2aczBV3cy/fvK4\nQtOM9TSP7pVwEml5/WrCjC4KE6pvL6vSd2kB48iyVbzJ0eTejooFsxB4WX2O\n+TUFAdgNi8GDro9EmjUABRMVLF11qruUEiJDIOtxNbfTPz7Nl3g0BwxJVKCy\nYVFEM8n34YyF1ColNVkONCDMdcvpa+UeE6cpd1vH2f5wKhFZkaQhyCC8Q3kc\n91x9WQ8XtuXFIw1fbkIuqLX8B1JX/u1GcqRSv3FhMpqdZYxlJOmkaHh/yWUU\ndmBQko6nfcEoqLux9SrX92OmNiznaPaLs7t6Jy8cuo8AbcL0kf9S+5Uw6uHR\nvONJIqSmlCoDKZ2/c71ZSu+PQOu2ypKZMoxIiuKCERhr+clPLyFjBAvSgeGN\n7I7N\r\n=/dsH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e19514643b1fd5873705dcef55dbbc65642d2a03","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2585"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2585_1623771301500_0.4348782472737114","host":"s3://npm-registry-packages"}},"0.13.3-pre.2783":{"name":"piral-ssr-utils","version":"0.13.3-pre.2783","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2783","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fbb76b26002ce21a5aa64d0f86fd4b7392147c30","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2783.tgz","fileCount":40,"integrity":"sha512-iw8cXBqS9DuOAjC7XVWG/+P0aB+OXwqaf2wmOddsEGPzXN93dkJy0+CHni0vXugjwo3zCmdEoq9afU9pOuqySA==","signatures":[{"sig":"MEQCIDgZPHe/b3JWJuGHuieMPOog+/Elhrk50R2ehIgIi4qVAiA3gENa8XDJbs5hzFDI4BwwD+i7f2tYPtdRjsq2J7wNVQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2JTwCRA9TVsSAnZWagAAcf4P/0np1yRPAxI0sbneRFKj\nGedgqtHtaB03L/ffb0AF/UrgMyjfBhmM6MupdAxdh/ra96rPQTE96OfmKI8B\nEV3bl2L3arLbeD6ftfWxRoTgGV/oADTOZt05rayS3rQ2N2amZ2kNvRzOyfuR\nvz2nWd4RMFx15j9KZSDKGpRpjlpu0qf8+QmaSSL1aQ4/9WADLQGc+e0JTcpV\n1mn9wSc5TzvUYFmY+lE8CUnYctU7PwhsXLvPY+rFLJxZe9HPadoWq8iTUwm4\nXp6jKQYzVZh/kr7LbwhdwZQ3yzqNE8mD0SDnM1NNGsEYl3OhvyywXAa0p9A2\nKdbibvSsNz0sZVfYvzCSHQhVYabXfieRTdgfWnVR/b+ORB5FHlDBkeW6+RtL\nDxW+hrCljjHdK3RF+iTPpzBrn2S12B4VJfgDMEyyEdq2bA2hCfuRit/inLy1\ngsDP3S8m9JczuAQ2USGni5aaGCTg7yZETRTYhWlRC6tAmCjaONZxvpcFYdGN\nPvwT0vz9aCttktDJFalDaSSkz7RGcMbQ0sK/xAAyJ3i7N51VgRySbIasrDcl\nHBzKr7UZBwNnaIGmWl77sJvw2aMK0J1dT7bNpviFNvlCI1LVbuocSu+ig7JT\nuDBeApB8HADmISRZiXCf0eZjii+xpIx7oCYO3haFEz0QiUmnsEZ5cjBTH5h3\naM3m\r\n=amHe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"d5d27630af09caa06ec633f00be17b8ac98bdbf5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2783"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2783_1624806639648_0.5617421809426093","host":"s3://npm-registry-packages"}},"0.13.3-pre.2928":{"name":"piral-ssr-utils","version":"0.13.3-pre.2928","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2928","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"257fe6cc198515b24ed9f02a448f15d4be67a5c6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2928.tgz","fileCount":40,"integrity":"sha512-nWZJrRvf4lMWCL6+1OrEJSIQ7vsXoYnhCXvEWVeesIwY0lGI4nyYMol2XiARJxCzpGaW3dpcqH/rg5RGvR4tRw==","signatures":[{"sig":"MEQCICFI749q1X2575w4MnxO18f8iuQXLu//Ll/YJeOHbOw3AiB5aPzwYzSPch3CswudMcysmtL+OwN/iLVMrjJGzCDpEA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9hLpCRA9TVsSAnZWagAANNcP/i8kKpearniSMGS+p6kx\n9VbfD9b4PC+u5VTkcMSu8/ol/fSS0kezWyq1rq8Udqa7IX5yGzR4amtYzz/8\neN5W96Ke9R7yABthuw6Pe8qxhpRStOMw4xBbWpw/flmdfUbnN26jHBY4sftH\n5CzBd0cj5lVVX/u6XTbwIJC4j9r+7nJ/NQZdu/2SL1CPgjIDKo0tePOaPlbk\nTKsaBVJ68/Y7qWPmluYb6ex5M997fBrQ0XiE1rM9KiC+U1rvVWiEKJznn7XK\n6MjSQnK936wmhYNTkaGjcjA1qmw5hxqNX9m3jfZLni1+wsVldLeZOEg92UYO\nxn//BFpMZTry7Xx0t7gJwpYLc0mPRhJ/Nxxb+qHP/Hq9HG7i+VXOwG0LgJ3o\nMeq8jCGou6gZBPsZ8l1xAJYHQQK0x87T7ZTQ+yrMoFbKD8LJQ8ceYWQUS2GH\nESnytVaHH0rLpo8IWToGNgTJ5wJLyknkDhkBlgXrq9PkxoV7k71gdaS6v1pk\nyMCoMBteqz2+gaTJsV/H5nIXaThq/j4UvDFpy/pnzwj2nlppueVkRiysHiGi\nsTetrGJ0e7yxC/bny1ONvpSRxA06sz3MCqGBAxYZRwr8hxCOyN/2SAYsZjED\nLClwuhseQN+m8Bbm8hSQaPkATth6Rps/c/ic78xpHr50Ghbyxy5NNgjNC1YO\nRMA8\r\n=IIrU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"6b0e2084d9abd9ff80e319aa1119adf4c3adbac0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2928"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2928_1626739433662_0.2291841409694002","host":"s3://npm-registry-packages"}},"0.13.3-pre.2931":{"name":"piral-ssr-utils","version":"0.13.3-pre.2931","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2931","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"236747212d331424cbc73f7b07db0db069ed239b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2931.tgz","fileCount":40,"integrity":"sha512-DzjjGdq9UWwE+mhndwSNPw54RmLfeXdqeH/r7SJrMqkCHoiRLscONXlivR3tR3+C8+bLap1q0iks0VAsUi5fOQ==","signatures":[{"sig":"MEYCIQD30IbtiH0kAiAU5Gg3qdqx3oP88VmGzlFAvrzmRRrxTAIhANOI5v74fHD+BHbJBWjR4p7jEQ2n8LXXnAMc7JO+BWbY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9+jRCRA9TVsSAnZWagAAtUcP/Rrsr73uIWDqTzWAwxrW\nf2o8r60XVttFx1qUibAqcihxxbVpd+JZ9lX0R09rthRSTwEnsRM/24Je3KwP\nwYnnmoWEhZBRyI4yj3QSqj5dMVCnOkVXUrl6Vqh07xsJWPnbqn0D/yhU4yaR\n/vIF+8YaYqItg2oj5o/wzDCxWSlhgsLbhF9Pg4WYt4Muw7m0PGI2kE8/IRay\no6lTysARbWgDXv1pSvm30lqA2H4f4AxfSsD2xYuHcV8LxXpuzonG42UZeybh\ntniMHb6w/pkNveED83BfpXHMSAC4Gai5yZYRlDSEWqx/eOL9rqe3vxLl6gts\nrVTMkPsYmXH8fhqjDPwmDYpUwvKWCTal/EOuqYaEIBIch9tkDvtxrHY8sZrl\nMGLaNyE7K5D2fE0xuBPiXKjp09FBz2vL9887UFE6c5/CYULGWq1Qn2ePFwS5\nGuqgZz6XVLDEEzdjsyiXV1UN7pk1FIwogrBmbiNKXTrdROmFHNiN04lERLDT\ngVy/vC658X8CMMRwiGUrI9kydR6dogjTiGxJ0cVvZxb/gHDMf2PVyQK6qtXV\n2AVgIWK/HLkPgVulYAIn+q8I0xOnAYOS9HXjZR+gM0qbAjO1j6UoSBYH3sgj\nfnbf5Gsq9RunvHCKHMd1R/T7UzZuqfpjBYkcuIxWfvPDA961SNHkC3x6U0cq\nQbrL\r\n=6Ad+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"2c33e1b5cef25c3e3a3c75434b41d78053f86976","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2931"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2931_1626859729079_0.6698642361855791","host":"s3://npm-registry-packages"}},"0.13.3-pre.2936":{"name":"piral-ssr-utils","version":"0.13.3-pre.2936","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2936","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9ca96a6b1b320c787072cfed788beacc79154061","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2936.tgz","fileCount":40,"integrity":"sha512-KeAqh60xcgBumbP/trOI7jGjzi2+tbwgDvSXWVAcfO6Iiecou8dIFXzN+Ved7TVIwdwPO0FjsR5iJjnzwvOgPQ==","signatures":[{"sig":"MEYCIQDOps3ZJoPfG06WJouYqwZ5dPa+1yZ46DBVcvQ/KU/A9AIhAOcmSwxXoLM0i+h1+IMqzOt2XNU6CqI0PYV9ZPREdgDS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/sHACRA9TVsSAnZWagAA4GQP/RxqsJSAtbqweTyMWwTs\nfclgWYigze3RSdKQSGii8GZnntPT8L33JpNqARMnbo2RNOCE4sy6h9V5Q2WV\nsFuP7isSDVZsDg7ELjWxe+PBIAV6QPtWFticUme3wbDADEp/AidswQtyM+Uh\nb+ERBGe05IVrfUXUCUnWU60GDi0wo9Lc9f/l8YVocGih1RGv53LO12bTZOw1\nArbSDoSIi1n0AKz4ZS0VH0LiFnlqz1F++4dxXdxQfLi0E5kNoEHpmnAcfygn\nDaYDE7k63V8F7ilgzQNcrEOa+WiQglKrtxfhIE4MJc3WVJKvC7zQgR9GH4BO\nXC+ZRQQKI4OXk6Df6J1StDm7lrJj3YMApcYiVAZcO3jJ1ViDmge7eGDiY7Xk\nCw/eczmR2M57PPixFyVMhPn7/pU+yR93Udl0mB051zeG/lbN+le+ON9A61Yk\nAPUJVtQs6VKFpdzG/y9L/uM054qp0Bljj5K00q+3lpUKfaM6hi+HeIg1Krf8\nu3+jeadP5GHQRwjnG+eHFwsmcS8XHhbo1VSdq5thg6VwOuvmm44b70eB5BiS\nwlwTlzFMVKXJNbq1EjBX2u1UEEVE380F1Oe6cEeKjpPPOMGCHjv0pA2Y9Pet\n2aYxcRlsNBz1Hf1mahvODvB1ZtePXAwDBaY7HFtoA5dxLTYDn4WVnhiRzweb\nvjX+\r\n=21yL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"bc49c375ba6b43e8e945707cdabc90f0b8d69ec9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2936"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2936_1627308480511_0.6700881962972274","host":"s3://npm-registry-packages"}},"0.13.3-pre.2937":{"name":"piral-ssr-utils","version":"0.13.3-pre.2937","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2937","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f5873619220774fc94131d0545cdc1f0be947e4d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2937.tgz","fileCount":40,"integrity":"sha512-b2IXhuhTYnSb3qkP6HfljONREiA9dXQZRTt/ISrRv0zWOkkXPD1Q++/+AsS2y2Td7KcaEA5dXdlcyaz5Y72ufQ==","signatures":[{"sig":"MEYCIQDQs28YxzuthgxGcJ8i+WNLb+7CmYaX+3wdKyR/iychcgIhAJxTt/OHufoNnv2rpuMyXy6hp5/0+cuj2f1SNIbUZmf/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAU+nCRA9TVsSAnZWagAAImQP/2BOoTUKT0Rm1pKJxa/t\n6ZSsCa9gt7Wvre8W9XX8debpmAsq4IJ0K/ZG264X3tZpCR6eh8uGK6WGgBNh\nUwNOFn4lGflKKMQVy+UWWNwBidC2yA+R93DbQSP7gYClvB9i1KrGRfo4Bwt4\n65bC0GXD2Ps3pFR2omDOZaftej2Z6DleC6SrUUaIM5xzv5wjUVwcXwdxJo3P\nkaTunjEbZlk0WZrfldCLiQnS0NawtBNWe3dB5XRtzHkHQGHA3PkrEZUs5qqr\nSwASJbxGOqqtyrspmfUorBxZr4Nv6XzYsL8g5QvHZJAW2bL21JjUT7ooswnW\n/csgoyLWi1bfCrlQnTqkyA1986v+Yv78ZAWUWjl5swWa8rqW9s3MkZP+0xHy\n6USUJFSBXHFDNXJrqjThBGtGYhFzx5KBn4CtGar7w8Q5H1iXqZx4/bGGGu+K\nkdQFVHbqYQQUFbVVceFMXFHU4JBu/hxvlKyRwz+DrtmjqyNNYTMskCp7ERpY\nyeztOxfHuJ2qUONVDObliBhRAt2mOfH2BI90MdkAps/cXIxp4SlVmtz9EZiQ\nWiM3nvetqB+dTRG8e7t/D3Ch3cmLNRY7A1rK+ZXdrvb+VVXq/K3wIiC9QLgX\na8CPdeZjFoM7/ezl0iy+DBwX+PaXD6KHPwFl/R5jEOGHxke9AX0rIbfKjoHC\n2xLH\r\n=mhJL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"625e6727a49d66ec5eb33dba0a7829f1f3d318d3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2937"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2937_1627475879263_0.1487172524273106","host":"s3://npm-registry-packages"}},"0.13.3-pre.2940":{"name":"piral-ssr-utils","version":"0.13.3-pre.2940","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3-pre.2940","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cc09ca976ebe8b2fab323a25f98af5b214739046","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3-pre.2940.tgz","fileCount":40,"integrity":"sha512-4DPP9VZNbeukNVbsXRnGsPmVhPtYbGXlPbiwQnY5sYYrd8ZphSkRJATvvLHQcvnEco6AFDf/TQ+Ezq6BHNhEhA==","signatures":[{"sig":"MEUCIQDgw9eq+u3JbRHO5eVyBiRYB13t1gw/sbBlmXcFR83b8wIgJu+zt8WinjRAE2o4as2ZnKFe5cf8A/sfXFhb2482ntk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAcpbCRA9TVsSAnZWagAAOLMP+gIpWtsjl31K130e2lrG\nIL2mFMEvuR3BjR9koEzfWMNxgDl+HpfPU2A0nCm9RCpQBdHdrmxyPrk0/WeJ\nb75Doh5e28Tmj7icLcvKCXzVtwVke1cqkGkRXOfFaegAZ9u6oDstYTwglX2g\nQ76S69fauxvzDbGKhUMGcVswJT6suSTDi5xi0eK/yfzZ5DDihoPXsVtmhyta\nDSPri+p5vu6P9106OBS7V8ytwSycSfHICWJDIDiOKDc6Z+oXmPibpmiuOAkt\nndRI1LApzEOLGoINWXahS7/1KBKm3g7JKZO55CpyWfcFmjRJ6FHwBvf81mwf\n7VX0gOXgZ4ZhufOJZyvv8sB5wi0+hKgJrA3ohiYBMz85Hc43IvfENYIxv9hw\nkUsxyiH+qnyXoY/MWZ0QCm27o87f5XDnU2FrvEqLJU3yHeoXwQQq7ebD45jq\nqfoGVS5J0l8p1IbueONZgHBAkeZwOtFcGfeV3E2s5oJjooNkgz+qbabSvkzv\nq26srYZfrlV549wwyHXhpK+0psNNOuWLwFvWT/Tex8Xl37Y8X7zdNdiWI6bp\nn18T5/i7zRuXKFxiGCCUANTMHobZ26xIDEYdHrtyem9uLObldvJuGGOEllRj\nwRgpGVAKta5OAmc3x4/xOXLnBjFT5Kx53y5/78DAtPjShVfsQG9g/2j5zjXl\ncC/R\r\n=DrUK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"9b949fd35ced6311b8c671dea19c099854df30f4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2940"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3-pre.2940_1627507291433_0.9902438390645789","host":"s3://npm-registry-packages"}},"0.13.3":{"name":"piral-ssr-utils","version":"0.13.3","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.3","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0f21107c9f3a50040b8ce74ec175f28ae55bf9f9","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.3.tgz","fileCount":40,"integrity":"sha512-WGhl8olU9t3l3gvvNBC5rkaWMZSPOK9InhkgMaTc/6GhHVh66gGg07EbpFIqSFCAxI652r48cbT8hohoGr4J2A==","signatures":[{"sig":"MEUCIG/gZ4m9mQy+xbb/zpBYl5rUb/byCVg+5x6cHu3Ib+CSAiEA5BwSw1HO/NOpfvCrse5MZN6G13FAjhfmPthtj0uKj2o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAdUsCRA9TVsSAnZWagAAd3YP/AuKG3oACBXuenARRZNE\nTv4HbyUc2kcdXUKgXL18+P1kW3EuBdWUAv6E4Y5FKtNzbegEifugYVgv6Rf4\nm3BOU/SNP50Cr0x6z8nzwNy5fGMC4m1Jl2Plbb5en4h7db4+gND1Q/ftIFl6\nVpUvxEm1QJ66dCYmSeX/LyCRBPrE91FYIO7tJGd6TtcaJkr3gL2n23jajLci\nt8Fh8VtfIcC8Tz2iHXXlUemFRl376aBsHyKf42Pj8mXsgNoUQ8BmVI2ABo+f\nL/iLftHJEGtPdKT8pTDGpy4DUEH8k0COv8jYCX3HLx5zflLq9Ru6LkwY2aGK\nER5vOSS+KfUoHInb1H10vu1qL/4LRozM7Kjb1+2WJNsDY9OAbFqbydOxeJN/\nbhMnIX67ChNFTPrSTMjHgiQxgxmHovSOnfg9rqbwuwEmlpKGF71Lb+jRECsT\nHTvnhC15C9nvn82o3+OcxQcIJl/fbgbpAC13vEuv7nHdlj3kVyJhEkeo16yk\nlVtwsQOEV0Y8ZIDvzflAoLDsQDHgSvHvseVo3k4po8IgtrVK/MZovxf3mMLC\n3ebRhbhTk3ItkflDCXDO/+2qrjCXKCilT7oogwi3dXNV1RevxaCEZ6lJc/1K\ndwVP0IOqq8dYPG4gTJik/toFu823LrigYHIBg2aKy+1WQtDIcZJa718t8Vi3\npWS1\r\n=36qO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"3328ba36e4c1c743547222bebb60b196725c87b3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.3"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.3_1627510060363_0.32752499960024073","host":"s3://npm-registry-packages"}},"0.13.4":{"name":"piral-ssr-utils","version":"0.13.4","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.4","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8762bbbf6bfd2e275aa5b3430b6dd5ba2672970c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.4.tgz","fileCount":40,"integrity":"sha512-YAKpOqkp/jb7c2gCo5hG5CvUZigbFvYLvTrBAyJi3CK8KpkAyH4GVHVxEfjG//YbfenF4rRkwCQqr8yDw/LHsw==","signatures":[{"sig":"MEUCIHblfrmFG0RF4Jrm0r/m6JcNksDVl0kTop9Frd3mwpNlAiEApwNpFbSBDLkt1pWHnGTR1oPEJ0lpJPWjzA4QdyGtf8Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCF97CRA9TVsSAnZWagAAmkkP/j5GuinLxSwbtA5bFOre\n9xbUeCiXfAp+4xmrmo1G/ougk3TqPoK5onk6BztmbtB6zvu3H81FN0NbMCvr\ngKoV0Dv+mkhf3WlmYckeEEfapGBIuuZPhrjHMYfOV/EPbRQdzB9lAolHrS05\nV1veu/rTca+JE/VQdQDaV32S8Ea5n0W1LeW8uxA9eYcVxlea3jVZf4PfyNix\ndu4KY8zGb9TSdmfGLkSGBzLlQsGQc+T5r0uy+L5mfBV9DuQbgu0903nzTdtj\nFOZ4mi04HEjz9LqkzTSr6Cr0q7GUAuagU6wsHulW4Lv8MLpDhd8E9qZxw/nt\n7EBTXTRKldDOYdcSpdelxmi52jlD91myGUCxwYJ0sdNU/BdqDXFt232HvWtT\nQ7J4m7BukgO7Jiv29H8L3WsI6Pf/TvEYfS2guRobkaThq5B//eoLauLUhSzv\nrxgCtbicP7Wyb20lIvS3EQmOppgTpqnmPPUmj1BDjz6vhVlc3nCBY5QTkk1k\nQ83nQWixU0bPkM6MRp+bGA3v6NveXMc9BeQGy6pNu4z1XrsmExnskE1J3gCk\nLfyV+TqmLWqzyHwuqnEW11nukjNKzEzsQ2pCvLFerwXzYWwnsPWAhug2PkmL\nK8derUKGRnzWfiMUJACaaIKnbZOxyQyoxgaSX5rUUONhg/HHSb5NplX9VdPk\nHf4x\r\n=XAY1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"f87a79fcf792eb8fa196f71d2e7a64840bedd167","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.4"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.4_1627938683377_0.26910759776008675","host":"s3://npm-registry-packages"}},"0.14.0-pre.2954":{"name":"piral-ssr-utils","version":"0.14.0-pre.2954","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-pre.2954","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b486d8326199132b0b891920a1ed1492eb434f5a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-pre.2954.tgz","fileCount":40,"integrity":"sha512-GLYnWmwS/0f0T0ltdRcdiuoN+a8/2mFOijZ4NfB9YQ2kyrprkh0BgtHyAMp4WHzrmxTU0rTPHtW01kaBc8t3YQ==","signatures":[{"sig":"MEQCIEuBisUDopqad9oZLIdWWFLHsnSp+IeNgI4c1Xix6S7rAiAIAdcvGsZLuf6Z0Uo7tIyRizrcxXVfCzTHoTZ0oGn1WQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCHuYCRA9TVsSAnZWagAALHoP/ipSg4frSY8idDaaA6sz\nXHLMjD2TcbfytbX6wmUOVn090dbx1kKZ6jcZadf6RnfagwR5ulNV6d4Ym/qD\n5nRb17LVVV8DMoLongPRz4EStl4v87+jlDHEUxCLmevMtGByyXBRap0kRCYy\nBcWikACMmgcfcLB56K5u0lF4MqHBycuQEuDqMFTP7BimnVYhfxqTEh9cAb25\nbEjDcS6EXNSS5DxTfnhP200ljM4y4cw+yraqHFmoaHTy+FvRuJqGhqjedbAl\nsCEtUrCT2vMK2Jg0QNmsws8yGFNUWzzx5Vb7aXMUHD5atE3eYcS4+RLxPv1f\nwGZ57zOUvaOkwPlVBovzXAR1EyUXGLzR0iIS+iOQobGCk/cZ1MM9Gk5B7Jvj\nut8VxxhvvkNSPJ47FBscyywmzLqWT+jFQ4sPVIIyXOTQaiU9VxGukmrPKJz3\nFzf838Eu2N5JlhoWu/W51ZNox5NQpOqP2VgPy/7kxuhgFNrdlv272NYO3OAB\ntZQyJgakXzM9K1xVXM2Ve88YG1l81Sb0p/nG0MIkdYpWn9oa9lUuCWTx8Ktu\neSmOx4mbrRpHysbUtur2caJs9J7ZtrUGO/iW+1o2pN7nn9pwWxTGWIrT6nIA\nrmr6ujyI164xKm2JZxiGtVOM/JEwKA1rfvT6H/7XXHMfMBQ09VhZ9TLELAPz\nlUlI\r\n=4eU4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"9e39637326afcce48ae3910eb46852b2e9341183","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-pre.2954"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-pre.2954_1627945880790_0.5950562766710099","host":"s3://npm-registry-packages"}},"0.13.5":{"name":"piral-ssr-utils","version":"0.13.5","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.5","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7f0a3999909e5b1604b7da7e767bed57deab2582","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.5.tgz","fileCount":40,"integrity":"sha512-z6mN2yQ/ldqXI+36i3lu3UOzbhGIRHOMEVsm7zu65aqtJRbkyUAE/CAF3Y+/WhlJ+WBMRlmzr+eHynXQcn7Z6g==","signatures":[{"sig":"MEUCICpprj8ZaxHieLgXZclSvRC3tzm2JbmJZr73rN/TsI90AiEA+pLAxRFKu/VdopQ7J9Uk+JPMoHMH5s7xuucSKE2uqaE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHCxMCRA9TVsSAnZWagAAVx4P/2eiNOTpGD2XOQmTJ/Dm\nkgBu/XH0R/PHD2Dp5L61iLUNOYZUs/IvlbBwR8ZMDqxklXWWDjEXUiCDTdBc\nf066OZ3v75OHDl2JBsqa8Qx+/fXSFnurgJKER8RfysPDpscbxVLuIPotR/7H\nqHn+i8ElpOmR+maJcd2eMF9wgiQEsvvdATr5PqZJcrxTXFHeNoTS9ikoqMRv\nTngPQaV7CHc7ZJqnIQ2UYwAHIcAf2ah+QAy8eWl4hWNCpe5SCCgXN8Ub1oBm\nSkei1/HAKsIuzTdTl/YGgFWS+88uRF2PQDfwXGpwi+Hw0vTYJQ0UWobhN8f7\n3R7kgMpUvhosNz3oFynKv6+t6aByerIIgL1Xvq3xEhD+8Q9NDoYVOSPEDV9H\nIrr/jBiLJVa5lgeP7I0RzLFjVtJmT5/yDsZKsjGs+ZYUaugRU7b6Ynq0mof8\nha79ZNziVFkBOYJdu8+r/3CZroFoML84tzgfw6f0q+y8NBOyr+PAa43byEBd\nQKFOioGFF4s2pYc+4Bzwhq6EVtefdKFXflvGHHjSfdSF6YI0BVuVWu9wGoPC\nPrpZab5e9UJAux14UXZAAIa3ydXbcNybGwaEm9Nn4cASxpojyigEKyAK7IM5\nuT1zlN+/pEP3zICE3hTV0C5wKroh1Ufx4MoUwhxzQevu3U5cKVIbC9UsUo+d\nIP2O\r\n=WmLn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"79c0410ffbaa50756b71db8adff639b55c98af1d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.5"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.5_1629236300671_0.8921689299207667","host":"s3://npm-registry-packages"}},"0.13.6":{"name":"piral-ssr-utils","version":"0.13.6","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.6","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"830e580d8955691c1a9c97ee80c517d2e6691a85","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.6.tgz","fileCount":40,"integrity":"sha512-Mx+gLZyNwkU2bnMKbiDqMnYDjuF4mTLuCkxSWGXi7TrHcVfF1bfHCxIvy5Hb135n7tO298QFL9dPNfDLzu664A==","signatures":[{"sig":"MEYCIQCZf/BQKMeV2/H9OsWLFJLhOzVkvFAQGFNwjkzx3kxmZwIhANVPperGUqbfBfnieKR/IOUk/WEm76/VuAtti5cK0av3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKMAWCRA9TVsSAnZWagAA/5EP/jvev6K9lBr2vN3q+3gx\nWC8NAIS9OflWEBBEOPQLUXvsGXr5n+R6ezdw3ZVSBCOAMYz47D7hzoxVepMb\nzkWla3agStudvS6qvD519XEg8U31ijXwEiMvk3LcbnSGNlwBxQoYriuoP9Vy\nKHaoxiNAMpaS7AmYEMvgP2y7RShqpLSRiGlIIO3Vnm5lxdFhrBBZX4UGVXxJ\n8750PqGI0f+e3YegUFIsS360LIvg85Ly+fVd+cddbbsxYUgqVCIZ2NziIAOj\nu6aiSeU6b2HAKpLQT2fRS+PBgqLvpawk3/G73J1yxBkrFNg7OsHrQw3YoA3X\nmxhWeyT0HkC9jCDJ+anCmH8/NBna0wb9V9RZgiJdcC30L+gA22kI3A3HDhDi\nptjIuSBiW6H4tUmoczRdOS9J6vLDkEdEaquDh+jgZ9BCewBh086hWcjJGqwb\ns5+4cN/qGB5Qz6YyqPfslk91DKkyCSLX26qzRm+7S0+V7zzVwFzJR2kCz4lH\nswbuFGLVtb/ZTuLzZudARTBXYZR7rXL5F8+knqLC0sBPKmIiibTR3/VzGE32\nu7706PVOqLLLQFyC7vsjxuapfHxJkYYpfhjL+4k08zZCSZK5ilB9Wyg/0BNq\nlzRlGGXHVjrbXsua4TrPiIEzsycnnMwgx1MHnQgSrzJU0k+9BZTzNhI417z0\nJxvV\r\n=3Q8r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"11c066bb86dcf097171236030d5aa1431588f537","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.6"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.6_1630060566599_0.24692406779932408","host":"s3://npm-registry-packages"}},"0.14.0-pre.2983":{"name":"piral-ssr-utils","version":"0.14.0-pre.2983","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-pre.2983","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f02a3bf630297c3b269eddd3e55dec90bbf41c9e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-pre.2983.tgz","fileCount":40,"integrity":"sha512-TpO5jAxrKdvLqAJd8PiwKz5kwLGijIJAr1LToi1O8DuHJCbIIpnEZims4AJ49+emQOsaLSltmfbHwvrbPI+M9A==","signatures":[{"sig":"MEYCIQDTmQJUE77nzIW73EcIUmnSdoHoY0NWIG6PHeUGJbcA3QIhALrVLPjTStrszAp2Se+6pevNOMZJHFq0iD7DtZRgoJOy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKOsrCRA9TVsSAnZWagAAQ3wQAIoBH300wyPP2lmEdHXi\nPoGcZaup43MXfaMXo08JNdCMIpezKXxmITmc+AMoB3KpPYHA8g9F+tKpWRpd\nk+OV4TPzvEhHWd3MT2SE2oKGKV4wD2BB+ztqttKyLQsKgQfhlA/V52SBANYL\nDoGd4862qT04hfJv9ySuSR9evbgwOGNXjtgqwNVJUlZTbYa5iLFLD6jtciPp\nQlCQuZkRnccDoAVD5GuE0K26HxvUq99BirM5hZ0y8YF7+j/jK9OpyhdOgZDq\n0CHrw+b21Xrkj1OdHc0rOay90CDAmSiQG2toYbuliGFlGd3J1HStY7qsyowy\nGTpe/ZIFR0RM++umj+7dSVm8fCsVmf48bcEW6G2OaXCLTCMr9Q5EGqczbvH/\ns5OnlojJ480C5gpEd/1cLvVVhM3H0b6PL/OaD5eUVXtF/Z5NzKgd4hgnZ/A9\nmzruLbnJv2O6hcgXLD6uHLo7xipquBQ2K54DSeW9+OSUkVMb4qMkyVjHkBH9\nvkJqs7GsKReZ7oXe/MWVchURE6UzptXHHbXOEglnHXAp0Qptnb9nXbJJhxwV\nphku4CWOPGlPHYXCJuZM5RREFJ0jFqyliIU2XQd31fJT23O0ZDCkmDVXzFd4\nif1kFWSEnaWzALUUtwADvDVmfL+dhIcYbGQkaYOEpuBE4qhCfywpkbq7kO/1\nrCRB\r\n=KiOr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"92c2eb96ec61929ef9430fcaf65ea35aa726b676","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-pre.2983"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-pre.2983_1630071595037_0.4921506210135713","host":"s3://npm-registry-packages"}},"0.13.7":{"name":"piral-ssr-utils","version":"0.13.7","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.7","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2a3a86cd57ae7d084a913b2e05b40220b04df474","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.7.tgz","fileCount":40,"integrity":"sha512-52Wvrw1e7oKJpZmHoFkCs5F2eipm+QWMvGDom2matLklnK1xg+2WUpuG161r7ZwOHyyxtBluRg6VcGRxCiVEYw==","signatures":[{"sig":"MEUCIQCJmS+JT3roYHJZ7mcruygYvkXdOaKmhJsZ73dWOWdjIwIgYERXfBK06Ni2kv7QQwvesN7a0gel7LxzLVduLrAjEck=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhL2jrCRA9TVsSAnZWagAAPlYP+wW1DzQ/nY8qNCg06u75\nBtenqANHq5TsjRWwm2R0pN5ylIgeQz2Wklo/SUTGshHlgcueS3OmHMWWkFvE\nxzFumsCVY6WYi/oRE/HWw5Uh0zjZTiTn/wqHgYX5wI8M3PeZqRHdaqkk0/Zt\nj+t0cGuYtI1IvdObt9v4CbdeoJ4Dntqn8WFOn2hdv3C9UfAmDtImdfo7uj1o\nYxvi5xJN7ss3DG7ONgUL8CXksuD3JW65+JGafrt8Yg8Few6LeXQELeO1LF0V\nAz0brLUt13UIxwF2QfhUJ8ZmDedNUxbIJgdQXeRbDymxEOtH0RtwU4oUvVKk\n0gE7h+KiC3JeM4tqPtDxa7Na5HC327DuYGWHeAFnx06z6rTMQH2L3J7d59bn\n2OOnqc788j258GwDvrhF8crl95Bhw7BZkL1SLFUBOxJaFlnIZpsJCgY3ki/W\nhOfl3FMemfncE/7dAqCz5VSNHFXjCchp+U6GxOvedtI1fyW/bt5q5iBeVKDB\nQLXq3E5/ln6Y1CwDSS68edlHJizFv+YSGMI+c3X9B2EW3zWPdZw1GNYvmilH\ncmij3+SWe29PY3dJwDMD6UGi1neWP8JsGAt3tyj6UQUP9ul0kkYTvybngidw\naJuNODk006YmXAZl4Wq0Uyrji839K47oRIQjAzo9I/E5stu6K9jzeynejDzt\naEud\r\n=jeCv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"201de6c1cddaacb1e5f9646bdd17dc43acf09e8e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.7"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.7_1630497003839_0.8794956580696085","host":"s3://npm-registry-packages"}},"0.13.8":{"name":"piral-ssr-utils","version":"0.13.8","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.8","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2fbb4ac775ffd16a006158c3724dbf14bc14392d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.8.tgz","fileCount":40,"integrity":"sha512-e5QbqITh0yBM0n4rNtfKmHDGvVlyAGogYX8w0BN+5eFn8tH2L0FHA9RVrN1CFFVSAjLbrhAC04fRft+KLDgnqw==","signatures":[{"sig":"MEUCIFovXo+ECgSJ61iNGnb3ihmGRuuX3BCpACK+zFOBrXC1AiEA+3sUplZ+OpzHdkDpY/1EmUhenAoa24JjNDyfHPYuF20=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhO0ZOCRA9TVsSAnZWagAAaXsQAJNYnaRCC4njldDP+QPw\nsHxYDew+R7aT6OL/8TryiC2fHDvndiFBut7sdbG2QFAoBBQaNG8Tz2kRucoa\nMwtrVMmIUnquuSh/RbEBxKCAGSiRSsQIhVCLz/0JQIGgJdU6acvU04Ammtq+\nCjhDluHvas61nc1u1BdWot0KxQzdYxMYd0ZSV7ypXWrmjYH8MI5pu+xAX0v3\ny9K4NKskg5cueAnBVVMr7DtdizviN6rVjLBtJXeqVpMlyl8tP+qn4yppfB5/\n7qLXLEHhEbmyBID/fgH+eAfSh4Vlhnr5zqfbwTeBagAgjU2k7PTU3PSW9VMX\n+Z4ux0TyEdn0Zzsjpn16o/Qg40SprpaIUOJe8xH/3e9WovVhrgpmGPbO889o\n68OyM4P2KkkkGxRZk4O2VXia7uIBXG3WGmVgTWdtq7rhkrMFtzQaw1Klumf0\nKuVBXX7LBLxzQZ/iPMHAUQrV8fkifzumy3t0WVK4SHNFitrXVzv9Qhtkoct2\nzDa6/YIog8jhwEIm7p2wIKCi0kdWWRYPxEsLhHRf0mqJdjez5K47OYm1vr6b\ni/tCP4mEX1sFzR+dAG9kXn4feNHDqW1HGNK+wtby9a1b7/uoU0SiZ69WbzOE\nx/nN7ojCaNueegkztCKGiFLOGSNB7YVtH5nLkG7QeOiTjMZc5OzATHZRJW1e\nWCpP\r\n=ZyM3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"26a9a75314886ad9d81ff9d17b5d05296af3d04f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.8"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.8_1631274574081_0.34250989243401464","host":"s3://npm-registry-packages"}},"0.14.0-unstable.3062":{"name":"piral-ssr-utils","version":"0.14.0-unstable.3062","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-unstable.3062","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"037f65dde6c80f1e32e06fe16b9541f7fba683bd","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-unstable.3062.tgz","fileCount":40,"integrity":"sha512-Oih+ExFTuDwv8dIqfBBtUpYzx0xEezv7LDH6yyuW3zEYndCSE/VHx4z2a2tMh97RsA0DPE1hcMRcG5T/VZ8H+g==","signatures":[{"sig":"MEYCIQDs8zBrtITLTLWVo9QK3o2VuR2djy3QGizBo+jlzUcEKQIhAOam3Yfq+ZoyEOPsx6XMMba9X4EJqw8qRCxt/H3tVkO9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41858,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQaayCRA9TVsSAnZWagAAWmUP/iQYY/urm+qPq5LEQnKL\nI0unipNCAXDIu2OZJ+uIjvZtocSAth9u/XWoqTO9fLgUXgJ6JrI6pru3mO/0\naZT0qBDTwTQ5neU7fj3ShSDws/RWugwRjZAcZlnBZKsoa57h3apoGXWJEdd/\ngmM8JBwf/z+a7O1a+ffij5qCu7mOZKF6VIpmSWKKs6nbRo8QGvCcDtV5fKQT\nI+qlwZlVy6T8AynZmbiQl90uAdE8Nn2JL83GbipyqhdbhTsJeAzF4lPzfoZa\nJTUlWcO5ju8OQUzCzCt/cs32Zk1KEp61AgmJA1AYJHiZ32FPRRPG2P/OYdPD\n9/YWHnXldFkpbNDSBmR6vbohQkSZDEsuib2pkyLJedpxzA4vhT+EULnt/uqT\n4DturTfa6UZYCNgzltbmx/UW4FzIuEWUMG1HN+PE7aUtTLcPb92Iwg91GqwL\noUfMs9QIjCMtcHj14X9RDrUYWFHa2IkziPGf53HPcQ1xeiMGEer3NiZeLrb7\nQ+B4l65q8t9uXy5/AIma0pCHsFdjKhI3VGWfD01LlA/quQafMlYq41vUPlgZ\nZlg3Xf8Yi3oOXL1jZD4KTS5AuErF9PfOAXWzWjmNoOpXjgRXE+XWBQtAwX76\n3CtY1D1KJnhCnJ94lhnn1KdwAxPTaFbvDs+GZmMqSlQdbHXh1JI3xrAQWpxm\nLZDB\r\n=Qe5C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"3c02948f10b359bec03366022a5ed09c86003a7d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-unstable.3062"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-unstable.3062_1631692466163_0.24770749512372614","host":"s3://npm-registry-packages"}},"0.13.9":{"name":"piral-ssr-utils","version":"0.13.9","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.13.9","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"03126ef6ddc16ef43717f9b20c92acd375b8740e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.13.9.tgz","fileCount":40,"integrity":"sha512-hQYnu0EgReQOAQVNMoAsdCGS4bcNLtNNZbiiE0YoivIpru0TArfeB3h+vtxZxoJZaScbj1Vq/bu41e/ImYDMLw==","signatures":[{"sig":"MEQCIEXLAFz7vKFyF5G8czUDRcD08Bn6cYhcMrEbu/OO387NAiAQcmDKCmPLpLTmHfmmyI6tpDAPZ2mx9H7SrEtPG6uz/w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41386},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"80de9fb69430283bc90f380d3254e0e6aad4c6ad","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.9"},"peerDependencies":{"piral-core":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.13.9_1632430162890_0.9719659543207118","host":"s3://npm-registry-packages"}},"0.14.0-pre.3113":{"name":"piral-ssr-utils","version":"0.14.0-pre.3113","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-pre.3113","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"270b3c8317b10c3561c8550034d460ce1c0bb244","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-pre.3113.tgz","fileCount":40,"integrity":"sha512-+iWbDsCsuA8Ws62dtGUI4CXgm2Pd/6ZdnK0XBgccBd+8C0/k9g/Qj1tDRVFn13s2Zr8UklSF9Fd7s7p8cmT82g==","signatures":[{"sig":"MEYCIQCfWzGY942zgLtaimt2vjbIkGb73yVbROuOYz55K+9SigIhAJg55djaC5jbjKpxg2xpLXuWBeM6X1/S7WlBJ33CAU5G","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41848},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"1cb567aea336aa9ffde6d8a33f5a1d4fc36e681f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-pre.3113"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-pre.3113_1634199773415_0.6825613896081815","host":"s3://npm-registry-packages"}},"0.14.0-alpha.3152":{"name":"piral-ssr-utils","version":"0.14.0-alpha.3152","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-alpha.3152","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1289f843171288c4b4d973d6530d91bb44997542","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-alpha.3152.tgz","fileCount":40,"integrity":"sha512-blHlCSFsbqSxKgLUNyQmV85VdqzYw+F3+rEhKhhoWW7yXyQFm3ZFcLk+hqt5CuMTBp9MM47Z5dkj9KAufusOgQ==","signatures":[{"sig":"MEUCIQD5mIPRpdw+Jku9Ud0FeETzUJLNVlJh62Obc77RUO6LwAIgF5OwYWfc7Ox8Q4gXK+eUO8CgxIoOCtOTND8Yi8K0SOM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41852},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"4ad88a8b8bcdee17f22e7e1e2e8feb41df6210e5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-alpha.3152"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-alpha.3152_1634821956058_0.40001151454520834","host":"s3://npm-registry-packages"}},"0.14.0-alpha.3154":{"name":"piral-ssr-utils","version":"0.14.0-alpha.3154","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-alpha.3154","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3129300cea99170a43ce826682bee356ef7a9c8d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-alpha.3154.tgz","fileCount":40,"integrity":"sha512-z+jFZpCKmalIf2PFdlVHSOWtdor/Ahc5FCJ2mhlVmI5cQPCXAVwl5wotmjvFoGJldAXe6Rj0ka2BEZ04o1Nl0A==","signatures":[{"sig":"MEQCIHVZns+NVUNWBJ3LJhdXclRjjHYpnZsskWyaScjhZg6nAiA1honaK9k8kLt6rCWn+Ah5SjkIf/YpNhzN66Q6QjB6eA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41852},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"bc6cc60a59e6a8b1a154d187883cb794e8609939","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-alpha.3154"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-alpha.3154_1634893260537_0.4622769410403089","host":"s3://npm-registry-packages"}},"0.14.0-beta.3156":{"name":"piral-ssr-utils","version":"0.14.0-beta.3156","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-beta.3156","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"478ef0ce7e95ee1997fe165af06fcf46cb3aea38","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-beta.3156.tgz","fileCount":40,"integrity":"sha512-Y5xL+aUrRTQyI/9kQ9LNxasbbDe5lyfX0YCHCFXBp1ePXWutV9zzxKV+wdsXK4xo+uiFGxcwVUoablKGWwPeqw==","signatures":[{"sig":"MEUCIGG7jL0OAEJlKI7dtv3BFeQBQWhkK9Gb4T+D6PoGcTX3AiEA4Vl0rwAtWCnwfCA/CIFv9ktwaY73ApahWKmhAh3rwjs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41850},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e368a181defdfca4722d7bd478a9dcd47d90a51b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-beta.3156"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-beta.3156_1634904662387_0.3811462943748094","host":"s3://npm-registry-packages"}},"0.14.0-beta.3157":{"name":"piral-ssr-utils","version":"0.14.0-beta.3157","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-beta.3157","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"569185b0a3e010a01f59dbe2d3fc90567b20af61","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-beta.3157.tgz","fileCount":40,"integrity":"sha512-ijdA9gCfD6CgcVIthYCxYLyq5ymI2NszvzfqBZW7Qbhqj7vO5t9QVXjCsCiNHbt02GQwbQds2kdquKIn2xplRg==","signatures":[{"sig":"MEQCIHf+Amh4TiIHYTLmoR9+SPZpy/RhRN0IWphskzLM0QMHAiAg8irgVR0bTknG1feL78Ti42RVWoQKOmh4x0tVeSBIYA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41850},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"1928e46becee1444f84df8e80a81aa12712d17e2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-beta.3157"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-beta.3157_1634914107515_0.9701023779361668","host":"s3://npm-registry-packages"}},"0.14.0-beta.3163":{"name":"piral-ssr-utils","version":"0.14.0-beta.3163","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-beta.3163","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cdfdec2904c44c91af12a8d8cc05913c0faeb452","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-beta.3163.tgz","fileCount":40,"integrity":"sha512-7w0U92z3BDTm3hQ5RSvddcZdRrYGupvmlyF6JeNLdEGzpS/ArbCrzT4eA8qIrRE9DFc7J7M/VMVl+96VsFvSfQ==","signatures":[{"sig":"MEUCIAS08ojCExVu6CiEFNvM+egfcLbxKn2QXhlg+tgzgW+iAiEA1zJnsx6Hfw9mKjvbuv98DD/GR+YpNWihz86PkoisBsc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41850},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"ac8a8f2d0a9be0be6267afa87521b90e98179859","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-beta.3163"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-beta.3163_1634943246722_0.8948430149439988","host":"s3://npm-registry-packages"}},"0.14.0-beta.3183":{"name":"piral-ssr-utils","version":"0.14.0-beta.3183","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-beta.3183","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4dd780e4d143b2b156d785039c003072b94f7a6a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-beta.3183.tgz","fileCount":40,"integrity":"sha512-sjDnRFuyCUm/hdLZj7jYjOsnhaA4boIKUQkMIh8PzifwvRI44Q8Dk5holpOiELnYWlAurKGpumyf0hBQQluDRw==","signatures":[{"sig":"MEUCIQC40nrcwoYWpAgs+r0UBGd+I9zYFEomsYTuoyRwQ4almAIgIInTwhAMEVwmcWVQnLSX7CsFpu84LqQlOCEH3D9lmNo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41850},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"4553e585d9cbb9ebd71d032a8fde55c305aaa268","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-beta.3183"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-beta.3183_1635349737124_0.5396912434323304","host":"s3://npm-registry-packages"}},"0.14.0-beta.3184":{"name":"piral-ssr-utils","version":"0.14.0-beta.3184","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-beta.3184","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"14ce79ebad198a745eaec8d492b1a3e8068a5f7e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-beta.3184.tgz","fileCount":40,"integrity":"sha512-7N1LRcsUJ+QCuQAXS0sjYMzzVgdiIRIsh5oBPpIVi2eiLlwYSIPenKRthqo9ArdCP5EIwAwTPYsv7kjlso3Ehw==","signatures":[{"sig":"MEQCIGsDIl/9HEOaYOS9PwJQ3nAMYvQpwC5tGQMw1VUd9Vk5AiALKwPUDH68ScXry5R5jVOEedWTe2/SaEzM4Gjhzf5v8A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41850},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"2d00bfdcdf47c737ffb8d58f700945362ab9ac6d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-beta.3184"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-beta.3184_1635379946664_0.9593193943621399","host":"s3://npm-registry-packages"}},"0.14.0-beta.3187":{"name":"piral-ssr-utils","version":"0.14.0-beta.3187","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-beta.3187","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3778e41699ad15535707f29a258672dd3e3e1bca","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-beta.3187.tgz","fileCount":40,"integrity":"sha512-a9/kYw4/Ei/B9WDLpvg1re/pHkOypYVFX+BLuuGQBCp+GWfqQyaP8WwMc+hsnyF/abZCe6SYwQMr4awGy9+TZw==","signatures":[{"sig":"MEYCIQD/ppCmI2MXL5DMzyczbwdheSJXTJ2C4sQbkVvdg7IMBwIhAKNebH3lqF25NCqWMk0tFpBrXq2ZX90vbl7EgZ2ZJcf3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"8c7afcbb45ab9fcb2dde5d8377416ff3bc86d3c8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3187"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-beta.3187_1635415822755_0.133921675674187","host":"s3://npm-registry-packages"}},"0.14.0-beta.3203":{"name":"piral-ssr-utils","version":"0.14.0-beta.3203","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-beta.3203","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ab558dc4ccd1a98e8137d3dd40de3187196c74fd","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-beta.3203.tgz","fileCount":40,"integrity":"sha512-dRCvORN/Z1BJgbpQhmHdbZ6I/FFNT3Wfi6UY4mw1Nr65vzC/FV5IjHvDeR1+2SIrfUow4NIgLsBXg8b6CdicsA==","signatures":[{"sig":"MEYCIQDCPurfZlvozbo09GihcUfRbHSJOeAfTdQtFFf9Ia7zQwIhAMqBoXAs4ybbqAPnenAf3PnaatZwBhGNpjszTKkyh7yY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"dc0453924cdf43ee3f8049b47f6562fc295e9ef1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3203"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-beta.3203_1635462628305_0.9934137163708194","host":"s3://npm-registry-packages"}},"0.14.0-beta.3215":{"name":"piral-ssr-utils","version":"0.14.0-beta.3215","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-beta.3215","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2d721d2bd733f4731b67fa41b47a8d4d25827843","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-beta.3215.tgz","fileCount":40,"integrity":"sha512-srT5I8V040Uh1/2rK4c2O9Hz4/2OlN49bsE+rMgHNbBVjoW5JvJb9/4aW10pPU4v/LfHKRzHuJjYE8cjKp/OvQ==","signatures":[{"sig":"MEUCIAFn+29DjQj9y/UVS6C8urbWuCVu/IqqEuucndgYXLtsAiEAvMwNPujPceO/twMAm+CCN8PFowHMT9w2rYh+9bcW4rg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"876f3ed398a5452dc3eac3c030ab5af4048aff88","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3215"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-beta.3215_1635540019806_0.242350022795351","host":"s3://npm-registry-packages"}},"0.14.0-beta.3216":{"name":"piral-ssr-utils","version":"0.14.0-beta.3216","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-beta.3216","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ca570171c5f5074db5635af18473ec0017c6514c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-beta.3216.tgz","fileCount":40,"integrity":"sha512-4g6eLG4n7R3Z1Q5YJN0H/MMSG0++H2UltRjD9Z5MJ/2EFUDguR6cHzmUJC99xlA9wdcAjJDdx6tVKEVyb4TJ0g==","signatures":[{"sig":"MEQCIHYcxV8ehoT65hb2a0E0yUkQSBU6N+mp1xwnqW8YwwA8AiA4xLVyunOMno3P371ciLj6lwzwcWSMZK3c6mB8vSutYg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"4ae646f90377893373f4ebc575eb0b8a707f8b94","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3216"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-beta.3216_1635549934589_0.25461231612693425","host":"s3://npm-registry-packages"}},"0.14.0-beta.3217":{"name":"piral-ssr-utils","version":"0.14.0-beta.3217","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-beta.3217","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ccd14835db6847fdee76a56d5c3d5b88454b84bc","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-beta.3217.tgz","fileCount":40,"integrity":"sha512-M6ANjRvogHdWokH+SgylN07iyJMHnVVvsiEy2KsZXzR4VWpi5tneXm/ROjdwWfd5KT+PnuIvnLwTrRGiPfnxGg==","signatures":[{"sig":"MEYCIQCGlPi5aQXfh7CBsMNmsir3uyF5coeOtKEvQpumFx8TSQIhAK1SyPwvxo4XC4srX7gVZFQhQ+xm+BUSKGLL1pxWAQN4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e91cbf791838b7cc2feda16fd8965f1f99a1e2dd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3217"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-beta.3217_1635647893716_0.03723235698481431","host":"s3://npm-registry-packages"}},"0.14.0-beta.3222":{"name":"piral-ssr-utils","version":"0.14.0-beta.3222","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-beta.3222","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b2df65c850b7a739a674022140fb3b3a2180c096","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-beta.3222.tgz","fileCount":40,"integrity":"sha512-/Ynp8hnUAFQi49LrCrXlqbVsOuZ8Y/pIK7uS0oPdpeqwAOKPOdq22/sibuB9soOaPECNxdb1s04u7Ilk6qFr+g==","signatures":[{"sig":"MEYCIQC84ihi+wAyoGiOqv1dWLf+TIgxrziNjHf5Lw7vqxSzUwIhAOzmxmonacP0P4RZzhf0y9gRPy11UBM3fJYj8cGJ2BSt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"c3cb8ee58b51d36fd310cfdf32672ce460157b13","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3222"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-beta.3222_1635938312566_0.9469345482456022","host":"s3://npm-registry-packages"}},"0.14.0-beta.3226":{"name":"piral-ssr-utils","version":"0.14.0-beta.3226","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-beta.3226","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6c0837b423be8029a44ae56460cfffae2a565648","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-beta.3226.tgz","fileCount":40,"integrity":"sha512-74pC0W+QWO9VZk7gxFcJLZDnHozQIJNgHw4kJZmMWUEUcqK1isCnzKwmf4CFbmmB1vkxhYUr4a06CuNcEbe8FQ==","signatures":[{"sig":"MEUCIGXLI716LleKVPD4bBKYjXN0KpeAUqz+A0XtEeaR9BjGAiEAkA/CkZHPpWdR0REJWQ8pfyBc3UbNt6AZjNWrWtDJ5vM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"9e558ea7a0f0848aa40b1c43316c120f43863d10","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3226"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-beta.3226_1636161761809_0.20590316843155332","host":"s3://npm-registry-packages"}},"0.14.0-beta.3230":{"name":"piral-ssr-utils","version":"0.14.0-beta.3230","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0-beta.3230","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"db01e64dbb7599293aec4b74d4060703bb651598","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0-beta.3230.tgz","fileCount":40,"integrity":"sha512-8FDZM4muhqVAJ9mS2j3yOZjSEC3ltq2qHBoqd6lq2zMQ8lyT5T9EIQnwayoATuFSGxYyupkyN53CgfJr+H0v8g==","signatures":[{"sig":"MEQCIHXlNh1pGFYejaaRsUBmgasnpGKi0PYGqEXk8RHvD1rbAiBYvMlxb7bP5TL/kEmZbLRQp/0KMIPO4BZuoM87XKm+xw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"ef69207205ff41122f0c536a111d0ca15048611b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3230"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0-beta.3230_1636377073791_0.029502677281473044","host":"s3://npm-registry-packages"}},"0.14.0":{"name":"piral-ssr-utils","version":"0.14.0","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.0","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"dbef1b1642b06810788a3de0a1e051b3f4220b7a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.0.tgz","fileCount":40,"integrity":"sha512-E/wAzFzu9D3lcFtGIBQH84euR7qGTwaFkIuK3SYKbyoOXfGF8ZlfJBYLCYVR4nclET+4vhyTMhVZo7lWl48Mug==","signatures":[{"sig":"MEQCIDmIapA50vZIHgZJPwmDwKjiXXRbYejA2bKGWTVWSS2TAiBsCrxJMcbA6CwCozGtytBBD0kFSx2uBVA1UAbsqr+5Uw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41830},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"42d3691018d6fa49c2dd18a0b65e4f89961216b0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.0"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.0_1636394587099_0.049643479672383695","host":"s3://npm-registry-packages"}},"0.14.1-beta.3240":{"name":"piral-ssr-utils","version":"0.14.1-beta.3240","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.1-beta.3240","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e4e12bb07257b7fdbc9cd17313b7beb402626ee9","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.1-beta.3240.tgz","fileCount":40,"integrity":"sha512-h1vEuz7WSYOGXbmndO9ej0P3XR5id2fWDJCFUqxiZTyALBksQidJdzvBgugbDNy5u0LxmrT79c4nLKcRYp8yJw==","signatures":[{"sig":"MEYCIQDrf0X1lr7SQgIWgplyXncDrovtz82nEBIbTMIdVyyAFgIhAI1N7BjWOdWQehpnANPgkmaJeUuPfD6sXfz5V10qi+ni","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"d3a08ece776d0834721c52fcd7a71c769380bd7e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.1-beta.3240"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.1-beta.3240_1636511672731_0.93555143783224","host":"s3://npm-registry-packages"}},"0.14.1-beta.3244":{"name":"piral-ssr-utils","version":"0.14.1-beta.3244","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.1-beta.3244","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"12b9054ba142de316ad3025dc77e9e37c88185d3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.1-beta.3244.tgz","fileCount":40,"integrity":"sha512-kCkbb1ni40V8r1Kz8iujH1fyTV7ZmdtiKHCE9WD+wMTh/nbNv8KD5ogqydJVvkqLVmJRi73bSJyBBP/BCPnWCg==","signatures":[{"sig":"MEQCIFs3/CXX7jTyicAc3bpA85pxpprpNapbtSH/3+lerQ6PAiBKrOlRPLMYPawGYPiOb55L8fwcfSHB82sJxJD9iAVnZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"358d1d5a45743dac772d437b26a875b3d98c3008","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.1-beta.3244"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.1-beta.3244_1636545534794_0.004078284619571271","host":"s3://npm-registry-packages"}},"0.14.1-beta.3246":{"name":"piral-ssr-utils","version":"0.14.1-beta.3246","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.1-beta.3246","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"584e87bb50a59906cba8c731188c6c0d7168a0f8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.1-beta.3246.tgz","fileCount":40,"integrity":"sha512-xm+wl73axuho8lDkCiup3TJ/9pBOXyJsU2LD2R2mQKjPCre4qJx7TqT9jY2IUeX6qu5HCdLmN7xDnPxhLEDI8A==","signatures":[{"sig":"MEQCIBsPl7ZnPZpxlNHoWER+PQqxp+xHSzCqlYBsuzZjKkotAiA/37AAFDwQbPjrQ6TZtDOiXQkrfvTO+yP07tLdRUlUoQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"66827dfddb356079be8538bc5e8da9f253f62ba1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.1-beta.3246"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.1-beta.3246_1636667124937_0.4165306548697336","host":"s3://npm-registry-packages"}},"0.14.1-beta.3250":{"name":"piral-ssr-utils","version":"0.14.1-beta.3250","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.1-beta.3250","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7475f2432f8ffc0667933d2242feff03e3d3ff78","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.1-beta.3250.tgz","fileCount":40,"integrity":"sha512-1nLnGQQI0k4nI96FJDacU18B3b6erZmRP8S5gEUA4GQHkUsNgLr27C+/4uB3l1yUMlelJOy1C/WXyk1QdnsL0Q==","signatures":[{"sig":"MEUCIQDLPRqv/mfErck+xDLBJ2CSFdu/KQP0tfvh7Z1aB1gDFwIgbidXx+V7Rv1nvfBugC2atC2QxUj57wbabPfnWNX13R4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e6b329deaa798ea0b9287fbb57be8f39973eeac2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.1-beta.3250"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.1-beta.3250_1636730522090_0.8626734030191283","host":"s3://npm-registry-packages"}},"0.14.1-beta.3256":{"name":"piral-ssr-utils","version":"0.14.1-beta.3256","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.1-beta.3256","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5307e52df20040b200f69c4e981159551e0f048e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.1-beta.3256.tgz","fileCount":40,"integrity":"sha512-wuNXM4THocSlHOGT8OiBcIw1kWWtXvTTWKPu0tJC0q4Yfts6npLjDqmHbQ2f5nBCfWvbv2rNCxckBDFHAmmuNA==","signatures":[{"sig":"MEYCIQCNNIVObkPbmjnioikCeO19flD1si0f2RwiSG42OcYbEQIhAI0bKjJrXJtosmtji1k6YWdy2Jfr/cWdD+mobEjRomNn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk7l1CRA9TVsSAnZWagAAMZwP+wTkVEyN+/pRf3VKUZAx\nnxexyZ6AxUouLegXplMHkkqJlCR3tda5q3TLV7vKTzq76nujAptL/YOb6JyO\nnKibT/v1oPCHoH4qP3x/Aomg5qcMlLit+AnbzaMuqPEvaTYR7/EJki2/J20S\nbhmjuQXttMtSZNWQ8uGYvZu9Y0cpEElFijiMV1fjiG6yt/voC6F28jEypQUb\nbEGU9jMj6eaGvU3ha1Nt02VhvGEQDl+ciodkWpsZGpkiyJxPtV9v8m5XwIjx\n37wNzMo7Gox54eixtXpofvoIA69snLsZdeRfiMDlwozBkYlG75QGudv89Yd+\nZbK8WDvuTKoiufDzLC0tDnq5MC0xt99sDJi8x0TP07qgmhOAuYsKvHVfu4vk\nKibaeJB3/YWMtcn/DNBgJkwlyi28zozG7S1qiEGdFHfOpz9NPZXq1+I477sC\nBxay0ZyS8nj9cnygYAXDvreGxBKAwlEB08tkGCcpkjWMRRdm2Lr1Lg2vdzdl\ntEfHP5SfpBT3/tPSD5wjnMq9bwVCKg82bQOxvQNwkByVeQxdG+IAjGPGeBrC\n2CTCuZ6kCYaNIR25pP/91YR96hPsdDJPbTNDR246A0hifITjfWgfWxXSVCAD\nWD7NtmC1Uacwkru6DT9i+9Dj/BlCTY8BtK7XbjKSkvP4CdqrvV7GRwkya2xn\nyVyj\r\n=x7Sd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"4fe700c9466e6c3920546713e911fef36c311b52","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.1-beta.3256"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.1-beta.3256_1637071221392_0.13845142362826968","host":"s3://npm-registry-packages"}},"0.14.1-beta.3266":{"name":"piral-ssr-utils","version":"0.14.1-beta.3266","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.1-beta.3266","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3b15b629bab40f2b39b24af72c814fc79098907b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.1-beta.3266.tgz","fileCount":40,"integrity":"sha512-zSELgDl/lCnxuY7Li5qipJkqC2FG2H2Cg1zO3JEXZlgwQoT4KgjrSyPwD4oKC37zNaJ8PsHE5vfGJD28uxydng==","signatures":[{"sig":"MEQCIGwHHLIZ15UsOnS02OOpebPjkE8mn0L3s6k+8jVUyL3zAiA+msliahXqH1okBeoE5lJINpI1oOAoTUq0gVRlprHQBw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlmj2CRA9TVsSAnZWagAABwMP/iDZ/rEGly51jujm4IJv\nj4EEeSu2bDavd1EGFhJuv3pkJiwGqWjqvVFglxINfBB+5i6L0G3/6+HhtBBH\njBsnER5+8C4bbyv/8lX5UNh896IIdq3S/foZ1FiiecZ91whla8zqf+DmMWo+\n7BNnvk418C2jRZDt7Mo1L4RfXHXbN0Aankp8C91hu16tkkV1T5xjlZjxVhGw\nui4FYZ3jHiwTbUYcRahdydMd6ifLwclGpo6/7t6Dr2dEqjOYtarDIeY0mRFj\nxnYiAIhhdS8DF01/zGbrRdcN6ttje5Kl8S7dk3e41FVW5146PfQNcbYd/uIY\nqhIR7FPSNY9EXxvLteGCN7VgOYaQNlkSbL9puE7g9EkTLKwu3HQwpyQNDQX0\nw2cYbb3nHFXb6ZY85gLWqs8dB2XqzslxoaSRegcYSHiHNljHM0pSHSNpKTpw\nIp4WX6fpBeJfy8yFa9yHXBO4GjPFSXVg3EcLo4mOjf0dAjNfYDB+1n0N0OVx\n+jC9hCqz495rYIO8z+1fP00P3G2jGckdsC91COLcn2VE8aXWGj/RPK+lEtTx\nWK7o/rivUPSG8x4d1+QOkH7sgDisCjmkKh+tfl3fdW+//DWMAiHh9ugoYcKx\nuaU31HOrBzbcECLrHCsn7aypTcjkI9fJyiuUhty5odsNIVq5epbo8biF/RKM\nTRvc\r\n=isfx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"9c4d208eb5947e34cc929ce1613a8cb2dee0cea0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.1-beta.3266"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.1-beta.3266_1637247222557_0.9355044880037271","host":"s3://npm-registry-packages"}},"0.14.1":{"name":"piral-ssr-utils","version":"0.14.1","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.1","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7fa8546f34820cc03a1a4e59a83937f7f77924df","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.1.tgz","fileCount":40,"integrity":"sha512-5FSUuWx36p202Jb1vjEzg2HXfvks86dzaMiUnsFvI9icwtb/i89FdgcUnCBoN9/eO5J9J23b37Fe/DkpjQSzzw==","signatures":[{"sig":"MEUCIQDcCk/Fb2yoN6Ty0f+F6csdWbzCetcl/12njV+skAsVfwIgYrQGZdwyou1xcoewbLlhQeZRCf8rtmVwzF6UFrLyIeY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhl6WeCRA9TVsSAnZWagAAAxQP/0BYfeub7ZEe0bnvTKSv\ngmXXjoLaetu9LVKMy3n2T7FaeizUNJbdABWQdc/73dd7mbnW53bZu0SKJhQ5\nI3OveNIv43mFG6uTS94thydNv9xbxcu4HFzcstTA/2aiYEP2sbU5dehnVhIN\niK3f7E15pu4lb0suiip8t9I+M8t2RbBxkvkG2HowjR+AAoy/APraV/rz4mtS\nGlP8GGruIsfj0ltTP22VE9Ohf3yierni25gKxaaVC/Y+bZ/z4QrlEgaTUel6\naf2wX7AZHLZi7qgRSYRYpvYiKcVbeuElD7LHp5uFZHW8fOink0+vDdsscMzk\n+3i9uQpxXpDFDJjoW9pB5c/QvYv9FqWwkF0WeX99apOYpd+4xU1SdT+1gt1x\nz/tC3N97z7m9cnbVPOWB9pRonUxNQBGAXRh9GO2wG0BhkNWKkIZN5m7VMlhq\nsZGg3igB1/Dc/L0yDOz6m6YZGwBPz/D7qdNt2URuRHys5Lef1vtnuGourRz5\n7tw5OjCvIaaCKXe9oAHbDQk8svsVflpQkjdapiUVtCmofHzoZ5cF7f9qKEc9\nyx5hJo/U8Q+8YQ1NV0nM2OIpX1YNFHrs/eHULFuAR/9OUXq1hN4dYc+zMrOQ\nkEEbHz0yEG7vsn9RHbP0jgpMckqxXL2pEvwchTxDDuoEmlzkQqOcaKmA4OI0\njNWD\r\n=oxDP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"510c86441c19ffa3e8c862bfdcff73e93c730960","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.1"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.1_1637328286647_0.2801386771387937","host":"s3://npm-registry-packages"}},"0.14.2-beta.3272":{"name":"piral-ssr-utils","version":"0.14.2-beta.3272","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.2-beta.3272","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e9732a2157da44bc002abbd87bba0941814d7c4f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.2-beta.3272.tgz","fileCount":40,"integrity":"sha512-NqYbstz/ArhDM5f86mBLKyPDeF2DEFxcpbcDxHClr8wNaPI/qvKA4C8AbQTbDxejofQBWNWFWPAiHEQocyrcWQ==","signatures":[{"sig":"MEUCIBVxGIAfdpe6DX7Ka7JcR/gH/ZYpE/LUbTIxmNCY2e49AiEAoUNQbQuC2s2FV8T3fN5f5f+K9R1eyfXJD4yGnY5UNbc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmEUQCRA9TVsSAnZWagAAeh8P/infzUI+ZCOAxeysG0DR\nyp3d20K3Aqra1Ubv8gdwg9ZtJJ8+bl5GFA6DhuNIRqcHsrWsof8yDx8RRTvn\nTRjUnZ2vP3EHrkQay/fazh3vIqO6ao28xU5JhOWv+9A9BFmJAKGSZlJE/BW+\nIOjh007muwKjU0HDv+X7kB15lor7TI3h5uVeo1wopfyfTp62cst4D8ntKfRy\niJoG+p7ewaqWRfNSGGzn2zqcaj6Svnlun39gSesraPtNVRaw6r1SsVJwrwvu\nYTFvzRt0FmuOVxJwyY+DozS6UwN/I++mCx9OecQKKJiV5HMYTa+74HnjuiP7\nBvcnEAF9O4XMUz+8wXR1CwE4YBnr/hEtxfIEG0VQJnjb8oBWDE1rkZTMgeGh\noaXULeVoYjxmCAc4UFQanbL37r8yn40ra/IPZN8EE1rnGaH+RDqeOIEjSOFf\nrKUn7S1kEbQCD9v5WLIZKIppDj+WUgWIEIFIpNB+FH01W8CeDjn2i3SmS7ym\nG1hu9iU7FcOTHQI5DxcOdu9EB7xeseK5Zu41bgcqqDAu9e3sonALCpwv427Y\nMrgM53Cg0wZEhthNJRVZiicTnOSIjm29DQv08y1IYZOaMew36/QWwRa9it9h\nTbBjGfisn7Di8CcHmi0Qa0Nq6LT00eYhhDik4LHGHGVNeVMFHDXxuxXK40uO\nu7oO\r\n=XTJK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"06d1e9fa163aade40f9aa1f0233ef1266c5115dd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.2-beta.3272"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.2-beta.3272_1637369104646_0.055926908741400716","host":"s3://npm-registry-packages"}},"0.14.2":{"name":"piral-ssr-utils","version":"0.14.2","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.2","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"75218359a6e3a02311a44684d3b4485ac73dca34","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.2.tgz","fileCount":40,"integrity":"sha512-5dS7b/9laos5TbzbcLTGiSi/2L2fFnf5W4z8Z2RPejl86aOJE8qlq/0w+DYozvcgAVSj6ciOBuYHKzksHxSpRg==","signatures":[{"sig":"MEUCIEd2nB1plMBtxFxbzjX3upF9scsb3kmTyHxSPLmKa19eAiEAmNdQjikxgqLAOMGClAj0t+KqsnrDVCgnK4fKKY6Zius=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm6a9CRA9TVsSAnZWagAARVYQAIiP8Zz0LYYKG10X8Mjf\nH1AS9h9gaL2xe+lY/sD+o7em588rSoiGm92LhsUgDkUM5TgNapK0c8zSw3M3\nHKJnteA1j0rUiBzNxTj2CR2DsRTUc1q58Clko5Y+kzS7Sa6DGCqG4FqjsgBj\ngXoS2u6bNJtehhvLDmml4ft9FzR8dxpE+FLqWjia4Vy1UffkPV0Sp+zZEewI\nJiOcRiY6wh2xL6XTZpFLs7OkS1RONLwRsX0/dTe3ZRTCqYE/KRqZEEZY/ChV\nnUo6Ep/GL/02oCqOvsTy/UlbjoxeaAQyJOcQBDju8pwW8V/R4WbiOpdIFd1j\nGZrD62mNhYoCH43NkNgkOJZDtxWgiDc7RG+66h2T5a84QkmW7y7+UnEagOes\nDsACTeecMyy5PARPiU816WpL9XW4YmMT3W6AXs/yUFwiKklb1xdVOIh+3GKp\nCI352eGj8g1G7sIMoEoZrzGnICZyrPXsclYbEzSuyhnxw6Z6oGrmCsY5m7e/\nJk8xuR5qgX9/wE01tdbL6RVWGaMTxqmzVSXY+gxrtlSThPWWUfL5SfGeApkH\nAp/D1EYeC5282SCQPcqM0O5nPmA6sNEnSQIeYy8yloEWhI31VeKvGbhc6IOZ\n2zXaIiaADRlsHN+6lBcWhz/qB/8capqIwnC2fnGSrqvqocabRIblKo9PJjv6\nAmkX\r\n=Q5ZF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"eaaab0f56b872802a70d83de27a77911af37ed22","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.2"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.2_1637590717286_0.38583834043130394","host":"s3://npm-registry-packages"}},"0.14.3-beta.3295":{"name":"piral-ssr-utils","version":"0.14.3-beta.3295","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.3-beta.3295","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c1f80d94241f9c6427fd4bb33fd58ad3cdc01983","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.3-beta.3295.tgz","fileCount":40,"integrity":"sha512-UnxcOoGoYo48x7AO6DsfV/Hd3s7UaEpEErlT7267pt1K+IqNdk8kupNCn8wooPzROxm4mJiFW6zqDZ2ce7429g==","signatures":[{"sig":"MEQCIDkHocQ23g+R5f6ISAd86N9q4xFfAs8r8m+VGO5lKrt6AiB53NxFqTMSwqbqOXP+jKOEH/kfMrRCDNBOf9gdbzbSsw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhngtrCRA9TVsSAnZWagAAZpgP/jVYJwU6kqgyJcJbkpIe\nDF/rz+/zmCuHZCKRYXIqMuoEFYgelQlhCisu+uDcpsMUX5VmrgbhCFeSGTsm\nuMb4MeV7IAGvxieJI8I11QuwHxiwbM4eqyOmpawQ5QIHzU7+TWjaOsv4BV4m\n1L1mDtWAkwq+nEtsogAhNoZ3W+LcWdHALFO2ziTuAwvnzc2UyTJx0Px+IhRd\nDcsXeGmHMiNkjl72i9Mk5YpykRtVxBCO4F+Zt6CcYEsxXLNXJN/sq0UCbrzS\nIlc2Vxc0emMk2MN0/mRpPedP8prKNUd5UB5ZPacv362b8rAvCK7DQ25YXyaO\n5Q8XLWUHZGeNi5x1s0QjGRmkvihRJWbUqP3Xh4jbp9jO8IKLkmnplpYvSqBW\n6eo6YB9aRMhgM6y52cqgjbIatyFrYNsi0irw0/g9+PSqu0ASUHf53m/FAtNO\ng4rABl5yZ6/0xbJBZuihK+D2e2AkZHJDcS8EGwarziUkMJ3DTTnTSrR0rvMh\nS5o9SAaRoYPN1VYKpSVzlclShTpCbcJ5Zb8KBD4k6APgEFxoBI6uQ/fqzJuz\n5GBim7POcLRhuUPviMrlTACcnzZX+BcM1757g1kBaiMqvkoPXDvWg2vipBVm\nhgwye5Ht6Vx/U2ISjLh9Pmi04b+b+YCrdFGqnoYeT5DEaxSptBardotQzY6h\n/y6M\r\n=VbQO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"699a617d9f89c76c277feba775da285b99cf370c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.3-beta.3295"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.3-beta.3295_1637747563606_0.04108853285685399","host":"s3://npm-registry-packages"}},"0.14.3-beta.3296":{"name":"piral-ssr-utils","version":"0.14.3-beta.3296","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.3-beta.3296","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"34aa70267b7d65cdfeca59e65c0a201d95e7d432","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.3-beta.3296.tgz","fileCount":40,"integrity":"sha512-9efj/UWzK1lxWJAtfdd8LFHBoVkz/c++IQLG3XWBiFa1BcPQDr4XkAnKZUGO4AuKgN/DhS7P3CrT38M3J/sgLw==","signatures":[{"sig":"MEUCIHSPzmqjc7koN0t6qNeK3Umt8NqZ7e61nN3vK3mxf41iAiEA8vKh7oU5dqeqj4mc+0Dl9IJeEgx/bTXwqZlyPRbSNGc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnk01CRA9TVsSAnZWagAAmJ0P/0aF2Z9YQN0lgN5dJk8q\ngesZPv7/0sIZ36uRGYMG5USFDHf6npPq4NijvNp8qRFj47BufmkPuI8vATom\nrN0WGFhljFuctj0SbSK4sGJeueCKbRLjsuFZZc4DSoWJJYxJttQ8F9y9sdnM\n9aU4I98S3AkEIhz44ly5GnsHCGgL1l4wieXxaO5qwfiaMzdXxXSW4ra0UdDg\nBomjbpq/BACpuGkyFuxzj4FCizCNHbMWMXhqF7CBZsHZ4Zw5PQFfOwkmRMMF\n5z6yzM7NuNpqp872p5AeYJjOc4vFJczqy+IyBcVmri2e8Tg22Lu18/mwkJCC\nHBxUyqy2BmfekWbA40fjFfwRG2lpHTyLf9JcsyqebesNWeap986xdw6XUAFs\ncoM+Ou4shAZhZFZDkxKcqBYfbL7i8kBcKIz9E3rKSGUi90ecQv/sE+Wg+q9o\n4RL1ajdn4TtjS67AwIh65m1Mgv6X5i8XvqC7aFbl20cdrJCSlq5cD1CCUrJz\n2BovzG7fPNSY5qedyYae0ZYu2kkIDdg+CDcnzffE/77A96U1rg3wBebbQIva\nKNnlUqOYY905CRlIR4RQck1dIARFZbl/y97GScBEkzsLAups7TElwGAiB3qe\nwU4L4u0QkWM6mAF6UwcNqPQCV9eMcJw1PGlXAAVXBEFoxkdxiiW8Z064EEgP\nt3WW\r\n=V+dU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"b8a8c6e0f21e4572f308f64299d1e520b5b553b8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.3-beta.3296"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.3-beta.3296_1637764405253_0.4316220943674298","host":"s3://npm-registry-packages"}},"0.14.3-beta.3297":{"name":"piral-ssr-utils","version":"0.14.3-beta.3297","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.3-beta.3297","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d97040a4c8c883359aa33b160d9ef4fe53c057ea","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.3-beta.3297.tgz","fileCount":40,"integrity":"sha512-agHancLJ5l+UzgeAcP2DtgKt8C+rMHPJybYUrlG0Ql5UKnxv/hIzxd/n1jIQhYqHNdUuYwotLH3uGcQPtv7lSw==","signatures":[{"sig":"MEUCIQCzGNuxg4+2z2ZvC0zvEOKPy/GnLKJgo61wxMCoV8cIJwIgaC/fG5yf1pzQHwXk5EWIx9sbsArfe99F/s5nXPMtrz4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnu7ICRA9TVsSAnZWagAAXfsQAIctHtIEeIskl+YzP0Q2\n3o2nE7dfe09RgsMqHH5g7BoNM922DKQ9RhdImUthRnoiIT50WpBgrnn5LPd5\n94LhNBZpEx5EfrD6CKJZztJ8T2Bpp3mhw2gayMiFPAokk2lwpNIp7uDYthqQ\n4iVwIi9pXTnx3RrrnpqxxkHfuMtUx+uMpzE3Bh4EBs7RHF/SUsR/uVLrdZOb\nSamdYVrMHGuJ6ZJ6BTPcmFsowtl+3gXhOqE/Nw2f7fW2mVXRokvLmBkjSIYX\nzifFTooCYE4lLMunziO+Jx8wx6r75BFicajtbONMnhuWm5yjNse/7tuyTmYl\nfk681qW/LNPb/0r/PMh5ZnsB4U/dE6M7cKTNyZp0Nm5phx0iV92M+m4zfqMk\nGQTwlrMrqy1PviKEsnU6ZvwOMQo8cw6RafIALdUYPQKHIgKzipbo6KvZOKp4\nbQJ5v2XV/VeNlD9u+tQ3mb0rKE/ED6pSfZ2+0fjLdnS3QEETQTc9a7hm4js0\no1JnNpOsoe92IpjSyavIwjTNJpCN6AL/loky7RmD04ms0FyFiJ3kivs6U4ni\n8A3SziJfnVYw75mUUHR78fb/leQ4f0QpUwYhJ7oLTkxZBko0O2nf/KiRKEdP\nbz1MnhfgB3nROsEtSI9ADrg2tonw6z/hMCNFq9bAGMJ3maShVAQmKysEor+9\nKeAz\r\n=eNe2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"42d5359bb0a4d0d9f3bf27e8acb205419bb4cc58","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.3-beta.3297"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.3-beta.3297_1637805768170_0.1275061931410617","host":"s3://npm-registry-packages"}},"0.14.3-beta.3299":{"name":"piral-ssr-utils","version":"0.14.3-beta.3299","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.3-beta.3299","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d9b3a03c2187f3b2c1de1d8af65628a758350b5a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.3-beta.3299.tgz","fileCount":40,"integrity":"sha512-FzUenQigyVwjDFiI7ZY7eTlnzNOeG2oUgyEwC00YyKTroVf7gIvuzoZxbhhHLoppeTm3DnYExMNZl6HbLig5gg==","signatures":[{"sig":"MEQCIFfSUHJKZkzw75zhUQnmvGRMJIg/mS9jiO3NsL4ATgpBAiAN9TUFFGoERk09l/wS58c6o6ze2tNGxkaioQ4nguXrPw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhn6WTCRA9TVsSAnZWagAACjIP/2aLB8dnP98ZgZp9WcpF\n/R+sMHvE195jmFZQCf+IOApS6AJlXYbVQP/wgMUjcWju6g67pgDk3sm5t/kh\nMEFdBS5Eqvs1be3CDxcbXXCgxQ+Ke55+21RJXt1xbPV0N4lgeo9X0CP1h+BF\noxt/pdWOW1aiIRpC20IZzrWcAqmHNksnzqS86hJvfrJHX0IodFbeVcJWuWhH\n2pgESVBUw5vbyVlwmDDzHv0syv4+/Fe0pZH4LvYw6tlG54VLEsqvSbNWKSOW\n/kHq1hUByjqV315BxqdzpAgnrC5Rat69u5zp1c7srlzPDvXxRtU8rZriMDbm\nKVG3EvJmf/Mev9mEZyobdgNUiBqhbq0SLUj31DZK/oyJcBvIxIRPEQSkxeRx\nryIxhD35OOktsbnW+W1O+UK1nLN3UK1h4yBDsa+bp6mfIbYw0H4bAJWn70Ma\nZVCfL46++sQxc0u0/UAWQrJk7BvZBAJrWzpzem19SuQZ70DuSYqOcRjRUkaA\nzJ2ILlLmQok6AvAUIDdZ9KTeFP0hZgNwrWp+md8SV+sxn+XmYBn+6DLd+8pw\nQza6/9CECEGLJBTeusItH4Ftb8tz2eSX51Zi9tqMd+NAezd7S0hNRbZoSloP\nTWKo9bpujA/qyc1r+Qo98gVr5O8Pf25JI7rxVpRr4oi8/N2GqIq8MEAAhYUM\nBePr\r\n=4lG8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"2329c97cbca23e133c1b432ead68964f6ea411f3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.3-beta.3299"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.3-beta.3299_1637852563465_0.007194184900818357","host":"s3://npm-registry-packages"}},"0.14.3-beta.3303":{"name":"piral-ssr-utils","version":"0.14.3-beta.3303","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.3-beta.3303","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f033290f640327b9e23bddcef20098318cc74cbb","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.3-beta.3303.tgz","fileCount":40,"integrity":"sha512-/eoC/AGvxY+/ACkcnZ3SEyGiHnhM4KkTsWi+hPXy+cBHHXzbqTHstah9iZ34l05Xf1bxX+yppYu8MEg8SR9YMA==","signatures":[{"sig":"MEUCIQCacDybvHUsBq98VGv5hCOTKbC0sMXuF20ZGqP/6DtwKQIgERLZG538ScYnfgt99yh8+HA7yacaTIxQxLg324/epM0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoDd4CRA9TVsSAnZWagAAm7gP/0T32KJQnGGbhwDF9Ep9\nNJWgqtouYm9GOatiNVPJscGx03zG6jfgIeyZMIEE1JPRREJdPyJVRUs5UAT+\noDUONCDM4oO51PhDxNzQqi1kfiul0CKEsb2NrRqmAdxPPJij8vVv385ve6bs\nOKR1B0T9U893mF+4e91OZ4lu3jGTDmC9T8uvauvGc6TD0XdKGYqeAd1rgglG\nSvRY4oIlbW9Oe6anPz6/IkYUAgiQr/l0EY5NRYygAnZGVJjxMGghGLk10bA0\no09nJEJ3IJeZafwNaDLN0GiPIJgqh0GzouuTWXVt/b4QvWexlteZUB6rx0ZS\nBBSW2OPcbgHrsAdlSNro3jjdYO6DFmgMYGWXQsi8pmAYzzI8Grk3JCUVTuon\noY+2KYbY19D+v0sjHvxfApk4JJSuk4z5qmFpUIX7fxiXJPWDJZremYHWOmHc\np8tY8Fi66ne/H34p6YE13OAM2XGs+sQSovovvHycl8uIOajQOSwDD3z1/NlJ\nvESVqZnRkTVffEvnlg4dagofq3m4kiAVmwtR5jsqGwJ6g6fHQd3QQW174jmX\nW/8MAC6JEUqiB8mw1f0M6mkEV8ogCb3Fzms9omprm0B797jKFM34+vYtslAB\nqEAer6UY/vjOviN7p65gIBe8/PWG+s+5X8saH/21kMrletb+zKO8TpMLxhb4\nwPr7\r\n=dcTI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"da89ec453fdcf613a0c68ff75d53d47a052ce356","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.3-beta.3303"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.3-beta.3303_1637889912374_0.5463850707379494","host":"s3://npm-registry-packages"}},"0.14.3":{"name":"piral-ssr-utils","version":"0.14.3","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.3","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"09ad3e2f81efa5acc70259e848fb64e327e9d8ad","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.3.tgz","fileCount":40,"integrity":"sha512-C0w/XrOdJCjxBfSzwoGTcfgs09Ij5SqfmPEfBtRHiVhW2OX79vw5IntvxmoavKLnql0WtKwNGX2RklNFOVRU1w==","signatures":[{"sig":"MEUCIQD728CvGxaiIMwhpMtuvRBYUnmoLpVVKdbMOBXysZ09dQIgCUalBucnnz3yQCexSqD25sxcpKhJImfT8IFv1e4c4vQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoLv/CRA9TVsSAnZWagAAKY0P/1wKzpbuh0Ex4KNZ6JxZ\niSVBt9tlwK/t6QvROtlI3p53AN6SpyiMqh6JgjTfqbZ86DQiBxP5vYrgN63r\nzpF7hMHgWwChdZv9sEct/HhtxF0CMeBsbo67fLR9sjb9F27PPcH72tQYywAO\nvnzlE5AacaZTQAa1Tenmz+zMvbHIKCUNny9QNeG5x4vs6EQTdiF1WXiBtpCZ\nXT/Ey+llKaJCDT4nYymb9kxuBwXkh8oYngbZhxwHzeXheK5Zgp6Q5gCmjyVF\n8or3tswVr+oc3q0edoRXyLWAr5YYGF0C7z1kr6RDKZfLtNiGXSTZuICOoD0c\nNHZ2LcXRtuo9oclaah6k3LgAJ+qXU6eLtDQ1p2YpS+vDeVpQ96VuxLnR20ah\nFlZ6/jkz0BocBnGGQ1dc9tg8Afy6QY1Wcb91LmjF+b6usDyWgyuS7VCdmTLs\ndbiMRPqY8dXoPaP2zFi45U1BYBWtZCJVgS7EGt91TF7MsoRopJTk7nGG4TOh\n4dfJwxrUncJUpCI1UbZ2GIdzUVKFREO3SGRsiboucKH79ya7ognGJOFv3DWC\nuUtm/83JlDU7NPn8bXwcJbFFtaJwensbYqEAtcFDFL8hL7FG2fKCIf62/X7d\nSavmcZRW8IfONipr8w6Z4R+snHoKzwCa1GXqF8Ooosnnw1m+e+cat6pRcnfj\n/sAW\r\n=E6BU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"6.14.8","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.20.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.3"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.3_1637923838976_0.30263235364973196","host":"s3://npm-registry-packages"}},"0.14.4-beta.3311":{"name":"piral-ssr-utils","version":"0.14.4-beta.3311","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.4-beta.3311","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"244740f29b79c0a02df6c51e00c64a5419067a1c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.4-beta.3311.tgz","fileCount":40,"integrity":"sha512-HieLCCtnWdU5ZqeH/zKsG4/ucixtBRHW6y+GgskzAgnuwh5Ew8vwfOpOy0gJaN/VBVpj/dPW1aNbrc/HHAyJJA==","signatures":[{"sig":"MEQCIFFe6CGW5KrFjgwpLNryJxDmZXnu0Re2cv5qcQMCSZS/AiBP0QkVTgwyO90zXnsM5p+Xq4Ic5yiC1OZa5WwLdhz+6g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJho6ZZCRA9TVsSAnZWagAAmSEQAKAckRRZMKtRrqAvXNHT\nOoiwlOBXstK7PB/wNI/y+c2w2Cr6H67+z+/x56wzJ0DNOc+ZTXYmQIx0fAYi\nehs1o8XcyyhCC9PVjDe0cND3/HtvnQ+NIPZWCruntI/1F3DEkc6SJokIzFZU\nZyWeLJ68vACovxkxy98xHTl/QiTrsrdS1XQKSowziDDoNExfXoQ+FVz4jWuY\nCF59fIPCE7FhKyrOB9dF9Zm6eiIyELJLQHnW92Bk7vnsAq63XOCXM1Cgw1aW\nRcFTHVJWwO6vx3RRjTiCmuF18SCsVpMxDVrh3TmXUaBGkao5aXhvjBY8fKkc\nHdCX3RPxTeRyffaIU8ZaVbvh8IpPHEFUxEYSZF7ESyOTcL7ChDJgKvPgwdrd\n9EJ0Z6zNYeVQwSURdyZLG5pAn9biE5bROpeSOQlL7+tm9ms5kQhOmV9o0p3a\nqsBKqLuKNBqOgt74YRYuoJ3lL2hSHKuuPDr1DOjMZ2RDjoHqN2p7+pIRFtSy\nHal94YIci9iBLYaD4RPBESPI/rdqxi4PoSGFMtpvBIn07a05FcJXhtWh28Fc\nuD6ck73JVWck7N/hAAE0uq7RiXEPwddjNmyxQp+AHdXYk7z9Msvy0M6MscgX\nuUno2KNmonewx1oo/NMmtD3S4BpHFGsr3Fo+NfrgtAwUbCGG+vT7sjjxSlqR\nIyvI\r\n=DVt5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"c2e4e413b6505da88b6296efa694b3b96c11f77b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.4-beta.3311"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.4-beta.3311_1638114905493_0.7586406271532167","host":"s3://npm-registry-packages"}},"0.14.4-beta.3313":{"name":"piral-ssr-utils","version":"0.14.4-beta.3313","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.4-beta.3313","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6719dc5361458915df1692ad6b393128d93289a0","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.4-beta.3313.tgz","fileCount":40,"integrity":"sha512-EHZnplhAlwlwcYC8iD3UxnE2LBAd7/Ogxm3MpZqTD9xyrwXJ1ASuo29VYfIS8YDqKaZuiUfQ/XX2jiBpzN33xg==","signatures":[{"sig":"MEUCIQC4esOGGpz2v9eJf6uuIAxJi33FplXKecye+S5NWT/xbwIgabZU9DbDz/L9OsMvnTEXSPNz+E69PsNSl4MxON6Ifb4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpQ3SCRA9TVsSAnZWagAAN1MQAIoNriIW8qAFMJtcr5sf\n7IsX3Qh5W84NPujgxsUcwJFG/HDO9/IkMs7GXfYz/YpjwlRzl+Y+afn5IqiF\nxb8VdY4Q6oZn43aJBbmhfdpOGUb2nDHsVqofgF+gUPf1oHmiKfeR+EnrZcLR\nOBfnCikoA8Hk2vVbVFU7Rtz5ZLyUurbNr1903VwgqQDdjY5K+kzFQu5Rcsfo\ndC7qq+NuNP2rnQ6A1EJNeb+9OfvkLeEa8/+BxsiBTT0EhhndIaXXoT1tvGJK\ndEdroDPlRBvURqANusXYIkhnKkPKQ25UAYgfL3JYHSoeqczDe/zcOkyBQx1/\nW3sueKL5YUbj3XA6csbTCgozrRHWKvHEgqwktimj5cRP3QoMNe+8Ci9hrIkF\nNqNYHjyOkMqO/k0egClx84+Y7iIQkCxpuLBQTOK3VhOXASXDV/Qj9+izFJ4f\n2eJIwIWPnVmgy7L7pZc6de96UcnGPv8g9K1ZGs67IGUsEKvpHOydVk6dOlC3\nixVWgoSQEE3bkNCdM3EOnYK7nvvVJ4EYzDLSoKHdofx595ME8WjV0s7XZ5Pj\nSN9dGIOSAv73PBY0NyN3NwnbijMITloXBRM/7tHQv3ZCQ59/5GXLTfMhSkA9\n6sP2SupX8CiNWIjEmksJglCplyDdDYubfZ896sE1FyXiAE5u1qiTW5FdP/Mf\npR/0\r\n=lZyM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"ab1a8f12eecbe2824fc7fe9b7a9acae33a91c0fd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.4-beta.3313"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.4-beta.3313_1638206930671_0.5611681788866203","host":"s3://npm-registry-packages"}},"0.14.4":{"name":"piral-ssr-utils","version":"0.14.4","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.4","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1bb51abc7bb87c22775db5cee1d4ea3053f9642a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.4.tgz","fileCount":40,"integrity":"sha512-oP54TrtO8DaoLf00TQo/Jt9HevnxF/9cQLObzf07VuTlcSN6oocZoMM4fEqJVdmbNSYnSyDu6JgmEyQUV5/hRw==","signatures":[{"sig":"MEUCIHAgw3GHZeT2eKQtvqhvSmnvtwtzY+QA7iijK90onwOWAiEApTo3SjW61gz7uMVPpFoJLF9V/S2AhYO15WTfqAe41gs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp0PZCRA9TVsSAnZWagAAu1IP/RKOqiKubxPiwIZXMyI/\nXgCxAED+TQzg68Vo3NIIlpvm+24lypaIVJilwfFdd/u8ddsKdK0y23DicM4V\n9kjduf1pgCJLgUmW+BJW0W+XuNkKTEbwJAhhbYXcuHbbLhvPBYZ+opk3jswX\nBdD/6HzjQhTaCKrIGsx/lk3MHh8UwzDu9Dq6sDJuZrMXdOHvWzNPJElKTK75\nhvrsc/pen5ww9HbdPzwNvgYKSBqevfMNvY7i9JpwoPgbZ6cO7pzoZGBq8Ci2\ngXI4xl/COJGh4Xpf8CKeBg8viSiybqnB3+v/ZPTOpro+2Zf941jihQ/rTbu1\nOI+Z7by2Ie/oyh8bLHS8mat2MnnuVBulDmD+pBF95F7/J6C7QPWNzfaV6ESC\nBpmLY0DhOegx5bceh6iredsdw89sxiDGAmQVUMzUqEvd5WHyEpGgY3B5Scy6\nNBsVAy2Ku8bgF4vLmVLoA2c61GNM3JWL1R2BPL5ZoajyGwTPwXkd2Xl21CJ/\n/Q91OCue9hycPfm8RSUIeYkyHMlqVzUh8Wz3QH8lLdckVpJefRCazzuGobNL\ntI6bOmAgtMbQ0vk+gthGNCCvgfui4yx3kicQl10EUDV6ThHdv9KXVKaFeL5K\nnhYDRhJVuwNx9EQdaHFtzuVp+Kp2+wwUzyGRnFnGWd8yWPQ9bNkdt5nmM5SN\ny0BX\r\n=gUgy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"18c4b414ae4643486c44c057662fd5e4f04bf265","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.4"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.4_1638351832865_0.1428562087298173","host":"s3://npm-registry-packages"}},"0.14.5-beta.3331":{"name":"piral-ssr-utils","version":"0.14.5-beta.3331","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.5-beta.3331","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5f9ea6c05921758208623e8afdf8bd3323b33aaa","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.5-beta.3331.tgz","fileCount":40,"integrity":"sha512-ZY6OroC0I+pltgxmjfewGKS578qIUFESwdxWOUdwyQk1Guwpxk75d4pVL1lJLjbBYA13NmP4HJ7jaCdmmpwymA==","signatures":[{"sig":"MEUCICf1ccs3ZMq+y92A5wxAcrbyO79D68rIOE0+gxJ+QVzHAiEAg5rbroF3pJNIPG30wOkDINCkXP8mzDFY1WcBFzUgEx8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhr5WuCRA9TVsSAnZWagAAYiUQAITHoY9cuSuNMdSNvZJx\nS2w8Z6S1Imelu10qFYBSTK0RfFDq5aNcdpQg7eLeQqGjT8T9gvMCPLTbjU4v\nEWnaNuZLDuIAOVyJDY4moiZ6EwMwpm3gIUTXV/Jseib5WQlBJq0g5mDQDAMo\ntnIQhbXF12Acw2jfeViwUhGdPeUaQg5mFfSBA24sVluvMLYNvRt6L1f+Bb/D\nDMpXwQX9935HMX8cNJlsXcQAm9/+dx9/75PSU2gvizpxCCORnYbx6zR5Agf1\ny/Ep1CWhxpz4UkmXFjXxW5TvjTQcKgKiPuoYJPMuTPCQffxzY2eKUsc3+SKR\nL4jOmuTWe5eKVFhk1KiGsUcZ1Zp1MAOes4LaAkY8g0a8lgFN6Vd12XtLlzfp\ncvDxxwbZvZKRLy8fkuR3y4QcB+U1P2FUw1lATnDDOiN4+ueHt7FwLNE1hWH9\naof57Qu/rY+JpEBDm98NJW6jAibb4gib+gpPchiRnvca8OP3Y8RNeEbgQn+X\nqqotXIczn5Qb0anJ4Ltn2KyblwX3QZfVOjK+/rMrQ5h7WvA4CEEMM20/PRz0\nplY47PdUsbGL5FuftMkT2GqDeCw0QGLImeXPIumeonIbAZSj5rnRiR7fV0CU\nVo4dc4xSY+H10814HRWWxqFFI8Rf+OJYV3rOsweowLKdvj5/nsAJmBi4lcsX\ngxzx\r\n=+2zK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"3db5015a2dbe8d68b87244b4d5ea6c9f84633189","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.5-beta.3331"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.5-beta.3331_1638897070619_0.3717761864551492","host":"s3://npm-registry-packages"}},"0.14.5-beta.3335":{"name":"piral-ssr-utils","version":"0.14.5-beta.3335","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.5-beta.3335","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e10a7aa6042e87df182dad7f7188309091b3d923","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.5-beta.3335.tgz","fileCount":40,"integrity":"sha512-i8tnDPGf8Nr7RAs0uiwohl17C0RITzRvHmhphcoc/ZsTr6e2mCv0XH9SR6NbF3e5H6RYdWNU6GPbEnle3+21QA==","signatures":[{"sig":"MEQCICWyc24q2padK8BUR3Hpw9wj5HxOzulmpJqT4rp1DloqAiBa9tFwtWlbXhp9gmIIEjyThrFc+hwgNwQKWQ+TsmZM0g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhskPJCRA9TVsSAnZWagAAZq4P/iJEqHw1Vl2WQC59reuR\naMnjhx5nE0CowP75ovixtHWNq5zqsY7GbOI2oQfnUJFA6LhDun3guICk2Udr\nKVwz8S3gbcKGTAer/GnQxiaDDjP1//lx5o67cirVAqCi5O73kwPCffVbWJwz\nzRPu/liDW4aTJEagEEvFbMzlx7Y+PGXTSta9jUA3WY53Qaxhq75v1DAi039U\nkIl2+lKc1nlTZPEEDTKMKSNGyqYFR52we/iS+tbpvPlnGOilkRwDXhBgggho\nnr+4FR6+yknep27KVapr5lZAdGuEAVZBSWovLAosQve5D8UupcB5ws4zF+tv\nNXpjB5lSSEzTa+7BT2chuB8f3AoXHZ2+XbbrCmEPZ2jy7iy3a3Sr3J6UDsPc\nKqQiXNxFABcvejxvhFvCaQpMcnoDr2T4akEkbbqq/mUrb7YT2EN6Wj1oUKY2\nQtIdBDcVx9r2M7c8ALO1eBq09ltHwxEUBfCemVNPQeiWMlgzdUGVhR2wEiG0\nahyM0e/53PuKYokmVrh2EkUgnx97fkvs9wHXavbnaTrUv9r68gswYRer9rqI\n6AI02YxRw5CjdlgqBWcCfDr7NlUyMz7Oc/Q0A7CSzpUXEp0TwaI9+QApuyI1\nYAJWfYu2hGYHjY8cXhLSqZej3GYZqCKsEYAZk450f9WsBOpRbqZUXpuIiTaj\nwZM/\r\n=cM6Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e4d630fc1e08cd0b994791870e26fefe9e1a4d86","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.5-beta.3335"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.5-beta.3335_1639072713534_0.45299125980423205","host":"s3://npm-registry-packages"}},"0.14.5-beta.3336":{"name":"piral-ssr-utils","version":"0.14.5-beta.3336","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.5-beta.3336","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6e6879c20a138431717d273261919f1a5aa5d62d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.5-beta.3336.tgz","fileCount":40,"integrity":"sha512-k9/8v9Ne7c1Ps0GNnhvmVTwndHwcoBPtnHKuoKO2fnk0XD3me06/cKuJJIN8qbFLB3C2Zta5Zq+p8b0+ZpsnQQ==","signatures":[{"sig":"MEQCIAvGAY6g4S3kE2OJNhwC8+WD9v3Xt4BB5oP+b5HH9LImAiBjlVs/lyC7/W4ZcMqzW9R3X4QfvuzM9Qtwkh/e1B+WTQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsoR/CRA9TVsSAnZWagAAwDAP/3qqNoRkGKVmgD6cOMbF\nEqL8ffwIO2WRuPqaQIdlI3kVPJ+kctaqTkorBMpC1HspwPVr8Nb37Z23stwx\nxeN5FbauI+CadTQE7aItQfqqu4peucD6y68ClTcZCrHFPnxws/3SwP9dg+cc\nzriutIyZ2N2vSW5ET9YY3XAvRNSvA2D/ocWjrrYHgTxDcvzS5XwlLxyRwtK0\nc77Zhfq3VmGPugFPY4TpuXAHLYzcnwPA84Ggu3I28HJ1+7tm0YcuFEGLa430\nz20f2iUoF5z9KhzNsuEsgyfkbClzq35JWqNJKWvbQJur3TqfHjsLrGd4XRqX\n9ps1ByYOZWOQo4mw9rr4GDS3+gHYQTHDz5S2Xmo6mL9Ws9DV1vUagfLOCOWO\ndsMCwu0Gf4NajWnT8E2LJO0Sof07/qCMB22AfTbhSCiU3VBDirWYeXyMtNIT\nh3OXtd/pI4i17p2LdgLDfoGJjhV5bqh1QdSDZFBgIOwayLbcDJUxA6V6fPwP\n7mk9bvSh4F+F9Truej1ds/gkizT6FgvpkZB0J098PZO6DNo1ktUuEsnUgpQn\np5aOjEekcXj5wnCHKr5YvVNISKP/nV7WZ1SYguQ1TgiWwEc/cW30O+JU+Qse\nmMZda5gMcqjjSVoTObASlC5y5Zl31ZWC2g2h++WrwoPau/OUxijJgNOC+X1n\n0+zZ\r\n=cy/t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"db950799d09a66f20f356adc35d3d6907630986e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.5-beta.3336"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.5-beta.3336_1639089278992_0.9394158456588546","host":"s3://npm-registry-packages"}},"0.14.5-beta.3339":{"name":"piral-ssr-utils","version":"0.14.5-beta.3339","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.5-beta.3339","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"862c6e76555e6cde9ac2d07a06b0ead31cf19cb6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.5-beta.3339.tgz","fileCount":40,"integrity":"sha512-r5Z7T9Gjopx69vHm6MMkR98gZJIsunp2A5zOzOEOIFdwzpjeKKC0VLSJtpEWxQ7f3oiH1ShiLaq+bsXTWSd2lQ==","signatures":[{"sig":"MEYCIQD1UWzXRK9KH2BvGsOGqTWXjz5RiVBS/uEoWm0AGAwgDAIhAOO7JFi1FNTsb/X+feEuALqc9gmGkJBAnb+BXXfJxOC0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhs4XXCRA9TVsSAnZWagAAfJAP/j76RWMzS3MGUPQSdyow\nU8Za+x2UFGr8WRteDyZmlziVVBAbDouPg/whVG5Wpb0f80IEJ9hm+q3qi9AD\nC+EF/+lIy0ep9/iqaYaRxNGChPP7Cm9McBJhfcQruTdyX0Mgz+XoomDtdZl3\nXD8Bgjc+97QtOIqO0aiGkleuSgHqKUn2Ov57kyviqCsLo5bmToK6EBm3pBsN\ntTHJslgLrEiNIReOzEi5EoEIiYTbiow9GylH7hEAzJ3VaqEY2KBEDfoZghpQ\nIBX4YuaapfG1KxFDxsI1hb7sBSNFO8G/2FtjVM65bIIw3oSZaEpn3w5puGjZ\n506lMFab/bFAgJ3fCI0hAnZ951vjKMruqaO04lswDAxYNHcNROykXV90R2Oy\noBQdPx3N06G/mvKMIwEmfgNybOhAD6RS1A1GMDwppKKespyPCNQ6fl8G9PCq\ni1pVtBNbtiPYRqpIi+lh+H7EqJJwGBj54rCxiLqHUecwKOpsnTL2is/Q6PAP\n+SGOm9kipXNP62m4U/gn/Ki5WANsAo5nUNJaWHJD7TNAbA9XiIQHcJVPb/T+\nBu0RMcjoK+h1c2VpPeAVOoIglkXQLOcAkWJDi7zGtc3GjRWArXzNpovGtwQ5\nnWBmQLYSVT2wpAu0p7Yy/1gRFFwrwueYw2oNDlLuQPpeUDyp60FnL9TCHJf8\ncG2e\r\n=cfD4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"8283906480a53afa293d4c7f23c2ac83227ee542","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.5-beta.3339"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.5-beta.3339_1639155159286_0.8651890768846604","host":"s3://npm-registry-packages"}},"0.14.5-beta.3344":{"name":"piral-ssr-utils","version":"0.14.5-beta.3344","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.5-beta.3344","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"46eec4ba6ecf62d78bc06b500cd27fe6825119da","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.5-beta.3344.tgz","fileCount":40,"integrity":"sha512-dJLnTjynd+WGI5QSdkAWrFu4AxPv2LyIqIcMQrpG6DoVnESOQkoFbJo2u33DV4VuTAOhyzW7BCA2f7ugX2k1lw==","signatures":[{"sig":"MEUCIQC6S2Pkh8WEHbV7rLI7rwfOcO0EN8Wa73SbpKzsrSxvOgIgeU9s4YlrZcix4a/b95XaJnqDX+57BYQyxuMV33KqR1w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhtRpFCRA9TVsSAnZWagAAomQP+QEANNMvGRMYLPlQRNGT\nQopiBuiH5turE11Yxv+ensR8X/JV17seW+TXjeB6mJwFpdiYVT+tYFzi8eyw\nun+0MlhPgXBmXXsr4qbyZT0uSx7ORZ+FI4dnBuoxUw9jazTx0Xy9hJ16PYSN\n324dc+LBmnpHtQgfbiAEZWbt9Aqcfk1ru4x6VnyLeIEyHWS1ws3b93nVShzP\nB8o4Fgx6v3HwbCAh5i1rb4kzAFFKC5d/19g/zxdgN93LOO3V4P8QMYrU4QmW\nJcsRtTKZKgVWjBhUPpRPiboEB0hiP9bURcmqs7ZrSMR8NNb8cZ1JfX+bRZa0\nT4LUz1jrRpLPjL14jAvFJa7Q3rXRzat9nxNoU5M1lLtelrLMayZpwY5vgqyU\ns6rMVvFQfFB7YV5WRX80tdoV7H7lN7Etu8kXrTQOoLA3YtcsgHHJdvzM6XCB\ne+Mrvi3ckebQMWExUJ1A00RArUrpQC6VpMSClU0sm1/GP1qUn/NkB1C4JV4P\nKRJ/+hMNZo30QujtrlO5QiUQU6+PUL9RRi38J3b/EsbCTQRwjpyNxGM07mLu\nLZWBX5J44t5X6z1F0usG88kmpS8Yx7Z63hHTc3e5+4fFspxrJ4tm3kNcUuMR\n27CuvUoixhch3+trJnrZEjUGfF9oN6NPYBHAjcPmERuhCKdLyLxzRd1xyYHT\n0/UU\r\n=UAxD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"b462c344e9ea09919e3f9b9f3da058b773cd5814","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.5-beta.3344"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.5-beta.3344_1639258693363_0.376383396630243","host":"s3://npm-registry-packages"}},"0.14.5-beta.3346":{"name":"piral-ssr-utils","version":"0.14.5-beta.3346","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.5-beta.3346","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2991fd6f4274c203c6d1712aa9b778b996138463","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.5-beta.3346.tgz","fileCount":40,"integrity":"sha512-ShUuztiDA769YpvdOaBFyHDjPbOCyj8lxC0fBeG4vBq/+tCJtIzPat8aqdOGtNQJIMWTExfO6oCIGQpGS0LcvQ==","signatures":[{"sig":"MEYCIQCSjef8sVTRL/Pgc5HiUFg1kY+d2DCKEpZF37VhcpQI5wIhAOTN2Fa3QU7kPpW+u9ORR9/zFoYA4KtmwFEzpLRAy6q7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJht0sYCRA9TVsSAnZWagAAt2gP/iDQL1YfiGmzYKU3foPG\nJ+GhZyj9bqmO96wnAw8RAas5F+Cd1UYcbEmytR1Ze5EnKs9ZxMxamf4U65Li\ntH/3RoIl5KgKjq7ugDg9MM6o9xi8oksfADsAzS4XV8mFZYHfggwJ1zFMFrh+\npqDI3WyPIulDOKB9DuMGy5BqY7YsJ+jDRuoLTwuusuR+wOO7WKUluEfa1XTq\nW3pHWyYTII1T8I3IwS5DEkZsBvEhY+cle2W7P0G/6JlbTtx+aku+C0qaaN9I\nP78RX3sXt5nWloFa+3o7T3f5D0lAqZ78xNa24G+ithG2tBh0GPpRYOif5C+b\n+NN6cPQALdkfFvLhLDHCGw6wUV9r7umZISNo/BmhyBsnUUdIt0xpv9cC05Yj\n52tC4jTq2A3xiUQt3YmMNGy1MilRMmdm+nYQoOpNbqMP8Sk9h9mwCR9ZLmrO\nPZLkAfZCCSg1fMCTyQ5PXc/zOt43OM7i0h3VYHT3qEI8Rf/pa2roj7+wPfSH\nBWaiNq/HHz+ZN5eflRTD1vKBlW7mLNeUmyHT1G0HbPSG2UmIY2Qm+Fu7VWQP\n/ytJs3SaR8tBoJ5P3SHXElIBHFNigjw/YPkuPmJQnC2/kQsn+OeAWsxPJJhR\nGULPlXKWOLxr2g2YBxdfW4xNJ7uUv7nksxvFNw/PSLmIu7Calz1OlvwxMyeM\nEWRG\r\n=4S4P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"97607d2b43b9613d0c0c92ed4ce23362710134bd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.5-beta.3346"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.5-beta.3346_1639402263880_0.3332248785679941","host":"s3://npm-registry-packages"}},"0.14.5-beta.3347":{"name":"piral-ssr-utils","version":"0.14.5-beta.3347","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.5-beta.3347","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2ea09f6f7ab60fc10d15a6c764f42d5846ae8491","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.5-beta.3347.tgz","fileCount":40,"integrity":"sha512-iGZ0innCLTpVuHRBnVm+nlIZcv6DR0eKsXFElZMA4Shjw/eDEbF87jp6K9fDw+myjzRsj38jWmJrLvpKJLM4QA==","signatures":[{"sig":"MEUCIQClz+zOdhTdTzUWzdElUjGwsy+I6x+megVgVHBrrCl4GgIgQI90Uf2ZAMwqgwUK7IWA6yvmeU2gxs8Vd6O8vf/XlnQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJht127CRA9TVsSAnZWagAAOwEQAJTedxy92w/3VzFTESXy\nQaB+mMYnDqiVjpajbWhQwn7XV1r7xqh2BQRxJ+Tu4LMexUcVq+k8CELr/7bB\n12qu3sFmsCcGy5OiGa1TVYP5QfH7GjmJUYmjZWO6X/pgoROI3irYUg2+g4re\n091CkYoWqIrZUYfABSqN09m/AJ2xoQrkd/7l3ueyn6hpgjlmb43/Xk01eeQa\nQZP6Tx3x1qzB0aGLSng62VFJ7T/Tl6ZFQhSnoXuEIbvhfp6XOSP2TZmjlpM4\nLTeFhSOG2qUHAvYQFhr8lyPaQo1Q43OpOx8T8hHxV9Q3mWpTIWG+Qlgsq3Ym\njh6G1F9m0H+P65NmQt88Pt+ZnbZmkqrUpZAs3ssw7yCQWrXSjmG9p2y0bJ0M\nf/QsMrWzY4bxxCHltRMcGLDwhn+16nWRiMCZiBQg7ZDWH7lcFaxYtEV5Zu2k\nTiN39kzyz33aFzBOQQdEc5Ffnu4PquyrQvVNzEgQuMUhilX+C4FinkODmRlO\n/I4Aj9bYmuw0Gl96a0wST50BPSdDsqf0QNugXF2LgSjoidElWr19usk1sNvO\n0JQ20mge0TxFWG0ai9LdWKJFCHJ909FzgI3OwTW15hJyYbMZq0gF+SAQ0WKR\ntv7CS2OOBOT8G8bs8q3mxgIzKgKkiJRDY1AQ7MJyXPMoymsxzyrfksm/Owcy\nCt0B\r\n=4Vui\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"b0f46ae0f72d5da0fbf834d5c5f553cc70aaa648","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.5-beta.3347"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.5-beta.3347_1639407035605_0.8908558996835032","host":"s3://npm-registry-packages"}},"0.14.5":{"name":"piral-ssr-utils","version":"0.14.5","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.5","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"21b50b9868c2a50fdfa787c0dc86d6f245d0be6e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.5.tgz","fileCount":40,"integrity":"sha512-VUb3zVBAdLxoC/gnbLRwTCWvyU7jQpY/Gii3kTMbXbPz8sfFtgGxaXkUcumEjYr9PHtZC79Jw0x+R1exV70aLQ==","signatures":[{"sig":"MEUCIB3iPXIB3FcUQegmXVkj3UX1Io2FI6tUxtooZDBlnC3PAiEAzKvB1J5FWQl1gtFiypex6zbVVt2kyclnOgt5Ta7jLWM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJht3dNCRA9TVsSAnZWagAAh3sP/1H4eUgZJbIQS3KD4SUz\nXInUCzcR/Qg+O5nnbDNtrpWwO9zoPYKYYVno7ApW4Tu2ijPbqiQFE4qRDYCh\neybiW+wjVCvfsanhQVkCS1akALepSGiu28YkjPTRVZYNzJWp/DRI+T7mG1uq\ncN0wZmRWTtBzl568RvihHQHLpX88D+irmwcISx0Y+a1mi714aXtniuFII8IE\ntJR3UPMqFlAfLxemPEl8BVTSsHi2nX5jQH5i4ZM5NlgpLUA5cSM/LtnaIzk7\nlrmLofZh2S/e5D7zmJJZajBXZ16ltyX2s+KyDy2G2G+8+w9ydOlkxQ7/ioEA\neSbUc4yL/b9d+iuhzR8ZE0C+XJs1v5fp0JjVrEFdcmuK8vCEXqULsHh3ENUK\nMejCZ8lhtfiLmuU03OuLtIwyB2Ob2ljg0c1JssJqBwkH5bmd+JhPmrpb3arV\nhZSwCD9eiPaBE5bpfVmtn9fK87/3YPBWAsJZ6/jvlRTzkENkoy7MczqBpuAs\nvFBJDgf1eucGU1ejZ4kOzipPwrze24Ltp/FK5jcquVxj4kzIxOFWKeZW5IVZ\nAtbgO1yK76BAFJ1vFp2B139QespM71uTzA70ZG/yKi3N9yDWQ05zpIru2D3R\n8vsVEVI2nGhD5FiyHbttPMu6OXyWHfuWyv6IK4XGebSifoQDMOKYm2VQDJHT\nYTrf\r\n=qDds\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"d2c53e25895f855fb7be6f7a09afe6ebe8b599e6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.5"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.5_1639413580926_0.9543202912711204","host":"s3://npm-registry-packages"}},"0.14.6-beta.3361":{"name":"piral-ssr-utils","version":"0.14.6-beta.3361","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.6-beta.3361","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8007aaf9f15cb56cdaf5ff2c5fd8a32643bd4519","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.6-beta.3361.tgz","fileCount":40,"integrity":"sha512-R+vB7ZPVqU6pCJXlUMaHW1jqT5CUJRmnpYjKg+i5hgT9NjzgePN3Hj0kcf1PYOxny6FdvZY24sslktWu026saQ==","signatures":[{"sig":"MEQCIAHeftJAWe/cE+VJb2z/MuER2cZrDAFFV14sY8GqhxQ5AiBDCnmfSZzr2XozXZcwMipPPZQxWaTpo+OLihJmsnGZwg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuh1mCRA9TVsSAnZWagAAEqgQAIqXYEmYkeu/jAxRFkYf\n6i34ao3Wgp1LafxykfL34GxU1ih48Xpq6HrvZIwcclU1pGm8f5ysbuu3e4Wu\ndLilgNVJqEI2CsU/Ztw3N8N2HjDwrQCN1qs8jgl07HDYSeM7YSWhaigtKYQk\nYkB6XxYKvmGAULs4HFxPNKVsX8mkYFONkzn/RTC4f8OGoxzkHnTAl5/LBRqS\nYnuc1zbqhYluZbf3eiN2PPEQBFsDHwtd99JvF48bkYAPMseZJRmAyv40Wn2c\n+EuxxADWYhrZ7ZoJwt9uYZootTS8dvUmFcqM8be0HBfcwBcV7VbfmRZsRdAh\nqHpYx3GS3+kAlpKoqXQq6bQ26wb3AR7uxsxjEcVC/VXfjS5J5yilHFmLp0or\nuppQLI3mDG1oCmrrDWW6xr7Idv1RCMgzPxgEG0OHBVt8GARAmoPJALK4ThjC\nUOfSpVM8HKXC+JEz9N+oOhRW3U2UglYlKga/gik39tlFa/gveyG3J3cxnZmp\nf224HktUnOakyZCk1f2nyuVT4sGXRkdyYjYIO66Tp/yB/cQaAA1KBY0QOkOS\n01NE66fakYXrPc/e8jubSnu+qMRn7nbPplpYL4fO4NZGtHSmdZsx6C1K1O9M\nGZw7g/6SJpS8CxeLNMqaOaSto7CvK8HIOImMJaT6oeZiF7vIffMVIBMomNGg\nIYY9\r\n=4KSv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"de8dd4b06e6115257363f763e9d24fedf740fdc6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.6-beta.3361"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.6-beta.3361_1639587174043_0.3320235568285994","host":"s3://npm-registry-packages"}},"0.14.6-beta.3368":{"name":"piral-ssr-utils","version":"0.14.6-beta.3368","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.6-beta.3368","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ab81f2b4e8a624846d717826bc9a937abc6f4e80","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.6-beta.3368.tgz","fileCount":40,"integrity":"sha512-I9p3vvB92SE78zKCw/0yXzPf04QAFu2/NOMKYi7ajNatfCPUuLwjGbiqYiliyhm3B3BTRBggHWS6Sd6S7RxkPA==","signatures":[{"sig":"MEYCIQD/sSd2xYn+QkLtArXQ4Bzb0wuzyCFxgSz5XwFH8g1oawIhAIgzvUqp6qoILXTRcdRdQrZ38UxI8Wf03xkB+F0bYDJC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuz37CRA9TVsSAnZWagAAFVoP/3W8IoM5m5mNpQ/yFX6O\nsY1gbOAWLObS8ByH9keI0KLKYsgVyEHBHMhdfdvLZHXAuwvjwjkyYZiQpPic\nRshjiaXTUBBgb0r0MrMig3Lz2BsaGnvYNIQFqNIaNmfDnQZ7aLNFJyddsa1U\nsA63xxj+uNas1Yc/ZQRIdq3uzxLflrU33p0FhhddVOQHGCSUQhImjU/OTzKX\nXbxuOV93+VEfR6McMY7VPWzMv4O8uflYFLH/2+2E/xKxL53syDt2oq7FTqFr\n8PN+LiCW2KOhRe+iVuOskQq1YJZm+LDdU0V/AgGNfplGObGzFKoosLiJyxWg\njEY9a3p5pSVPOIzkU2bdiDDHT3cdULy/B273ldqM/L7mklMTf5ApXnDjo8Rt\nX/STlX8eY8+LBneRGeshDoljQskRkffk8rUcuUMsDCb9Fuq+iRZfBBsHskCT\n5HXUJGORAdCcCWG51fKsxOfpxC5a9JzewZoHvFLTSwFFWhGqKyBWTurgxQWr\noLQjX1rycbUX26WxpXdHE2gMExT4Zf/flWotXMTAV5gYugHLSEotzaQ20Xnx\nJVWLXLHMCGbPWhvfiFuhIYVYlKFycyk2TVP29ncRd1HSZ+GLXXORgaSJSN5f\n8luYnodJfB2KKOLT8ilcbZTkkRTekjoDTG9ar3URwKr/nEwCXdwEz+qL2bvc\nqr/q\r\n=Uh9T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"f2fcfcba5ba7ce9ac91cc97f9a4371422bb5bf36","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.6-beta.3368"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.6-beta.3368_1639661051470_0.5152211511726357","host":"s3://npm-registry-packages"}},"0.14.6-beta.3400":{"name":"piral-ssr-utils","version":"0.14.6-beta.3400","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.6-beta.3400","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"42ad77332367bea394f17c44282c5230fd01bbd4","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.6-beta.3400.tgz","fileCount":40,"integrity":"sha512-nsTImoQHnKMd2qPqhyFKTwLZyXihKkxhkOdllw6FcQ2NHZYvxZHklnPZZFPAoEwm9kM9VMDO06l1R1d6Pl8d7A==","signatures":[{"sig":"MEUCIQCbQQtGqxMBWVlGpPy+mDOzt0Si8DU//jTTqZxE3Xt9IAIgJXVpZfeamM8Jmg78tO1/AjPxVb51H4O749QZ4tAXgTY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhw7qSCRA9TVsSAnZWagAAimkP/AzZrj+QqI72kToO5elP\nhhw3zGQ4HBRRbxI79unSJKK/a6+GpTdG2dh60JGn+yXFFd6GAHHEA1B3bAht\nvOmWfVAblorXK8c0wD+iquh6sgJ2BITHNnme6wZ4iEbQNz62DQlKazhek11s\nJ4Dcidf0fk8aqYe/yhDpI2b9MkO5Sd2k9QLhk+SNBWu6XamhIvhxVJhkJ8nd\nWSJ+9Y79pBQJKEuSP6plULyryR3Cw34i81thwKPPYZtf4Ex5eOU6tGCPYjah\nwE5QfdJQcAYlvymjB6z4wwPO2ZEwrB4d4bmR2ei1JU+JLm00vnWMsIApBoxX\n6pvbB+1wq2++xu+OV13Yzp/AJGGJ0hMBq3Hgfz+Lroehqhz5cSK8wLoPAEKs\nOhy6LnQe8cN1oiWy8r0Js3wxX9dAo0UaaPTU4zNZ6IZW0Ub+YzwrBWNoQp6B\nPD/67bxzbHAOZ2zUo949n9MbxKNTxUIx1Qv2JdpxTT5iwARYfbuc+vYRqdUd\n2wtKfg3h/K0BcZHhWCPd7RKpTl0UahpEqoYYLovVllAoCChmqWdDtHpIe8Pf\nsC2OQfaYjaHjluqD2GzzR12qjyqFt0xzv0XxGr8CldPdR4+sK4i8dIaD2fGR\n2+dQTwIkRu+t4VfAwp5s/RCx8RJxy+sXXGN1nKU6Wcd0ozMLC5kQ/tW/QStQ\nLP4u\r\n=54Tb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e579432f5571034e48696c185d354b5a53a12b9b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.6-beta.3400"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.6-beta.3400_1640217234236_0.0705869822542331","host":"s3://npm-registry-packages"}},"0.14.6-beta.3419":{"name":"piral-ssr-utils","version":"0.14.6-beta.3419","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.6-beta.3419","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6f0bfb9da4a5e753e5d5a827964286f5814370ad","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.6-beta.3419.tgz","fileCount":40,"integrity":"sha512-vY2cL2eLopp99mTZj5ux3ffXGT7bzQZ2Or8rZ9iu0rGieTc196DVJsVzCSILXicHcqfeOAFWVtxuP0VXRtp8oQ==","signatures":[{"sig":"MEUCIQC+1AhYcNtbJOFPQ4X4bb6ivq+ad9iXBjIJIRyQCVtYIgIgYsy9ITIRT0dRLI/tXv50HWOx5f+AhlHb3mC8XAqALgs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzyJaCRA9TVsSAnZWagAACKUP/j1P/YWp+jMmcYNiJAxu\nCZXmNyFKlNOmaq+xINd7ALo2s4y/fBLQ/A+Ghny5K3npPpYLBeub79ZeYm+e\naOokyoChS0Y5x2E6v2j5K2pYoTK5SS3hWuuuTiGZvnq3LB4LXoj2p+FCIeOo\nciWp+1M0o6QOWJi3imdesDb+e42iUpSLi2bZGK/oHOYFPH3+JZ3xiiZul7q5\n2idFV6MZ7HvOJ2TZGQPKDGEFnG1bG0eY9HeYGymFkqwtjQX/R1MpRzs2+Kqz\nFlGSsIyZbLYHrNDqtKpyMJ8cgWahjENJf9DVoqP1bcjjLHAtsQ/NVu+pCm0q\nHALFNl7Woc6WtGYkjo63TNSmPyi+nd3mRZpF4iZOfPKyhshFgyMETyd6inVv\nj8wMDl+Luj/diTZjH3nmsV6jywRpGgfIUxxpOUR355pWVk+OQ3HmbDXFwv2E\n+UsOZT7OFM6SizONdX+JFzT20kPWwOVm3sqyPIORf9cVCDKYszzlk5pI0ZWP\ndjDe51zkUirWmbB6vTXr7MlFAK16uf6cZvaAiIXVmY/hOdxwpVsqjnQRXyq1\noInE3G63UMNJ7YZO4I9jiJ/apDw7wAOH/e4/uNWCk01hZaKkRDWC1A3QHjw+\nMOpTIzfiFE1IwWNG/BWn69Ryc6fjMik33o0t5bu7mFNbuoY+anriI2Ltm7+h\ncYtq\r\n=I/qG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"7c83ddb2a2b193991fa16153c92b84356d8a30f4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.6-beta.3419"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.6-beta.3419_1640964698822_0.6820963998762672","host":"s3://npm-registry-packages"}},"0.14.6-beta.3425":{"name":"piral-ssr-utils","version":"0.14.6-beta.3425","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.6-beta.3425","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"451896f87aa666752afda675577e8b0d370b57bf","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.6-beta.3425.tgz","fileCount":40,"integrity":"sha512-jjyHvnt+SsP/ayNc1+JBgK+JkvG5J42BgFRhJgll60D6BWS41x5xcQLRSmiXO8guatVJHtKK4oQv9s51eoAZkQ==","signatures":[{"sig":"MEYCIQCt+XVMfTyThOAI/RIK1BUqEdlWpHaNr6rPSyHr3H+wKwIhAJ8ygtjhj71jc4AhEbIyW2adG6joZbVzmIrNtGEk9ri9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1WbBCRA9TVsSAnZWagAAUIAQAJt91lQngNLImCH477Aq\nMIFi8gyZb0NqeZ/18AkzOwvILxWOGm695gZ9/UNI2yDIt+/ZTzxPeCMJBr3F\n2CmP3UT5FcVjMj5uRS74y5I4h2iwQOQ/XJnReHt0axYlpqHtpFEzzU/AcjTw\nUOwIQCDm7j62qdeg8zoUawkVoR3EPMmbmRqa8cV4iOVZUAq3/Y37UEdAIm3m\ned1NnvUXwcWFtzxdbHugy8zEby3ZDc3fqBc+5PT+iOGzBg5DYbuQcejHFU8p\n3NwXtPWqmqLi2BH7nyJC5f/itZ75oTwavBBoyjpDV+IElPyJbfmPKP8+Vj00\n7ELzjgg/7ZC6il/JtoYcyCyYVbZa8hOxaxiF1x7pI0fEnw6FVIgk3zpgvhgo\nDzOeKGBSal+dexP3o0i+B8GR4ehQFJJZgUMSy+GGJphu2PqyJC76Zd8k2m4C\no2VbXTp2Oj/VTYIESRwkauBQ5HinQiUIfPvYXhHCZ7ST8++Fiuc0ntWab8gz\nP1jsMqdWcymD/gBy+Bvq7dd/8GQXQwhBavTKTAoIF1JUZPqGE0fZNSJczNyN\nUeGFc64pO5FCc7K97kS7Yw7+tCk+crBJXlJSfrt6/qZHrLd8VoZfQiQ9ecDZ\nutRO69HUqXhWI6mNC7Ds+CWd/aOH2iFgbM+CUFQhxVN8Z7ENFRQjC4mOyO4Z\n+rVg\r\n=138g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"f24468e2c9c308dec7908a787411bd91534e0b96","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.6-beta.3425"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.6-beta.3425_1641375425287_0.5141617801135201","host":"s3://npm-registry-packages"}},"0.14.6":{"name":"piral-ssr-utils","version":"0.14.6","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.6","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ac21f7db9381baf25d2b64082c45d0adc7400a0b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.6.tgz","fileCount":40,"integrity":"sha512-Bl0T76Vn8C2X9YDMC5DkW/bYq2zwX+YfeFIQH5n6u5YhqJ4H3LWd/UMdk33g0rnBMIUykcm944Th2Obpl0WtMg==","signatures":[{"sig":"MEUCIFUnkroyzMuJtKjPhaw98Gn6pq6d0AHMFW3MvzigdK9fAiEAx3Jf8UCs96Wv6ijn/vOZUv4iit0PZcvtpRf9+mg/QRs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1cxhCRA9TVsSAnZWagAASH4P/jZ0ofs+W0k8uVpwC59q\naFa6IPKqCrlElrUnafBP9gTh5LbYKUBo2U1NR6ksaMJqDPV3uYqnSF11A14p\nj3KHA/eEGZOHHi6JxZ4bmOXER1ytX7Y4IbpqkvFErzu2QT64r9yyCtMynx6x\nENIbOH5nHcTpGVdzZ5+wKhYhlgQV1Uc6X+9KSx9Gw67DD+gsuWAQs1hcaiOO\n537P5t/Cb59yCnh9XDv+j4L+iYH0lENCRSNrvLBZNcNJ0RONUGsTraPfsTba\nyoYZqSZlRBpml7X8n6Co0JwHmdv7YvQA91zdbBAseOXEp1nCu1zbPhhA9PGa\nLywjSbbaJS90Zo+nqbpYzHYHNTLsF0AWFJn23RI7HhYaSG1sZ4PEm9S8OIX0\nRgeTsWag11MUTdj9A161Ir4QlpLBMmNngJDJg8rAf0FFTm3a8SnNXECoWTGI\n0M9pPQ7xnvU/eXaV1zjkVKqf1JBs/BxPfIfrLKKFCDPNOj+Pz1gXNHsgQ8lC\na1TrCAyv1OY9Q71CfYutX6uW6BjRMpt71HiygoDxZRTTMPSoxLei/HYA+r4M\nZ0k5J0Fl4UXBeQF97FS2rnHha3t2Nl15LzF8kOG2zwvfC9Lgc93OKEldQsVC\nhMm6wPIPdbN6YZrxWPtjsIiiVLhikt6546evJtcTwIbvDQrf0FByIuaIJS3N\n952x\r\n=BeeP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"58dfd3dfc26a8856b241be5220b0fb8932107dc1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.6"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.6_1641401441746_0.2381771671469768","host":"s3://npm-registry-packages"}},"0.14.7-beta.3428":{"name":"piral-ssr-utils","version":"0.14.7-beta.3428","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.7-beta.3428","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"01c8e2fc1115f79b233c3ccdad498edf72dd49fc","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.7-beta.3428.tgz","fileCount":40,"integrity":"sha512-MLxXB2DyMeurl7hDWUghpxskn9RFK7kQdsO4TwK8u8sgQA9rrCUxmfeuVtx3ybThfyMDWHrawc2KNOj222Nwew==","signatures":[{"sig":"MEUCIQDjywycoe40LTcWkSs9FYJxWhW6mmt86zdWB6uYyqLK0wIgBycbj1sdMOzzfjP9LDSn9ICJpKtpggCMNNkigwJvfAA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1hHYCRA9TVsSAnZWagAAQrQP/05zJFN5QMrfPr6u7E6u\n5VjXUIOUpHmGDKvvUuR2JzuIfjbnSL5I4/I+HBQBa1QqIBq09sNU8fVQAhEX\nzBFDPgiIT1aVtyXW1G5RPlwvXFrYYu1BHbXzL8iyRqsALZRHDebuTu1+ZfuO\nfYPijVnEJXmKguelY2HYidcMlpVRgbejAup9Hdi+LDNxXMUmat0qN6ICGyqp\n02+ZgaoWSd9p/Zja5pYCMRlb6KKjEYr1JmZ9JZpUbwTeFhqZTOHclZeO+oAF\nie1e620ZT1Ev2J7b2BNXmdFvw7923K/h5FeUaNpR9zsVIW5kDSHygSiJRUTL\nznyc/F76AEo8Jzo2IxmAMrbns1Q4LgaQTaBvgq0CkZXRmGOEPj9pbQzXKSMI\n4TtUoGMQl6/o1me6+Q77+h8JewZJQFis4fyooysL89Qi/dUM09w251ou7b69\n2eByE37QUfDuUT8mHO0qkxyMQLOjBPFqI2zScZmgX8nlR7rqx8/oQ3OeSUb9\nt0Sn8Tk7z1+1DGqeUDoKJ2AolvJAbrYM+xxXkARc9xSqatv7X9r/rryFISCf\n1alI3rtq8Ocx6btudolXoiFOD3SmU9+0LmrfxDDEE50+4YrMP4FDfaqPOE/f\nmOpyKtvSOj6Ff5W526R70CXPgzKXDDQahjVykLb0JHeu0KIjtjB7IWptKIDz\n40HV\r\n=xbe2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"68a26b99cfdbcc8821335ed03e1446b55c358692","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.7-beta.3428"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.7-beta.3428_1641419224352_0.7047594916082804","host":"s3://npm-registry-packages"}},"0.14.7-beta.3435":{"name":"piral-ssr-utils","version":"0.14.7-beta.3435","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.7-beta.3435","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b4759d4ca1b803a29d32c6e80cc218aa22141bbe","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.7-beta.3435.tgz","fileCount":40,"integrity":"sha512-im/252t03f9M6ck6Zz6PNVNDG06cdSNZokMlOtGSzP8GS9Cn9iXG3CDmqbbly5pQ38+5JH70HiN/79MASMEE6g==","signatures":[{"sig":"MEQCIB3xOsnUBajcGjR7StZRp3i4XMujMj8jTSe/EaDp8OOwAiBPHvGad+ZdEW/mN1aeyFVfjWenPZsVAHlwsjNgXtjqrQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2W/yCRA9TVsSAnZWagAAeGwP/AzZhbSBWL5BB8YhMJSK\nOKcw/Q1WDZjSlMljAPddwdQYfZetZRpQnT+PGrIg/vBI6tRMcDjaQCmH8FkA\n7iCLkSnDiyJU9ynby+rYFUQTu8cJcwjdkZZC78qD34OlIwyRm0SnIm5UfpWj\ncwEv+1mp0QZ/xmpcltsXsAnkRjhWmInovfQsT6DGq39gyIUONx0/ZaYIlzL4\nqc2OjYm244Zjtje7xoKte7Zs5m/vWq1cdH4foU0OuasiUJv9rjMCLisRjlhs\nHN8lNNdv8eRcBdtw/mH5plqWrftbd9OBBYsoJio36VCSCTo2MjTyBHToLpU9\nkhRy7jcLMQLPeH1mJnm43ylS/9dkc823v73bpWD/fi4aIxRNMDk1vIbeT8Sp\n+bPxNgkYxTTgMU2VbtnENa0fge4dR1befCv4K4lkzIJ09sGZa4iv1kLEvPf3\ndnC284of60kevmCcn9vtb6BHzpEgbxX6IXxic1QYdDAHtD9KZtElPUVqCGUW\n6ceDOw8OL9bbGT1avmYLxREjXzuZRjMPP/3awZMWtVqNPjdL/xyDH/QhCw7h\nJaCBpdj6yJ8aX0Oi4ULi9qetfg6iepXOf04joXMKWySqSTpPSX2yIZUt1rrK\nN9GemvmMLLdRQZo9QM/vIbIYWu5t8lzMU7EpXiwd1VuAPSL3DdA2RjXoAL0d\ng08M\r\n=zphy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"abb9340b35e505f687b9d20eaa8f496007ffd976","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.7-beta.3435"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.7-beta.3435_1641639922018_0.5672923563792363","host":"s3://npm-registry-packages"}},"0.14.7-beta.3438":{"name":"piral-ssr-utils","version":"0.14.7-beta.3438","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.7-beta.3438","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1be9e92deb7b2d5bb8eb29d1144022720cec4351","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.7-beta.3438.tgz","fileCount":40,"integrity":"sha512-/7J4//QvazvUVy4O8awnsefUYmrmaTTChpAoxYyerN2NDbYFJPDVi/3i2jBtvIHNJBQlGmuy2B0oNtAJNlqN4w==","signatures":[{"sig":"MEQCIHsCqHwNdvYOL7Gmr+w1qxlIDZHx86/+6PqbVPrYSBClAiAcVIVctenTtDKD5Rr6MP6Yqo5sAX2yjVf83lhAifT4BA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2q4DCRA9TVsSAnZWagAAhkcQAIcqechw6iwtRu12h57i\nXnDh1mPG7ktbLETeHRneeri2hZBxCFbqQ/MenTxB3oZwhUN25BHQPdWmjqpe\n3ZtPkThB/mi4IHmndNwgeJgaPKKUFYO9RGj6q4traRTDzPoFJJajTN/HmSTF\naBO9id48vO1RQNbNEO297CuUEjiq73zCFJVFcCV2nItKKNnyWQUuDe/MfdSQ\n8G2JeNzmw3E76FcdKGqPBRr8jGCwPcGjuDR8N5Q7QJpyA2HIO6gjlttB/I76\ngPb/FntkRhi51NZ3P4vbEzD5tfNBsntNLb/+wFQGMLmyfa0RQexWBUCq1lPR\nf0+RDdI7FMtceKIuvqxNf+cJJyAxvSgpbZKAkyPC8JS3g6eknC/qUq51CbdZ\ndKS5R3jwcMv5KCNsiQE9vxjtYLlBalXO2s5CfRio1SECpp06l4jvJOk3M0LA\nqd4BQZ6uk+OgFcYWKJxop+IE2dwZ+QpRXjI0vbtKN+xMGqUpVRYq2Xi9Oafu\nKCV6WEQM7pt2gZwSgz4fLMJanTS3xrO4xqtyJoTgHXoWEsYhWr6BRdTdvMYf\n/znrJ7KpR5rp9cE2BDnbyTX7jusgemX1i7y2JB4ieZDKc6KVbk+rjua7e7mV\noVTojZVOZP4j4f6rKiU5F3MxiPVgSJFYW1YJtcqinTvWASgAmnX0OA05trlr\njqBx\r\n=IKHC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"0045ae2a368207a8b346b07002551552a2882a43","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.7-beta.3438"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.7-beta.3438_1641721347190_0.5568694461789083","host":"s3://npm-registry-packages"}},"0.14.7-beta.3456":{"name":"piral-ssr-utils","version":"0.14.7-beta.3456","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.7-beta.3456","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"644f5411d1b88f22af9e59144dbda0207bccdde1","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.7-beta.3456.tgz","fileCount":40,"integrity":"sha512-9lifhYdBJ7td5aA1TSZuW2bynAF2YAbxuKCvg3CxNK1EDmPUBQSHIdWlGriAq8VXHDkvOCdN+M8G41wTE8dk9Q==","signatures":[{"sig":"MEQCIB2ePJiHh2tEAYuLl63FJIcLwkbzxiRZyBhyu3EgVXjOAiAkLJCS+kpdacYhRGpsXRYWN39XCMNSv84Qa6OiT7Ctxw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3BwfCRA9TVsSAnZWagAAhHAP/i6s+/3HIJ7F08HoHWn8\neaZ/A9AQU3iy5HKkLTfAsgvypPXsAmi01iS1wUfrcr0kRpiJIEs+SkKzR50Z\nvZS2F0kOZ4whvOklTBHe0DddLg2ER9w11yPqQiiuxKjy3DWi9LhQYDp2gYhV\n+ThVZV5/FYUQveBrrN8I7tYdWQHQ9ml+Z6iySMcEsFzLD38xYLhuA+2HBp70\nhV405y9y/dwUQKrnUsvtpnaKGW3uiaPUqbohyq4qzFQCnkioptMR6tpfs/dc\nIkpEutCd0DK+enLHcaUBrDOtWOhGnfshF9bPQV2fgj9RWqq+QD5FQExTO9OP\nt1r1tV3se8SJd83Tx3m0HjEJztMmTUYXRDu7+MZGefDgcQVY/Kc1LOKMvqVA\n9Z9+7uQ0yUyAsCL+9lAZabX9gC4LVsWTwIdEgM/n/5xdcO1fN1aPBI6FASRS\nEyUSgTT8hJfN24KGTR1k3L5ePTp0t5lYMA7MZpqb6rXABdDdCJxpHTnhl0Qy\n2RghKkud7R1AUaxTFBUFMMQw5njFOTeyXj7z5XywksEVEkeBZ72FE0kElkmR\nKDFRpmBqpCEvRebL9NVMDN+6bn7hTbUCE6hR+tO1VLktSqMeWkiKK3yDGV+X\nqBsVCdFNyf4epPRQtFOpvIR/BrQTS2B8/YlcWPj0LDcllozBkEyQOui3ud+i\nYYJz\r\n=nP5C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"38955c6a6d441bee3ca3d737af02d02f54ac9e91","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.7-beta.3456"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.7-beta.3456_1641815071610_0.4174297827399227","host":"s3://npm-registry-packages"}},"0.14.7-beta.3463":{"name":"piral-ssr-utils","version":"0.14.7-beta.3463","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.7-beta.3463","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6f1c6fc896a6aed7b51a3a1704ae9898fcb26602","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.7-beta.3463.tgz","fileCount":40,"integrity":"sha512-eF2F1Ng4ncZ1+qKmVGcZFibiGZXhbzYjDd9jJ4/WQ84sz/yrq/QFJpbXVtXuz+MuzWelOp5Z4X7ON9cHKld5uA==","signatures":[{"sig":"MEYCIQCimpTSlgZ1hgmnCExrfvDBzVlOTz3XLRRjfVKL0JYouwIhAN8MpywpCbYVW2hiNMrXxtE5k599J1WlJOjeALffeF4H","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3DXpCRA9TVsSAnZWagAA9XgP/joxW2dd6A6roQVk3vxA\nMxnHcfJBP/lvrpDZEphZXLG9QsOco7WbzTUwVYRlajmNf1rdRCjkWnWloTJA\nhjlWwLJBSR8sZtJIMMLlcwlp1RMh3EObez3VxckILq75o1WtwmTGGC4BBhEz\nRL5Rikg3HZEewDcrNOAVp/fQX47ndaoxTrQeOVYI+8wK1McH9538pcV1Tl/r\na2rPzwFuCAunZ/b/1xZDDm0xBE98ATuW7mtY/QQdoeN8XwqoKhBNfAxyY+g+\n7ZqKjpxHTnESg+rIT5cT1rw4/7NvyY/4zeXx5lGtn3J15pRA87Dx5CDq7J57\nqjgm48yxjr0GzT4+pxhapvKbkLoWMW8OgbnBXSsbuqWBADsPAHgmiLpkKXWM\nI2P8p4o67O99YTQ594JWmCwkXPbdVuOxAU1rl+cHnC3j4DDaMX1BWcjIRFjX\nJtiE5J5LKPuCJKXm65VVCoyOCM2M/OZ5KcAJcTPtNouEMJMzuQWPLgvJVsvn\nHdstYp6e6WXpTQxsN71dzUU+5d55v7TE4LVh0MGYJ0GHAv7xg5vS04YbxHbj\n3vxsN2Y2NFsiSidwkK5WzJvnpOKqdciGljUMKiLWnAyVaxgl4FGdPqIoH2T2\nuyU4pFuksgjG8P47sPuhHhn+sIU3w7NkD5U7MG3EqWCwxJwzeSEErdPLRIk6\nBFmB\r\n=6rnl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"46f8e649fd61bfbb49a7c24d1ff60e5c9435e4e7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.7-beta.3463"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.7-beta.3463_1641821673470_0.025933554132938408","host":"s3://npm-registry-packages"}},"0.14.7-beta.3467":{"name":"piral-ssr-utils","version":"0.14.7-beta.3467","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.7-beta.3467","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5a867eb7f9d34695e5b36348a9c2b0dc5d66726d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.7-beta.3467.tgz","fileCount":40,"integrity":"sha512-/0GY+Wstd2EBZb/ODMAuZWqZBTtEo43XuiML+s8SPapdaHMLwP1BcZOzjb3Pg1Ljtl8IPgm1hoHPZlSwL+gz3w==","signatures":[{"sig":"MEUCIQCSmB6BizslYPTzvzOPJUzm9pRb9WG45hWh588DVls4SAIgfMmtbk8Bm+48vNhtI00f5+68Iop2FACv2H2Gn8MHf7Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3WCDCRA9TVsSAnZWagAAZk0P/17k4h/pAt5o7FQ2TXO0\nwLne4hiPNW1PwGK762QoHWRbVcUosNnGwBKF/4tDhiK6P+UWkBGqK9DOgfzM\nAqINKBs6zwTzprCCvL/osdo7/eyRRX3yQSK64oRt2o5bMKsljVOtVSa1kVZq\nRsPvpdZxPfLoWnQoIqkcVQCArazBUvmU2zkpgjwGDb8qXJvWoJZhUEGbKmeF\nfrsaaaWxOEiQPYCMUDiJ+e4/uMJ/KKeQ4F7p9HHPwD/vfCfcvWBFa6ocreYL\nYqW2Qf+16YVDiZNvdpI7W92rI2es6wAIn9Tp8l50A5XTNTOGAGIs4M1Gqox6\nZ6PvNSqXTUL04aOIh8RYZtyWhq5LIsXdVii2cNXCXSmk3fp9zqfmTOix/x3v\nHKGnPbdCEEvmA2ATeD8sJd/SruXin+8XC0ce0edZr+4TL8wsxcI9wbdaOxLs\nOk1LX+sIMM47GhwQH/z9oi9kzTvNhs6yAtmLy+fWkpYk5J3VZiQJbQTsXzQ8\n5Ot4QY5OGrIyVv83uAYOWMKDOXDugz59Mxmec9bQGSDSRAo7Qe0g3x3NZi+u\nTEA+bLmR/d35MrUTZOiRfIv8wM3FYtRGRD/stcTj+h/BYzYYIhe8f5+9SZA0\nIwiBtHmg03X51lUZ9J/nktDUqGj3RQGIrILCkbLQ+Ld/ygd1NQrOBvP5o9fI\niPH+\r\n=SJ7O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"7e212b074a1788ac6bb0dd0445cebc27e7c036d1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.7-beta.3467"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.7-beta.3467_1641898114922_0.6231468989040843","host":"s3://npm-registry-packages"}},"0.14.7-beta.3472":{"name":"piral-ssr-utils","version":"0.14.7-beta.3472","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.7-beta.3472","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e8b78d836261ec9a350082011356fc7f352841a5","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.7-beta.3472.tgz","fileCount":40,"integrity":"sha512-4X2DQdiyqEAYN9hx929HzHrN/nfv6YOVqZG9JzSJPSgUZvOnpgt81b3I2ANIX+L8H8kVJZoN7FKsFpzGqcrzcA==","signatures":[{"sig":"MEYCIQDv+aqTQMVH4Fq0c1MgzwXu4hzRT94rDVnkaC9UQE26VwIhAK0B2FlfOpA2Cw0UJAxWgpIC3ACbiFDzHmhOltusEjPk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3jCuCRA9TVsSAnZWagAAj6gP/1s65oZ66xwj8fz5gzgb\nGi7KDofWOmCZkOKkoSb7nHRywutKQjqRVyWycGS9qRHdfP7sQLzw6M62LdPK\nJPRLsVKqPSIqwoPblq2PhmDFkywlCiAmgR7Ch7kv/du++5kWYiKL2ZEAjJQf\nWsg7ceSesYn+od8i4aCvIUSToEu0sZz1kSPcHwd0yzrBb2bB7FuT+Ift/vge\nW8IeWd0mTRmjaI5lMcIxhMtax956J/0H5w4TVGM0WNRB3Xv6LCMRVQUBX/dH\ncBQmbQ8yv5sn+0A5n1dD9r+XW1Oxj8UBBEc9JBWIbstsl0Ml0C1jLsiMFoCo\nSvYZiK/STPzsHAH4i3y0SA5fTz8Nl2l/pTx9G9O9OlEflkpDQxJ2ieLDwkVo\n/rBfvsn3F5BJ4Cv0fG/MV3y23eCGtNRYYgbbLr5C8Pp+wRjjQ0qnMO8UXepI\nNEQXR3Cz9yIH2g0EFnm6ZWcDmKSkdTbAse56Bll3edFzVB1et/Pk6jZ8ObVw\nKem9WigscDvMMCa4j3+ejcYUY9Fw4WetsA6Y/bmWth++DehD5fdgE10uWXoH\ny0kTLv5QBYheFTkQtkfJnmJ5lLx9iqa/pYRFpk3eXGKhvd8lx7Mn1EG9dqX6\n5X+2JBxc0M7nRsI+9V204d/781Zxz6g4LU01nsgM7ZIUgv798VQ30ufx5zud\nxA8D\r\n=V/Cy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"a6f52016d1e8720feeed91d2fa5234ca72d3fbba","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.7-beta.3472"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.7-beta.3472_1641951406648_0.2905641540319197","host":"s3://npm-registry-packages"}},"0.14.7":{"name":"piral-ssr-utils","version":"0.14.7","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.7","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f6d9de114b33a601aa6435478280d5bee673e677","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.7.tgz","fileCount":40,"integrity":"sha512-8mgYp8Fvq1pKy4U/iBP4fXcpeD27BvUgma9Dar9unyrhStBxYZVwsKyNVxwJ9UaCvfc4/mHGuGExjKSFx/E+rA==","signatures":[{"sig":"MEYCIQDVWJFA4KdqO6UDMmsZc9+7Iq7gwMP/9kJtU+1lqto92gIhAMX7jTmgGuv2+XMkn1rXctNisu7lT3NScLV/jmU/SZ8U","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3p8ICRA9TVsSAnZWagAAHicP/21okJS569oxmyCYrlsW\nNhqPdEwLl+NtOlvERtwbWAp7vYe7H7kCqjV/IBuWSlDcnTTL1lJKfhrC5qEa\njuBwzn4EY+y6wN+QnhNiqjt/Jt+oaWbjKi7+4jChMeq0NYqH1CyXRjZQG6gQ\nsMcvV1IcYsn1iOxOD32hLlGot+deuj8tow9fKz+HsIbmbFvwSP4Y5oNmfVUL\noXWNpjFRa6Yr8yJ4Z0STilJkyn13pQ55p2gjHGHa0y3pFoIeZ+3Q5kYR4Uqc\ncsRskIoj6KPEjkHCaz8ZVMvyEh7p1dwVcGzehI59dEf3LmfOx+FwyVbv6agr\nEH3JXmlda84MAH6FnLVsC2gcNJQNqPuQda1wrApeVvwDnOuP9mi4FjIXe3ui\njte9Ap06D8jhFxwRBqJN1+UHKfvgUKNyPtF0eSGOlKOtP550dg8zYfHrQSwG\nubrXkP06NJ3/qvqx5HwFV48ZrxbtPwx3Igx8MJadHWciLNz14em+8u60wtaR\n4+BEyDVC7tLnqSYqNPUyYl9KOoSv63noa18DCqv8vyaTl8ye9SWYElYs2XQJ\nhC0WR1nSnzGpdTJrBH7aydvUNgdgRvFzgE7optfcJ8130Aa3dWwtWQCM+aq5\nqYvCzARdqbXj/SpxTA7FCrQpuB62GAdtwbL2vcZm0m4FzC6ZuFYwOo3pJb5Q\nefkH\r\n=HovB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"143f517aa087175f9efb1a5f17f2ddb284adb3b3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.7"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.7_1641979656100_0.5148612108024961","host":"s3://npm-registry-packages"}},"0.14.8-beta.3480":{"name":"piral-ssr-utils","version":"0.14.8-beta.3480","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.8-beta.3480","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8b9268c30bf4ac9a0edf6959b7ca9e308a5b72c7","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.8-beta.3480.tgz","fileCount":40,"integrity":"sha512-pmVcYaatb5qQfWbEcTeNE+CFjHlwNej6SMoQBpCOzSK3//2tSF6GdK3ciqyY1Ie/B4X5T96QUO+e9fnRzIC+kA==","signatures":[{"sig":"MEUCIQDYPA+SR/+AE/YYIvvzsSB6Y+1lgC7TBcEE16/vMiIaVgIgRr6Wd9z6AOfHiZ3mb5rBJK26QB4v4b+ylrpiYfw5w/A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh32pxCRA9TVsSAnZWagAAZ7IP/0B34erwBkDDNUAwp2ub\nnTOETHh0VqhtkRQekgQatwR8e9zfxK2Av9QfNS2qsuL+p954OaBkXNYMqMx+\nuLFhfrBNdehHXvfFgqREL3M4n18D6nAq4wMWHVTVsJt0SPW+xfBQArA8vtyf\nNLlLzcYXZcXNG2mDNkkJgnGWzcnlOEaq0yfPvFfC3URv3BfxeQEUU2l2uLru\nSqyYo3iPe19dAUujAtWqldK1g6IeE4NWsAbOBptQa43lDSaqNIaK+a385OAO\napvQN09f82YT9LV3dTqRaaw2+dlji7PxMqcNpGIbN1fQY1XsyhseYyJp0dsT\nh4vTvUoBBIexlVQrYPvi3gIaGcY77G8f2F8kgzuOAZkzoP08+jVHg91KyJqP\n1WhnTX/zUiPxdm7ApgCJPMaBU9nX3FsIWvLgJAP+HjTmQVaHXza2MiiY4y6q\nadldtNfsBA2Et51AClLFwgiknQ45bnJ8AIX5rP5HG3XfrVOEKaem9tAglm5l\nRtn1cmXhYJxw0aBjy2TUG20EvJxdw11s0GtoRESXOU5Zzv1p1oDz0qoyuDB4\nbLmAxx0JKTjISRQZ9NGR2MtvAF64gBqsAYurjax6e6JA4+BzFnbMeC0TvszO\nN7wXXdGA8oYrD3pbc8abavq7QgKMCBVY93tDS+Ss1hcY2apIIHh39J9Jctqr\n5d6U\r\n=tEfR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"a35bd0eb547a18a708af0df85f66a21aa76bdb76","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3480"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.8-beta.3480_1642031729511_0.9284582703240389","host":"s3://npm-registry-packages"}},"0.14.8-beta.3483":{"name":"piral-ssr-utils","version":"0.14.8-beta.3483","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.8-beta.3483","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6c47c85dc0418103f052c60a9d72e723f7d0cc5f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.8-beta.3483.tgz","fileCount":40,"integrity":"sha512-ihiF9a6+68xnJL/zguPBdN1J75QrwImr7/utolVkpylTtOUY8AIWZhxBIumogNhjoTzD7/rC77OD96+NGOTIJA==","signatures":[{"sig":"MEUCIHOvzkkmS9MFLbXzbQbpz0HIlUV0BFyvOD/vWcslnKVwAiEA8FnxqYnJtB70n0DU91Y8Ib9UxWlgMpEICj2Sb+hXxbU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh33EGCRA9TVsSAnZWagAA5hMP/3OKBjXghzS29ZrkNbSj\nvpfdJFDG/4xEfza9qBVv8LonPwO9DayJSvxsYdu4tC45cDY225AujYwX0KtJ\nYHzEDZYuHWdiIaFjKO9rmGFz8CC/RXNfhTcGZ7kJV4SQ6PQPz69Xmi3fmzMZ\n6yy6Ckg/Dv/dDoB0wBcBJfdj/nkE6X8yOrKzfZO9HecWvHP1f2kAxhoMKL2z\nEoyIlcOQhip7BGvvpXf4Bgv3j/0UD4ZM7ioB5iRItm6P0q+yL61CxtcbHKNW\n4U4hUTrWM8MDBFeLt2LpFZzAbNyKGofa/bpR5Uzgfer150QvViWvYL8DC3dW\nn5PqpaQlsIYCv95l1AElv60YB7E7MJbqJjeAuvW5ZG/18zIchJzyRkVV3n8C\nmRz88J3traV50Eah4ZzxCVk5U2lbtjpE89bw9kXesrre/NeLj1NLaXa9HDHz\nz7LRRR3jEHzIewOek5UDsgtf0pFJCe35fWXRiQtetKyJTgmzE45zfj4JsUZ3\nK09nSuvw4/3vlgG7bP565JvN5dO4isKF9uekhFoL9WLsGnZHZYTd7uonX2Hb\nzoXvuwx6ZwgYiCsLg38M6HFrw01DxmueNAbHK+49sXWImumztJvHKIVu0YIt\ndL4K9Sgm8KxFnK2FJg8XKq+vgSfqQG6b8bhTBxasLM14TJnJKTehPA3qP3ZS\nXAR+\r\n=q3v9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"a35bd0eb547a18a708af0df85f66a21aa76bdb76","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3483"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.8-beta.3483_1642033414294_0.5619923011632015","host":"s3://npm-registry-packages"}},"0.14.8-beta.3487":{"name":"piral-ssr-utils","version":"0.14.8-beta.3487","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.8-beta.3487","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"194cf5863794e825fa0a71c6e6fa3d99260762b3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.8-beta.3487.tgz","fileCount":40,"integrity":"sha512-NhYGck4GBBvpb72SZOQdYn6e+/lhcvTYtN+umIuQzmmOUAc9Jhlh4UTtNSLiK+0CPGqLyx5UrPEcLB5ugxg+TA==","signatures":[{"sig":"MEYCIQDUZonAjm5hzNMJI/K3g0WcZXEnxz5MwcN/baG5aaW2/QIhAP1BtOP5V4ISPb8FHGTqzmIf7UPnC7jYh6d5FyTcz63j","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3/DfCRA9TVsSAnZWagAAf8UP/3iP2M4RsxTPQqFp5YR3\n8jmpWFesEVZIkbcn4y7u5pDB5cxQVvNqOgBVdwFPMkddaAV7ivQHes8JnG8q\nnx61gjhB3MxLWAM2uHQKjOLTDRDoE1CIOBnv2iV5XACQvASBvbRuC4rQC070\n2ofc5ml9aFNuGcdK/smT7sPsjMiH1nExiO+mi1lLj4yPQnIFgTsGr9Z3nsOt\ncky24nvB7KlQYBqgrA/qRsVPqjovWSi10H4bG4GIjKRjhNdMMu6XygUo1c7Q\nhCLnOptbgvKovkBTKB7L7X5D3mDsVkPbGkaD2ZCQX/QCqsyEdpgrCS+BWuA7\n9TerhV73CeEbvqAuLnXBbZH6gz8SLuytAKpZmaLQAlVtn6cMXbR1dwgJMW78\nGbE4ZMwcApb9MRKVgEvCnZmJeygkBbDj4+RNOjkVeNzGpsouTKMGVfzMUx0y\nP/Auk1CDIR/wbMzZY14p+kF4wzzuC5Ql+Y9Qe1hCNBwvhx7Fj1kuLOOQyI9F\nRSC1udbSkfI6jIWptvfvC7EBDY8O3HWYMk7KPswhmaSig/+OFFMc+ISJtP+2\nd03W1RHJaQvG6CPLLSeL4HQlN3WXoqDIYPx4lZgHyx5BneQeDF/3yZ2KM4PZ\nGVuJEm7nJOh9nx/DIYaSouZKEKiAJAlsJ8/TJentjxumy6Y8I044mvJe/S/5\ntFE3\r\n=x+lR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"95872598216edbf8efd99c8b7044094ea209a049","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3487"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.8-beta.3487_1642066143511_0.3825130633129059","host":"s3://npm-registry-packages"}},"0.14.8-beta.3490":{"name":"piral-ssr-utils","version":"0.14.8-beta.3490","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.8-beta.3490","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f8a128812ad5c2f1e3573077727212ecf72b994a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.8-beta.3490.tgz","fileCount":40,"integrity":"sha512-rFWdtEEALuNoIcBcYCNMhOSlCYfoDBFEE5C4mul2iA6XrWQYY3DjXE09ZP6NBDZDfi3Q/wdDUvHJiBrZs3hAsw==","signatures":[{"sig":"MEUCIAHey+kDU8IEOa6gx8CNe86atev+fawlBYvewyeGxWpoAiEAjaTMbXcpWAj3U0k6smrq3tD5eYwjcRHedYZFQcXARw8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4GPRCRA9TVsSAnZWagAAtUMP/0QI/ZqY6Wy389NFUj5U\nrO87727TJlSELoPHVgeeRdOr/njYq9TCYILn9Cb9Z9yTeMkTBxl2sWt5/1fC\nkXXJp+HOMmUwpqAQ8oa4NT0Ldzo0IW/0wUDi2N4kZc950TvxY2UcDNwVQS4Y\nkoDy5BSLNdBBynAqahhOyWNC4+Mu06TPygdxOmMOSkKyZ43fWihm2yuqc9a2\nV4SgXEIh6FGqEPU4pajD1fXqVC5ZT6lvJJ11h7JO6mdNV2W0ZLZdCZcUk4NI\nSuNycJdFpZhu5Cn0PdTXTFPrZWJfDQaMafydKngIBsn/hmMrj6xPgd4Mg0AB\ntyd629Reg4NFeN2QPb9QVQ8qbaxJs1g8GOx6OgprMUbZKOJlGVOsbdv4T04k\nJV5zMNNKe7zoLBK2Et5HK3h0KA1CffndVHVS2eWX3XBNusOTKNDItSYje62A\nbMKARtn2CEuZ+rWkNvvkG1jNB5wq6Q5PMQfvXar0ae85rgmmT0hf5hULouHs\noeJs97JMWvOikBhV6yNBgxvkceUY7o2+/R95sR7ZLczkzyA46WOoYQZ4xDGl\n6EIoqxD03im0s+5f3Tz1b+GsM/Nxw+QdUQG2FrUGrlyu2mGSZZZNKenVS9jA\nU4X+2/nPHGCnVurEbdgf5OC+G9BSw3Oxh2ux+7XqYzkJT6Tx+03OpWgRQsgS\nEP8w\r\n=o7Qz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"c8a70566a926e3306ad5aee94e0f3f7b1bc3d690","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3490"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.8-beta.3490_1642095569015_0.6709158312099979","host":"s3://npm-registry-packages"}},"0.14.8-beta.3494":{"name":"piral-ssr-utils","version":"0.14.8-beta.3494","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.8-beta.3494","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b136fe17a8fa936a19bc3b015fce934c5e07b35c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.8-beta.3494.tgz","fileCount":40,"integrity":"sha512-OwGWSUseKN4yTMFqfEampY+OxjcEulkBlFT3VfR/7SYpW4yiBBzkl+T6YweGVIkgMAcZj1BCbojpdBE9BQl2NA==","signatures":[{"sig":"MEQCIFdSgK1uJJpWaz9BhJKuLu/WflLFNsZAt5LtRJyr5gBKAiAFEJPx448EohRpyHLk1he1UHL7rF6VL6iUkyH5T6UQJA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4o7ZCRA9TVsSAnZWagAAKnAP/1ke0xFLxXA42z74BcEM\ndGY8aL8E5hBIKR6Ai/AnunGgwQ8uQu/gUzGZ3xKEKwS1j03K/540h8H/HylD\nQVeFkVF1Px8j+8qkvjP1S2qpgA6kMD/3IcMYBkSBM8lDWSr6SnRQrrGU6CKp\nTt4lwQHNAzkkDmG38CSHAI+evNK6eNA/Qb7lrnXRfyLIyszoEZiSmVvgltzu\n8ZZKxhx2YETLzTSKL17i2mkKG7G8aXvEKEW/V+ZockybYKUd7FLiZ6lfnrsh\n3K0QRBE1NaeRV0O5PUWB09h/3nL5jlHikCZFBGa+rdqR1kJq1I6KGXlvZYuE\nEVrx1qLbzKHASnLD/eIiQDdCRPu4gJuCueRsyyVdBatUpS0VABrAkEmu0eNr\nVYX9oY2BzW7bPWu9MJVEhfTsu8S0UE5DFbeKTccCZQoRdzsZ4OjB9xQFLK5a\nittyuRZ2qKv+3EDsKMoSQ8lIg/sSFctmfVFC5gKJ3FlpdqkpyXkvW/gD8THo\nP/b6p2zo4wLN7WstJCCmOfVV6mHJH2dyvuBo059QhzC1ovzAVbpeIhmnowbX\nCH5JiGPTvwOorg7aIxODryBeKPacPdfDjyH0eP27yL1YICeES7Lvdg/ffmdp\nucYlv4l/WQgCiLehHp3aktW8w6+59bEG2S8fAv9q41q9aEoNHWvPyVGhCyKw\nUUre\r\n=wcNQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e0cf86abbcc310101a68de1297c4c9104815cb77","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3494"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.8-beta.3494_1642237657574_0.8314814814095604","host":"s3://npm-registry-packages"}},"0.14.8-beta.3500":{"name":"piral-ssr-utils","version":"0.14.8-beta.3500","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.8-beta.3500","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"68b1c7d92022970f4128157547d9d55c51a93d01","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.8-beta.3500.tgz","fileCount":40,"integrity":"sha512-URT78T7+2NpfDpME59o1oCN9w34xSs3fi5Ygj2gS9A0Azo1w4rv3X45glgaXDYszg4HoJx0cQ8NV88Sy3F0LUA==","signatures":[{"sig":"MEUCIQCD/Y091q6ziuqeLEacaBs4Qv2kbi9auGreNmPf/npKKQIgM44awB5tqh5zbng2wk0t5yFTUz6OyG5+9QX0upfArMI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5WJsCRA9TVsSAnZWagAAuGMP/R1YV30YWpxieGSZlvjT\nfVw2ZXpbwXpolF5xrnHaTJwXcj36PDwX6RN5jPSgeUOExwsgpZy9DA7KsAQx\n5I83j8L1WzgIXn6RXVxDIHQJsnaVKlfAG4w+nAOaoyzyD2XzmIO5MW1ER60U\n6b/J53mGHPIdwUtzjgEosu+T2EpUMVa3pr8ZyXFjLJfrUwmX2uVXp4EPd5WP\nC7jqXF8iJ8sa6cfHfVCs5/RItfkVFkVTxR6Zqu5u+ozDobW9uBsqRqvrEo+e\nmF3Imuyqs5BUr6hZ2LFXV1Os0Dc2yHzHnWP9OnIf1F3qsK21chLF5HRJTBU+\nWzpO1a39dm9y1rk+zR3b2cqR87AI6qHOECBgV4tLQwowWrWgbYZmBVl0iv7K\nZ7ueA47IN9Jd0QCh5M4rvbytcFUkuNJ6XzDhvTaxizoeU7EXHD9ZeA322hAR\n0fDdyzGuQeP0xRF72AGQuHH4guDUETcyBs2fGFFpZtmwwQiGV38ALEJUCibC\nAZJUP5m8PrVUCTc+eHvfhmH/KazRsjIgPuA9zy4+ZYINNb4lAZh9GwRvCAUS\nbi0MYh/5O+1miZOfiZiyIzXk6bNKcHeX5E5FCywtWiONLzMB2Y866Cg5D11y\nJhIg28HHf7giAfrtABSiTw8RqcIOLOTQpxcx2eIsHdGL9i1/x8a2btcaiwae\nOULK\r\n=DVbb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"89a719e1827869c9953f9c3c76a338be59e31b7d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3500"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.8-beta.3500_1642422891973_0.04371931781571736","host":"s3://npm-registry-packages"}},"0.14.8-beta.3504":{"name":"piral-ssr-utils","version":"0.14.8-beta.3504","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.8-beta.3504","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2aa31764d52d96468b4208263427a35515114096","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.8-beta.3504.tgz","fileCount":40,"integrity":"sha512-CKRq69A4vKe+ELRkJWab0BsWqdYsOs/UyERZqTlaz1j5umrjs6WVJjJy9/knmaQUJnFaNewYxN4AQfjtfhXPiw==","signatures":[{"sig":"MEQCIFJadfzKlxY0Y/gRU8HQicTfhh1sRG7esiTYYy53MX3BAiBseol/xmvTKI+2rY8ual9iYUxsuo9voYisCUbDuHdbuw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5wMFCRA9TVsSAnZWagAAVvwQAKOD2/9yix50cg20frJ7\nwpLkAyaVFdwJZelmrNjId8+k+H7i7G5eEXNj8rdz8vz58mTonGmNwndKIhZ1\nyDcfmV8DY6bbuwhJs4TFza046mHn1cKcO2mvUo0s+Dx6h3PigOqlwPBzEISG\nxMcre7h4PYz5v45VRSiJ/vEii/e5vgHYnMfoWyQ4l9JvpkqGNo1iuHlNGb/t\nJ6CORV9EGI70oEhxmtAH38anVAkKgSwWh3CkJrzalpw7j2PsDL/RXo7P+y3v\n/fUtZ9Ec0KFGNtt3Ozu44y+u01glmo2DUHNyHQ8Afpdbeq5Ww9FjqRFuDYdH\nmocLjFdn2YKJeg18K7gui9xcGFddbAoF0ThGH+ax0dpKAO4Ws27UeNjVTlCD\n45DK5ANJVeqYzVRsG/qgZddBt6zno1ehJvWX/KNLRvfyMKIi7w34+6qXD9+7\n2suhSqyG4UOhM993Y/k2ke216gAvg7UfFY9BDBimmMTUI7uqYHqpmmyigsYY\nuTxk1BBaBsPST1K01lKb1QQbPN3LSoosSpxrncx8uClHl6/6QPuQCr1acPLn\nREo+nVK5/HqxM0ZjfAb4GJokHF8dqEWkemPBKZ1dTQOCYiYk7jU8wa3qOceG\neaajyegI/32t0Cenh07BIIskl9gXRC43Nm/2n6/PFXlh7EtKXoO7fTzhJUYp\nCEJ9\r\n=nFSr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"8e89db6eb732293e4abda6bb3c0cbe6fd0335248","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3504"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.8-beta.3504_1642529541631_0.12235736159794275","host":"s3://npm-registry-packages"}},"0.14.8-beta.3509":{"name":"piral-ssr-utils","version":"0.14.8-beta.3509","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.8-beta.3509","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0e05a6446a73a1ba99936d848fff8970b5c8c881","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.8-beta.3509.tgz","fileCount":40,"integrity":"sha512-EIvb3QgLgH2ER8udHA9kJ3KQJJ2SWldzd/bZm70prthkjlFgXkNvgpj4OnT5NMLyh1+qLfeooF5qkAfGXFZg6g==","signatures":[{"sig":"MEUCIQDg5i1n+2a1VMBR6IU3l0xX9TZz0lM1xaH89vgc9BK/6wIgC7C4lryJXhZ/1WKvXtlrjx8c3Cksr6lsQTh1TB1uGhg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh59GgCRA9TVsSAnZWagAAYy4P/isvXams2Xiz3ZbXMORx\nCJCq5RzMPMOcvFCweYOKkmMg4OZ2jZYTSLB8SX49cI+fyWaQi26hzAUduwxQ\nUMc9dwoeiMFusmcpj8cblArfLIKhU07eLLqVxIoJYelKFN3lcxdhsqgQLThV\npCbBhsQvvbWtGDyuejx5JsCf2W9CbifSkxMd6M8wgHF0unOijQmFS9+YmzQO\nBZd79qQAZy+pzg/f04zfP0uSI2xgQl2Z18HHsdpthQfoB6koektlj3WyWfjA\nmAiioIztmvCRT7ldHaKeq10EWLOnsAEvr89Hj/elGCE/NemSVJkeDwmaHkuN\ncllkQih/XqWu7WGJBqCD22oIGuTMm73hGjS3MSCblF4AaezsbRXxtF0IJydY\nYS6JlOEXceDwvlexsHH2hGJCWJE6AhPK/HNpszZxPuEKv1KAfgfioiC1jSgt\nzUs16ZMpAewNubNDzliH4g5Atv0cSU5nLeRs+hQTF6aJYQq1yOONMgk4TrnK\n8HGCadevGZgnM8LwwYpSuM52rnnLu6aYs4AaDeK4mLqns2Wdi3rugq/tsX6Y\nlzS6tdl09XckOx+e/H9HntHke33+Fw+pXE6ObTBoA/wZDS504MX5LOjCM+GH\nEEr6kOLvycMQ/xB8SLyFRz6rcS27DrIss+/bFy2tWV15mmz5rmZTfZTKZTeq\ne6vB\r\n=ZpRX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"309b0cc1deb3e3a7d717963913d0b834b9f484ac","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3509"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.8-beta.3509_1642582432202_0.580582169439599","host":"s3://npm-registry-packages"}},"0.14.8-beta.3510":{"name":"piral-ssr-utils","version":"0.14.8-beta.3510","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.8-beta.3510","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6553a044187e313c8097a526c3289cbfe1e49e3d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.8-beta.3510.tgz","fileCount":40,"integrity":"sha512-MiKhqYcESK7gGRSrm6R2UcnM1us2pfNlCe0uLDAwwI8W3+xsbRCxBv5h3gU5EbtZVQ4/uKYO9Gb0eJs5bxQGgA==","signatures":[{"sig":"MEQCIFPH8tiOk4ZLHR8912jg3pN12KunZszmQzGM+TG04Hv/AiAtHI/GoUedDrd5hbtEobUvJJ3UGwjZI8W6Z7bDusKlLQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6LFgCRA9TVsSAnZWagAAkmgP/2MnYBk/4l72cIS29LNB\nHC9ywjiZUGcfWbrCvNNsWederf3hU+0mI280Ts7etuwrnlfJ5OZYb1tR21J+\n98DcurZExX6q9kSjMFjlFMTWx+sW5aHFRYDGtZJuT63vnFPf5rFGKoZNM4rm\nwOByIuZMBltlWLDJo4Ns+VSRrQTyXlI1HIdvGwuvQRpQ3CPuG8msV1tf97Q/\nP6PHXJUSyzuXVVWJKtaA2rH+lZETxGYaacivttVfkS2avaHevEecDVN/HtD6\nLxIBPnpD8bkRVveEWgMWEh2xiRsH0OZk8zqM9PB34zY9223E0AS042sqdKF4\nzKPQQvwX8RlA+w69OACwduez68whMyWs1p/FJURVA9FnQ+9Qf/NCcIY9lgZQ\nWdZlW3RuoNdnp8OENanvHrKGDeGDj94GSxLXj9LoXGJH9fIk9xMjfdttj2Ja\nyEg43xfMS8bky3DlF5r049A06hTBsrrh8np4UVGJoyDo+1S6KvdkAxDrmO+V\nPdfUUA7sOnfD/+01QmkiiDnpPb7md5Et+wakkj3ptCMDwxnKudFuDb+66Knr\ntiwrUtGgWFDIIC9eKEQjz/st6H1Mk61Ehtks5ZqngnZusc/acfj3VVKCc84f\nzS4UCF8qRM/bcJNwKA8bs6Oth4vI0CZXq4df5qm7Hac1TrsG56jscgvzYRzc\nFJB8\r\n=r5XZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"88ab7816c6116dc853c2cce595e0fd1456db5800","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3510"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.8-beta.3510_1642639712126_0.567368311511222","host":"s3://npm-registry-packages"}},"0.14.8-beta.3511":{"name":"piral-ssr-utils","version":"0.14.8-beta.3511","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.8-beta.3511","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"544bab95470b0f53095eaca6941b1aae3cf9520b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.8-beta.3511.tgz","fileCount":40,"integrity":"sha512-gQhvySKWf9sgAvYeuMsQx3YbQpVFJD5YQany1PtDxTdGqRQm5taAG3Qg4L15mIHCvoBCzEO3gCiSMBfKmWNQDw==","signatures":[{"sig":"MEUCIQCZ1YS90HVgRoMUp58Ppu4E5Y70SE0/TBmj5wKCCuNutAIgDYvpck9ksV13CIbrPR92ofEmd3AijPgSrjqiHy8jxTo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6MK/CRA9TVsSAnZWagAAnGUP/0TjObN/srOAAaTB/8vY\n48jGV5RJjpD0Uv9sp4mFGTbrqs0gdVgO4YxYPsfXJn2ITznNjKZdGF8CXN9m\nW3pgn9ubD5Y/g9d/Blxu0TcAFe5UyxSiGlkkx4fO9kpVLOAGBSSUrdNcO6US\nakPOY7fgML0zBG3fP+HGRR4e3/e/Ppslg9vnBLwhoGnF/bL7JRZM7dxQGdKI\nk67te6fj8G/WUGFggiy4SVkNuYxR2uGjTs/Df8fDLFA+Tl3nOVbxBjzTGapP\nmkYm6lN+/XZ8625e/3PK9/c7arjQIUygyDN3Tr+8LDDFdP6jV/VSpZdWK3nT\nMZOWOhmau5pHQzFLzvYQ1q0IACrVWy9qRvqcZsgRefvg4MTFyfUw7msvqTHf\nwg1PnFigZxMb4/pdTrUgoxYUlDClDG0RvZBtZVn290C+B7aaUIB8jcqciLfg\nLaIsyu3ROnIVRMZUpmRxpKNoCRPTRytjcaBv8JQnHdGht2mguNTHcrHhx5zj\npmGTBsEsYLWzhx6pC1CmfKS9tG/cFrOIjKfNjGmZ2C5JdIojFEKfvsIBIKUC\nOyHvA8TXYnjJx1dq9wO8uAKD/AZqjPSwfRvfPsvg57UKF1x4/3Ce/5ALHq9S\nlqKyQeHuoCEgLLX15r8+AmQluHEikK4uJoHmCHXj8eb/tG/XQilv/xg0ECIN\n7yuK\r\n=ECAz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"69a69677e9c44c0013c3220877978d262e11c9ac","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3511"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.8-beta.3511_1642644159677_0.7617952752633088","host":"s3://npm-registry-packages"}},"0.14.8-beta.3513":{"name":"piral-ssr-utils","version":"0.14.8-beta.3513","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.8-beta.3513","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"89cf6b4172c45cb00b3b99f71a93e3691e2d3fb2","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.8-beta.3513.tgz","fileCount":40,"integrity":"sha512-whIwu+DKYEvI595DYUlZASm/iY7U6De9IeGpauGa98GxQ78FOwJ29s7Qeo6X7cQGUsDkdV8uxPbaEs0TezZ9YA==","signatures":[{"sig":"MEYCIQDNMi5oojbMfwIeITJ5Gypkm1uGhhZs2UNHs4OR5kpNgQIhALuTLKWNLPmCnjViN3uGPkm6FJc/OdoFRRBWu8MCXCG+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6Tj/CRA9TVsSAnZWagAAb4QP/RlCeXg1/wbnVX6aPCSP\n1gu2s5f53QIr/M4V3QuCLF6TEmbVlq7VTcXBg8CSgJeiQEJ8OoITbFUQoeHM\nyZpoeiOJddaOAqBWrke8YtK4qjlDaQGrDE8tJna02pzl7wLZNSK1zcAu/qL5\nE6/YhrLJfFfniu1oreNdCtPZ4V401/m/YLU+oXYsubRSgBdGFbCA5/2pIf0Q\n7DzuHzLwBntp8FXynNme4og5+HSv9BedV0SqAzgvD/a5aJ1eS0lFNwh/9x95\nHVC/ted1h6nbhTyCmUCTKRSuG7ktUoZWMdgJrfJKkOrTo+CdrRXdljrRvSyk\ndQBSaZX3B0EmtyjCqOt9/bJQcciGlrkPhD/I9veTIqR/ixSTGhD1PKjgVOGI\nELvDybVJDujP1Dd/m1bTrdmBIB3ymBq1ybmrm3Fkwr5O5vsXjvcL/e82yUnk\nIWHBfN/5vcbmZXWuMHNuGmR5uZQ7rk5CxRjSYlLDRDtD+v3/GJaqtnuGzQri\n/inBTz2PMavytfXbD9Fkaz7Kh0OHsSMm4kHsvl/y4nnz9HhcglskcQK997e6\n7nw0xJUqksBOeq/xw5vfkQ5VPLrDqUcFinFiFyphL5F4F5E+m8wxJhJ0r+xf\nazhFKzSW7wCKkOxlBl38osTq+EVp9gems7YjEwbG3iuXGSk4AwmXwNtZJ0yR\n+iwT\r\n=2M5T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"082cc37bd4974de4f462a148753f3a9443f69730","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3513"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.8-beta.3513_1642674431578_0.8576255232337757","host":"s3://npm-registry-packages"}},"0.14.8-beta.3515":{"name":"piral-ssr-utils","version":"0.14.8-beta.3515","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.8-beta.3515","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"409514398a719806af08c83dade14b4498cc2362","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.8-beta.3515.tgz","fileCount":40,"integrity":"sha512-/nD5vl8wPZOD511LwPl82Uj9EmLPX9x4X1TBXfbiC0E2lEoq48nUlzfHg73Exk1ZIX67Ojc/66viBjKueipCSw==","signatures":[{"sig":"MEUCIBrdyB1j9MLMAFQshrTzoWvTahTedDWWgXZSZpSBHlRbAiEA2P+sk6l2/UI3dWjZDctDPIjY0Xb4cWe0CGOooGjYxww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6VH2CRA9TVsSAnZWagAAtsgP/3eYlmq6kKbu95Pm2Noe\nG7s9OLtnHiaSdFtBpnLOji0wnnhUvo6FFnwb41Yke3uOqEAf9+C9tjMhQYeM\ng/ZOmu5pzlnY4FsxlKG1GlaLmfG5x7zn8JFk7KoYLypgrCaYQ0ZwDd85sonA\nsPQ4N0iXY9MrvuqXvVlL1ElMc3ae7w7BHXUVLipBD5wOykzv8RIRHNZtkhq4\n5asoBUN0BelRE8QjKwnzi/8zzrlWrn9FiS2jC7jd1xeajWCGaCTQZ5HsAZZq\nWbhRi6cGNvpzixhXhe9RwRcjaO+HZapGH0XwI3I649jkm7AmIGHMS3VkKK7Y\nM04lbSmzDvyfuR+PuoruLvQut6GAqe7wXqo3CI+dDBcopLP8cUGczvsFnTKY\neAefsTD5b8j8F+HWfsucTo3p4zzz81lLydm4W9qmNiXHp/oCZE3ltWPuxnVq\nSFk/a+LvHQwgSwkkB2jHFLNAP00hnItqGU1YWQa/HRfSsVKIi/Qg2Bmxf+Cr\nEe7EmK+ZR3n2OWvydP3m0/PInJwWIoLKYciUR5pUdeejrnnhjWxNnv230lx0\nuAqCOetVRKOWV0RyDyGb7Et8U1/hLmz8nF6SxHjuhWsDks4/rbCtAYzDLcx9\nWgOx7VGLJVlQqbIo4hYfQeBVX+pab1pz21b2zH+wqVCrPoSspBBjQnH3Z9eW\n/S3A\r\n=UOlw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"67b8421ae8c8da2ecde19e2dbb2494e092efde6e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3515"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.8-beta.3515_1642680822024_0.8955141887557099","host":"s3://npm-registry-packages"}},"0.14.8":{"name":"piral-ssr-utils","version":"0.14.8","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.8","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fdd69a999c202ae597c0b50f49abe6cb074c41fb","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.8.tgz","fileCount":40,"integrity":"sha512-eABKINAOCFpCZXk/FwMqbjxWBQ5/VZOLiRSy/UaNFJogIQGfmlAAn7mXFonNG2Mxhcf0od2OTw/kU5+HKXzhNQ==","signatures":[{"sig":"MEUCIEdpTS54DOMfDS3z3+67PQ09RG3IrMdqx10vFeIdoXeQAiEA44Efe4Atu/oa1PD71jvNZ0Nsvhovp88wjAOyCsmtlnU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6WfXCRA9TVsSAnZWagAAqccP/1Nmcu9Oyc7ntz3cY+v4\nxoQNowPrO9ReSh6gli+JikAl3BE2bP9VnMbNT8uPcxzJkdvmc+jiTkN5X5jr\njXVJPj7nVbHg+z3jZtKDKfTcOz+wG0ofLGlJYvTsCOSNiFawm2AuguQXgJwP\nSKq0PubgEzNeX0jN/wzSdd5lrpgP2XalMfSl0o5XeR0oARlm7hkkRDzWutDg\nxCYas+gEFDmttEt+FudStfXavmM9mdmGF712iNTKaQhx5Co1VqR9xmMlXxb8\nZlXvvUMUncLKKoG7MopqTMdEpzpNw2RhzJ3Wf9xsb7gf6lR0SlVwMWQu0s+Q\nsO6cL7Opiy6UhAJNB21nADQxAWByRlD5SElk4sGtGRJ0uzJdVm1Q7QiKINVW\neeF3TE450G+7zXKWjn+kEhPoXcMYnet6L98E1agFTHKqwenURkOspH2PnFjT\nc6KACty7DkiDUxHqPtFynBi76aLGEukYBV/Nechf73Depx0zKoE0WRqky6Yo\n8gse9FSUAVtIRgFTkJpfkiqvaJH1SmJc8yktOFyOF2nyg+3P4uG8FGuR7Vt/\nQDApNmKNijU5GvxGbKrWLrkhi+9jihANmzba8RCjG8nXS07mz+OW4+X1v3zr\negrXUb6dKv0pNgTwZGwSOM7lUVskkzWyvih8rB9vCRI1GY85w96sl7NoVF+N\nI1U0\r\n=2kjc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"3a592e28dfb9ad1dca34cb16a013f02dc8fcfc74","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.8"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.8_1642686423755_0.4331486523842085","host":"s3://npm-registry-packages"}},"0.14.9-beta.3522":{"name":"piral-ssr-utils","version":"0.14.9-beta.3522","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.9-beta.3522","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"042aae5f5aaf47ed0ca446d0a47a1168d28bfc28","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.9-beta.3522.tgz","fileCount":40,"integrity":"sha512-VncX5zN4mO+uvWxGRUT1sRiaZphUi83HrKa13j6LsNt1t5f/LCg57PRBmjsEkBjy//LYzYXSxWvm/IzknOjEgQ==","signatures":[{"sig":"MEUCIGMm1f8EvWXitm+qOW6ANHKIkLbrVdrbCkR88CDU9kWxAiEAlfsHapebg4FOSfJIPFDBkx58QXP6LDc/sy3DB8c/zmA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6gWtCRA9TVsSAnZWagAAQHoQAJ2TDtKnFv2kPdqwTP3O\n02ZwPLh217dEscIov/QJ7kV6vL5hZldIsjGBcOfMHQS4/v7AKPtAtpHOAZq8\nTAdIP1oCcTRSWT0RiO2/UlIBySHdqgjIiK2PGr0acSREX8RIZ/tsxG9wxQNk\nroLR/fuWR+K9V0nBvTQp6EGbDyL0WniZb9rmRzpqfYH9BRxqmxOfDNMGShaW\n71g4FHoo63RkK9TMtGTRXXzIB36isfguN0nTmnVsPVO1xvwasafc9QGtW8fD\nb0Bj2O90KXgkVuNT10RPfG2xFewuIqhUOotW9Z0Ro7KCo1szljbGWokFAOLS\n25PzZ4wXoWvhyz1cnrSrnuBY4B9a+s+KFLwn01ma+oBgF+jkILbYevAOoHaH\n5ksuE+aSYvwEx+eg49AMB5AQ7ZbrzSIr+IVxCTDwojP5RvQCLamJXbLNCW2p\nxmkrPL2EpPfyuoFuSL7AWmSFfKrAsTLx5Fl0BZFGeVAQZM9VJRoD/ul64V7c\na9BpzUqvyvup5T8249q3T3/2oHiKMvTCGjVOwPov1KQcxiRLI3Zj6ShErlFq\nAN1lYBZdfQGMT6cLAfV3e0j4VyQ3Wxcub5baJcI97M0hbAGUyPa+2iOec+Ep\nVSVn449eJ6lHz9k3JxS6VTUfrJ+nCIVPIus7/8ZdvTbaNK95uJ35MRVtDjf7\n0D5p\r\n=o9vS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e7f2966e6648eb5cf517f295674785c3f90621cb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.9-beta.3522"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.9-beta.3522_1642726829137_0.4427045733766739","host":"s3://npm-registry-packages"}},"0.14.9-beta.3526":{"name":"piral-ssr-utils","version":"0.14.9-beta.3526","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.9-beta.3526","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ac2122289672882bc7e8552af3c7d9bc91ee84b2","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.9-beta.3526.tgz","fileCount":40,"integrity":"sha512-ocvzq1MT8U187KD1i9KWdIsZqwu1C+bhp4lyzZVE6qZgf/+eEdyqumcaoA4R3moPEyZI0zdtBzxBOjZ7rgdFbA==","signatures":[{"sig":"MEQCIByiZbn0WpXjc10xDdWFqOpQrxoaOP/hSyxj5amaneYVAiA9Z9b99WY+nZaKreJ/H33mg0ARuJm8jQJ4XMBYJxJe7A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6pKJCRA9TVsSAnZWagAAAvkP/0Hu/ngpEtdW9DAI1Wpu\n6Th/n2/d0Li8U5GN5g4RhasxeW/HuYWMNgxuqqUPvusrwAqlDncSbHoZWkC0\n9qIn++ylDUEdWsihD52TI5ZQd6LIbaNfIxJ1B4fU350EHv8rbZnmC4DUm/bH\nExi+cifve+qA164/DHFtrExBc96Dg34Oonm3rUtnXiPd0E88xOqBty+ESw0Q\nogVvBKcw9D7BNzXthnMCw+T/dV+BwBpZ8uE6jARC0Z3vz/R5L2gm4rvL40wN\nvms4eipMeRoqUHmJUFfMHqyaN1PsHhO+Lgu2UCwqaexA/jZADzsyj/vHtnx9\ndSDA1P0jsbnSLNPgQzX++ekcZA4GMlQvXSUY+aylzbmX7/0j/Uuz3NL7oYnu\n1YmYUoGZ0S6Sx3ntN4pEDxSC74MpyHLq93pQoNfQo0xPcYO5bijF+1kPasX7\nW32CechW7K5yOElf+2gmAKDmH2hJzDr6c7l3i3TEzN7YvcK9XjUpycerpYIF\nInkgoYDnpvJgR5/LBOWAsJmS/LLAA5n8D248ElGJ2ai/im4MKH2A5Mc7TEd/\nXfPBCGyeYbtid84nNsPHJnc1p358HekQr4Aub+mx/ZeHekO1CcwgbgQySZki\nLXP/EwlCkZELNbEPwgPvjaug0t/uuKMgKGwpo/h5SynjozgZb0ryP9Wfosi2\nsTWU\r\n=qMNQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"934210d4f9261d9ec158922b540a6099900beeb4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.9-beta.3526"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.9-beta.3526_1642762888994_0.025789856123866084","host":"s3://npm-registry-packages"}},"0.14.9":{"name":"piral-ssr-utils","version":"0.14.9","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.9","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"107a6dd63cd21f7f9b742f58988da95c4dbcf5c5","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.9.tgz","fileCount":40,"integrity":"sha512-WjIW9YjnlZ53dM1XzEwgBCdAxu7kseI7Wq8VRKTkpOVk0e8TF0qcH3OY0CmjVKC0DdeQXV1XhJSD5wp9vTAbqQ==","signatures":[{"sig":"MEUCIQDEt5how0SG5ZLn77LOcKQazbuP95BimI71Cfug5B44LwIgTTJo525guDwtJ1EHqQku2h/9x0ddDkKg6UkundLmFHY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6pXVCRA9TVsSAnZWagAALsAP/RcjEtorzxza2RZ+DKOp\ny+T5j8ECTj9lG96vHMdeAKpX/9X4p1wDhmxs+MkL72L9WkMf8z+RDvmE+bQQ\nBrqdLUlsreWAj/1INzn748e4wfpcKnxdL9iEcxe9OKgu5oPPa6Dked7NBikb\nle/ZRldNLKQnB2iMuedEcDnhBakZLb0eIq0/do3iL8ATVmty75ryCZHfFsFk\n/e1on4eALXavPn9WaTRLobTQj1trzUB/wrSWHfeGGlUDHV/8W89HqFa/LJZd\nTVsOTrsGri0AzaabEfH1Cb+zE/pAmwiwirkRB5Xol3ex8g/9szB9JUgFHA4w\nOiKhlQY8CgUvk4ZraBMpWkCvFBOWhtfMqCJiHEimW1An+Qlv3hJA51lOwvmB\nh+TVGYwqRH4URzGsPp/6mS9iS761J66GQrMHQnjTAvvxwT6hYZ/LLnfs2eiG\nT59eW/oOyrIcR/tVLtY5BdlCs3V6fy94VDE2JjQMspELhuCL2bnib9QcSSAe\nhFbnfGg7m/9K0OrqVpRks/jN06BToPbWt7dNfGTaF4oc4dEeo2eNriep/Lk3\njIwpn3gmL3SLKfZMVPjyS02IxXUACFA4yIAqe6Zf4hyLmsA3H6m/VrMjKqCg\nJvxV3IhsYO9HR4k+KfmMqoB2em+yXnAaOULqZkrxm1sU1SdO2zo5x4hb+Mrx\nKwBN\r\n=IIY9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"8c378ca7c8a55c1b1e23e7992c3875aaf311f29d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.9"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.9_1642763732823_0.40652790920811555","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3537":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3537","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3537","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d3f5f6ae2e2e71247782a2b531c45b1fa135600f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3537.tgz","fileCount":40,"integrity":"sha512-DFBDBnmiMzNMt9xOvLnn+/OBQpiwYq8VHkIhhvJnlimWJ9n65QgoIWxywjgHo6QUl+Xy7tpVQARg1gELrT8MwA==","signatures":[{"sig":"MEQCICU/evze+hGy0fzQg2DcrtLEARQC75oh+0Q/u3+jYxzvAiAJzRCjMLSMW3wLDCq36dDrvWC4SCJu6rKCZ13B7pnqgQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6yltCRA9TVsSAnZWagAAI6YP/A5k2pslKsPURlpich4l\n18Bas9vc/wehb9C9geE+cE8NlMASQ6IklygFgNMkskucPbLeV11PVmQYQ2kH\n+xz320bKpd1MimzYY1b++wgm34+O5B310UjZYJc0+t7x18L8AZFfrRkrXBpW\nSfy5Z8yvycl36JEqIStdkmz59LeN9o8bBKB5HATM4/omPOQUg/dszdVjQcJL\n9Z7fokL4o4D9dRoW8QX3U2nddJWMgMY+BHnI13XS9mbAWY2nzKJKejojADEh\nlac3VwFR9MGHJPq9apQ5laR7Xav+OltHzQW03Ae5JDV0c7j3QJSNVjKH1DBL\nOpJoeIrdzbVlr0PtI+PVaLM3XN7yzV1zDvHfQ8e98iG/A871EgHoglGBx+kW\nkgNZZosFQbS/pGerJiRnvKOpBAlc1OhRmqEMhucLvSL+xXGrh4tdfIN5zeA6\naDw1wqUIss02102+WKn8pUU7UaTeQY+73tVdiT57xjAbAwsC88PeDdyWYMil\nAKCJHDEsPdD47edp95f2HT3g+twyMH2vzI+kDNnpQjU8xHPErywlnl0G3mqz\npPgPSy/27ouuH/rj0ukuTiA/jHqIFeDyFxD9oizRWps681tlZGjkhX6iIvXC\nA7C58sFVjwbEhfL9rNfXdWEmxwmT0LAvW/7QF9lOjW/1QG+BsTHJ3kddded7\nVEwl\r\n=tQWV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"5da9d7fe4793668e956e96470aef95b41f2805d7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3537"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3537_1642801517514_0.8571626394267304","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3540":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3540","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3540","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4db8bde54663b0c3941d1d87d507747148098829","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3540.tgz","fileCount":40,"integrity":"sha512-h2HiyB6gy/gHUvhBigNIOg93shrpxY78HE8WZezsCpf8fxlx2uw3yHueTlwBICPjrWUTq5i2ZZ8USP4C7dus7w==","signatures":[{"sig":"MEYCIQDv4urfFrjO08xUn3MSvi3VqrXFkTq/bp5Ua02S9PIHygIhANzUSM92QWEylUT35llHcXKeNsazwavswz4qOuehibFI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7B8SCRA9TVsSAnZWagAAhOEP/RcvRbktJH0jrB7IP3U0\nupqvsPJ3PC1Ziq+X5sB1hH8b2tYMcalnoiMLQU2NtgL7aba/S6ojEYSxZitH\n7plgijlCWXvUUw4G4mc0EUzRHybpaautQpFacaKG5W/Qnndm4ifRrSb7bz0b\nFbER3zTzN52JpTmVt8p3SJLaMYa5+XfqCXAEloH83FKB0nf5gnbaVbUQxk7i\nyNKvqNvwu423/R+TBEYQulJqAbpvUkIFLjzcgm8itwYHoy4j6Pbiyy8Z5syW\nknGT3NvA49p5oAdLM2Wa+b9Q8IKf0So8qwn9iYB35NfM7+mBJMm0pWodjGVC\nX+9VUWBHyCEuejaLEg+KsQDXToqmxuzYVRbxxB/RKqK6c73q0jVT71vgyNaA\nB8ZkVPCtUHDrCXifiKUgH5yBjfPB5PYyT9BmwxlPZSoUq3ixdtJBbAXDaGqs\nxbJR40fvXwnAIlZU2j05aTuG/yCLKm8Ywwvk0MB5CybGVNAse2d5uxG94PFl\nw4+vpkjh5rILOWeEH4uXwq6wpep7sxWGGWecvFbbPjzdZ6oxln2kQl5xCsa1\nRE25PweDVzpavLvE7H7PD5yZWYWJAYvEcY/kUAB2iC0ZmPzrTlxGlMGSS2Al\nt8qpsKidOXhSUP4kDgvHe2tDwyDuFal1zycfxUgTrKQY/C8Yr2J3AUjYccCA\nl8g3\r\n=S2c7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"151470c2e2e9f8616949acde653617fc0f6d1f8c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3540"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3540_1642864402313_0.9938038304690107","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3548":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3548","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3548","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ee314342429e3f327614c37d425929bbbff15aa3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3548.tgz","fileCount":40,"integrity":"sha512-JOb81OODbtAM0MEfOTuhik4qeF0WMkyg7yXLf6OmyUu+yngbzMKcrOw2/ySvwctzPArBhm+4AqVmWZ524J+c1A==","signatures":[{"sig":"MEUCIHnWanGfACvFvJnJZMbErMWy/bV0VXVq2K5Ni5i+1hkeAiEAx92BFPQ6JYEQN7/StAcz6wymxCbjejHf7c4/SvV5g5k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8FB5CRA9TVsSAnZWagAAHB8QAItT2NqwfX8cWBUoMxCS\nNSJ6wFb/h2ulUuO913lR1ncQfMg1l3qPXUF58hqM1LfV5hag0ox66xYiF8RF\n4JMYCvwcS4lxN6moGYatM8W6cXSJZa87s5OzDhsoAWlxF9hLB0b7EmOjk9lx\nMS5Vb/AFD1jAHjQ9+0AnGSfCdwt68c0CPjfICYiql708gHSflvWVQYgT0ZwT\nywEX+kAAnfmS1W/wWJh5s49mBzhWsLuXfrJIX2avViMWOg0yXry44eEefJxW\nNRm2Wr58c0z6bcIqt2DVpB94cccVxkOfvDbRXH9PFXPZ895iLWjB5bWkFm64\nGofzDhklnJJPeqOXGAL08jerBY+p4/bnWX3uttCH39gP+L+YZr+e7nNeRZnN\nZqyRg543WpL0zuo0BWVaJ8MoYeJ0bZAuQ1IfeHGr7O65CSP1T0EYZPtXrz5R\nS/hYdwRvhhVTwLCnSX92WRqpIKC03ABSgfZbxF8LRxN1JaUuEk7X//ztNsUZ\nKPwHgglh7RFjTzKk3ev3jOot0p5cWPGJ1tJwnhyKw03tRwA7JtgcEjHVYCc/\necyR+q3f12kn1ayHotXRV3tLPPTW92ar7lx2Zkj8d3aA6xjd8Gr+LQKVsfUq\nhMvbgP3IThvGQwOgWdx3k14xgPKJCkJf++6xN9a7nWXBe583GctZhgU6vhSB\nNRMd\r\n=41Q1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"2edf7bbcee6a7e931348198d14139c7f958877e7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3548"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3548_1643139193191_0.2487067814429451","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3549":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3549","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3549","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b79825e55eca469661a651cc57a8c6efd78d295a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3549.tgz","fileCount":40,"integrity":"sha512-c29VpiWsA08H5wwhd7jMVJryAcxtenwzvbmuVUU1KcdICXn+qWHzeByOB1Qd3MIAg0GNMAo10Mrq2+XMFSqsgA==","signatures":[{"sig":"MEUCIGGxIT00i+FCD6mEQOLolNmfU7YLnOWUcLmt0udr8NCiAiEA/A08vFjv3n2CWEQTEgDBAPrXTtSY2crHOvB5mFL8K68=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8FUPCRA9TVsSAnZWagAA44UP+wXVngA37GtpZS6L9akb\nW8YZCu/tGeAqMnsHB3wWWaXtKwygM4MIrZVInwWm8UIB9BgP7Z5Ed6bezXEU\nWeidr1oIPmFE6n4CwaqBsFYnwSbUkcEAuq+I6fK5nvia7jCirgwgOeIC3Z35\nKqIaaeZv8FYITSD5VJccOLEn8e1rd0LZt6351OFh0pLkc7HUlDac4OgsSBll\nXnFjctAm6vniH5YgI+2rzDqsCj46oqbKDydRbggu3VqZN8UZnn/i/AOrQct6\n/Qupa0r7diTsXF359aIb3EBg7KVFSPYxL+tQf7IspERMxfUuK+dVq3tiniDH\nHjQA0MSwVU9Io7FgnoMdcykJtH0LZ/Ye4dGOvo18uFRaQZHLZnPaB0yOe7nR\nvNoiu3zQ2eBmqD5G4IUVBa/2PpkZk7VwEwnxsVQnr74/TP1rzrk/QfilZhLP\nL/j5+eMzSLV5PV4IYDiYOFYYdNV4IxrJHyb21NTNaDcSsB68Pc8Y30DZZP75\n27L5NM6WHEsNHzDI4bsYBoBO6OY8W32hi6XkDNfhY9rCH2lqMNSyqbEQjjbg\nsyV19HVcqfLMk+IU1s7Y01JUofWLcphC/2CM0cmOSMkynx7ko8f67Msf2z+C\nRA62YyF+aj78Q6K+NGKkvG+ngict5CBpEZD9yItBiREg0QJwhT24AqCfN+mC\n3fyp\r\n=ViM/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"2edf7bbcee6a7e931348198d14139c7f958877e7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3549"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3549_1643140367175_0.028694850879538603","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3555":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3555","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3555","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8a27100648831b5264b740917eaf85ff281a0854","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3555.tgz","fileCount":40,"integrity":"sha512-TMBfjxdBl7YdQKbjzvwGAK5Wr8KkmtR9btx7qD6puOT2VxowTZ2DI1Xcu4G4GLc/O6bczKtGgDdg9LNdY8vbkQ==","signatures":[{"sig":"MEUCIQDFet8y8/QmgnI47jBqGB9YZPCw4RP/ncrrYKhh0bXCkwIgNu6oub21DMoyyWeY2MqLPtBgo8wVgIw4B7Yo/rdWQGY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8foHCRA9TVsSAnZWagAAQS4P/3tnTQvQym9rFIzUDvha\nHl2DNRHJJc9mOCA0WGSLubh39DAaH7j41pD+6kVRd8DXsjztunHuyaJPDHDj\nxAXlPVcwSKPj6pfhJdyIpNEQpW193MHn/dpNvfBWDAgG38RSEavMFxSXlLxX\n0htQoi0GQUqvnMKmy7K78mefyv2A9FxN9gAzg3DMFQ4FS6FyTEZ8F2fZ37pp\n2QnamVGZoiBywup4+iaYB8iWgRyOxbCVEoGUoRhBCB4OBtFbSswiGbOZjD/2\nyXFduzDk0okGwiM/kj6hSjTJ7tS/ObkuTQpr0JfqVHAqsoqKsaUkA/7YMD00\nj0EuG1UiVGdtJBNZyv7dPeLoDFC1AwyHFYYF/YKKciq5TBEQCixIoZsB56DF\nX5rNIZLcOK+hwxIepG/Z+uoykYThLfuwQBAGusM4eUfw9EzrxbEQETHw/+4F\nJU3laVPgT3tPUTrY7AtJ+cCIkEm6fYeAbOeiivEwHw2O5+grkpXlPV4wRLP2\nv2k2o6DhxfiS2YfMR/sdTHjDCOixpX+7MvjGD6eFb2OYWDNW+P1lBjtSIBt4\n4PU/jFBXkMyMfe/BHgFDPJsikwmlQwiy87OWgtHVa8UDiY61Ybbk0rTYssqB\n05a9wy3ThngZm1PP6nWfLRyhIHnISs4wM5l38zfiHuj42SD4BGCKO01CekWw\nxRUS\r\n=kLrr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"0727a5c782dd1bbc7ccaa11a036a9f16e616bf10","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3555"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3555_1643248135522_0.18777562865610697","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3564":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3564","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3564","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"41549f0243f1b7906858c4ac9ce48c90757a055a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3564.tgz","fileCount":40,"integrity":"sha512-IMSgkKuJ38k1VvOrEpo3H0r7nauGiUkFpEPVXH2XZNCsOEDzZd8LlUG6swPLEFxX+FgdMs4oT4Zx8g0I6nrMpg==","signatures":[{"sig":"MEUCIQC3ayOFI1X14yazDmu/HgZVZoMSMjiWApjSayLZLP24mAIgKd3YzVMTxEuS5uDP1AU3Q5ewlb++xEnJcPiXNsyYzdM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh89MpCRA9TVsSAnZWagAAbj8P/3UKwBSoLOABu3iCQiqS\nwrz9fpCt1KtFmUI2ahhP3EZwPVuuHDKvVmI/rMDAr6whAKCTX3XKgvohTSuf\nZsfrxr3Hwhjh/xy9Q5e1a/bg/aJCouf73VrLHDw5OoWkUkDQHj/Z7sxQupI6\nOlHy/O3/AvOQqoz2HqSmdQ7ONZj41egfnFAxHLQDQpXb8YcoBMo2t63o4Tqp\n2E17UxcB0F+fCJeUNVj7Yqn/G0EFVTXfosc8VnomsKPVG3LukdlBpKcIkhiU\nAt71zEi6awULg4lBaR4Xr9CzUF172WoQo3Cx1m8wpOUphW3y9ACv41Drx4yT\nQqFXTvEtXWLau+jn5T7g9NRi/z7WFnNes0dcaoE6qDkTc6QhNw8C19yGL6sP\nlQ1sZF/XdJIduPi/9Js1VwvE8o+I9C/Y499AVVLF6shmwgkkk9P2oaKD8EvP\n4ddB2AP5/gHS1wOVJz1cKJeavcSMLzGgueBtoSjlG01/v2ahhsOE9lKRN/Xg\nkzIcJyyoIu+g5N47uDhqlG5u+likK5XIuHC0/NveNYlSrWjGWdXNxXGh7aag\nXWfRt6vbnIqCtyfIyXqszZTS/hEnP/yYRhbrZHgmSR48EOeRH6FOINL+lnYn\n8Ir06nCEYkCsYxUBaTW3VIYCEhsyk2iQnUAj1smfIFst+o8HKUzSFXZqog8J\ngjXw\r\n=SCnT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e5af009799d073993a1c415c4ee63029f9b3d547","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3564"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3564_1643369256867_0.5432371204165294","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3589":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3589","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3589","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c3c164f205f2188add2f348a90de0c3f45b1d211","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3589.tgz","fileCount":40,"integrity":"sha512-Z1Q/vA9q5sdUE7OYz3ljbmQaBsAUfJUZteL4XjeNPX2JSAv7SzNtVsJRNoVCRsd/1oYXy7+4qeKeB/zJQXQJdA==","signatures":[{"sig":"MEYCIQD0UKSRmKP+jHAYTCKf7UWUnkyefknNstrb6/KRdHb4hgIhAIH1/NnLkiHFqixx5L0NjWYQPB2qMK5RTiSW7SUUq+LV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+seYCRA9TVsSAnZWagAApj0QAKCqOjtF+8S6Xazdb2ev\nHTqGYcIk68ddeqWLIsW6+G1CTZewRgDGsJf+I3LxH1PXkR0FDZyHWSkXaQgV\nqvIuc+J5CkVGnl/VUBaMCXsIyrJwf/BzaiO2ysfXgDAY1NKIglL1VChK4NCf\nYlWV1U3pjOsS5AvbWgRstOjYZ1vyyOtFWSN+UC80arJ7g4mPTCjsdry4aJUy\nN5SOcSwXlLe9eNEjMvRDgDWQRKBap97pW9H+eszs1SNdK12dyzHbSv6KqL4r\nyGfsr0in6TlQuxTDhPtJQ32AUJhF2P0yvTar2K0yFX88Zv2ni43mWcjBKglk\nxKQ3L3REyXK6dZIo9+naIfhD9LqeV0rNb9847jqn5IEvr4Tlnmzi2ep/uvqi\n/J+DKTDI9poVFO3vjwQ7WNt88Mlni1OtX9GZ6Vz1RoAM0hGekym/+l9xiCv7\nnOuBAfELSx59UYsKigNUVsehxAUUEVM+IsSLj3Wbr+7YxvfDJ1kEjRWx9526\n42GnmxrtN4r6EoRQ0rqYwJ88XSPA0LpRGwiYy1Q8jV1K2L9gYcaltgzWlpNV\nifFROOJDSrKxIjZGx1i3sPFF+wnl2qMnlfjrXPwsrEYyYseDjJuLV+/52Xkc\nefTZS7Our5+3rRnl6YVFtVwDtaX/74T3d3wry4n2I9zBofVu+qTko224VWgo\ny+8b\r\n=Qnzz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"3de80e7857d8f95c5f7c6944dfad56d4a5e21f8d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3589"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3589_1643825048785_0.6314931040893976","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3592":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3592","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3592","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e4d599823fa66ab7b3824985074ebebe9f778eb8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3592.tgz","fileCount":40,"integrity":"sha512-9RoXKDXQYF8YlMXYcrUTne8m6cMBKiLXerj6SxDBcTfq8MQ4/Lq5ImlKS83hMOymbSVtyhSi2yI8o+fcPkt9Iw==","signatures":[{"sig":"MEMCH2iVC7Bw6gB0DmrKxcuit+Bv6dhyCk3hOsg8StTDWowCIGVmZkt4B1RqjLo7bz0xqsHcyDMhIyhZIO/NSeijLSdy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+y0sCRA9TVsSAnZWagAAczUP/0o0ZQfTHOCtCdccbENd\nMEBw3M43atfZrjAw8msUcz6SbZAcy5qG3e26ONnX1cbbw0JBVAjbUED8uHj/\nGNK6Ik3qW7E2ODKeTn7xScxABsiSL1qvMMqC3OKg0oOEb/UbIjdd8AIt9Sq2\nqdvPHwtfYmNIKEXslR6JmLfAc3NV8OCobRywJTIcNHW5eF7XZO6liNdtIS2m\ncWhUe3hV8Lv4DrBcTVU09r/Z0HOwcRDEhgYfaJC6qo3JtXkPpVfbH56ju0q1\nOAd01COePQLuR51zy1u6dA4lXGly2E0l9zMCW2xK1ajvIZiYz638UtG5M9+D\nEQUuq8keWPhzvKLGbLzsTJIxD6XzeUGZnRNU/xSmiXaReliIfZqiuhnwNpZg\nhnF97giQeyQKSKrQ/xEb/AWJNpsuN8uaMRsMnbQ1AfJmYH0LUhSuLOyNNnxv\nol0jNDDPDlr1Uuqfa+Mg0WccQdPoSJKfv7W0mLWtfATd5eJs9C2/hxaNNVrL\nKgTQDuqpF1z4EO+9avuNNbafZ7AIyNpzcvABvQMU9m8NGsDNrXqcFTJZ7lcS\nqodXHdZgN7aWMh1yyilmP7Rn+Q9E2O9qIImS81T/akBAE12g07l7pOHMFuZY\nh20JG4KwAm5Xct0bb8DoIH6Sd/E443MQzpFhVkU1472qCl3cEGHJJ9Itmolx\n47VI\r\n=tbJp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"5537ccd39d275afdc53845ab8cb4868a8dbc8903","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3592"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3592_1643851052604_0.1829924031196719","host":"s3://npm-registry-packages"}},"0.14.10-beta.3615":{"name":"piral-ssr-utils","version":"0.14.10-beta.3615","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.10-beta.3615","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1ea275f2e6e856d59ce8eefd495ab9d83e928a6d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.10-beta.3615.tgz","fileCount":40,"integrity":"sha512-JdMoZ26P9jhLI7gx5FFi+y+wZLhWRuecs/1D4HC5rvmdAmuKGdS9MpmBqfWGQ8giAIrQOjgZFsoqujWnY2TVwQ==","signatures":[{"sig":"MEUCIQDsygq/jfZeFB7UQto34ovoQKOsNKQoUJnhLt21/Xd8YwIgUFFOnYhyKxBP2eIQG/ljCSoFZhpeoEhsfPaPcr0ivfk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/Sw3CRA9TVsSAnZWagAAuj0P/RiQqPC/PEk5+RgmqwqW\nULjI0sGzEV2Jyw5kDUg9sLDzFmFNO8yKQgQCksnIzjvSjBUCG+Ab7E/BeD81\nT93FFdsbcnY7OHaL/2mmZ1mUBMaO9mm0zqpDQ9G25Yh5CD+B6/eibiEsQP/h\nyFkVpCuiO/+oyArTBbWJ0v+0Vm83kwdl+oDQm20XStdM3IPZCN7sTfJnQIOd\neSFh4tk3e2zlcSL+D22wifF19uHwGKXUBZIN9mm9M+WznQFrGEVs594SQHca\nXQB5mvgNrwZoUAliIGrV4HE/ZA7EYLG7l2+rK1QEAlb/BDuaBqfdipUNIVQH\n135RfZyMBTDU9UvGfkyuko9B7ulzSuqeNY/t91KXmWJ4I1xOsCmJMWjroExz\n3KWI6am8J3UTFS1Ot27V5xKEMH6wR75xoiZFtUdvP367jTo4gip2qFNSiKc4\nHpj1onv36ecZ7Qh/9Jbpf/7VePoUFFixhayz4C0+OPcdiF/E7lRWe69rjY+C\n44GVgtHO/y+lmnkH+jSH9NBhl2iG6x3yjVJ4hDDrPfeLvcVF37tNvG3lEZB4\nng0b1QylfKu/HRhbQKQ63FiedZNzdHXqeRMEoOKTAk5noXTIDEissybktC1U\nKvoB6Mhe9wjP2od8EhE5kTXvu8PS1QsyAdCcAs8Bdwy5QIdaI3oZOanEBfYz\nbqkM\r\n=4Pi+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"57d7688876ae35920a429d1580136d5f18c1d085","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.10-beta.3615"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.10-beta.3615_1643981879221_0.19221724569639353","host":"s3://npm-registry-packages"}},"0.14.10-beta.3616":{"name":"piral-ssr-utils","version":"0.14.10-beta.3616","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.10-beta.3616","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6ee21077ce108682a7cdf8dc28088f5843f8cd5e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.10-beta.3616.tgz","fileCount":40,"integrity":"sha512-M1yDsPatO+OCJciy0BEiGtaOpjCjDSiURkwzw4p1tjGlSj0Dzode7av6S4zAOtJXxxSBjak4Gxead+E+Tp8DAw==","signatures":[{"sig":"MEUCIBMCP4nd7yadbUZ6iiRtrHJWtM2KcuNnaAh+1NHMW/XPAiEAsbIxONFWjMdDmAnueYYPSdOGNc73cEeCSt04uCNwvlQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/S1ECRA9TVsSAnZWagAAtnMP/2RidPGWxc1k1ZDXLkaH\nykQuDIATqgQRB+p5HO2Dun8YuQMSY7qUbGCOhGceQ4BGHEt3iyL3/sSHlzEo\n4dU3z/iGkmJZdwMG6OUwtxJ2eRHS5ut+mTQMZyHNKJ89WbYztWtn2vzkVnEe\n/Xl0wDzRicRI/mVkVKwB8nyB9iqn2nIgwH5BFq6xlcoBBPBMysziB1ui4abO\nt3YVj4+Z9Pt8wuiCjoksF29YXkfhiTrSonWMGfUYEETm1M2c12+wvHD95kxC\nMy6Jxbal+nMltLhOGqko1vBJDc1LII2eS8Ywaz015jKkuUBMz6LExkw2OYrm\nV57FsnhE11w4xozP7PCSA7x7+3XW66QvfwNmxyEIGO8q8FqA+Z5WPDSx1rWw\nsucALxlvf3XkZfN01lkR5Tgiv22ZxusIMyXfRG4tlTYFB0eD40YsFj+LnQVP\n/mEXdmGqBBTpvMPCC262ohQct75QHUJM+rIoCf18eBksWq1OT6R7BtvEGH5D\nfOa6fLk+CLmc+ngtnNVnKp8JkItXX3xubRsALEOu3WrFgLaAIpragrjZUQtE\ni8F+oyOAP9dQw4XCy91IgnW8sENRxSQA1WxOXsYz3L/bj4U+Js35kTxlbATI\nlG9xmOt6QdNpf9vpps2G2gxKFbf5cvpa7QUc5eLUOY4Dqz1XlspHAlh82V9D\ntaeO\r\n=WFN7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"57d7688876ae35920a429d1580136d5f18c1d085","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.10-beta.3616"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.10-beta.3616_1643982148560_0.5530689720788553","host":"s3://npm-registry-packages"}},"0.14.10-beta.3621":{"name":"piral-ssr-utils","version":"0.14.10-beta.3621","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.10-beta.3621","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b768f738bf176deab994692adfd67fa25127f376","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.10-beta.3621.tgz","fileCount":40,"integrity":"sha512-6SpUNJ7GqCjMUwcAw5WQQhV8A39uHHfo59rYB/O3Prn2/3EpBIltvg3g4XcpcAYiv1txVPZkZI9kyycwZR2AEw==","signatures":[{"sig":"MEQCIDklpPTwrZQ/WpUrZ8vTSQGDLfaWQyUXfkuooNrm81aSAiAV+rQOtRU8AoiwC1ZGkTharjUGzPs6OiRfUpFF//YYyQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/W90CRA9TVsSAnZWagAA5OAP/25CmQIgR8p/koqhELpK\nlCtVKsNPkJPiM0uHhSvDBVm8HCn5WarGpbSzMt3fS36T7tV8fieepogI0NuP\nT7IFaFKZaITssQ3KM2dgsy1mQCt7lrwtajUGRLQ1U63FdQAXCCApd2M28p7M\nPino/ODYibgdn49H+VEX0KvxFHDKM6bI1WF9YsQbaEnig7djjRX+V2u2PjJx\nSeePy4H81jJw77EsFpERXW0SIgPqqHhuqYgcfDXW7i/ZPp3tolJXISbSlvqb\n52TbxvBFJh4KzXAXz8jHxzyxS8dCMoAeen1fRK15fkYu84K56h+SbHwId5pP\nMvhD2vn6Q4qJqPmSels9yvMFPmkZcvXPlpbqqhXLv4x6HQhV353GEFdGnMKb\n5QnwRyxB6xxaEX7tp/QBSbC5ZuMTh3KBQz334OBmq+PspeTFN5xFO43KuMxo\nwiF0Pu2mQnscsm46zG6ph3+wnrahsRFKWTfUIlN/WziQJpKlOB5u907v71Aw\nqW7V36XyVCbaabkXlNI7pV+doiRMpDkLRnlx5YCjRbOLxeTMDPmoMviWZlRX\nbF1w23W0oCu/mFGCoBlylJa1HRhQaoKJzLhthNs+bh3temxaFIz01WkXWPn5\nKnAscQBh3o9lpu+M0uuKQA6GPWHW3ees2/zfF6eotAQjaZbRk9HLZ9WgIeit\nGwW5\r\n=c5b4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"161b6a945b0044bf356475aea053f436c0cfb89c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.10-beta.3621"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.10-beta.3621_1643999091847_0.859523239414661","host":"s3://npm-registry-packages"}},"0.14.10":{"name":"piral-ssr-utils","version":"0.14.10","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.10","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"67b065b31f148d2735bf52dab4e2973ec954751a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.10.tgz","fileCount":40,"integrity":"sha512-wUXKFfEIuuB3iLLRQN5DhlJ0yTYmfkUdp2jZicrWDPXrBFF0PcRbHV/hLfIp0GpDGsIyW5c9nL9i5VycBgY7rg==","signatures":[{"sig":"MEUCIHOu6LaSFhyyGGqKqJoT8jmUVBZNRw1o6vf7PvObdLhMAiEAoI45kGJQNGngZrC6MMiqJQCOzBxF6JDh2abQ3PPzbY0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/Z7xCRA9TVsSAnZWagAAVVgP/0nP8UssrbqurVHHQFeq\nQ/q81sQl1aC/hWRL9GtawuWKU+H6KpoQGa/QTDK8FcjvCK2H3ktwv4XkEyMv\nyPcjO8j9OEarf3ctxW6/AsGUtxUsI7pyVQDNJWf+ukQzoQKbYyU8C6Tk9zsb\nrpgHl7DhjEmQxaaUY5WBw310m/RpktAMrIgQ6dTnJsEf/P+X5ZC/RowUjgRv\n/fccEPv2quqUtpSrAQpG53eBT7q7/qJLyPjpfsmoRh6bZgWxnP3RF9E++r2J\nN1QjDUg2QweJ0MgPboTtwzn+loa9Yn+ac/VEWIAjkYQnDYjgbSkF97/y/oLi\njRxQ41+GZLgMXJG9Ro+e29aw/akS55+pwW5+MJInG5U7/rCgvqdG0zAMoiWF\n9FMur1ksBRHOSqQe2QyS4cgpaJSXlkTeCBKWlvhP7IqND9fggRtAEX72CLtf\nxdx5tpX27XG2M8U+fCrizifwWKuMck20y6Yugexe+jkb836VLHdi02zb/deV\nUB/IaOVN7xVFF5bp4QfI2GUTw7E/BOojTOsvyjaBfhrd0A2QOTi9WN1ccunJ\nBh0ounMCHDnL675FVZxVZSeoT1vcqg4AzI07ATdLIRi21YQ+8u1jfmsU4G9m\noPFxTMfIhXUfv9RRZuA/5M5HMT5V2IvVWAlwXiuytItVM/pu/e1P5GsOwEP1\nDdoi\r\n=6zBZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"6eed3712597b7162bafe5d12b77014333168b7ff","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.10"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.10_1644011249448_0.19807965589554843","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3640":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3640","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3640","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"dfa8b8612b730f4a922b110ca9d51d3669292be4","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3640.tgz","fileCount":40,"integrity":"sha512-lhQEVES5yMYi0UH6SRiI8z3hK4kDk44zKeTn9xSWwJ9cbfADZj+m1AFvG81weJ3ZbL4qpxXY+WidjEgQVb4tZw==","signatures":[{"sig":"MEYCIQC+0row+6DAGXlbybb0OeqcrMv26Us6OpqyY1jh4iwVXQIhAMHAzYzpw7krksS2xwG1WrMWadvUBoToB/cHeo7IwenL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBE1jCRA9TVsSAnZWagAALzUQAJ03Lz6qIZtOvwSyvVWg\nQZk0b/o5GANmSQIOWuASXRMsaRJO0IMk/ILc5BRPA4zUd6sGYmr43EUnd8/h\nRJyW1PftsGKrh8rxCFqNf33prkd9hb5mUpvWIqt166Q5IfGK1bWIatxGgnNQ\nomG2IqcYlVaE79k8Q+GIGs/AcxM/qFwQgWYPUOuyxYwxegdAkqlYn5av9IjN\n3jE4dGfHidzqs3ZWdFSjhNiy4Pflrl+h7O1il92V5UM3DMyPm+95v5rqI/7g\nIQ7Xppw2TQECybNfINWk8LATsW0kzVAMsPrXG50V5NY45SY4UL+3ukV3UYXh\nUeSnAConHLhjCgmcs4q0yP47ZHR7x1XWPKlRPhv33z3hi0fVqil1hbm5Tgiq\nVqnQ6MF1CRe4rFUv2B/J7q7AnIfppgcIInEpH2XHBS8XcOAN/TIZb1F2jXh6\nnYxF9zTEgI9uzuzFXFJDCoZswBY70KTO71y8Vhr61yGO41lgn4fRwTXhP8KU\nLWncT4wHr4AE4yx8z+l5VPaQSjee/QnxShh/AecI8ISW77+81R853qL9Kvx+\n52LW0Zhem30/6WlYbZcUMIAw5lWkfQIGs+oH3hYF4hmYJJO41POluucw/3/A\nMxhi20XAEtgEJh2HEnzU6v6F7SxVGarQG7yfoVO/6j8c3fz4UJ0QUfC+Nx0w\nLdhW\r\n=jcDp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"29ee91f865f9ee42229e58a7804cba6ab5e9145b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3640"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3640_1644449123166_0.4022140397788083","host":"s3://npm-registry-packages"}},"0.14.10-beta.3659":{"name":"piral-ssr-utils","version":"0.14.10-beta.3659","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.10-beta.3659","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4ef4b20933a3de8ddcc864588c49ae3e81828ba0","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.10-beta.3659.tgz","fileCount":40,"integrity":"sha512-9yb3XltPs3tAEHoryCSGi0qu3myS9EV/tBuH1ulfm6rm/cbWdTmhkwABTjo8rdx7/YX3pnKCnVkuj07mVgm/1g==","signatures":[{"sig":"MEUCIQCn3Kl7Se/c+ePyrpwP6jL5fdpaXO84IoaXUOu1kWgo2gIgZbV41EQvzRP8f2XNecKaFSkhuYYQ1uf/o8nUDDU2VYI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCOGPCRA9TVsSAnZWagAAGaYQAIbJ6xu361vr7uPDbun1\nPEa2DuoZ8U2u/yKXkSYZFLiLA/cF1OuBHvtxl2GD3BokI/pR+VRWsx9EhhYF\nu7boOAoxajWMSy5jYs2mHBqe5cZsvKCcI8FqCGD2kluToD2Ou5mM2DpTVA8Z\n2z1rx5eTgEzsjznzIpXCmuoeylR5mhRXtcZs6IxcnIrXHHiWS9qFvYzqwf/A\nkdAYvEgoXoxLUEZaKGNeHnKqDNobFzieT9Q77YHL1GyWHp4N0G6eCOZ1wh2p\nsSh33uar3+XoGVP/6AfwmriBSioyLVj0Ky+V/AaU0k6lGQf3uIjpKzkefrFd\nW/pEPIlA4G6lK8NuLoXtQ5QKRvBWlW1CJcIJrO+FCMVoXSwSZGt3jWOu0Zpm\nJeq8jbt7nm/xQ0Es8BmEjvdpLI8HWFobldXr27jbdA/vNi2fNOTHBqZSzpbE\nBnG2OR7UnLob08M9vaX3WUTgmgWaNQlQ2i5rnquDf1f/Er3X3J1VjAiMFJtP\nY9V6O1rVL+OTn62U88U1Fv/GbYDfw2SgvV8jxUQpmpsLmKKJm0k8AutoSlKv\n7FcZ5mRXClBIMMyUIUMKYiixrHByaD5YX4MLBma4pta+A/quX8g19CpiubbO\niZxd/77ai7SKROqGjfZQX1poHeOiUKdbFuAKMOpKVuedxGYpnhbdmsEAQBiW\nPmmX\r\n=tb7l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"6ba6fa4e5956746899b81046ee25ab8bb36520e6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.10-beta.3659"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.10-beta.3659_1644749199027_0.6641233686797419","host":"s3://npm-registry-packages"}},"0.14.10-beta.3661":{"name":"piral-ssr-utils","version":"0.14.10-beta.3661","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.10-beta.3661","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e8b10675892599fad75d54d0016e336701f594ad","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.10-beta.3661.tgz","fileCount":40,"integrity":"sha512-rmtbADhoziwA4P21ohQNQDyR4fUYayoI4aoj82rEa6o6qxjhU0kIiGPOYM6sAJTBoZXtPRG7r72qFi1oayoFhg==","signatures":[{"sig":"MEUCIG6hRruR97ipzlzDned3Rxmd056Vc4Fz5l1Kikj9By/PAiEA8l+1y1vT05v5xZU1qLQGIv2rmbBTTFohvEdAg9srYk4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCOTmCRA9TVsSAnZWagAA3VAP/0F8m8PlnU1MkCnYm26p\ny2KfsCgY2Hlmpd93Z7F+ZLq+Py22hqFTxDycMZ10Uvv/rzhh6FFBvct0I2d+\nG3EI1p+sY8wvU+6mYpOEqYnnt9DJ0L2/KRlM0w0U0fEIY/xzLSXl1jYRtNaz\nGFfIvyjMji95pzim1jdKQuACyQDIsosa+j+vx5h2kuK1l0/0vDE8a9ozgmys\ncaJGST8vpbd37PZNOEeh4fjtYAaM3aaGtVXbq4r1V/+fZf1+/auKRbE/W5Hi\n/QR0IOSAOjvw2X2TtbUVMqFy+LmV/ZDSdgvZUqXB2VAIIPOcd+a+MIbavA0B\nXbuDVi/kue90X7l2A8o2IynAjZWHMnbEJJFvgj60YBogf8tsfzpg70tTFNSM\nwp+GwIi/s7a0/eicQeS+t981+OHPmH59ADYnqy1qEqIHgJFaENfkdhdmh6va\nMRt42ReJon3/Nkx2cv8WRis1+CuevBfGDF45LcJDiIzl2FltkCZ2+UAYk6RZ\nxjFXpADFs2ZOlDFTt2v6vtUhDJDVAme99TP9wuA2jISB4HfInLVTT39Hfhpp\nTehmr3cLCapIA/7TIybQfySCxe+C9lNmUAaKg6+07895c3wPh2t/bKYwFI35\nTiRcZyR4DVy4QQRJBQwA8DtOWDO9T2jvd9SEnbrYW4o72xJ9JK/QSbHBlABY\nKZOP\r\n=+XKN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"6ba6fa4e5956746899b81046ee25ab8bb36520e6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.10-beta.3661"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.10-beta.3661_1644750054267_0.17069907683822683","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3662":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3662","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3662","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"61b2c34843ce08fe334abb698b4031b923856a71","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3662.tgz","fileCount":40,"integrity":"sha512-aqal7iN6vF0reGBw/0CDg85CYfbZ/W7HeVjbcn4mwW8gJ3FKb5H83DJMai+GU/4xTOK7eV5ZYKdek49TpFng4A==","signatures":[{"sig":"MEUCIQCIK4E01xIk89G6++vcll6NWyEcyGrBbupLiDV/DK/njwIgZGRfvn1AgjQXH9R0Oi3hMBhOFy2SPbV0b8IG7HqEVgQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCOqTCRA9TVsSAnZWagAAs+AP/0K8s3qjTkJxTMzQIuKs\nHkrUD0pWk6EErOkQuD+lYjRvDVVVZ0aOr0fYCY8u7c+jflcYJlxQh+ju6Vsm\nE4Uv0YQ/uMpoLMaslogWBcAn16UjXgTEWbHltv9hubejPMlJ6ro/8uzEQmkk\ngd01KkE/9dcaCh9KpRc6AWkjBxGSdmpapeL4BWpvWBn/o56reyByqwemkNax\nBa9U6uFMjlYVjYu6edl3irw5ieTaYyj+jsmbtX7sRpRq9AgKJuJV7cNqlAFP\nJeLSQVy/e2wXTVUw6v/+XOqfKVyC05YsZaxFYy/3n2FxbTKwq/94SfAV/4YD\nyxHGA5Dh5tX0S0MGAM4Lv7r3RLXNybTt9lRM6zvZuIc4GkocV12xuMsAYlO7\nTP5kK+t1tXRUn2QplN1xVwSlI9AbrP//GamOn+5szWFKQERmCfbw1dvIidD8\nw+kpC1l73gYy9abTzN1LEnj3vnsGbZUufBDJq9lF2u1BuY8ZMJBM4qz/XQ60\naKSCBBdJR40cFgYqz0/LxfYUa13EkhzAbJGTDwcxHJzApNWdUHgclLAB5AZa\nK7gCZ+byMF31nyfB7dYeObx5wKniWH/ldFLHFAyaZidTbz19c2AZ5HhSgEsU\n/VkA9cb19QQY8OGly4EJvktvhD5kU6gld4QyyYMWo8QdzyL7pCltqq705ww4\npfwk\r\n=s4oQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"b7ec6c01e99557f270b2558a7cb23bec8e6ce0da","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3662"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3662_1644751507014_0.6893237577335214","host":"s3://npm-registry-packages"}},"0.14.11-beta.3674":{"name":"piral-ssr-utils","version":"0.14.11-beta.3674","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.11-beta.3674","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4fb50cf1bfa41ecab18de5ec5fe2f95a622a4a5f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.11-beta.3674.tgz","fileCount":40,"integrity":"sha512-XuXH+CmdKy8ksrTFS+wLWBiq4kf+Zs6Rz8dIW7N403BlsXqd8rr/cGsDEEPXyc4STxyVf8QqlcFveZ4X6x4+lQ==","signatures":[{"sig":"MEUCIQCaLjahB5/tnriECR9xJpPTnYcrpHUgnlAvtwl6XftwCgIgc8IZASWJ596j2CcdXMi0j/TD1IthrZwRaHWCWo49Vww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiDjB/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqc4Q//e4J1aNYz+6/GL4AUby0MkppmgVl5q6DXBT2K021azOuPs12q\r\npAUTFrv5wum87178T099u9PzSMo4yHkGmdk/C7vDAs7j7NR+h6Fy3YV8l2Ms\r\nJSUV5gBb6l+6LJwv19xk5ommxrPWO4kMcdqDpbLRhimdolwkEK+NgZOHFXrO\r\ngAJlTbzdadvOe/2B7DefNngQUKZUYjvfH7JuA9YXwSMoLDVat21M7JXAPiX0\r\nZWTCzD/s80//SPK1tN6M7cVOE765mQ2QCQDg+keSGuMW8SUdKmQP8yHgLQQp\r\nfhZtkL0VrQ5dfIHwqJD1i71brTZlq59KMbM1zV3NZT+UmwMCbJ7Ai4tiGZ08\r\npjMFfrDVyNI7kNFahiLhx9pp8ByZa4fAnGuXIwM89gNGzidEQ1x6Ne/CEkzr\r\nDlvNsXeoRIMhEJdX572kGElndE5ssg8ENOdwB0PTwZC1/m3ddUuT0q+dUGNS\r\nyVPy6YQe02ZJr4cFVT+FRc2Ss3Weyk6UA9HNneG6Bd/CpPSM1G75BUWJQHch\r\noS4Zdof/LUPECcWcG00DzWlWIUB3FvuczH8YAAQyfDdaPNvu315tP7QO2pS6\r\nACKopx45UlDyRPNtLhv3JC2gdzWL8R0Fw71xnw1iNIq051ySSV0pKKDxd0zJ\r\n/6A1I2MMKZHq6zGsqJ771kl2zI9aW/KMwyA=\r\n=qulV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"a33a388c8532a2a762bfbad62c5b5837cef7caff","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.11-beta.3674"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.11-beta.3674_1645097086905_0.5693990073108259","host":"s3://npm-registry-packages"}},"0.14.11-beta.3680":{"name":"piral-ssr-utils","version":"0.14.11-beta.3680","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.11-beta.3680","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"af21ea960ff8811bcbbaab97cfb7986981c1a23e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.11-beta.3680.tgz","fileCount":40,"integrity":"sha512-Wd+FeKmZz5spgXL9WWP/L9M7n31QxlRqEKtJoqrddRiMCcDAhMHk+wZHEwc6zSVJuJiu+C47UZ06/gfbreLrSA==","signatures":[{"sig":"MEUCIB7k55sxvV7MGOWELAwwKt/B1OpucWIhOZKqLOXMCOhcAiEAxnBZCAjMhDpnJ/Ib/87eRL9eZF/E47CfrE1g1nKyVoM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiDlDkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoa3xAAhw1vN4d5jccGoJ3FdbOkWEYfb5MnCA/cwZIfxPDWrJuSBvLx\r\nqeqbs3+Y1jX0wrH9yVyvJptx7vMFSNd++HCt4KdSufGxRwN2Dn76bAMk4bS9\r\nQO6+/zUGNzvjLSi+AbGA13sQV5s8JiENqLT8h4CN47rCk8jgvCAIwKHyaqIQ\r\nX9bwvr//H5ue7vkaggjNjVEF0uozDfPvXUEi3zoIuayAitRGwWPbugGKsC5N\r\noGhJMRpeYMdTb47GLsYHesdvXyJXKduXrnJYVp9++kgvoesjgNp+F54BQ7XA\r\nsbBQeKu86o+1AVbeUu54dBWcWbCOOPAsNghsjEEhR53wsyW2kqFpOFAZ+9mj\r\noUNnNE2Buh1si0HGC5K2z9VbgXQ5otm9eUGUBuYA3VAulwXudB7arW+Qpkg+\r\nUoZgZ/4Y92rryeCrAB3lz3JWICBeujN0vKiSugdxxbKzo3OZHfySDpyO1mzq\r\nOkZ8nc+VtPpIFrVTb6SvkgWybFOzy97jEr4WIrsValq4qBddNY/Wa+FYStRC\r\ncIrAQ4xTIV4Z2IbHCibHPgZrL1O/FZsjBnbh+krVvZTkyF6EW4mRxZ/TeCii\r\nIWXaMWB+/a38lsT9oCJ4IXd4ATJmVDtXgJ9sAFshOCWo+ueU8OqnCAXuvdwE\r\n6Bb6h1+NeRIVz8tJJ8YWGnrw14LMmVBmG8Q=\r\n=jgU4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"ee49adb6e617ced5f0d64a996c9f92a897451687","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.11-beta.3680"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.11-beta.3680_1645105380492_0.6211877670727404","host":"s3://npm-registry-packages"}},"0.14.11-beta.3683":{"name":"piral-ssr-utils","version":"0.14.11-beta.3683","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.11-beta.3683","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1c70457194cc00483ff73265d60e39d5de57c3b0","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.11-beta.3683.tgz","fileCount":40,"integrity":"sha512-CEznvc4tyUoijA5KwknsqoUevF9agHTIqmoKE1I8CGV+domxAU9s05qn0tiFYzk01Kw7iRtGsI4AqlHQSkz1KA==","signatures":[{"sig":"MEUCIHmXY7d5Q6HGCc/be2vfetxQfBz1Lkan5yTlQe81LHvzAiEAvHu65r9tnfZBfJ9lPAqD4G42QSNQKfN4XPJI8gmTz+k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiDmWJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqluRAAnZk6Ypze/BRyKF54mje1PDWKec56/RDWANHFy+TOixe4FlGE\r\nxFlvbRiyXI7gaIc+fm8Zjk2G/9cV7p2Ap0Ltyf1sQoKaZ5eva2uAO5mffCX9\r\nUpfrJIXazZxr13vcNZ0gvz4vZuPDrVJm9rUMry/QHeN4Ul0joMrKG8hPUWl/\r\nN87TpcNKxohYmgFPJnMniASr7gVNgn6XKN8RDnSzH9wsbugtTt7bcnhs6xtl\r\nj9rl6Jd/Vmq+2x901XmtgB/EXuAgdhcP4qq0KCPY4YVI7XFJjPTgcGa3Jpoe\r\n9tx4p0aLcytyMxnoozKRMVcRXQunA0pOkAQt7LFoO7Hfv1So6vbok9bXjNh3\r\nf6px6i3fC3MFp1vierwekDtaWfmCacF65hu4W6iO41YmbggVlPQiDqY0CSJ7\r\nyQRONQrX8rZx6XxR338gENpX5YU6QXunMB6UTln2Ar4K0zApv1lOH4nD6sCc\r\nAGSWSC3G5IVYsW7e5Q+qYnPT0pJvnzcWhb4sOv8vId7IVqDJgrB0k+Bo9c8F\r\nPxgPEsidAHsynLuczeBpbi6bN6G84cTzLOoS7eo8ovmD5/cl6ficxz3Izsp6\r\nHh3yroGV4kMwDZ+bVNT9H05oE3uGCo3J/DosRlmm//AMqOBvFnBVRmdU+CeM\r\nnR8Shu+lNCXn7+rGFFQPPru3EjyIVTWGM94=\r\n=BbD6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"175022bc5b565d8aa303a412bd72d75302a53223","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.11-beta.3683"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.11-beta.3683_1645110665752_0.8089232593635001","host":"s3://npm-registry-packages"}},"0.14.11-beta.3686":{"name":"piral-ssr-utils","version":"0.14.11-beta.3686","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.11-beta.3686","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1b0f8690647b9cee843e5ae1d54e7f95ae1ec458","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.11-beta.3686.tgz","fileCount":40,"integrity":"sha512-n1amwn0ARH6knzU/T55vtOwSXihQiA0pCwFSFX1VewlsBzqWlVPXVM/AyrEk0yb3Gus24jUVHcLnQdV5rGKdFg==","signatures":[{"sig":"MEUCIQCV7mDYAb9uVPkgl5orGl8Ijsuz45ZqxNBq41fAl7nsKQIgOx5G+iZQ87Vuks9SnRRamx7S6L+QGSIv85GjbKnmKMc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiDmy2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrVhQ/+NpqLpjkO9amdWRF8qQRoSiYuqWhyFz04xf2vP97LS36yrNDg\r\nCiC4LJxccNiF043AEoxlJWgsomoZWYf5piuJVVxFflwBqUBVN1fMfh9mVn6o\r\nPDW9ehat9vIKlhMcOFXpk42pYWs+/PqNw/u1WlaPC9UuHDykw5TGCG5rheFF\r\njis8No6uIAm8vfL+Nj5pHRaXUBE6f3TaQe0RHuW+pf3YAlKjxd9VSe5k8XdS\r\nGmaZ6DfpPDomDDZlVcK3cy27SWKvPhFHK9MT7FYVWUBnuAnDfq1ekZnb/qML\r\nZPsd3ipgnLVnJCE1oA//ZuLtvP1uZ0kwvrkt6xZM76b8Znn7CLwYUx1m+76C\r\nvHjhJ3lom+aaK295BYxkLr+K441TNzCWNjGXdBxekGT5TNd5Hk75B7dWh7x0\r\nOxedTAhNBojN8qz3Wb9fwWG/b1Mkg+qcyf8yMYPXVAqv5TmbOdf6C9xHL7Ao\r\nPVx7v5bd+0UkhHjv/ulRnagLgC2aeXKHT5seC1EkWNea7ofuPRdzNk8TrUXp\r\nu3YbS6XzMO6R1D2KBWqHHWcKJlPkdw94YQWR30gRaMfC6+cB+/78q3Mm9mKn\r\nplSBiUvOe1zCMl3X7NuXUe2rcxQjguw5xB8Q+fa1HKvdGHe15pl5nB+9QwU2\r\n2Z9tKsLiz7RJVt3d1RrRO9MB+LNzta0gFbI=\r\n=vlOE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"175022bc5b565d8aa303a412bd72d75302a53223","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.11-beta.3686"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.11-beta.3686_1645112502374_0.6417444340018972","host":"s3://npm-registry-packages"}},"0.14.11":{"name":"piral-ssr-utils","version":"0.14.11","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.11","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e9d5a9ac3031333fb62e616542b48bbfdd421b97","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.11.tgz","fileCount":40,"integrity":"sha512-7Tjrt8JNiFt5N/TApenTkDdOeIVoQJHHoKgSpNEakWPRFapQ7XW9MZB/A1OG+TY0BKQWxUFoNlxAFIVBAXjORQ==","signatures":[{"sig":"MEQCIA6mRzoW5xSa74bA964cfwUgm1DGK9ZYn48Ya0Kcg5IBAiA1lYpd7bfyeoiD6XK90WZtQ/RSpHIiQg25tWBzGEQL0A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiDnngACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmovgA/+K54d49dPcokNByFkFRZDZwsB1DZWciMFhV3JoNeFenmQb9vv\r\nPUsqtJwbWO3boP6SpF0yCoHvhNamjMGcCj20l4wZkZNrw5pwvmnDs6km2c36\r\nqBeauoU5IXP1vaNLpgUJD+6n9QepRTifBpudQ9wbAo9mx8MhWNtml5OwLMfD\r\nw0vvQLgDvokSduEb8veqPUP06Hbk84LSazVIr8gUU/yNaKXfTE6FJm1TsDOL\r\niFD4Rht09We2F6Wy9lwc4I1VKAVq2fXpOLYss4tAQRgh0sccqvDt557B9hNj\r\nS3Rjcpexwl38Lt1OvQk1hL/YrHWsrzJ0s1/+cDLMyoWSybFTMwbtwl9YCLig\r\nU1f+cvSi1mjttQvLFuLD8MWFOnHUGv/f25A2RlHcqqd/2CvG28OFvPthBoep\r\n2e31gQ3pSlJguFnVwaVMplSpH2y2HOeF3CLKI5+zPXibHiZfvx89IaRw4A+G\r\nrxaGJKUXGDY2UK8YUCLEDxO8JPY/fTGGQJbTAYT2Xun+95onz1x+GnDJ9ZTZ\r\nu1XVyJM0i/J05y58a2n0UqTKojMNHXmGeoWM+ZAySaMCJEWj5WJY4tl0p7j9\r\nXbs5trh7KkS2kZ/g+sN3Cksdxr2qkxoq5sREVeoCwihdjk/SVKbSCTxvRsAa\r\n3GQcW9NZAw4HO5zIsm02DK6sBWvzGvxLZ7w=\r\n=//bo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"487c320b01b51012dfbd1bbb519bae8bb0342042","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.11"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.11_1645115872103_0.6178838059433458","host":"s3://npm-registry-packages"}},"0.14.12-beta.3701":{"name":"piral-ssr-utils","version":"0.14.12-beta.3701","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.12-beta.3701","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d3597ccc83fc2f0bf8b13aa606f42f165b4ffb61","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.12-beta.3701.tgz","fileCount":40,"integrity":"sha512-eX6vAW8vW1bpGc8D11YlxqU752Im93yFdIzVlYSFGDajzyYOUeNBrlWc8UiHRsB1h8OgIiRWJxUYZ6DemUliFw==","signatures":[{"sig":"MEYCIQCL4Y1nnryT4lH2dIL4crc0xACRs1Zl5J4rOMMA+vJ1fgIhAJbFKIfUbYJTflqsCR1DMAKQOtHW1ZEBfHvsKDSajrxC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEnPwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrcRA/+J9CHKKAt7jFNXD/c2OIg/17uwVoiftsTGvHkg7UFN4lWq5So\r\n9PfmJtLHY0F7zCT1USf85m7nFOzXpAqg2cAfXNJh4mAyprHXpOMKxBxYi78u\r\nFAIoFZxgql2+xwIsKv/cl8b1+FMjUvOYU39VzmmM8cekLL+Yi6jsjjyQMgeQ\r\nYcjGNPSLGllsO+pw+Au3m8G8oD6oP4yFd3EfzNSuMmNy3QLhlSi6sjxrpmU/\r\neG04bHRjLmDH4ZCc6mp5le22HZvek3wLij4CnjQpOvMT0Un+Nuo8RsHSrtl0\r\noW6F2yOYZLDjZBlHZthfhANcuOsohIvSkSdKoABm9dS9LtJP4ALMPQjzhBCb\r\nGR5aKQwbvgi8uMpZxVgRayKjsQnebYNvrR99HVk+KJ4M5AkH3uVkqPV1fRTH\r\nCoADGd9u8Is5O6zFMWrAjAs0tfljUj0l156xUaDj9Zqf/3Bd4GBtUfcm37DG\r\nv16ms1o58b42DDLP9Jp4LsNey0aPXDmPDdcwUPCRGVxeidVCfrGAcDOqcAd5\r\nEMLOpeRhi2G7a2Ho4FiW26g35AHvkK5McTlT/ospvroDI7PU4BIYkq3Ew7Tv\r\nDmRluNBjuoL8qMeGtuKAeERsa3DLbkzHknsnFmEl3KvsShARyG6uum9UbC62\r\nGqBpBxPMWm3/HC2qWeBtAoL1lX7sumkgfpM=\r\n=rRea\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"a8fae0f967b40858bb9467972e17f9a8d3bc0572","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.12-beta.3701"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.12-beta.3701_1645376496377_0.022007787688741454","host":"s3://npm-registry-packages"}},"0.14.12-beta.3703":{"name":"piral-ssr-utils","version":"0.14.12-beta.3703","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.12-beta.3703","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a1399f7d013ad84ab62d61a21cba08c0c066ac40","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.12-beta.3703.tgz","fileCount":40,"integrity":"sha512-DvVuuXWiajdCaVKTadFSc5o8zAwemdG5L50vNLf+UTVQkN17MnJD2h9jMR14FAbM4kXQvlrJPvvq+6IAVeP3TQ==","signatures":[{"sig":"MEUCIDHBfS/tfM2/PlNoROxjwiQRmoqMyUH94TsYnmekIcrhAiEApoWs+8Ggz3woElhs6Ab8MEo9BBGo3hKMIj0cuxul4w0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEpi5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmorkQ/+P190mfljNwqBvCcM66ld9Lnd85lrxSGFN5PJm8d914X5RcH8\r\nGLgIuUKlcwWTd1ffBZzIVTXJED2YPxTvAgxg5WlcspcmI+bFoR85xMFQ4Nt1\r\neO+WiRr0jXAQv2OAYzNQWokGetYAZ52BkxEMx2S9k4D0fwzs+TuudS4O7GQf\r\nDAGw1wmQiUz6G0gMu6g3rjoPb3GCTZwBXDDzN9PCLe3rjdPrB5SJN7HzE3y6\r\niNi3PMJ+GiTXJ9P2LAwBY8Gkr57DCo1TVxwhC3hZ0k6iAaWtXdPVaBKko4uG\r\n4rIdm4ztEAohPjJV2JaczgtsSq/9Q30RDJ46PdxaVvoiYyngkP6oXHNjJA8U\r\n7NlAlW0vUe2Y6atiVxY5rfGCOIonPMeOsOJI4mqgDJsQKvVdn94r+z/2+RtK\r\nql53939pajJobpAyNqa9iTgidR2SUY7vaON54mZr5+r8GdkWQWpKI94DeB2p\r\nqlcMxxVUPdRAXiqPAXQYc+vMrbmnQjlYRNKNAT3iOVexM6xBcC6eRNuhPhsA\r\nqJjw0O2cGNhHqrOGSrw/YFxIsVyiIUlPj3d6KAP/QNQ0NAI5rEFKqjOYZ0ul\r\nDQYN17V41rPNjjJUurpAayFpBb2d+POvjH0xZdyOmsfWo0XH2r69g4KtxsRx\r\nQz8ttbh0HyRWzsNNa2BS/oo3pDa5ndPBryE=\r\n=34+A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e834256214e1558a021e7ea26e29eac864614c90","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.12-beta.3703"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.12-beta.3703_1645385913275_0.18434801326519112","host":"s3://npm-registry-packages"}},"0.14.12-beta.3704":{"name":"piral-ssr-utils","version":"0.14.12-beta.3704","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.12-beta.3704","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b854ba67fb2cd76c3273efe29cce6aa99cbd3c08","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.12-beta.3704.tgz","fileCount":40,"integrity":"sha512-pQ07QF80cS36uS88PmUQqKI1waS/So+5RrlJrv7GhwEVCwoirVAAqlXlIe/7Sv2E/XuoRYxEjwce9NMl5j3hcw==","signatures":[{"sig":"MEUCIGf3AtSBwBeKltHqBjSv2R12w1mAVgnTXuQXpkPdPqYLAiEAlHzeTlKQZplkSdlhLlelQceKinplgyIr1CdMDt2uj8o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEswgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmos8g//UcQrmg0T8r5VJd8b0HIx8rj01d/W2GFn3Ri+FE5slFVgxDch\r\nEQ0wT6yhDPjnBo4+vL6u/6Jlkg5h8TWkF5bn4o1+xdw/phw5B6VB5gIjTJZW\r\nq2i9TeT07n6EZnw+tnzGAziF47Blv6a+X5hzUi680veTTVVcF8/v9aD93Y/u\r\noPykmyqp69yjXzyrR0d1Ev9gTKTTkj4f+FjAS2JY0FITfAu/dtW8+YX4vYN8\r\nLk5H1sEY2376Ve79kmWZ1ukQN1Crw3Gi3+8m6KSHazUzrV0qLvoudAikSRYy\r\n58qwZ7TrKm2vgbvsXcQlFpOss6cIV6hGcAAhG5s7+/Ycywlk3smhuzlC+7eG\r\n6i1cMCQg9SZlW+cUs/toOj3SlWXaJjKhUQWIrzZusdO+Fe7nPD6v3IVbGqm9\r\nLILovSyjQMHdvANkx3nLutAzcuFO5+s7yx+De2enX8ZVu5b7215KD4K42tKX\r\nxA95axKUQuQstKcWXVmV/FLOgjZenoTC95weOQXYgzCH7CGt3ynP2WEtsSMz\r\nvdlj34JyK2rHufyv5uQhgeGaHFcversGlibMF42SydCMpKrsp+EGNSxeGEN4\r\n3b0Tqm6wYtVjmJabGBoE58gMl3t8Uvv3qYd9jeQ5MK2bdwk7JSTR0a8Lmua+\r\nQrDU4D3s0+3Qk4rMNX3y96Uev1lIhvejpWk=\r\n=XbXR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"9cef97e9f611750aabb1165a833346a621580d37","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.12-beta.3704"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.12-beta.3704_1645399072667_0.054385251778807264","host":"s3://npm-registry-packages"}},"0.14.12":{"name":"piral-ssr-utils","version":"0.14.12","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.12","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6276b9f81a84e4c691023fc8e990fadf185aedc5","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.12.tgz","fileCount":40,"integrity":"sha512-yEtsDvtPJhD/0whpLXjfgSGSiE79LUAEIMgridFW7SJWHUM3ljzDVGO4UbuCB6EdZcvgioaQygr28gHEezGIrg==","signatures":[{"sig":"MEQCIERUnz/QXw4pKlC0Bf0hGul0dr+iHEsG4xJ6yMeLgYhhAiA35pVc4eTLKRQokPnpO4Azd/Y/zN0GGhcQOzcEnVQ6LA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiE2WjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobOhAAm62+zr+fX4R0ZA8Dirp85A8IOc8Due8HONIvD/FWelNR60QF\r\npf2FC8DboNEuOGCCfy6/OIH84rT0PADgU3xDmT74joc4daVXMaZtx4Us4IQ9\r\nTKO6m3b6qHQ9MS4drcu3itQBFEm3TEyUrnLH8dTyJHdYgrzT10TQLm71q+4N\r\nAP0Dyn3Uw0a0A+w5cgunBBLESBPMgSiWkblhAX/FGg1yr+YoV5zpCggS4SSS\r\n5og+9vAgKqrlI4Wu3bF4hbEIpURTLbr+u1fCvLIscue4duxOG2ybng5ZaNFj\r\n4UMdPo+F3pUW4iJC7EcupQVuI0fdd8z89WUdDkBNH/bJJX7gFVP6JZ6Olg3u\r\nq4jTcP1N0bdGLaKRVJF5uHWuix9FeKumYW93CAfNIffaYHl6F797iQWvchNw\r\nTiir6qGSbCf/jVncm71W7Jq080lreo8qAxshBUpYu4IIHiabDfYxcZ+bd5K1\r\nv/e7ekYngzVGrVr8NCA6IPLHdQDpCyB6qFxrXUtLF9yw+gM9jt6CGteHlAH9\r\n2r3dCTSShG9mJHkowUWsknNQoBfiYlxoTDmc+jEikaHjaAel7f8+mxRNM78O\r\nFFX4rTUTig7rE7ap81xELmLFpOeacwR4YrzEub5NV+qxRJ3I97A+JEA34Lr0\r\n1kyDvSJvUE9dUu7m4toBq5KSeHw1tWTDB+w=\r\n=JXIV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"a75b9e31d077eeb9e998b26b32bf331faecfaf19","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.12"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.12_1645438371496_0.5435342635516833","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3711":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3711","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3711","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d0676587dbeda36694c999bf3f22e16e95f33e91","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3711.tgz","fileCount":40,"integrity":"sha512-Amd7d5XKJ9j6h1XTk5WfuM/7C0g2V7HZ3SvPpuVkQS0EksQ+B0pOHw+ST4ZFeKCk8LLsjOqJBr7mPRkjkeEu5w==","signatures":[{"sig":"MEUCICCq6wR0eQFI2tNNKvx8kHmqBO4VPSMOn8obbUNCjdTiAiEAibNzEoN1CJwB1SRRe4fead4O3j4X3wGj+GZ0VrU9T8A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFASsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqAVRAAmcEnVFaguIQZwE4QhD5G24L5/3Zn5GaHpowmjXHzzEHTfJ9b\r\nveWYnRyO3KwpPyaKAUy08plpFgV5g4gEysGrZg1+KHLqkmNv7awiHvvo36zM\r\nl5NvnPdzvMzjul35wQLdWR9wd/5uBG1ji7vZEjSBxIG6WbgjxlgcFEDZxCwn\r\n/2ilL1XlJkSQlD6Uh7mA1hAB8wvnbGnJeTh/wyA8Zo+8FQs4Mt6zJir4MXhg\r\nusa7qUpmLwa9BM9P35Bb6nY7EV1FXz95CoCNFlAB/NSQKP/R8Tj/2v359FDf\r\njmN4BmgkmUy5e7Cnp53YpSQzFPkOJ+MgqqBMBcCyD9M7Mdd3XWzK/lmZCyVH\r\nnAJXMFdUO41I7+EpddkthcDm7UBbb9hs8WhEPaTSTunhBUqbQA6+wllCGQtE\r\nlSI5m5oGc4HX3YGdD8IbB0XAuTVqumOszVd7KIlqMMKn6MTTIe8NLykNCMY3\r\nueoej90ff22hM6OrPvW4U42mKG5rK3HyfWuESVP/X/MC+S3Sq2H+BHBSzE5y\r\nLXentX1JgmE2yugsMt5Z/YtogNetEx19h4/KXqz0jejNG1aq/qhB1AoP3bb9\r\nOdh+F13va37sk8ypA5PIu/kMG80B73aiHz5+yJholO1wfUvrLEF1QDSqtw9V\r\n3Wi52rNg6C59Tc8BO3GQi+YMULu5gACb5dU=\r\n=7VMR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"2ef676e46e2fb402edeceeb3b4f1a1aa04c99970","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3711"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3711_1645479083894_0.02071408537402397","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3719":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3719","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3719","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"58487c9ae7d2ca3ef820c5288e0fd4d86534f69d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3719.tgz","fileCount":40,"integrity":"sha512-tzQrAVpHmG21+Pmm1HtAUTURrd5IP2RtH4t9F2wVstYOu7uabz8iQxGluTNoZbjIStJdvmo2IT2/b88dgzSOrQ==","signatures":[{"sig":"MEQCIDpuhK6vseK85ovdjwYFDENy9F+V2rVTg0tqQ5qo3ZZIAiAK7VbXMCmVnEn2A2ILt59mRg87rY1VtOjt83UJ8qvCYw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFf2DACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQORAAk58ZtSEJOQwvAm59RtSGzXPDU36yUC3/o6wUtgaoEKOuANb1\r\ngmTdM2kJrErxtvO/5ALouGlzjinK4xN1hbyrHQLGnacR1exvNJEAHCvAluFn\r\nWoW8JLnBgAg385Fob7KJXBLDFzCetnd0CecGUA7ImZg++0mvcxO3sWeWoykX\r\nA+XsnGJRlICS+IlOvhaNrb/Daqd/W7qH/z7QCHavsKNgo2lCfJemgL/NHVMY\r\nFTb/5KlZlgnJ+jJQy4U1B++t/mMscd1Bhve6JQEoCuH/LvqhdCP/+ASWGPm7\r\nDB5R1Vzns1texZUaSouFHdbQfvGsDB1nE3DfkUVwE7PLxtZAN5kVbpJr1HgK\r\nrWis2SetYdjfoaFOtPpFvjnV5IOB96H9NTuTysZHaMRSyIdHPfyBkBR114RS\r\nB0S2uFUwMb+F+M42KCOMIBkXm5iCBaIiC+DPfDLzYOCmw7Fy4DgPPDkNhcVR\r\nVdeszqrP6w5QNxCrutWgwVKNigCpHvnf2yBcEwrUR/QcDW9gFKgxeIEKj25K\r\nlHxzA2ytmD+YZvtPmvYLdnJit42phfo3U7M+XpixlvPDVz2d4Xdcy9q7r4C/\r\n7xRX1EunUUOvZjkhYwSdDMCDlndCFCOK21he1EP/eXnHO6nDmvoUdZkGO5OR\r\nid34H8iBySB7nUj4AwhEiR1CAib7rCK/w2o=\r\n=WIEg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"f40561b82bfc877ef475493779c4378ed67ebaa2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3719"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3719_1645608323817_0.4618821480060953","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3724":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3724","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3724","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"930a8be4806f5a5a981189d6b007e0c7b5fa1cf9","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3724.tgz","fileCount":40,"integrity":"sha512-5Y4N1lYLRrqfMbJUaH6QKJHo5Gc9UI/bqBhMaotnqUa4kk0Lzl2eVWDG1/OjvA1KS94mrJ5ZpPdEYyAgUEuxsA==","signatures":[{"sig":"MEUCIDg011H/Si9cGA7dFopKSIhDHA9bmnjRJ/6vGCL1DKaHAiEAtDH5vjJ7AL9rK7bkoWDgWrEwm+EomMqRlnqdR/ScpQc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFlpvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr7tw/6AsoJ8PIix9Cs688XvOVvws7HCspRwk5ZqU0Ojsts8MKpdl1c\r\nqtZkKaARso3/errgD0jVpYtka6Dn5J/CZCQM9CNWa1rBjRPmM6Iv1UJdkd6t\r\nY6ad77W/Ei3w5VjIxakw8H8AtkppKJDc0Fo+Z5ZRreBt1SGo9Ndn1ZE6BoIN\r\n2ljlkCTIMlIEwgGV7mPL6QBHO9RYLhBFu3jar4J6OhMLDxMvnC7VTAevSiyH\r\nGVRYkaLM3CEOL8i8eDaEFt8c5GETgKQqwjzy3Sz28sB1uJaC4rAMYnErueQp\r\nl8s38mpkRlyS2GzP0Don8/o+XM7KOuFQrfCLTiulC878nMrDI94OeKn0fbj0\r\n+XaCj05GK7HeuVRom35sf3cajj3Ub7b0d8Hcps0+l4SA4cYBmTwiN4R5LS2a\r\n4DHH3i88w3J5ol1k4krY7EZPwHPoa75qqBkUCWSDNZHskwoYhkLjNH4RZvKu\r\nHBSQ7pi/Hih5SadQGaE3Epgcr3V5y3Ig3/bk9gdi/bbFR0zv5cxHJKpotyg+\r\nGyUXXgN2n9gC6UFYvhz8M75f0W0G6uEEj649V0mHLRouMN9E61oL7AiLgCtq\r\n/xo/2H0GlDF+QpShINYA7TVoFCrr8tq1eiJEOP1z/bqQhjS0BpkuC7Rw6XZv\r\nFmngfeQliupqKvjQ0OE107blsokmX+NqA8c=\r\n=aLru\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"5e2da2254e6d06b72094cb172293b65fd83075ea","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3724"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3724_1645632110916_0.31716551453909503","host":"s3://npm-registry-packages"}},"0.14.13-beta.3733":{"name":"piral-ssr-utils","version":"0.14.13-beta.3733","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.13-beta.3733","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"aa2e2e2eb2146af79aae13691caa952772f8f499","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.13-beta.3733.tgz","fileCount":40,"integrity":"sha512-IKnVn2Ing2AqsqyCeC7jQA4qtniE1U+2nSFPQidnG6+lC45h1QXMdzcdO52GIgi8xmGFb1H8IFVzVNxcv7+TYQ==","signatures":[{"sig":"MEUCIHlO2iOxoXVU8r91Feany9Fw04060SFBdjjVYtBOxHFXAiEA/8Kfp6POESHKTDq9HNA316cDhpz23gnJgtnWFFXPu9Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGkkvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqFUQ/9EvTITzAba8RZCXFUAp58TKm6XThJCRSc3c4Fn2PJ8IOcTE5k\r\nt9iHZHDm27O+/fWntCUtxlm+O6DMvKxio3IqU3VcxN3j5uYMaPHn4lEV4Vpg\r\nBIaK2CbpVmG3E1W6hEJS8NGJ7P+niULjBeIxHTowbqjx4r2sf4k2J6p3bKLf\r\nU5pk7R/Crn2TKS3cNh8E7GBm0mMNk/+6p9uaPPcsN7lYg7BMIbdMaf7xdVf+\r\nUD3m5bgbXgyI2PGZKPcijEbco27cIeLXJ7V+C9sK8l8UsN+Y6GLT6hNO8jl8\r\nAaHf+lMknuRXvKQefQnKglcFFq3eLISbjKqesSSJo9PhUAkrvEYwOHV1AhYg\r\nIUOKDVKlzccRQy14QWI35s70PtIyOzd9mxkCmqds/kXzFCW7i/eRzsE/Ro3b\r\nykg2SddMQabzU15Rid+a5g7XkkaAy3cRciq1mW/lod77MDLeu9HYfLH9OV92\r\n2QysxyMFgXlu+N1sC50zLWWvMU7uarVXmWGJh45D7lLQX73DbsxAQG025BQ+\r\ntMhLzeefSk6XJL+FHV0hvXLHTP9LDa9aqqYBzumGOtWhiyeNahSx5uPYt88Y\r\nD7s5htF7fvk5N0+RvvI3uAm7PaWz7lVtWt1N3UELRtPnEc5g8OmxsDLOHq8q\r\nywJUg7J52ZadGJfpGqBT4kS+cMPm+wo1q5c=\r\n=NNRS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"a2d6fc488718841ca6c0069d84fda6c37768928f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.13-beta.3733"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.13-beta.3733_1645889839189_0.1887890348988699","host":"s3://npm-registry-packages"}},"0.14.13-beta.3734":{"name":"piral-ssr-utils","version":"0.14.13-beta.3734","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.13-beta.3734","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0cb037b6193ab523134b2ab972ff9c79c9009c05","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.13-beta.3734.tgz","fileCount":40,"integrity":"sha512-bmVY0CD5pGjgwzWtpfXG1B3LjtBNRBhHn5HB2B/lDqoIOzrQWqNw1IISrWC3KV1AX0xVRH8DoVH0s8R+quQnQg==","signatures":[{"sig":"MEYCIQC4P5AhgA1vgK+4QiujkEAabH+eiqGwEDj+Io93PNDe1AIhAOA/CtM07Th/RSGSLFAxFgbkqD54iB0k3oA5GU7E99+t","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGrNgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGGw//dV1PTQj3VCv3Q24EC9vQ1K4SMW/mrpsq4e/T0U/Fi3KytZEf\r\nVHzVugoFGqAkVbCnirGw4jPwGjArhIERfp63hNXAJUG/wWdCe8L8mUn8S7Yg\r\n5ONS1nUsZnYVdKVktLAyZZ8zzteIUzmdQQDwZWoRrevLLvBUfx60E9T6mJy3\r\ngSGjxU1Eu+GwUl89PD6jn/EE4gT5ZpJvUuthidvmhKHBEve3KnqQXuCSkEiU\r\ngur+bz2pXmsmBTTYXyn/C6dw6Gho7CBEhKDJ6b8xvGQUehc+taJzcX2Hlm5N\r\nyMqLCRiYDCfGoclh/bRYLtM+RiZq+nnoWRsgZUPCFc7QidxQN2ceZTGjq6HE\r\nfQF4vV1Zx9A73WeJXtHdmvRnb8Br1dFKxilhXWaygmEvuL5aE0oqYA7GRIjJ\r\nvmEjWyP2xJXfAg/1BFhH8s4jZ2ILi9hK436fcs6CDO1UWa72+p/Q8rJWoipM\r\n3NQYP1aY7ZIODpfan/ZsINxJCmVosfhUgDe0CrS16GUhy5nc4imSqy/rbkW8\r\neI2uP7GKuFBexqzct1AMX+Jg0wLRvqM+wplDKGEAb4atWPbl444/OQuxWQeV\r\nnnkhdRujKq9/EuWohlpAZEidKUlI5Cjxz97N9C4r1I6uLnf80OlF36k4weKR\r\nKXvFsimV5SVtbqAHRF6FHh3Ccimyf9haKEQ=\r\n=PFyG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"4dd8b55919791bcda74969e3de6c0ad04ac26e14","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.13-beta.3734"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.13-beta.3734_1645917024059_0.07206640018755661","host":"s3://npm-registry-packages"}},"0.14.13":{"name":"piral-ssr-utils","version":"0.14.13","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.13","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"bc3b6dc2d122eccee8f98c93514583088587ec19","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.13.tgz","fileCount":40,"integrity":"sha512-Yv6TZ03jX2sXCGIp47Paap4dziOOtYb05I7fJT7OT1ScdDWzH4bJ2JMFz6ZIfykCxmvo0ycw45z0lhHpryGotg==","signatures":[{"sig":"MEQCIFML5YrcMY1Nr4OUtwlnCRBbcynU3g2xRtluNPOpdZfZAiByotNTSa8RIRVSUEHpyf2H3syM7UFeXdfu7WqY2KvL+A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiG0+IACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmouBQ/+JJYDMNOM3vxxvmlnYJk+ywbM3dEAb1AhNuhE7v0+JWi464Rz\r\nBQG5Y9b0KL9PewYZWli6SdVFcWvN31SroTcfMwgS7KjdWTcek7ex9HOClfne\r\nkfGbKnjxy8Rg2tml8I2qaSLcj6zpm5uMu/6ZoleKdbZGYJ4Fijf8gFUkI5oa\r\ns/PBjfW/ygbcR2SE9teOKiBiqH9rizEUP+pRhhbH3kR56hy34oBeb2iRQYro\r\nz1JfDNXQ9cphVGhDf0NdrTrmDiOxLtCmGLX8mqcNzDrIva69flQ25J4a+Uqf\r\np5MG3lOswQ456ZGb39xaQNTwzENPxOpGBiFLNuBbbcQD+VV3Fm2W/cnJPtaB\r\nRPCFrPWyfSG3ARlrrD2fGIcX7mcj0xzhiFnQ6pkQVoExPg3QtTij5r01suJq\r\nKd31wfDgrrf/qyC9n9YCb2YjrFZEZhHZOIhaBGQaWLwtKO2XO0r/EYiV17Nm\r\nw7pzyVGuuIaW1cyo4KJwvcLJ9mNuNxZ3tr7Jlp4uWO2PVpow6ANMeqxOWtjb\r\nzJwChVKcQFiRAHXslmQYBcAXjTY7wfWskbt0d76Hc4n8CIGcdlCQgDWEO14I\r\nONezS5HxchOgqEi9ht0TJ1vH7tItEqKY34LRtt8pYb+fes1E7/8DL6zSGPyK\r\nVaBY48G7hNeuEMK0/Jx9SJI4Qi28qfc/CUc=\r\n=oCum\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"6.14.15","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.13"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.13_1645957000440_0.983949471209113","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3740":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3740","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3740","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8f86402191db4ed93b6605992bb40042e82c4030","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3740.tgz","fileCount":40,"integrity":"sha512-XR1OAzR+xo2IB3RqeO4toSDAGkV0triipDjndNXAZOgTe8xw6Y1dOpvOOmbgoaFLEii7RzLxiU+nx0BHDipqfA==","signatures":[{"sig":"MEQCIAUPtP17TgpJ6imF5Uu/LREs/UKCTZqsd4cnYKGfiwcgAiAS4WVRooH/GGy/nfVzfBDIc/Ur+klqtc1bZnT4LoyRcA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiG2vfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7qA/+JsNd0b982nF573tZ3CMu2WBuGGCiff0DXuynWWxXM5peIlZg\r\nzqBoKURCgYNAQ3wu4C4qdVRW88PAJ2N4cj2M2FqxkXwcTD21nJD3LHJED1JC\r\nvWorG/FOEC5aeT9V0QGdWtah/xdzV2AEwVeEpCuIiuPcaHGhUNWd63VZdiah\r\nqNFpgdgwquY2BVgrLaxiGpx7xyo7kaLzawitHPc56xY/KrIQT4Eh8okwIYAl\r\nFnGr4CWghicmQoZddDIbWwEl9jwO8TOZz9llORZiKPLYpGt3LXhGjyzIuxUQ\r\nQAxRoeZv33NnJPCy+31oYxeigscUe+Vv80zaQJKDgR0EOnlbdHZqKq5uGCTP\r\n1luoGWDm+xbctpemBhwNL/whnE3BbyQeBK9ban+/glF7HciarY11OW5YmyVJ\r\ni1hF4BDbSVr1GHokYvyxpuj1H8XsFqmlTzmJsC3k2GRzXq2og3SRq12ezsxP\r\nLlAk3nboqCFkvlNKLv77kdDGZIy65D6451S2LWoA7Yfe1gpntxdtE54ALa/k\r\n78mR64laX9GUYq7x1sd0/BntZZaR1AtW4XAHQ230Yep9jCVhV7F4pfbLejJn\r\n8C4gBs1POEkpFQXlztt0ONS1Ecg+2OzVsm5Z8tS2i995oguhPecTvThn9zpO\r\nk3Y3n+zCDf9ljZqJaQLNyboQfK32PZtWK8M=\r\n=C3GH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e70f3043f4e6750dfab89dd5fd7c9da874cb2883","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3740"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3740_1645964255764_0.837442263309591","host":"s3://npm-registry-packages"}},"0.14.14-beta.3748":{"name":"piral-ssr-utils","version":"0.14.14-beta.3748","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.14-beta.3748","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e95e5ce2aae778f9d3ae04753feedfab55d9ab2f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.14-beta.3748.tgz","fileCount":40,"integrity":"sha512-1CazyvyzHKuqYN0602KWbKAm1ICqKh3uWN1BkcoylgUKYN50kQVzUYPb2MGp0EUvBqWpVtLSwo+/6Mk+36N/PA==","signatures":[{"sig":"MEQCIQDekF03yHXkwAIC5rqcjdTt9892sTr315Wy25mKomQz3wIfHf63S4o958FkT9InUal71jW9TWvZ9YUuho2sAqhG+w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiHftLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoh8Q//UKNBrSLHUSnihlVfitNJjFSBES/iBjzAgdfphpXGFtJJbfsv\r\ndyIYC6P4sRD7VDKhW5ZzD/hB6CQQmWramLOeb6NG/vLJgwVNs8xuMOE8SiY4\r\nGI5stTTjO25o3XKIuoUo4x2BCUOeQvUGnHIPgoSsHMDgdyZGzxQs/04PBEr9\r\nPCQiIpUE/S7iouTiGymvgy1eYUeE/uIjWU2UsqoWqETEIxgUggrE61CsZDYB\r\nJrOCQPiPhs+baTUjDzxh4krNADrU62gDTXLTKMWcID4p3kKyO4xNb5f5VQrE\r\n4I0hicRpnKUL+iIs3gl5jiDDXGaySOKiIzRGFJEYrglylKb41sJ3csEiOOJI\r\ncxalXPouW7ZoaZ1Ek6kY2a60FO6S0W3pN88g4/UKbPAkS6FS59nR45oyddqa\r\nCcXgNVHI9bzXDOsaMelxTSfaeIzklRd2vIHqXff22MgwIjiqVFxrA+F7KCGH\r\nn0TnMLCDQQY4BFi0wDuXkF6d+cagSgG3Nv7bf9oaIVeiN1Hfx31JICQeseTZ\r\naKyyYeKXQ5HsUH9o76bl2QEz9eSTvWEuG8/Qbj9i+5X5z6j4kdL6YyQqu/ga\r\nUnuhaSOSNq2WtKRIROt3wPc4mC7L19ldnk5LL/Bu7R+Sm4jbPe1l2WwXHRtt\r\ns16xQ580hTIiLaQ16vLlcG8sGkYNj5l03VU=\r\n=06+D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"d39cff6f08051897f87633123c601f723a83fd18","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.14-beta.3748"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.14-beta.3748_1646132042945_0.23434642561770658","host":"s3://npm-registry-packages"}},"0.14.14-beta.3753":{"name":"piral-ssr-utils","version":"0.14.14-beta.3753","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.14-beta.3753","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b2479915ac3632119c180636adc0ed5ea0cff46f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.14-beta.3753.tgz","fileCount":40,"integrity":"sha512-m3fDzCP3lYexjKovQjGtGsbP/lihYx2A6LyLMHKUdaQ00f/oAlB391V/z1+WkkUEhk2dzJvllZHtHW5WOTZqYg==","signatures":[{"sig":"MEQCIEmKJcYdKtYLp1QD+hUUbsoG8KVfhP/8aWDLwosJg8ChAiASqNcSJxfUJF5khGo4J/RM0QMaMWyYYrcO1YeuTxgguA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiHiZjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYGA//fFejvA4c321CjpOobTkRmVx9J9kG1gGW0T2yI8inbyEnM9my\r\nmSpU2/YOtaegHaSmJUPYPhGRGAXOaKi/1vjHBPhfYZfJ8ZDewTVfO6Mf0Kmh\r\nDa1QLHFwmQLfVybyiLhSR5dKB8dfY8UNMxkKOT7EkKF1DLhwEaZ4ER89Ev/x\r\nI+gA1BoXFs3NYPzo61FdBge+TaS039tzCG8cQy6t3QdMakMn4QoCcsgzLK89\r\n0FdYU9MhtAohkJYZo+1Msli9XjPZ0daEvm7JucZ90Q8/mz5k1/tWjSQYWXm2\r\na3YMN02wNBWJliIUhfqrZFQlkQz7AYZhu5PCqaOp/8ZMDhj2XK12kLPCILmb\r\n6f/FL9HwaoXLMDp8x8FebURegTcpL6x8JAoHQvBFJAMS6w7k659RSmeL3z9h\r\nYHdeqb3EokZgIBx8clHySQJwMXRWuastMX/P9vSmsaqgWpoTj9uQplcnb+ta\r\nMrRB7KK1Lz8FMRhK5vFUn+DqwAEXtjSXQ6KRG1i2wFA+sT/d0nADJazv/PPf\r\ngEXj8jV9OcSYiTiiM0nZ92lu80TZTE+6oUrDH2YZV92Dok6oTCAlW6duE4Ls\r\nJ08wnvmxSKe/FAxaLtXXlaH+RzE9rlB/9tl/iuPrnY6R/JBC/4la8/IETNZJ\r\n+dLdp6obhoWV+eKH5i+Bz+u2RC9vM1RoGKk=\r\n=2xk4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"34acaee35dc0edc17e08871ceca641fc5812c504","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.14-beta.3753"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.14-beta.3753_1646143074931_0.42464594811146616","host":"s3://npm-registry-packages"}},"0.14.14-beta.3765":{"name":"piral-ssr-utils","version":"0.14.14-beta.3765","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.14-beta.3765","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b1586665f0da3433bed7bde51a79c1170a6a851e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.14-beta.3765.tgz","fileCount":40,"integrity":"sha512-lmFiMTihxnbILjMkqQzHKV/Nhvy0OZwnhcfnTNviFUZpDVZ3t+3uViDZve1N7w1KkyI2NsM/NwsbqDH1rH7PNQ==","signatures":[{"sig":"MEUCICdR3Yt4ye/K0i4wY0qoW8WfQKpauAUIBd3bJMPfjNCOAiEA72MP7ejx7/JQbRx5vioIj0tOtdikVzAp+QbXMPG8ESg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiH7BAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrH+w/9GCBDy+JKwaUfMKESXWSdNIhAwYeYwG41mFFY2Kagks22/oEf\r\n6skZh+890MlNNLD238Fr/TLQo+/Ev2mAMkFxfqO8HWFR5SX36SMJBSojHw6s\r\np3eV+Ah9oecE64YhGKRzQZoEUTOuFwajf3t97UzoQSBSp8MeH/G5NbrvZiHI\r\nkA2FyLJjgwhdtrAmTkOf7SXolTXF7lRx/F7ZVp4L7mFr3Sjpjvm4dlV3yWh/\r\nsODvDnq8NKtWjn9qVo0sU2XRtmWe8sPOg7V9z4J6aJMrkFrtF2BJM2Otuuga\r\nYlNQ98AAVLhpB9ooLXvyO7Vub36C9SQDvbMGWj3tFB7iyl9KDu72XEwvL8DD\r\nYzXQg3TOM3/hMQJ3a3XlmjHYo81nO7TbP3QM+r5vQxHGcBotRO1ef3aP9NL/\r\nTws+/my6po6Kio8nyqWiPdsGfUr8Jf31fu6QX3B+0Gy5f1tjW5WThSjnLpvF\r\nzi+Yqv3x3qMIBwt8AK1e1e152BRFLNyL/ALkc9j6bUUvIdqvbRHXp+X+ofG3\r\njjSGxUX6mlcaF0VsL7qGfYjYZdvjfbZIvm6BTpbvrG1K63y5yUDJmHT8hRbr\r\nqf69Ty5T2P9JdfTWsuYcuz5ISbGiblbfnHzhSbFMQOZWlkpS5RRGKvJO3tR5\r\nlmngO11eKDprOjjul2Sxl6i17iubrK7enpo=\r\n=Q7Qb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"f933f63d8d746f6f592e6d62a4f74921d8fbcc01","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.14-beta.3765"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.14-beta.3765_1646243904057_0.8224579426689456","host":"s3://npm-registry-packages"}},"0.14.14-beta.3767":{"name":"piral-ssr-utils","version":"0.14.14-beta.3767","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.14-beta.3767","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4e170780b4d5489c7945566d422b0b2762905833","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.14-beta.3767.tgz","fileCount":40,"integrity":"sha512-bpY58PTw0JJ7cX9agtfft47itMrU3iqOlf2DohDH+iYADSuNrsRmUGZEoMRjyZ62W7NcGY6ot0c4PRBy2xV8tg==","signatures":[{"sig":"MEUCIHmu6icH7mBoV3ewrRPNoLWpHkbLD8vIgRPOXmcP0V4xAiEA+YNFh88Lj8IPkV0+/CdbDGBGQ89SS3P3j+f8Af/FvAY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiH93OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqOARAAmyRMLqJe2W2c5J4IRETqhUjPXjuljDsDeNnW7ZrCmSaXom4S\r\nTBvU2cYxCZuzCX47m9E6RTe0rPzyWYp3gx4Cn8JGvyY+L6ihy5hzVh5MXYLM\r\nrDTkQt5KtGJnfYW7Oy+srz//hVcYzI8tO68YYXBA6U86LmC6uaPXSmPfDvaY\r\nGNWnCD6BFt/rv5zs5JVFPEbcVkwmXteQD6rmY1ckOCR4xr/zwSZoVZ0sQYMD\r\nWZD+/7BQODRKm+gnN2PbdsdVoGI3OUoMjJEhQM5RyyWBPcFJ8bSlDOQYyScd\r\nYNWB98qcHQeQoOqzz6C2ZcLQpVMd/cVbh7DdlU1wbXnojYLP8mEnIYibsthb\r\nPUy+afWhAEOea1Ycwoxb5ahrw7ViiU5xU1dgLIje7cZNg+bpNy+asZ4Ck1X4\r\n5/nBO+5xtIFsOXpZoRiBn30UaXnyXXGD1CkC4roHrnatRhDUeUTOcaqrgGhO\r\nTBtWqcw3eIGXlKHZMV1spsA+9erMob6+IaOLr/G90BBGoiBGuJK1tEF9GYxC\r\nc6wY4wwYLCrLfYyeQ8mB+PpX1Z4x8MvzOZMwm8xGXwRYqHynM6ZYmeqf0xY+\r\nRISrLreKL+U7ylRcAO/BlCQ4aDNavwj/Ny7Jno7D2gtGLoNL+tV/MmI0dldP\r\nwdhWsxKuZJJ9oLQiYNz83WqTx8SpJX+KxRg=\r\n=m/bc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"dc6b4718c8d6c7b17bf3262cbdbf97bf0a4b779e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.14-beta.3767"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.14-beta.3767_1646255566579_0.15181842931097744","host":"s3://npm-registry-packages"}},"0.14.14":{"name":"piral-ssr-utils","version":"0.14.14","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.14","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4455b64f66f530f8c9ae8c222023557fcc243639","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.14.tgz","fileCount":40,"integrity":"sha512-rH+mijeeovva4B2++33otnaOk5ho1yKXK+d5zTumisuqx0S2HXSlr6SSkOY9UWfiOTp0kmUvSXieo9CBazqdWw==","signatures":[{"sig":"MEUCIGB981cl5X2GV/6YP6Rp4RurJrjEOO51bVw6Ro82P/vFAiEA24lSDUlAS34JFHv9WUO5FyWyEbc1DjWJDYq0N241Stk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIBluACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHqw/5AKve7RKwq+EBSbT2DWb8Zea5wEc3A3sQquuAMrekTlNjpqBX\r\nYHbhLSuqbbljZpiElFPSHz6IfvhihwVlq+On/4a00Rlt31MFkGBKTOpMDzcc\r\nAEk6GuvGuU2E8kjPnPVfryIKKl2G9cqKZlONvOXE9ID511jXJhJ7VwjBNiEU\r\nAXEAnvsrZWKVvhAekQgiW3fkRfjZUB/YkibTA9dJCgJaAEA90ag2TgcCC5/b\r\nslqDIgivlrIWmkWCdedC9ouwMHmNFk/l4TIvENuHkDahlyeyvCF2IrKUOeJa\r\n/7aetYSV9G5r8yWBpRKpyPGI5P5ddN1A9vzurVHW+ZwN9JUbjvVtT5NVjdzP\r\nKQ1GH6hmyWZxsy2z0Va1VzjK37tSRALHCTR3ZSngry9UMgc8r3KzC3lAh5fx\r\nwTuhWCLLNDCdYrJe8KWPUxCa4CdvmGsWk/uAg7R49L1lUoneFC02U03JvvT3\r\nGdgYPIkUSAOQb/ElfsY+f6KuOrtJkiwXlN82rdtQeVQuHKOtnFtGYTv48Kv1\r\nX6wW3EUoSM/7IflBMQHBvvmTPIbXkkuIuFJJDGNFKLTNhSffBaauiq30EOpU\r\n53+xmutT9zPdQCzLam8pWZ458WgHrZQosCKFmOEY94FR74kzng6rlQGACumS\r\nKpDsLkzKQuSvDklRE8Od9Ea9+MUt9Bf2zpI=\r\n=NRc+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"0562c909cc402eeeff4907c9db564f5265a12973","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.14"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.14_1646270829945_0.9613780378569552","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3784":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3784","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3784","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"eaa443b8a70a0fb39c1f8e579b3108cc0471a033","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3784.tgz","fileCount":40,"integrity":"sha512-tia/5kWVNDKX++DZUCaiIduEnztIh2eoVukfHxWppZxmVP4iQPmHfcOGdPu/HLVVuXYKFsjGfieEVhueUC4i9g==","signatures":[{"sig":"MEUCIAUFHMlanS2wnAbPiQrd+3MOnwVRvplECvvGsNmD2+C+AiEA0RQwXd8Qt1PIlnygOAyWzz8CJVp1p8lkpAAs/S3jsmY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIT1XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpL3A//WPRPbojfFoYWQZ5id2PMc5m1fnYjJsjxHrXXyri6V1/7Az4Y\r\n1CJ3vP507HDjg3pQvaZLC3EdZT69L+Am++7zi02ri85GVQ1JV2Qby1c1binF\r\n409uYlvcUaUvlKTqzOCnRWp0TLWwCo+aUiMcjB68X70+28zFsaTcMzBVMrnp\r\nRvI9aCB0ODNOMUtpnUMtqaw3OpKGrupmqH2dwsmrL0GcMM8avMCfo4f2y21y\r\nIUZzSQn6jxmcaKVm4vzcZFNkCY89G9WBg6QtZrCuAvStMAVatYyTwqDIccJS\r\nHCjpuEqZKpjBk21WCW7sRgsBA/2Sky4kxzjMvDa3H2slCsFkwOtD2mu0zVlp\r\nbvIWiUr3i7YTzY2/vWRyWEecjCQMl/y+UB26uDVvDkMa4e8+PySg3yrgDBrc\r\nRpx9zpPrj1g9I7ZRjKjYXeWNpWnPJYuW7T37RALxG+dP9OHLPsKn0yQZewEn\r\nIr842sIORkxmYvmLkS/8HpRYQoMD+5Z+ngawavAtelbCugxdRVrq7if9v6NM\r\nVHW21ZeLtuFdK3gd3mui6nbkVQtEwleD6+w9Yxj8U63qjCdrqvjjIl3StRma\r\nPmPAJzR1I3tLh1k6xy0fwJsIzfURK46utCTm7vOMdgv847cqxW0qCqpd8jqP\r\nxqxrQaE2S0ozcuMQp+rdQFm51R4DDI2AphM=\r\n=pk68\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e2dc030bd7e656d349caf5353740e45329e471f1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3784"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3784_1646345559534_0.45192538099976365","host":"s3://npm-registry-packages"}},"0.14.15-beta.3790":{"name":"piral-ssr-utils","version":"0.14.15-beta.3790","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.15-beta.3790","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"28da6f6660a0904a15baa2a382591a00768da682","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.15-beta.3790.tgz","fileCount":40,"integrity":"sha512-Oi4yMUdcwGJHqK8H2SdCyx84uZ8JF2yR3AOJl7jYxuDziGMn9ELm2HjBLqPLiO2uWjv7RoWVzvfqIPe63+aYtQ==","signatures":[{"sig":"MEUCIQD+5WOgHUQ2nx3Z1P9LHX8YoNnjqhtmfLmlZXRP0SprdgIgDjP9hDuPrH3bs4xCH1yO58ziyM4HYnIrYNDTkgHEleo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIhlcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6DxAAjVaCy/NaaOp68Zf5Yclr4dNW5EUlgXhDf1kQmovkpkgJWcH/\r\nOO20lWT2BTUq++BxN0HVw2QtSYWnV3jZMB/zn078TeKBHdP46uxWwvTANNgj\r\ncHZga7Joqe2hGt27Uhqe4k4HkOoT0DvA3NFlXJVc5tTqZPNjaCZZ+0OhCLXw\r\nXcprFcXEPJVIbOb35tS8OQzJ0dPhBQq9ukMdQo5m+6pfCRBPX33wqLcK7m0M\r\nBBSWQu+P9YzIPustEYrqiradeb+FltFj3yFPGPcYwcMNnHYKVOD+Dk6gZCty\r\nEWniq0K/VfH9oMg5e0wt5Wn+2/HjI+mWkwUIpRxLkckEVIeAFHtyct7hVaDf\r\nx/P25EOLcl3nxmB2zC8R0tzK7r/00cxP+SF1xMiBB3JnCQf0uJSLryNpbvd1\r\nvS4rYEJyzMRUTaJNdvGGREa+9dbqn89SuF2FHERPT0xQE54pjEXVMqCvvaCc\r\nwsBSlcOKzZAk3oidtRYmQWEhAHeYUwlEYY0RH+1Zh+LIQBC3hEo+jAM3UG1y\r\nEHHEakQ0VT4cgOGP4Sxd6YKishtnX3fPcd6xzmTvqJ6jO81DTRIpR0HooWeE\r\n2b83NrymxKyWu/7tekorLMCE8KyKb14g7e5feHyH/3kgZUPiZpKQgpg+PvnE\r\nR0Mrc4CDRqXH+coT1LKHta1VGd5XY0GGDSE=\r\n=f4fY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"ba8540869244912e82ee8f9d2ce06ee9c5152f80","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.15-beta.3790"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.15-beta.3790_1646401884225_0.67357205089706","host":"s3://npm-registry-packages"}},"0.14.15-beta.3791":{"name":"piral-ssr-utils","version":"0.14.15-beta.3791","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.15-beta.3791","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7e4d2a108ecb01a9878339538dd7feccfb1c186f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.15-beta.3791.tgz","fileCount":40,"integrity":"sha512-RI9AwqJE2ZaW2zHGqOG+pwbc4HV58EkcrDkDu7IaD/aZqI1+j0KbTnyIEVF6LmdnyO60S/o+0Wl/kbKkAu+AqA==","signatures":[{"sig":"MEQCIAzwa8ojF/gzUUWrxSec/3gKMbqcoC8UhKqs0qc87F9RAiAz9TmPF3IfarMUDcKqHES+96jgtVYkgxPxhasYRH3m9g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIjkLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoApg/9EuM6wXFD1cHta+HZLmMB/Bmcgc1t9N9NqAW40tB16xwK/CUj\r\nR58po+rvZ+RgbYta+mwhs9Qn5rI4HLnZJrM0zYxSB3sAm40a3rbThTpWukQA\r\n1bH06RzJQ0rqA2rGFfcGJ5aA4bcih4zZSmyOPUWrBdRMh0lP5FkszsNZqWYC\r\nF+n67MZi7dk1WecBT/IRNNXvlakJj132RLrUniDxJyqVXu/hebrq+8dA9A47\r\nhvinJ9Ok/PkmdCwBq2hR0r3E/HvHbYSrnlBTMy3lSFIIRo/hB7UVpfJAcUiO\r\nC5DAuAW2uCNh9afrVgDLhZO7tt+0crmqufE9Be6ZUEfleb7MAEg1RQQ1kdts\r\nyaK2qvSRAdvh8jBwOxUOdSMAskbp25XFFZRabEXUo8Af/L3Qp3b6i4ARUG7X\r\nBfxktW6LJvi/QsCPD2Zv1MQwKUKc5oNRb9z7t46XH+P7P12Xhl4P2/DroghO\r\nz0orsw5JtNPssY0joHyJCrRG2WsVuWDH7Rt/dkYAK0ZjVFJWW29d2zMH1NW1\r\n8TBzzuwpC++A0GAblW68sF5Tm3KlxquxXLeCF/ALXJF5sr0UmpW3eAVmL+G9\r\n0zTb5Kdi2C3EJ2tnuBuxINuzM2dffxqqP203++Yi5tCrWdbujylyWhLB0rTs\r\nOnP+e1AnFuBf4mb/k/fftaOW1PHPMRrsSDU=\r\n=bfb9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"b536bf76ceb574ce0ac8eee5117d73e97d7d8179","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.15-beta.3791"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.15-beta.3791_1646409994773_0.5188747549392918","host":"s3://npm-registry-packages"}},"0.14.15-beta.3795":{"name":"piral-ssr-utils","version":"0.14.15-beta.3795","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.15-beta.3795","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"409917aaa5d1c338a77757bd61e5813dfc3773e4","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.15-beta.3795.tgz","fileCount":40,"integrity":"sha512-FyNJIxbvLo1YKLHfSnK9aQMUmgk8xr6O+Fid19xwJXmURuvC5J8xNuXu0NjnGyFvyuhIiV1n446IlxveYd+Y5Q==","signatures":[{"sig":"MEUCIA8DgVQpwnQDuEx08NXOnO/5Z6huntatbM92eTBShDziAiEA+p5eAZLdlhLEqMnXTUB/PKaRD+JJP2USuAo6C+8NG9I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIlebACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMtA/7BcG1H4iMWnC4uH6xAL13w9Ql61pxO7PaFv7bSWlXCQrhIYSc\r\nRuQw/SZN1FdnVt8TrGYQbz5fXGCC0hZzKpcFG55KfVDDBCeFlGoOKOmC9hlR\r\nq8lmbqXIdErzpaBvbOPJzVQOcvO1FuDCgN7mBqIGMynz3lrghkEYurzfMrz1\r\nj5i90u1jVThTY1FJ5WGZG4ocgLed68osJq7AajB30sF/PJw/4YOx+o+HgAHx\r\nMpejc5FD/QybobcefHOyMJ4uRbyR6ndo18E392P/SWBjbW2h0jzTAcv+5zng\r\n48ywlYSkRvTHfy739TMUZG8ex1kw88Ki50QFyDqPUTCAdwKv3pO3gE6LNX1b\r\nfC8y9b+o6Oh7F9LrPx41xfMg8OlsWdnPCU8cQrz4pa676uFVWGmlzbAYZ0Qk\r\nUKJ69w01XYoUlpPLiNiwt+tqTRtcMFIUnB4VOoTV820VzdXDDaeeOQRWIfCr\r\nfQ8rWlbUwzKlsRkLP9+Or5fgb8l3CF0U3f6NSshf46D8jERY2tlK694eNB4u\r\n0zNfYwpUdP8Tn9bp823xT5UNVlAL8UATHmZ/tz2jXSewxIIIqEucRC23XcrC\r\nEytCkYG01lvMXFy1iSVF2Kg4MV+sWvdd6dp2Rim0Hq+O7BBdudgHRib2lSrZ\r\nYRpsVlhXuQoofdgw68gzO2lPaOWgKJVNw8k=\r\n=ULKB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"aa87fe6e8ff473c009c7ad31bfe7e810196521ce","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.15-beta.3795"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.15-beta.3795_1646417819521_0.25017857813789846","host":"s3://npm-registry-packages"}},"0.14.15":{"name":"piral-ssr-utils","version":"0.14.15","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.15","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3111dc98c24d3cd22bc488d23fc27625b405e4d5","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.15.tgz","fileCount":40,"integrity":"sha512-zEBsdZRyYuGDcXm9nn1N4xRMQnkrx/dGhugggb+vEnG5hZq+C0Hqz2AWwPlnxZGEGLKl2snE254Cr61lpWcXWQ==","signatures":[{"sig":"MEQCIDr4PccAXv6yQby2+c+43NZFqhzD2DUzMzP+b2tS69GtAiATmqmYm93fIwy+EGPktSv5t5yvZRBMtG4AGogkH+UGiA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIyizACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQRA/+PClj7tIDSWpKq8B1JbIUlRONCzMwCgRmDkcpJGpn1m0sl9GT\r\nP8JmVAJkPgwEgodais8pemLhgeGzWnMQ2tFFVQFHd8aUQGMAdpONu3bWbely\r\n+ffM0assqusyt43VLhNx/tjrseRTXN5+0TCfNWMCO1EHPLGdvTYSqtyjQSvC\r\nCqvDBp0sui7jivjhhWUElsDP5592tzKW0JnTxWDJ7NWOwcTAM1+lNFqjX9AF\r\nLWmTMb6GqRAn/SceU5q1A8lQJrDhmm0WIT5pCp4LAzZ/rjQTYkTzwUG9oPpm\r\nsyybF8csTXgvmSSZz6Yt1N237DYLxZd07Gdd2RtM6LX3K3nsIPYWgsWB7sce\r\n0g49PV+GyWUKH1HPF8p6m+wecn7Cl5Ci7la05ex5mL0Sf2rD7ON0jf+os+XP\r\nS+WKuUxDqlIPnarCsL4P/vmBy4V2hTFxOHcVBwRRxjVC5pkB+5Cs6c/vHzhl\r\nzlwybcuw2Fg5IlP3jlFK5D72vJz+VNi0mkKuIHa2v+/5cPZf5dhP4lHzb7iw\r\n5Iolh7LOOniZo7q7pBQMCJwQbwjsqf1nlpVEIA+QfXpv4kSZVHEDvwAR/c6q\r\nDnVWPMTRd7U5mfv7A5pUM+zuzroYpT+1S2P5VYidrus25/14PqxX3M0Bio4A\r\n0mVGSIFT5w8yxEBViAboRazwY1Rjsp1r9II=\r\n=vq3i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"8a2448cfaa82079200bca2a03ca42c0bf56c17b4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.15"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.15_1646471347044_0.028101188102127805","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3804":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3804","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3804","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cb3e59567e6480fa60423d78a0c5eee38ab2a0ee","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3804.tgz","fileCount":40,"integrity":"sha512-7DrLzeOAkesMZYPwVI6+k/QYRmu0268B+Uath7ZUvkn7p1i0A4HRDmNdpm/l65IAdQoaNusKRQEvRcKUOtIFaw==","signatures":[{"sig":"MEUCIAa4Dzovdk+uiZYBK23FUY06UenWRsgPfx0ICRihkc0kAiEA1TFNh+ty/+rYYZ9vAudlXYS/rax50ThdRE2lmYWB4Z0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiI21/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpsGg//RMOv5eJb93dfRvj7wXRGF1C5+QbIRo/n0PH5HaJWROlpbs79\r\nLkeKkBBccSMTeB0P+2ia4QNpMGJ4d9hm0qujpAlOFHqyIHz0fJQz5ycg2ce5\r\n2Nr3gROhFJcP3eUzsic/2d/l3FKV05ZvUbBDkYop5yPGcD6PMG695WLGwfh5\r\nf7MIg20NOlQufwpxxA8FkXftEfg/JzdYj/4jLv+4N3+6Mf7miDmH2O9AvR7z\r\nGwJsDGFW/Q7TXmqZy72w4L57RuYw8UsqItTb3+Q++RxgTCDrBxV1a1tI78oB\r\nJQ+Ph5maTJ+U0AF7e8xomJJ4/YnNKHsTClJBz1zLtVuYgfkLheRvVWH617px\r\n4MMVW+VWacH2bvc//N6GCx4+r7WJIsWjEDP6txizvHz/cKUNYQegvvUtj8lN\r\nl/ttkNrkrvbLDHAt159+CoWW2JMVDEDvocWFha84s1b4HKPGvtLveAvOjrhK\r\nlxymub2Yulj2olsvi6Fh3z8bbiGJraqCyP3nWr9ltajrBScoE83+swHsvrgU\r\n4XQU7qTHcBN2BbZ0iEbKIksovYnzd4KNtYepALdM+sl1laC67COdeNM7hufh\r\nbuWmDMSkAxrsrFCVWrBfdXi3DmpOxlbdC6YNb3bTGVYJdCh66wEatVI4xPnC\r\nKoQxT08kVA5J5hSWSAEqtC4rnL65Aka7o4o=\r\n=hVMQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"a053a21f6195fe292edd35301ea19d5602129c79","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3804"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3804_1646488959654_0.016509867256463417","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3809":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3809","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3809","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f09790173816a22ecd167515be38b0f8413dcf9b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3809.tgz","fileCount":40,"integrity":"sha512-TeauRcu25Qxk63fVZVthW+ZJ4KPijqWvImL3i6OjQiiI7yiNQaEsAR0P+C+9z9TkvBd5CKuabmOCaqTzYqZSEw==","signatures":[{"sig":"MEUCIA6lum/jcmx5HF1fLggLt1cHXz4Umo9u1BJnQXx7fCYfAiEAyTm2dyMKOeyZYLkuYGSIJTiHr52xBXY8VTbQSk3pZPQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJIUpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLrw//eFOTPgyaizK+f/oaUPtENN4cy7wM8yiAU8ODkcHByQImSfJ3\r\nEoYE87+aeUuyM6Ydk9QQgdtQlgakSEeeNza73J2LeQi5QdIj3S/spj19oJhC\r\njUqWyX68T/zvJOzjkCm4ormEUCYyxiDKDIXjcDS512JBF6cE83LcD3DVEJZf\r\ncV3+pTxFy+ZdnherU1/i10ZdWbE6p5vmQaJfHU5tDrROYQgg2MDjMJe36030\r\nFcJX/1ItBvvQNpvM5dlR3jwmZRqXBGUB9ZTGUJXPE82AsUAMUiHlWsgvjbyY\r\nhGJTQVMVQLs4MI+9NDtk0NqzJ+TkxVcj9PtTzNQwTbLJ3570wCga7NSwo2tm\r\nIX+sV/N1sFBKbqgGk8r0MN3SnEY8k3nqjNiAtg+Pu9UK1IZlPb+vFFtnQnxQ\r\nPTxfSJ3v8wv/BDvQKL1qjr0RE8ugQpR8jtEBbfomw8HgUnTU9DZrzqdZG3Q0\r\nKpBmrmWBYGufPVHzKLTaGSDXKIUWNWXeolRRnaZstIxJWn4E4wynXrqzp/uE\r\ndiNQPFOEQgFZrm74M4CwSivES+YQl1hXJ6Kbex602h7hMaOGjX7kr8euHrd1\r\nfYeixS/EuYP/qIyGgXEOFnSIfkjL7ZZIhafSzL7Wv2unVyb39pXbGA0OelrJ\r\n45UL4hfe38ALJwiSS66hojHbKOnFTabU50U=\r\n=Tjis\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"e26067cdcbbe90ff72d1d0815929655c05126e3a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3809"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3809_1646560553807_0.7576248467257656","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3816":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3816","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3816","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"13de2cb02f4adf85570e42f0378e82bc57740ed0","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3816.tgz","fileCount":40,"integrity":"sha512-lX/Uj6ebtb9awHhTEoZHLQNrt/GBmqXbKGPtxnir2fxnvWbqgUFo8xZY7GuN+uTJwqMLrN4f2VkTzb/TW1kGDw==","signatures":[{"sig":"MEUCIC8oqDepihT85rRNPPiWPu5ghXfYYeqP9khQ7zyTUiuyAiEAqXkkcGHkaQrCPmZG3QDT7dhlVbo+yxud1hvEQ3cWvb0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJx20ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqmFxAAkVOjxbRiudybrrW5cjqvaWgOexPrgh8HRb9bTzvV1lIz0/a/\r\nw02sVEyQ3xMsy/s+KJsDLOG+NRS+EH5a8BlVrPIWARWL9btTrusnovUAar4F\r\nu4yHEIKJdzJhlz2eNp3puctHShyUgLp1XjWkL0Y1WbvZglDLiS9YdDw5dKHr\r\nioBbbFKk+bImJqYRR3Ojb90vrogEFfKrcngD28OEiHDB8FLFh7S4b+TOlr2V\r\n68ci4exwFwIowY5GM+GbJclOY+JQL8PY4w4buGelbwczdRlv3qCyBPs7QPcE\r\nI2FUvRlmyWBvCcwYt/SwIZ7vN4lB0rfDK+IuPwK/QlvMGV4gvIW10/Lh92yI\r\nzxpF7GB66ZNLibautfrCRXMux2iryZx6qrH5ADInpDya8ILsE9ef5mAHZx2y\r\nuxThgckm35v5JsRujl5iXyrg5oaln/A7RlxdY9fTG97d0dWoGco3drLWI6KD\r\nc30XBzdn/XD0+sXeBLtvjL++Q/xv8DK+PxoeviYlvfRr9F6g74g2QczzaJRp\r\n1nk496G+fU77URJT/x5s1rpDabifPqKizHSm5Fr6siwq7lRsNXx2rTzjYZ6M\r\nv6OU291CPYm/AIr3SW6UwVr1gWZQNv+iiDwuJXLTpjXasxTfiZm4bCTAPZ8W\r\nThIlxILTZkifCmp8amUCP53X3bpq7pUcAWk=\r\n=2u4J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"cfd7ed44c6b73655be56587aeaf774692e0c94ad","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3816"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3816_1646730676826_0.6836964164604455","host":"s3://npm-registry-packages"}},"0.14.16-beta.3830":{"name":"piral-ssr-utils","version":"0.14.16-beta.3830","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.16-beta.3830","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b1f4f39c6a2f486fa51516142ac1730c4cdd9082","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.16-beta.3830.tgz","fileCount":40,"integrity":"sha512-8rNgGy10ZUlYY1+mt9ZRHUlYBAVykC+LplYTzsaEYGr4OLC2qcwF62fi7yVsJvMekFDnILjkIvoSlAtXQasXTA==","signatures":[{"sig":"MEYCIQDw2rmg3XaH3W9wrnnLN7mmjMz0m256yRlDuLdIJ2XBggIhAPj2O3a5AdwyyVK3z2FJIrTviblhSgeRxxaq4CjxDb/S","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKNarACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqv2A//acU4+eFShMpKc6Dv+5O+Lda0YMYp2MMSRkEljYU45EvWOIAm\r\nOSvi8W11FlC2FuphxWThjqZfPUU0/vLuvn8Wg9rHv4JYWlmSML1/yfqAWO9A\r\nvMLUPtyPQLznc5gFmzKl8Tvb549f5OxVdq8hPf+P4tJ1P7bQETuG02lP2jjW\r\nPq/6hOAPkHYYshz2hBUBq2NlMXqjQLd9iYTdQBPtHsFbLQwwAGV6xt0iRONG\r\nI2Nz+0g4UX1z6UJ+HRgY8I5s0czub9a3APZ6poXki7vZiWDze9HUl7nt5Rnq\r\nPYTrCLNLaUeVEFDZUyzxk1Hj++tKV0i+dKB2OgEcmPuMEYBb2WqdzkatgUQq\r\nYCQh4rYZaiGNay8BxzlpCsDTF+Ittry9/JK4Q2C3/2JnJ0yhDywRgSqH5I2i\r\n9Z5siyci5nSQM1wEsD+Lqy8i9d6kE7secUmksPV0OSFnnaR5kNGn1zuR8PQ1\r\nR0DjNXT2LvYdV5PP0haw6jmXWCWueZHkWMBAoAgZtf5KI9Zm+foEH42u6A83\r\nedrSgJjPmrdWyQ/q13GK0PUkwFffW703Er/I1fkAEQEpxwPqH1VPTXctFxMf\r\nCxmConHeLXV5WLceoDZfrJYqAps12mc0RKyjVx0dR5dDfzM71TUIxMGCcJot\r\nt2cPonu7fituEu9jcKwq7cg0Z62opyloh8I=\r\n=t2wE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"93fea0946fbd6fe225116631770667613ba5acd3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3830"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.16-beta.3830_1646843563359_0.37125625140659313","host":"s3://npm-registry-packages"}},"0.14.16-beta.3834":{"name":"piral-ssr-utils","version":"0.14.16-beta.3834","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.16-beta.3834","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"551ac01873f984db90d81664c6d2a9a9deefcae6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.16-beta.3834.tgz","fileCount":40,"integrity":"sha512-EBYjhEjB1NDkH9U8vCVEyv1peNEqvUQSsQYGD7pKM+kofKsVvAa9nMBULkqYEsr80GWqE0NyVixzMT8/wmUD5w==","signatures":[{"sig":"MEQCIBQIqm5XQm6rCyRbWNVd9Vib5Q/rbxNiF4tdkTRV1OfoAiBgtqrzUgaYFh1fMHVheLu473AwRt4PAmKV+/os1cOk2w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKc7qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq8iw//TyY+wjfOf3z7X7LR7L2l6W17qRsF5/suGtqzBRH3QncREH/n\r\nbPuVlHVCr9Zm3s6XTiUTdeaDntsEGZGY6D4KjURPLq4P+pTVCHeMgLD6AtlK\r\nUkSLovLj9RNvFC6mJQV13ohIBz8AD+ghyLEEZdJVNp7/rvCgUNdw7lin67iE\r\nPJymmU9OYauPuKeVw3uKWeIwRwz1wsYIEGFehweD8EFVt4fa2WthkXGdAfqi\r\nKR7ZTR5XIDcumbmB6FjmPdU3kpk4pYhE/oxOlbnTIrV1jEH1pVSIAigNwoMp\r\nvUO21S4o+8KBLD5RIMCADN2OhAfUC5xZ+AvPXYngihR3bMywSo3r8TmywmqX\r\n6mvO26NHMTA1AE2x9k4Cw3p2a02OQfwJ3N4YIsDQToJGcocJVCOfT6wtu174\r\nhgMVufsCGU3YRnX6vohk2r8DcVns9MCpAsNET60sZThS2vZFlliCpPWsz5Xh\r\nsb1NI6jGJDdGQ6m3vpKZtsHFvGt8TcuBv8D6JlKwBuxuItJlt0HQpsH7n/xq\r\njrASKQ7IVPhgt0TUxqIEpK4L5KkhCiuC/wxGgGsCqt3DjXBdNKMqWO5PJgYJ\r\niOJRspl5PaOSU5jJT8aq5OU8ziZa/q8jyjmi4VN7QsrMlJyRFS51Qh9XJ1e5\r\n57Pnxbdt65IhAvHGxURkWeg3qzk9Qa6IOAM=\r\n=w4lI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"dc5add5acf100adea76a88895ed80ab6f5a03c97","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3834"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.16-beta.3834_1646907114539_0.3907762280346101","host":"s3://npm-registry-packages"}},"0.14.16-beta.3841":{"name":"piral-ssr-utils","version":"0.14.16-beta.3841","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.16-beta.3841","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6786c382ccac1b9acdfa750684887975ce6eb818","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.16-beta.3841.tgz","fileCount":40,"integrity":"sha512-sVuiB2sZD5yCCKkcGfH7ZeydzhYZr+m6Dku9zZSznhvKjiOaX4tpFe3qWTIvsC0KiUu9svvrzkaHV3W+ex8ZKw==","signatures":[{"sig":"MEUCIQCkzNqu1TBJllz8gVO/TYxeKSTy7SB+pUGrqUwp7JYO1AIgVb0JgAYFRKYpkATAvcSWD1VfXnU51VByTWg2DnxmLcY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKffXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpARQ//YGoW2dp1aArxK2YHDSHknMFOm2C/hTcJ06/Gi9B88OoWYNEP\r\nOYxQQB+i7omsoJx87GMEKpOTWWt+7l9DxyYlp8L8Ry0jROW34fLjTwdeQV16\r\ni9mYILDSGyCCf+rBXMoTg67QqnXX6/352+aJh4ivRtnUWpdYfL5NU20avI35\r\ntX3bxgccOE5HtzIcvoIhAOD9poCJQjjUXDQl5VVSiLnWNWHqgOnhZk4TrehU\r\nDfQQTDMtef4xeHLk7ftzDQmyI0UKLWtHiXopWtOhDoODLcGjEd/lXESBqLOD\r\nC7VH68Ma//c3oGUYl2bK7J2Rhs54OkvAHtBa5873siq+yILpbgjragaMYyGs\r\nd35jqUJDe8S3JbPeSQOHhP1JBA+iIa9GpGJ5CgjuGaXTIM3dCN9npAl5f6nV\r\nkgaAcGQ7AXGJayVCedcxGDWKBItnyj0qwbb8CIQDw5mpRjpSuObs+QPyoXv2\r\nLPHvLwzgAiItLiSQRlv6SnXqI8Y2coc9aqYob7O8JrgfZcXYjK3LblxN/5RT\r\nvB0OJM7rEW34DU/GotBsSH6pZsGdkv5NgUx3Ju4r89CEPi6tKdk9Y35xqL5c\r\nSrJ5cqrqx9K0xgYMP0SfNUfcVRmMCtStUs1Kbh89ASkl3fZbd/rK9AHWJpwN\r\nsgyYg5RQwnBhzNXzX6UGvqsJ7O+/1U2bwh0=\r\n=9jBA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3841"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.16-beta.3841_1646917591798_0.3307745409904983","host":"s3://npm-registry-packages"}},"0.14.16-beta.3852":{"name":"piral-ssr-utils","version":"0.14.16-beta.3852","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.16-beta.3852","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"78b30d9b5f68a2574d95a716bfe89ee349a67635","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.16-beta.3852.tgz","fileCount":40,"integrity":"sha512-TLQI3IbMaZhyZllDcDyk6dRyt4xmR9TvjpoQCfC9qnXjcUb6OgSeAOiqnwhoTbfFhA+bKeSyR9cl051ExK1S+g==","signatures":[{"sig":"MEUCICt/4cKOHwAuyaoGwjk3jjSbxhBV44/cb8DnIAQNiG5zAiEA3NeAcMuAhDWUHchYryep3DhtQzdonotvX4igQdrCX4U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKfsaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpm9Q/9FHBOIsDGxas/jMfZ/sZmizDbe8XLTCp0+/WkLw1sagz045EI\r\nmFCpGBTfe15M4ivNl0Ku0V4T0orZZy09FE+Q2EnDEcgEnLfIPA2WXVFPxOS7\r\nKJm9itiI3SGBp/mXQRQYFdI4gnkEAIrgOh4L5rszEUlqa9RiAI/WKDBn5ZqF\r\nxjpwU7iBw2CfLupqWbnr6BLbePR8Ey/CmjRCs2euOldFYyV6Jmg/pnt1YVsL\r\nKum8Tallzy8Kk7p8bLsZ9rJVhGYdN9njx25tYgFBLiOJEDP2INxIWQaFV8pe\r\nn7Lci0/rv4PP7neAnUMNSe6dUCaLtrir3JoGDTnWOOIV0rmtzop0Ef8YGEqE\r\n6JbUCg4AAS/oXYV1ZbADD9bbZpR8ovQ8FNDGH9Olx/oI5AV0pEJIz45wibp6\r\nZL/hlhILg1Adk1iUPnhjAXVXQZPBOupjHU2NpZufwNtk1z7aG+ZTf6/Zpj6/\r\nltX4IiIUcGN/5U2toxyNMCbA630w8OON0Hm46iFcrQOk70cYRx4zPf53ZSsH\r\n4LQiqqHmhLoP7vakYuHkrloH+RrnsS0pp41o86GO8Kj1UMF7tPb1oTWofDB9\r\n4rS94+S+ZojultvdUkNZBe6BV31xcHjoYLXSZBnEEzX4Wu6iZVlc32FC1T31\r\nI90k8/ew20yNaeEYyv0rdb1GMhBeUELCig8=\r\n=MDsO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3852"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.16-beta.3852_1646918426134_0.7680404668703475","host":"s3://npm-registry-packages"}},"0.14.16-beta.3861":{"name":"piral-ssr-utils","version":"0.14.16-beta.3861","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.16-beta.3861","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7361174318eb15af235833f5499e35587e620007","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.16-beta.3861.tgz","fileCount":40,"integrity":"sha512-y7VUbR662LrY125h63W4vlvWYXGidwB658kKX31ZYuoDpnSPlRFFcC77gGSh4nXq9ifPztSxIkNKND08bDef8w==","signatures":[{"sig":"MEQCIARcl4lXgUU+JfrTPCHZsr/3InjdhxJ5L4Mk7eb9PKwYAiBhBzgg5odHlUgha7MmYawA9+VLibyXZEDN/bdQ3EV1VQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKfwIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNog/+IThv3ewHmn43WvU0ekc60tAuMyug871GWJQUz+oiObe+LjJe\r\nUSoqBdBMz12DVIP0L3yk5/TjvjMf8hBAXGO3IoAhQC8jluZdV5K9Y2tstPf6\r\nlcYzZ9NxHBjioxwjfMeOdeJvDvzVr3k+dwFrmfxshsMeGIFPF1lVQ23xASqF\r\noUSHXIEcWBTsoFHNhwggdcxWJ71zKPhOu6mvZUhtDVCYGmKliZoaUfFDXIlX\r\nPVlau/a4nhGP73gIrIVbHF8COcXhtWo+AWrgvjNa6zNbcxJ7jhlu+A96tAuq\r\nn8HaJ3nBSJ6dCSYn21nHCN+fz2Dx4PZzgFJo+gHOlpKab0M0ditrombwLJXo\r\niB6jUqun1qn6N0zdrmZGqF/EncpkQm6b8fb0bYxK5Xmr56APb+D7eRxEqAVQ\r\niOwOhmchRQ3I/2vMVmYHDeXnA7cHMtei+TPHw5LVq2MPtmLKsChUP7yfbEuL\r\njZljhOXaA5ON+TF1RszUdrTKAWz+tXegqFP1Q1v/8WNa7nyZljwTlfKw9eju\r\nwQ+87hqwHtaB1h85NWL1hDG4VazeXBaD1uew4u9gMzkL3i1ID2IulYA5iZy5\r\ncLoOhyV7DXPAb0JP4CPmxPRxvKphEvoiLNm2CBY+6dVaDm/UtpHQljB8YG3N\r\njsv76qDXThvjP9G+vRxMJ/mNBAQa7UQV8Uw=\r\n=6i9s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3861"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.16-beta.3861_1646918664444_0.942080498651096","host":"s3://npm-registry-packages"}},"0.14.16-beta.3846":{"name":"piral-ssr-utils","version":"0.14.16-beta.3846","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.16-beta.3846","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"dc5d2e721f78ce921828034c4d0f0aac643a5e30","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.16-beta.3846.tgz","fileCount":40,"integrity":"sha512-BMYKTb4TLAC6AtUQ4wvtL0KP0Tj8as81d/ObTzSN48emThR8aNqwbupBQUfNcgOcWKj0NU/nGX8R5xGQezvY5g==","signatures":[{"sig":"MEUCIEbUh47BwlmP4GmHNS3dv8lSnbMZ3mp8I7CsjsAKVXZDAiEA9pXGL8sUUKXZ7CEsKEwfjubxlL43oZhv0s+GfUV175o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKf3vACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmreZg/9Hw0C3PkuCSsjRUOth+jgj2qP6lxbyizyodMMw0hg0hBYrK8M\r\nadtfOpdqqI959nIuT0+P+SBEijb+q9YeNIkdHyBW5jKoDIJNa/mrb4EGT5Zy\r\nOCWELK0Ah1Mtcbe1d8RDpLXb7B2d0v3CfEWaHBet7qw9c3cg0Y0HCdeldm3/\r\nR9OGx6mKK2NtZ9WU2WovTMboMnWy9t8CWFcNuCuty2PqV8aQIszUitnXqugS\r\nT9eizWH7Bp98uqHLYeOm2HToHnRZdayznrUAET6ABwZPZUItaUv1O/NpTeLk\r\nE4VYikQisIWpu+HhmYx+UpxFfR6ovnPaiX4yZG+t3Qf1tfjhwYTaATsbu4LW\r\n73jUW4h8Scta1mNtc4amuE31hlbigv4AGOORyIr99XPNtpjWVXES4wFWxO1h\r\nXpBNLdza4zRFCnMT5JPLpZBIln2ds8x2Vm8lZO3I2YxetAO17CxJraV2TlCi\r\nQr4knzBBQbr5kIBk/cG4AwsrzMkREtWKiR24OS90sSIz+JZG1bs91yGD2jwY\r\ngNABIAR1zZ1cat0IAJnroWxoglKS5fr0WX5KPs2r3pmKRFevNlUY0eSl3Xai\r\nf2wSZUQEsMEde2iS8erum8y8MIrBuTKYE1RUZ9GEL/WQrXIFex2ZoWPz4EBO\r\nPtcLdagaQ/2tiy4nQtvIh3dAde4Y1M0zLOI=\r\n=ldjX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3846"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.16-beta.3846_1646919151589_0.7812400359099143","host":"s3://npm-registry-packages"}},"0.14.16-beta.3856":{"name":"piral-ssr-utils","version":"0.14.16-beta.3856","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.16-beta.3856","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cbfe81cb6e383ef3ed38c779a7190079394dd6b8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.16-beta.3856.tgz","fileCount":40,"integrity":"sha512-f9TsTaXAUAaLLYpawuzmTL6p4IvEWAxBRhL9lEaxVVGm8y7KXY0FGQ/dfgaQVBS2mNSCMUCaPK0Q9Vo3DkplMQ==","signatures":[{"sig":"MEUCIQCt+PYCuTNZ4Wd+3vHx9Ii1kzKe1jeTEVQtW0VKzJDcjQIgLULvodptKwpykYoCoLSpqon4nchoCII0M0Ai+Ts9NTY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKf8pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmokhw/+PAr/A3+hyHSyoYW0+GMnNKl3oGhM8oV3v12CMPJjRrv+0m1l\r\nP80hXTOWQI3yK4MMKj3byt8DeOPBeA8SJAVXCVMmAn005+k7hQd/ExRC3Hj3\r\nNehwPu3o+7E/S936K0XBcrcIGtSzxIKI/yXeDnjTBq8zvI7GsJvAa4k+fQaA\r\n2v6zp4ccl9E/sSGIVEMhobnLlxrWToxGhwIX/8s3GIY504fHIrT7BLx9IJl6\r\nakEdyqd75+a3hB/NC7asuIZumhDgT9E6d5j/LHppfnDXR9WyWK99F4buB0cb\r\nwd0DE78zdpVYG5toaxtuvjby3Ko7Mq4Xeb+Hn01bytZ5vEbkKcsmaD7UBPcm\r\nj46WhKZw22ij9zODdwmcDYIIKckAP3gubFv49QIgrLx17KK0c916ZmB1hwuT\r\nY/N0GWuMtZwPTBh+/EStkXefPEAGevodk4LVPa9C3SPa/QlvSgq8gh3SazNY\r\nR2YOzGGl9duNRBiKOCovv5gRBzNTbQXBaFsvUCmJGm4GwsrcVr7Mcva3SleA\r\nevslHB2473ZLLIjY1QzkcBBb6M6na5+jxGAlf9BkMpaiJ5g2KG8bJVx7yBag\r\n9mEDPxkbCblOuSsjkJtgT4fLQnubVxNxx05WFE2Yn6hKcsj52128ha4QY9hZ\r\nZC9rBQgMNZsziTj9sQ8Ex/RyQPt4g+k46RY=\r\n=anfT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3856"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.16-beta.3856_1646919465850_0.30205220596615345","host":"s3://npm-registry-packages"}},"0.14.16-beta.3843":{"name":"piral-ssr-utils","version":"0.14.16-beta.3843","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.16-beta.3843","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9c1eecf7e75ff3e26c56157a32b4936d647f93da","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.16-beta.3843.tgz","fileCount":40,"integrity":"sha512-nPa++Spl+k7GVEv3gdzfmxLvs/VO3yEXGaAp3aT3V5LkUm5jBy+Qv9nTc8mP+oTQRfK8rw7c5W89i8VFLZZHVg==","signatures":[{"sig":"MEUCIQDu/oezkyn51dBxdapY922RAWd9XsDina8Xu/srvTkD9gIgMzRbqaoaoAYUakF7IrBleF6xXUmVSm4czuMGXUfcTmE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKgAsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqrIg/9EAoqsUOt9bjA5JKe1A74F1ZqMwNWjudR/7ZYQKeMXnYzuCFH\r\nQsfT3o4ro9rgywY+vq/0afy8wDHIN9G/I3PQ1G8iYYYOZcUF9280JN/YyTht\r\nPi/MJrYygjHEhixqrbAHkos+AMeSleCUSWk80QTPkkp/1eRQxO6DZ4+NLpzb\r\nflBLc6ZN5LCJrybzT/R7rozv2f/FNruVKFFHytSE2DejODZPNnf/kG6+0Uew\r\niv+ldjxZ8iMQDqnhLc888NsEn5g2oN0rbGSu0vViQW4B6HkSiMqsGT0h0enP\r\n4yFtujW2rp1CtIp1qxEEtwG+z36VrpQ+YU5EFn36LCXJSA7Rs4UHHJEx1G7W\r\nwb+mFNNCRugi+59uKPOT13IBrwNxwhEXbYqmOYPHeVJ9LpOg/GneH1WXD2gF\r\njANzLqF5hWSwOwko2LZs52XWqXubnjXp2L1i+t5FIUYK6GRPB9u+Aq2aKs2t\r\nRm5IuFC1Gmk0qCD0My//s0BugUrqUqfLmPflIGD7SSpKgTC7j84QAUw78wvD\r\nKR3Z9l/aJFPo+GUapQJtOCSSXWSYQ8bsNlb0LOd9CiHOtbbl5PBgVlpCN0tu\r\nzLjaqj/q30fYOYt4ifj8Fe3GtmcXMcfYnTXQ7WUVbw23PUCkGUaSSdHA5CW1\r\nQ6hiNkM6e7mBSMJeyxMtxknBK9P+l9gmEvA=\r\n=6ZYC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3843"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.16-beta.3843_1646919724555_0.7673889533122611","host":"s3://npm-registry-packages"}},"0.14.16-beta.3850":{"name":"piral-ssr-utils","version":"0.14.16-beta.3850","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.16-beta.3850","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b9b53578d3ef7f48d3b29d7d7d92d7b97e111293","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.16-beta.3850.tgz","fileCount":40,"integrity":"sha512-lPF5R6P0wdZTuLtJY/wK0JDRRAR6N7X5NOQs/4AmK72synaDRVhL9ClRVgkPnyDo4fl3iIY0b76vJnLSdu+iCw==","signatures":[{"sig":"MEYCIQD3IoeiNwD5ONg6PYu/CaMxt8ouH0gQxS34+cF1xCzLvwIhAJBl1XXIJst/FRoMHGFyiOeKFLZd3ShnyY/c6QEV0N1k","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKgKCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmprZw//fn/fPIEc00tbPgtJbGusZ0WfoWm/OIIRhaL2r9WXuXZQfzRF\r\n887RXE811oRrfhD3zkh5FfHJtARwchOefpcHbzllfKir6LCZWWFxXA6IsZnN\r\n/4lZZRlZwKE+M9Z2VUbPowBWfQypYQ+ASMETxj/NvIcL6YJWA5eM+WoaXnDQ\r\nAeZHwhVwzo+w2X+QuIVio3EjYjDPWa8h8MisQTH1vvDdmR6cxkux2y2QTnaH\r\n69ctmLRnF4nLbX70C4WH+QHZJjy2qFBbaRuSu0CaoOjthMsu93HdcaLpMM8m\r\nCoFTU/V4hDZrwdGhdM6zO+Fgqz2Z/zRwNMgKLYO+qaYG/2jeRCZzGDoiUe5R\r\nVEsS+XVr8yvqR9DRsoF6qmW3BQDUddJ71uvOSlXNooHTvpnjdMD5EZm/3db7\r\ngc4kk7a0I64KcE3sglhxgQTqbbgfKxs/YuO1MUH9UNRYWgC+4CjylUZfkXQq\r\nyw0rDqxtO4oZ0g+pS8vZqgRX8Nxt+yZOa+Ju9BN1mWJPIPsbULelKyz/Nmih\r\nUL90qCXzqH9jHe1q8lba/F4sDZtJm4HJi8HG8gfbCtPdy1TtqhrjQi8TH3yS\r\nJ+HV1aLIBHD+eaqqptjNtEHqKcaMyupdmMmEEwf+kHrxvmuW+8d7PUZp2jyo\r\n4RJWw5Pkwl0Kt3oaXlg0u80QexRFo4L6InY=\r\n=T/nu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3850"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.16-beta.3850_1646920322326_0.7459239147498877","host":"s3://npm-registry-packages"}},"0.14.16-beta.3860":{"name":"piral-ssr-utils","version":"0.14.16-beta.3860","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.16-beta.3860","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"342d70e6446a165323e82a4b7f058232fc745f02","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.16-beta.3860.tgz","fileCount":40,"integrity":"sha512-LDFq6aSD6UtNYkQAAnTqQqHAJ3XARw+mttNSiqsxZuVZrZwgyLamSMEXYbbbivBNqiXRfHPBdjygDnUOj0HQIw==","signatures":[{"sig":"MEYCIQD60B0jTA1nI+dZvOphWd6+ZyazVFcFHd8ZRopMGx1xeQIhAIkk1hXRYyg8cVXkgNk8PlCWZrhDN//xTDG1M8eRmt1l","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKgPDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLgg//YsuRIuF3Ju4lMl9GnRB1NHZGP/Yb5l7nVWAqkQFj79Ncqfx4\r\np872oKeB+CrfjAvancEGNNIVOKPiK9r1jIej6QDh66MEdlTSIANTWjT91/M3\r\nR3OrcJgEXdJATXEx7RZvWdP/o8Z3AIg9C00OSSbRfs99ifBH3vdkuYFTWZ/4\r\neXygP0QD03PYMSAdDWVNAqeO93cy/fkcmtrkR49Z+NHjvruO0XgxAEKMGp74\r\nHowCqvu1mbSzfM+Q3cqnAqaxkHpf4URLK5Vxhqyra5NbE93sMn0tAHU7wlRy\r\nFAu0EEYbXC+r60TJPX6zsjYpyX460QWZsf041F+E+3nV0lMAptMhb+PNXC1d\r\ndHDN45LueXMqMz2d08mBIIiu3GrZ0siT4sHx7CqPnFNmaw5vjFvOs5LjRE4g\r\nN222+4Mss39TcQy+zZyxUOCOr/ZchVmaJ4XETfuSS5GxZ4fpFQgHIh2vbBqI\r\nOrneUPKtdbaWu+it433dgwdYeOgSRGZyTbTxY65ntW9bguNGi8n75vTxf+i/\r\n7/Vfo/D3imDfiMLbrU5RsjLolyNKIq6hTenLjfHNfIqlsgi+ITeGdNbSTdRl\r\nEpDI2cm+9ezQ0jx+AYAdStPVbt7NzkvFrTvtUNPtTxVHEDyVSI5Lsa48M0Ga\r\nWc1jYqSLGR3OPVD3RZufINQ/xu6Pp8rtsXk=\r\n=57pS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3860"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.16-beta.3860_1646920643221_0.23867104915483628","host":"s3://npm-registry-packages"}},"0.14.16-beta.3863":{"name":"piral-ssr-utils","version":"0.14.16-beta.3863","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.16-beta.3863","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c0271587e973222720e8f03f0cb16f67eeea2b20","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.16-beta.3863.tgz","fileCount":40,"integrity":"sha512-KK0eJlC5EaNlKAzS1S1v/P4CLxybXVMEutJ1w5swXishu4eINBO6cCAYh5hhZbmDzR53nnzU8izq+pHQS2KHSA==","signatures":[{"sig":"MEQCIE+UtGJD7GzyYXAPvgrGnnAiV4M2ZCn49BtuY+iIKz2qAiB5HouGc0kBQnHdaUndcrffqo6lzv4Rii1uY73hqdL0EQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKgTaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqSgA//W9YlFpiueR2cjmAgjyNGyC0M8cQLkjOEj22Do8BEsq+0sG24\r\n2CGWI/rnYGhQpdD3NPd2WS7KL4qu5+5k5Jh7U2tuK3/i/FWq9L7hk2W2VPub\r\nGop42AIe7r58Rr3k3f1qfteYpK4lQDGNuMr7CJqHNmdCBnpjqICTdlGCtm8X\r\nALl+KGwxQQD7yqlnXWP0eXcQAKNkbGJzCPCfmWYu8GNVSpAmQm89r8zJGpeu\r\nodluGDmFkMGV9nlS1rdXX41W+hUXx6kCuKV3hAPa+3YOISYHlOkpoUjhwfaJ\r\nQnyCXNA/01urTmSyE6l4LRxvYsLGAxnJOpiujATrz6HtxPmfM0UNs0b5LVAB\r\nxPyR98Q2jIQCqn7F5N9cIyS08tDld00OA4gdZiM/c96DI8p2epz7gobsDNds\r\njPxGJa9JAD2OeMNtTw4dpnv1xJ2h4flggGuOtdZJ30ULXzRwV/NEVHtGf5Hd\r\nMmRwxwMwrmjZYkkzCQPcpv8qxOkoAKjhYwHJDQeoC4+KTKmJno9H3GcASPb3\r\ntXfwRP3S1AFD1siljiki5tPdszQHaTtYk3GGI4om8HNzHlJHn8+SoRES8/AJ\r\n1mMpN57mPQYuOYKrhftMzS7SnbB81LGhfpd7zaE8YuAV5kVE/QZRnxHXBCTF\r\nZeXT/GzBp105IvKmPZkmepI+dMe00pVvwfM=\r\n=7BR1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3863"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.16-beta.3863_1646920922214_0.20186420276857175","host":"s3://npm-registry-packages"}},"0.14.16-beta.3855":{"name":"piral-ssr-utils","version":"0.14.16-beta.3855","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.16-beta.3855","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0e168fefb592f2a545441f3f2e151d4d7fd8209f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.16-beta.3855.tgz","fileCount":40,"integrity":"sha512-ehiwePVtVgPTVk5+mxeG6NtFSGN/crir1eNlnmPtZ/63UqA1NOMG9cR/mrlIt7QAL91YrFWkIc2FCQpCNlt6kA==","signatures":[{"sig":"MEQCIGb69bCdcL94Fu/8YKm381+AYpWFnH/xDFx1fiEIAM/DAiA4xM+lqJDBVeMSvSg3cA3fuaNcW051UnZJxOPUHI5rog==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKgUeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoxsA/+Ofkz8/2WGvXtAfJTqSAKMbh8IUDW4QCJCOm8yQQixRDYvaSw\r\nokmY44GrK8OzQyOoeKsF1ejwKetEHWeNcu9lDaPVXrjF3rSyXZLit195zhSc\r\nFlqwiymR0gvJKjf37HNiwY/U+NKrhHjWt8tCSwXOYM56FbDVEdgJCx7GiAIP\r\nc66ey0cIXpO74MkxX8xZOC1KBD3TOkfY/FLUWtiZ9dR5Hkx2iV56P6DDHyUN\r\nHxkJcalaEM3/zzKjZBs8Lat0TVNgmV6d1kq2XRtkJVcbxFxxFhH8zEjtqqet\r\nGsqYbGh9lv9YGV7mRHRWfo0pcIA44ZgTKozhfVgf1S4Ieei3tummWa3zm3AJ\r\npyXfoHQqAbkPbjxSma0mpGektdHXGNO4udC1tPTFoyMQGpsqtRDQlV9asiMP\r\nz2zn4X9dp0oRFUncBFtwjPTIUTWuINrsCKmBxbEgdWCbOvIMVmQD2IlVrIXI\r\nWZ3aGRFlh9tpgqqojLdr2zGwLx/xpotlGG4fG1uFdwtGvj5ea5a0G3U7KMvx\r\nXl1rhHHqHLcqR05/3bChUCWKmQumuzFpGlqtSJB2wgG4QnDFdii7xT518V2d\r\ncyklhmT67JszqJNBgAONdw2SsB23KPJ+ryL4+9z8QqL6im9YHWlQyiP7rIKY\r\ncVvVrC087V40sHFbOCfnrZOYPCFKQMSvRBg=\r\n=KoWh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3855"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.16-beta.3855_1646920989683_0.2633875019223544","host":"s3://npm-registry-packages"}},"0.14.16":{"name":"piral-ssr-utils","version":"0.14.16","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.16","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"61bbea85d366701954e6ef1988c4e46e77a5a43b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.16.tgz","fileCount":40,"integrity":"sha512-awH6QJsVdlEJpTwAoTwz1j9/awDpDmv0/m7A5jdmwheJX8dyU91S9R6bQkSbLZpDjkNzjfWGiHA+tjA4QiQxgA==","signatures":[{"sig":"MEUCIQDZSRB9t45oxLc2Jh6GgSC58U9mKeXwEWveuCXUcB2R1gIgXlnTh5zIX2KNS+C806cp8qESv8jOOjIUC0xiA1Vum5w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKhjTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpdJA//aY0IwYGFzC3lCCeNcEiRXV/ZFkKe1cUMvUTmDknEll9XKgXT\r\n3G2vT2NxAbrF4ezgpUCQKCCIdlC3itXByRvljTewad9REZbYh0rO7gAEUcvL\r\nAu82unxTwBMKyMb30d7xplIhW15ooSMSJEmr3FPvQZtB49Ga4axjvQAZ2L0l\r\ntDUHSeGz7jFHTaRRyQ8w/Q1EvEvY9HRVKWSjBxRyjIZ9oUpYMdNQdJ07ic0t\r\nMOvJJ99xIiSQ0C9fQaRZ01UTNdIbGOZPXC2JC4TtKkNkshhXXz33kBb/CqRF\r\n0Enwd2EYR8nbT5hU2HTYjgAR3nsSdydwaHhLipiWy+lFA97St8fzFnG6S8g2\r\nGmq3Rmfj+Ux7BRcxzMY0z6JHUuwERCrBU9xmTk1er9B3tZUBKmRNN6gxtrtf\r\nbC7tQO6LVoayeu8BLsBAVEcJeaFiGv9te/FGFcRkWA6l1YsvSHY7j0lSp6lo\r\nnn2TYDtJqNLZ6aot6fhim5jYiZ2jwfBRHAuw+t/HOz+/DFJoQZvpUQipgxEJ\r\nw+xDYaZp6Z1vFnMZG4Tm63BIJHiw6O1U0evwsM3vF3Ztj4HeuGi64OmGqQ51\r\nDZQ8Q9nj/NxzUSwVSE8EWOjjFrWyL+T+Wbcmwwa70EqfWRX2Zc+ZhHE5bqxK\r\nAPBCkHe701+NXHTRuoyjiHNa6iimbcVOuP8=\r\n=flPo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"39ec6f4eb7b46a14530cb845371bf9e294be0171","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.16"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.16_1646926035544_0.11792526641436574","host":"s3://npm-registry-packages"}},"0.14.17-beta.3882":{"name":"piral-ssr-utils","version":"0.14.17-beta.3882","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.17-beta.3882","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9f94065a34a8bcd4a294a10ba85d0a821a9d14cc","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.17-beta.3882.tgz","fileCount":40,"integrity":"sha512-qMmYzUxjIC5ZbsFtj200pKkBT3yvPszWQyAqy1MbDm1Y0sRNLVRxHdM4sByGtikpunD9Y7rzW4njiyOWT7UGkA==","signatures":[{"sig":"MEQCIFzU+lBkEOmmL+mdCKgXYFMkDNOCAOC92yB7GMmfJIPhAiAGiTGOuAVZVogftdL6NkCcIaxpsd8m5BKkBJ6UJ9Kp6A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiK3AOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZ3xAAhR8ZBKB9hXw2Zf/Wi77P84RMQBI6uSR+PBxWUBucTlqJX8+0\r\nQW38D1JlJD0BzN2cMnuZ6qJ9se4NWNyIxyetE5egG/gxaz9L1HydPLxfObF0\r\nzhDl6dTJ4qlk8TE19Taghpo4dN4G4fhoHE+cm066/i+SQKHka8uAUZqkOiRQ\r\nBy3MqE5eOZnYSETN51eY9Z5yFPdsPVkFqQOaHfURjcPQLz372xEk2+R/vsDT\r\nweMFGtrUlgXueq+0mqDjiqHx1p6miE5KVBrltnapclnplPnEtGZ6Wlzonx/j\r\nzaVdZH4eZHyqZuCXBNt9uyR92HIZqb3mhzwjIY2MZ3bK3nakGAoDBC91cYQJ\r\n/o6WkJbs+dD7BQlBe+BAvIZLo6XVxeoWQwN5mm6BJYGmY0o4u3qCZZgrjcbz\r\nxLt2g9kfyNAj/oUcpSVdFY0T3J2HK4NO9ie4emErkSYLadMGD5YNRB164ryL\r\nm7QBvSBch5mV5UH4S0Krd19nt7c6UROOBfj5ksm7D+atzXvZMZGPK5HAY5s+\r\neh8ae8WTt7qDSQ8kn9jMMemwnDZwRC+KEhRqwzozhnkElMy0/c2+ll83k7Mp\r\nfp1bd3tqtuu8UeoD3qwt0mbDt9t79U246wPa5HqrCyhUAxJdjpjBqXkMzc16\r\nG3id0dmAm1rWzxFYMDB4ciQOKy7I9NKihVg=\r\n=vPbw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"baa86e46163bdf6ea51d84414a6fe64a913517c7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.17-beta.3882"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.17-beta.3882_1647013902242_0.824763367756874","host":"s3://npm-registry-packages"}},"0.14.17":{"name":"piral-ssr-utils","version":"0.14.17","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.17","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"43d88b114f614ffa5e6a37016e9c5694fbe9e611","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.17.tgz","fileCount":40,"integrity":"sha512-LEiakWuNUjWG68g11en1eoAITt07EDua4asqR+6a9+f2LW1WPRA352pWr2fonI/nXWlCqHAPxCvle7O/DpgCeg==","signatures":[{"sig":"MEYCIQDasqTM6v/Fd8qShWS9rAd+3YwxdpBFQVWR+HAV4F2DtAIhAO1fRHy7aEb+om+g6CThxJT4sTVzE6HJtbBiDWrfkGtK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiLhl0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpFTQ/+Iq0XqxEh8BkCHY1kUXFQSf57eS1nBSIiDl2SBgrrc+xJlj9V\r\nrC39Ttl/GzpSqXOo7B4dGEAf/K/5Y6Ew9kG69ruQ5eF34u3w+LU6qtnyRPXs\r\nyADfK0lnnEu8bKZlIRn6NN1YJsRdV5xDNxqmunwXliLDSKkpJzsPxZsYJOTD\r\n2dqQRYN8TGRim2twPm+oOTUbeQPTcGNlUhJKaoWDeW5QqrvnV6S7MzEBNoUb\r\nkuqawKapgz26SGBG6LyBBZv28wx7kItQ2d0vQUxVCXu7PR7E0BBG09bDt4xN\r\nVgtJrHcg1DXdGfjpMY6i1wqIY7teq0OWfZ+PiQKO1KLhS7D4ydPuy+yRuCfh\r\nmMREixKW+rSd+N077ZEZUbJl7wTrzhgiMtbmEQlhVtzKCtCto4jfaa/tfEmb\r\nWetxjtGAugZrZ8edhMwz4rIZglEa3q/UKjGTJUUjzQWYa5ye1SCPxXLA/ZF2\r\nZ9O/v1m0+EXLt0KmmM/afJwHkQTJ1ooajAnKG+WKa42PD200CH6X6Hiat8DM\r\n+eMw1Ht0sCjPcrLOYR1kLitnVdiurw9v/Kck2YC4YLd49OE0L/pyviC3yLXZ\r\nlbE0rpI1kqyekgZEHdUFk9OJeYR0shHLLX2GS3LeI2jdVeftQuRF0EUBQE7p\r\n8BNN+CD6nERHt87po94e0Wfw9sb+/hHFlhI=\r\n=Jvg+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"8038b8c79e38dea9a1e0bbed713803e2c776bcb0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.17"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.17_1647188339880_0.28558301852577817","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3905":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3905","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3905","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7e7bbd4054a35f50188044f72aa5840d49b8d5dd","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3905.tgz","fileCount":40,"integrity":"sha512-NeC7Ck8L6/sjrn+gbIVTznxQTozcCA0hnU6MW6G7asnjs5IzAK80Gv62AfubsbWr9F4FnDvK31HhF1G/T3Zm1A==","signatures":[{"sig":"MEUCIQCaGGkgv2Ye/N0MMZmtLlzytJXxbhgXFGLjjqLgOjxb2wIgew6nYbVJegmPp50ckj9r+VimBcfa53L1TKkCne+INes=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiLpypACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrwkxAAnQufDGw2Nq/7yau1AmoH1puoveU3L2pyiR4Lx5uhP7X3BtGI\r\nb/lS/Vk2gj1+5Z/DGZ92pZkQMkAo4W1ySRn6O49eqTqHgmXsLrzOBz9Q1JL8\r\naqT9pGizjJlpadWzDz8hkT7qbAT/arst9bl0zrcoyM+GfGv84sWY6aUZj0S1\r\nZQtKjZ+e+wjzMsnqSbe1aLJ84SVibL5XCxso8RbMSPdrKe10W1+ojPLwC99b\r\nsAjQVVY5FVWKPYsy9nxaMIe6QKKrE5ht+clKkfJ2WOTI+tsxDij/F5I8NoJx\r\nrKh2+I41tR63ilb+TuWTg4Qllp0u9ZuZzjI056GMy/+7/uUxtnH0DQZ9QBrj\r\n/CaSDORkrZ4ICziA+1ukkyOWuLRJaPiXr/cMlgFE4MY2gjwoFAxtp2GY3lsB\r\nEUgsgcSoEAEJHK15ui6C6cjV5v8Wfs7D5+sCYYboBjdIxexajlPAMYlKBEf+\r\nRUq0YCPLJ2LnPlIuougJYoNCabBFb0Y6at/U4dzrgZxhlmPMbASauQKZfmJn\r\n49Zy0K0U6e3zs4026cwmw0qzTyqY7rtLvpa0nlxlL06PQ4wEnSrN+W7Px2Pw\r\nasvVw1YlhB54KDmjFWvuhqZNoYuYWHApAD6BfVy61rUDOd1NLWCQub+iO/1w\r\ngbbLizYqvZ/SGyVDktm2au1XY479m4z6IWA=\r\n=0sf3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"533d09963cfd8c901df797958ca386dbae0286e1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3905"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3905_1647221929078_0.38838607905144396","host":"s3://npm-registry-packages"}},"0.14.18-beta.3923":{"name":"piral-ssr-utils","version":"0.14.18-beta.3923","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.18-beta.3923","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"53accd51b39b47bd5ea354614229ee8bce791789","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.18-beta.3923.tgz","fileCount":40,"integrity":"sha512-u6gcE3qtzWZ4QdZnWa6roMhDitPyx0WW2Oq4GeOG+bSASG+xWr/Un6WuWUkP8pEmV9Dg2eJC/ssSui2NbG9Cjw==","signatures":[{"sig":"MEYCIQCKBaI7cAlh8oWlOVL/OMlp2TZ6JPZipH0OwQ1stPh/KAIhANdtDEqXBk5O3TpxZnrBcvxnRO2VDUa95oI3wXcGTgai","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiL+McACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqU7A//UPjuwUlXq2sx4byA22tb29AuA3ZQquDRqdiemf3e49Vyl/kl\r\nG9hhzUJVgLFq5gVJ0XuJBoThqspoUURjkaGemPvgTfgd1kyguZ4Pt2XrTNM4\r\nPuZpXS0GeiE0YF7sqgeiErzdCOVtqCfv3/mn7tt+ceWpGo4kj2iefmrGMBtJ\r\nJOLlJJGDyw6w/ceGWqm5SNWAs9xqzciTSfKr6bsF95A4KQllAV/L4rlxkhxm\r\n93SuCdSqn5okmViJMzAF7iQxoCwRWd7mCEy8mumzzzl7/iArzxoUoC9nXcsE\r\n0vQW0XQZjEWPH8/eB2fBlJt9Do5a4ZobOozQMbxNMuWozvjmiT8WjQZr2fOB\r\nXjQCB5QnoMhiUJNDVQNOhmSvNemL7gsfrzwAk5ZUL2gnYznFrBeS7jAaQe4y\r\nNZgdGYHQUC8ExCSbPi9jdYVCmWM8NotJMu/h/yH4xABmaYJwLgsoFJz1jWTb\r\n+l022UlmNH7zwxn4/9trF1U4ilCHcRJCTkd2skwoCXAMKzmoQbgfG5OQmai4\r\nbPR+t4ABKBWe0dX1SQ4ovq2/YpDyChBy6NoCCLUaYkUOj9/COysP1ofi1YLH\r\nkUSNRxIAqYP1NRFB/HFrQ6xtuhPbgnDCT3IHeP/cKKwtIvtWOJAR/hmw15MO\r\niTwzeqrTQSm+dnzZcOVVJ/Pah0tIhykFHRg=\r\n=Gtoq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"036cb83c1f1797a833edbcc9a7fd698a926aedd2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.18-beta.3923"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.18-beta.3923_1647305500783_0.6221049796360851","host":"s3://npm-registry-packages"}},"0.14.18":{"name":"piral-ssr-utils","version":"0.14.18","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.18","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a3db9b476a39584c94eaeec005ff857fb575a0b3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.18.tgz","fileCount":40,"integrity":"sha512-YdTBGlL8zDH94PGY5nPDaqYBBiajQesZVZh258oatanv/ITvFolbUq52Evpyt3161fqPvXusb1ckrcYC5b01yw==","signatures":[{"sig":"MEYCIQC9yEDiGm3a3mRWw5JxLoXhVV+Kvfk+hhfAiyjXvSJRoAIhAPus8ln8hD25h0Ck42s1q0H+e5XM7c1MxTTrOXs4JS7R","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMFORACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKzg//fWN6Q39ztc52uZYgPB9tCRVOoTZA3WUlDpF9pVx+0Z1peRAS\r\nuwA9bBxxhwODsOvLCNbZ3w/kMHIE56ERztzlNr/+4r+y/6xZYYSrBG2r5Hhp\r\n/CcpwsdnqY5G4/4ojfeTPqXgcvaz8XxoHNp7U+xBnxghH6t6vLtwWDDjq/W4\r\nVz4iZeUFX+tj/quSChcMdDxui9v22nvGo9rBtb/aZbF5YknMujLRU4mx7cMy\r\nggFR18r0VWhxGqvLcxwCUtBDRWui6Qoi5a9hObJYkxuSugfpYe+6myw/9m9Z\r\n9RKRQ/LlWb0OsyfNrH1qebIwuggA7+Yy7AfYeednfbyBxfwMORKqoyh2Iuvh\r\nDOTdAkLx5Lrg9C3jR6jGZoZWmhZHKoN8QANMFDR3xMAnk8zh/7xShc3F3B94\r\nNvP00BZPDUAkljVmx9HYzaZsX6nmW7P/iiZs7fWXP259/wI+cSmjCF5evfFG\r\nzldQm/onSqm4UbvQDvMaJvvcqw3+moxjLwy2SpTdvtVhiP5Nam3MnTZDwF+w\r\nxZAKDI8mGeWocEZQbfuLYn+NEDdDaxfxsKPcJXAe4ZnWWCmUFOOtQVydhRzh\r\nNl6kJLoI/RmIGi7DHyFTQ59nVvqhx74Pw3frQGKKK9+4lGuzsblepMFxArSn\r\n00ncbDkYxM4K1nbcQnmEv0ai6e4iv3yPwlY=\r\n=g1Dl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"ba8e17c27b8854890fda9499e1107587e641e9b5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.18"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.18_1647334289851_0.12031219326282927","host":"s3://npm-registry-packages"}},"0.14.19-beta.3927":{"name":"piral-ssr-utils","version":"0.14.19-beta.3927","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.19-beta.3927","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0cf9df2a0191d4d939478871e9b63637e03fcfd6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.19-beta.3927.tgz","fileCount":40,"integrity":"sha512-71vxmCIV9tdK46v5Dw3lx5NZByzt6owKExcVxAj9O7hMz0O8sR/TadEAFdSL23/2ec8EIGGyKSv1zobyrtY+1Q==","signatures":[{"sig":"MEYCIQCYMxmDtQtpLJFhMHXB9uvFbdp9Q7Nz67Py9TcJ0RdS+gIhAJtCVYiRrDWW0udtK4KM/ynrF4MUI1lkDyPygH8zbdyo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMNMGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3chAAolTJp7B+JOeHivJELT1pScH1VcEANKTOsCxnZXwrqqU8ElhV\r\nGLM6bmznARwTjVNG/EK52mzZ3rmED52IwcB6TKP5xCopsRH80/6l2XRqiRYE\r\nHN+sCAiXkdh/CzVulmFtFHNMMc1Hjfz23W46KAwC0qBeSL8MmX1RqWgb/YCa\r\nR+CKgivo72wv9i+Jx220Lqy4Z+Ci/wBUqEt6Pm/6Hv2N+8Sk8eM/xuk/R+Um\r\n+zWcDf3hBVdC3jTwy/fEZUTnvIO4uQiAmE2omU9eVMls626T4SNTXXnIvgUt\r\n/yXoOHltdIPQN7lzMwiFN3+n9pETGsfKfPuM3Pme/Y4RziV6t/ex1rsN9Qz6\r\ncFgssMMKPjrbJLI1sdd+p33MKJ0k2Fa0p4mnJg4GLbWxBE2P9mJFgDrAX9c6\r\n5yT/NxNJpYh2FUKTmQqZxAb9BN/6HeXwlAuVxSsoswbKY1eXNG45q4EEdLjP\r\nwuaKiAbZQvwKpc90umaeGEieq833FiOdwJpOxraThj4h/4vOQbSz2DDotoXl\r\nmQPlgeXpSXAQjy5VfqJHrFM5ZXeykaHlyCmJq8+4ktWhD340N/7ZDr1FtkwW\r\nfzi+uRwpNRzJfgsQlFEr2h+8mGnH3ZMEXPJwyaccx0aCwVYgAtD+SXeMCN9f\r\ngufyrzJB/7AYuDUdj3Pw0J3tgWUv64zrgxo=\r\n=2sW6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"32fdd3a819e4397c2fa853d9c9e637153a7c44ea","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.19-beta.3927"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.19-beta.3927_1647366918429_0.4576748450966479","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3933":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3933","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3933","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0137edbf7fdcd2e8b9fa84063491deed1478d31a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3933.tgz","fileCount":40,"integrity":"sha512-GDo5gI1PGmR3qvEbNvDYrKf+tKOMJjKmXBOvzOb6vWD/xPNIZ4tHtbJBb1Gcyi2FCu60pTJ0hyx2sXO+Z9mRZw==","signatures":[{"sig":"MEQCIF+KCSydZPG//1HwX3WuCO1+0K2xC/BvyMZX4pFYsVWZAiAFc8crRGviUQko/pmmKBZRE2feZ66oz2b/VCF3NlMPbA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMbmiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq85RAAnGuR0JktpeCGKYfnsPKEPN1Ngp0X8txPmgn01GP42Z6mXabS\r\n26em8B+gSqOqCUniIokvxCk9+UHUG5uasrb0cr/ZvS/R3ejhSqvFeycSbb9f\r\nBtNLxXawtOUKgBDNXgMzOltiVVGM8Xa8ydDqOvrdkJBJJadO+oqQzS52OXpL\r\nYEHoa3umwQIyqvUsBdgOVI5Qges9uA/PhMFVqSXu6VFMvtkyVhFtQw9rBJns\r\nnFQaSl6bKljN89m2k5Lyn2Mi25uzz8CzXqo3kY8EzMDUOKTJFw/YipShDvRi\r\nLn70oTPUPW40m2bEBYmrupUfknmoWFTENejAp+y0U7riyHTwAYGPPCg/4SVN\r\n8dhEsZCBEtiq5NiSnIg8X904kgIPXrfRUBYV7zIVrYk6H4DrZ3Zu6MWQEGIR\r\nf4M/wP6NXKvtCBOcnAaSgnEIbG95vww1C5bxAuF78/tOSpUBt3g6U6Jz86Tz\r\n6hwM0qiYTWKemOsGhS3cW2a3DItWN45eIoPuRUWSWn8OmonV8BJ2Cwmzr0Oc\r\nVyalW8Uu//6OeOGFs/f8ZBsIeM5NN1xviSHk5BCOiugL7Tq1wuF0S4q/VSvT\r\nfs+EmQmpg4AJlrZegWDIgDVczxDvPt/d1rHmGeUWcCN0kR7zjFZv4653euVZ\r\nABfxvWspfXdUQEk1QW2MJdR9kPsM/bOZrHI=\r\n=uZa6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"520a272d09f02543153f1d8b2ae23a3ae10acd6f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3933"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3933_1647425954490_0.13474243388654394","host":"s3://npm-registry-packages"}},"0.14.19-beta.3953":{"name":"piral-ssr-utils","version":"0.14.19-beta.3953","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.19-beta.3953","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"787aabcd99e4ed61e6565f0ac9307a6981591a58","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.19-beta.3953.tgz","fileCount":40,"integrity":"sha512-p2Z1qenWpf1Gn2ReueGLFqvreTbaVbYBBwyCtMCOj7Nczz1IvRX0gopBsH7Pl30hy4WxxDuDkpHBSSXCxW4Vgg==","signatures":[{"sig":"MEYCIQCfce2qSVNIfzQtSc25t+LAIkS2z168A5qq+Jlo/J4w+wIhAOYjz6duHbx5XB6ZfvkuYzf1sVKwjIa1YEFNUw4ys0Dg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiM/TbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq9vRAAlUqopVeNhDmXiRk29wafYgiFmsFF8XD8cdcsQX3SgGnIjVAj\r\n2hKnFN0qz/5bir8afo/dElBDnpYeHQ/jBuhYPZVuy0sMZuddTqclIv8tNkkd\r\nO3KcV2zq8zKqrKO24RS+sKG4wDmb5DBIrt4diEAxMm3mhFJZhHIphbJwlnwu\r\nmbC0jHRBmpGH2q3zB55gCjb6rdxkC+9jjw+BrLWMytI2yrOR98rmT7EcIVV/\r\nRkbioIc54pNrpjoZOdNYWo5RrfuapjKS1FtfN0+B+9mKHwMFh5vxiG1ATIKr\r\n1YK9qO9/z1GuhSbea8MM7ePUKoDSar3vmyET11KeWazNHf3tArl3DDN4gdHz\r\nN5YKXWc4ik/Gc9ZfwdEj481+FQ5Hz6j8RV2wDMaTXi+KC7cyA+bVJABbBEJQ\r\nvodQZeWODM96FnN0FLA7Iy+UtdioqzN3zgIx4Q2CbyAXp+dq2ah6edAJZuKc\r\n4v+tss0fDGMjpd+WUykoZQh8SieTQn98VQQP2r+GKi1ZeVgSt+xi1+5odoq1\r\nzDfNnCWjdkyl8i9k2T8QVF2mlREUZflOroVGxqM9035esYBRUhOg4YP0Wu3j\r\nG9j0e50FjGjiqdJJgwEq3VIhGvk7fyrKDFubgAZHzrJUiWgqTzR3ERV71kLC\r\n8OSHLKbZq7d5mwrop9I7B/lPJUBNb1to8es=\r\n=MJu+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"b36081fbb08175c6f2a88f5e076fbef69779c1f2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.19-beta.3953"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.19-beta.3953_1647572187353_0.2684900409170474","host":"s3://npm-registry-packages"}},"0.14.19-beta.3964":{"name":"piral-ssr-utils","version":"0.14.19-beta.3964","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.19-beta.3964","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2117b45673ad33f8c172f7367e45bf9f181fd704","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.19-beta.3964.tgz","fileCount":40,"integrity":"sha512-Lz3uyrPvsLwSdHWq/blCW0ofLEp0umHH9N/vhmLIUFWO0HXP33e0FdoImaLDNxQ9sq7GaAjlok2gm8oMkS6Iiw==","signatures":[{"sig":"MEQCIDurakDLOxjWOHyJ8QpoIEDpA4MxFJz7fP8pXkCxxo9LAiBLzH8ZtAh5x+/jINLOorKUW34xnUn9ExomguJNV753dw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNMzVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmptwg/+IxMiz1GoxXodE4FCYgEx3WyrVPhCywWIcLnVzCmiOti8o46j\r\n0qOUPoghbb/sccUjPGff+otjA53uMkKl4epp18M0dAexZbaT8Mt3BTTYCZwZ\r\nN5TsGiLmyUgzg6SXEZT+W5lwK+wmpVsEGe3Dz+IFeBx8SAKZVMMHNaq1OP1k\r\n26MxnlwZxBdNfyahHX1rrYDP7d/LwXrycPTL4saxHKZeJHSTIW+gnPhuBICA\r\nQMl6wu3DSRh730rDgHhryZUwaO4K++3LG6kFkamatIcVBpZQYZQzyzaKuid+\r\nbH5qdmC7L0XMgT04SgGNtbHL0W6INHvYOx4xXtLg26oyim56XlsAzF+QPICl\r\nAaeXB3d2MLOTcaAPNK6U03tGpCnnbGXtY4QpP18gxjBGUyLPin/8FhJoq4+V\r\nvBoKqYjto9lc4yFvBAVyOYa8x9BmflV6r7JbHsEBN2JqxmFjxAdZDpZUtltr\r\n0IptyJoR3g6leKMFMbDyyPi9655BrYqJJebqSSM8gqRj46oMKN6A9R7FNOx6\r\ncGT6k98uVF71itkFa+EbeamHsNB/lm6ZJUAaNpZKWaKsSBVs2NU3FCprZcdI\r\nw1lm3FR1EQHI2ft8eSa7/lhkE/piyvPMUPJ53acfm61nIkkPgmOt1+wvfSlk\r\nkEGz1uV/wKoBHKRvfn42OBZeqR201kl9E7c=\r\n=xI/V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"64e72e3a638df49105fe8fce5f89547657cb015a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.19-beta.3964"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.19-beta.3964_1647627476993_0.9523525849926489","host":"s3://npm-registry-packages"}},"0.14.19-beta.3968":{"name":"piral-ssr-utils","version":"0.14.19-beta.3968","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.19-beta.3968","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5f176ec9843e6eef95e01deebce00e62a1e08a68","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.19-beta.3968.tgz","fileCount":40,"integrity":"sha512-AJE+4g15cEo0NAdg3R3KhTDDfokLBDfdRNhZUAkTG8lW5lYzSE5VXQ6RqENbwUFDMSsaJbotpfVIkgRc0k6mmw==","signatures":[{"sig":"MEYCIQDCaRDrZHnngOvaLfvTJSnNOGg2xg5/r4q3JoHy3I84IwIhAKhDzz+5YJSw3Zwnee6Xb/F32ZKHogw5PUk5nBt1tlaa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNe5UACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp4FRAAjkSyArDG4801oHqR0l7loNhegjqwnQeIRmQvwMeYDcjGqVWg\r\nCnNmLiaxbXqJIQyew+xqyIps6dl0btNMq2x7fUTrWG8E8EPXOu/9B+vp388k\r\nzn1ZsMGr213RDje7/IhkVpM6KBBHnVlNPtTM17lt9jgJbJcAk0OGKG/lqj5V\r\nBn26qE46E83PbW6gEzNszGn/VffmOe9pScBXW68jSKRh2kuu1Jww+9O7coOp\r\nR5Qsk4WdkJ6i7EfjI9O/+Uauq+PrwDC7oeO/LKqLCPb1fZdlPR8za0Lpx8xB\r\nWmLiEyfozEcGOAQxTTMMsek+9AjPVg1HXcaGGMD2K3GnmzSrOhjOxyLDdLIg\r\n6WvtliwGah+LqMooS/YO8a+p9BjoXPLea+DBSAZWJPWbu812qJtL7m2BndZj\r\nyyfkqV7C3g13OtP8duqPIi1Q3wWC4m4HlhTyjlW6KDB9TNuux9HujCgzYK+Y\r\nlx3xgQoPehHllCfGy60FmC/d2D1dUGiQN0fRvwTQXFZ8fDUlrE5cGu2ynn93\r\nsPD2JAzkdg2pE7AA/A4lRnvCs/JB28BNDO2yaey02FfqRYNvBw9ty/coKyv5\r\naO9ei+w9fGJ/WVKb9bL14eL39sz0rTdS/RGrKd1Z0V8yjc7GHpH0ZRpgRhJP\r\nxSUOwZhQJ4zMYosqd5N+6RBOEj7srSKKR8g=\r\n=GJeT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"3065473b4bbbb26675c8973e5a53669a458ca796","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.19-beta.3968"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.19-beta.3968_1647701588796_0.12070386781366649","host":"s3://npm-registry-packages"}},"0.14.19-beta.3970":{"name":"piral-ssr-utils","version":"0.14.19-beta.3970","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.19-beta.3970","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"87d764cce1f6834f8caf8fa8bd3631c158e66eca","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.19-beta.3970.tgz","fileCount":40,"integrity":"sha512-SAm8qf91uUHPI8SlJ5RUJ9mWDwnlnc4KJKgbQMI01SXkHtLYvgi/HQPxQmuciByt2zdyqu0H7ZObejK+l4qigA==","signatures":[{"sig":"MEUCIQDxeGYVNm/KZ/H4GyLONv1sydPzt3w27SV6sOT9VfJIXgIgOH58LX+up4XjKxy382J1EBpryVVivxhe+slmzZVKLtE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNpuhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpryg/+PR3q8/Ch2UKAcYFQK3QmtfG+6TDKTMWJUCrcKytjvCQPI8BV\r\nBap70oTQeVZE5lB6WIp4j7JT52kCIp/se+vIoSMMku9irjm7vx2w+26V2Gca\r\nbnFWeciun4UuEhBJR7WF4CoLG4rQg5GaVCFhuGxgwAPooWHhdGUMWmnmzFWs\r\nU47/UuZrzxADH2VlFNp5l2rTuDG6eHDNFzrdhkbECeXKUh8Zc+1H6cJJGQ5z\r\nBP5yr62LRVg4H1os97XbKCfwdz/wtPSnv4r7pusbx4ywQNVAYwVmf/h1eCAs\r\n0J3l0lN/jBDFd3f4qCYQ7TbExo8rjNA4QHSWkpAO4JqnfZ0Z3qq716cas0T3\r\n0rnEW7mug96yFJUZ7Kx28Az96wx3BUWKHDN/BdxmOIk0UIINkhugaoSwA5MA\r\nJciUwP0eUnhvAKKMCW9VK0BJA4+ws0LrYstVG2caZh1/+aEXg0uR+VFkXcOi\r\nq/kM9UEgSZUxOjzu+PK49eg6fdkeHUZlCypZEiokuVxOxy55zIbkQni42se5\r\nUWZBd0VgA2bb0eB3jSgE+fHxmPiOhd4e47fDl4FEalDqXgED1Qv1udImd8mt\r\nhvsZUNYjSG4i5HptVV4IA5P0ghpNWrGsqnswsChiMSxFKoYWaAsYZ0g7kYD6\r\noUYcuCDpgqkiHLpMRYIQTm/Fc+QBEEA2PEY=\r\n=466m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"8b31fbf437de7f335b748aeed3e0b06b78ea37b9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.19-beta.3970"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.19-beta.3970_1647745953108_0.14886582414170046","host":"s3://npm-registry-packages"}},"0.14.19":{"name":"piral-ssr-utils","version":"0.14.19","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.19","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b8ea9994c9ff4389f695cbae4b7d9f1366be3b25","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.19.tgz","fileCount":40,"integrity":"sha512-Gd7HoMl2cWYofp8FbcKOf8CbVNrocdreu+pROi2NIuf+xzZBM/mu+iBA4mKOvEM17uS4bBZh2keF8BZSmmH0ww==","signatures":[{"sig":"MEYCIQCDh5VH7SMriZdhv3VuMvSY+mQPRTSBZRnRvCHqfLtEwwIhAJlfVJkCInwgvpgmRyrbPMkuCJ4Iw26vk4/zRcFN7I8z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNvoaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpX0Q//UNMIw3F8PB5/k15md7z4lmhdMcVvQm99RFRAevV9RY5tT5R1\r\nWLkUNEC5DP4GP6rYtxbhTXQvOO+ygNzzeugM7oufCmm2v/WIDdHlIB0WDw+V\r\nU9mbm2v2lBqQKYhoAZvxKZwqjiKpg/CGW3NUHdgHP6nlk5AF1Y35VkS41Phy\r\n4wd79gWIlmsQ+IjWNY6JXlEZDIuhV0aPpRucjY7gTpfhk2fAayniHINLwLvw\r\n8nt8I1TE51j14i+rboQe1PecemLYfwiALG5iwkiF6Wt+F/ayp6bBxU2NmEc8\r\n77vZYeKYqbdc6M1saM5heLc/wSIPiud79qXPH6VwSabdNRKdNTjt5FsASm28\r\na2JMeMDk9DY/HBbJznJnj6R/leJx+YCz9+EZSVE55Bb+myuXLoeJgdBTm4ys\r\nediGcDshAAFfPj9ACbRzsjm67L8WlD2VU21yJK5PfH4YzeAiubwgbdKsPsEb\r\nACPn557rMuzMQ9PPdSVGyY1lPArW6u8VhRrrdvnTMGAnHZg25SkgjrS+lWIh\r\n4N8wLs8pgiPd5it0bDfKyjHfBRPumzy6O1xUHP8QejUld1lLEKqlZOsNW3uU\r\ncsr3aDi60KsrK/gqu0vc7OfH7lG7ExNSkh0Gsn2qciBn3L8nezltXIGkmFEV\r\nLw7Cn8fRCNSgS6WiFPFz4SEuq0Zx3neyaWw=\r\n=wLT2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"71ca4a75ba4138eb5f4176e45882802f338ce3e6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.19"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.19_1647770137834_0.6597137103020247","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3975":{"name":"piral-ssr-utils","version":"0.15.0-alpha.3975","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.3975","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"bbb91cecc818bda3f882e3102ce9a2957ab574fc","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.3975.tgz","fileCount":40,"integrity":"sha512-e8PhynNKwWWpXfY1WbNH37YJy3OzlqudfMFkANRK73G/XIN8Qs1tlmh6IPe4H31sXmCDmQA19pNJOU/zd0ALCQ==","signatures":[{"sig":"MEYCIQCdrV4S1aeEbBlEhWJcbHc0V21Y+DQ9vrHfJo0ZYaXp2wIhAML57HFZ43zfQQVAEcYf0GzOPnOYleflYdoy52sAhWPl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOCloACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo5fQ/9HNd6RhaoZQDYgSxqcnBnvdPA1vuElsQ0IQOZm8oXyl77t/lJ\r\nUYzhFOjtUAoRvGh2TdQibCgyhIDCzwrpoREg39JTTFtmXhx9NMvoYur8z9jS\r\nAHpWSJzpj+cB1L8e7Y+OADDVg2jj9WoHKd2BCGblrPYb+arFtTEZ7atAYQlq\r\nTK2HkVsPzypwo03CjWhnumKKyNOMevPKYFMq+9ih/N3+wZCAk6PaOSYOMpv8\r\nO9Y8Wt/IPauX7m8gXvxTGaeArtNnKY/rHM0YbiE2B5Y1xHr0Crh8uUpK9y0W\r\nd5FUZHrB0yGHx0KyPIJ9p0fkTAUmZlc6ADBFk3qgD6PuHw8C4ilLq3z5ib6Z\r\nrcTfSCRkDgM2edfi3VQ+sN3mIOUugTkIXkVnbmTL/wjrbrfXbMH0w03qq9Nl\r\n9Z02zm4lq4PLtCC0ESeuSWq7JOQxGxGmZ0UGFrC2XkLcI5VJTEElX/Ut4f7z\r\nbCVndlo4/5XFgLGl2rT38RIFGwswi6sQcjFvX7FKw1EYcrl3zMGx+NKdPGj+\r\nio+GB5LdsUP3vOToSy2oxb/hO+8oInSEdD3nj1ErCvetQJUulTDw+j2BIyUe\r\nMNrdbwGHkqQ779/xvShMO7iiKiV0t6RiM63lGu/VeCj9X7yYhx0pytoUzH9t\r\nj0bJ9K1bQbHsyuc5khhILqmADV9DrJvXUOg=\r\n=sFYA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"461d63cd1957359472018b32a56778da716d3406","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3975"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.3975_1647847784419_0.5428222034421983","host":"s3://npm-registry-packages"}},"0.14.20-beta.3989":{"name":"piral-ssr-utils","version":"0.14.20-beta.3989","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.20-beta.3989","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"67cf50702b758ffb274ea746c09ea4e8ff0eda73","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.20-beta.3989.tgz","fileCount":40,"integrity":"sha512-QEA+iMkcLYzAaPBZ4Kshi0O1aFBskf54wahiigxPFMm+0Q/skRWvZBoJHgUJOjFS9a96bJtSKgFNO01Hlj7aAQ==","signatures":[{"sig":"MEYCIQD+uixCQLYyo7msjE35hdGfv1iVIJHgjFZrAgu6TycOvAIhAKCuwetrfvNi2AXsj/jd6qyHW38EE54aB/kK0NR2xydR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiO+u0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmobxw//VwjvLg7thWIEBQxbAK5l6aiIpCrNZlmGpptANdDKneknBsBm\r\nHwWP4e5Oyu+/C9maXEDCBf3P1TQwIGhVI1p8oEJB8nHrF8GoaLXDzYfrptES\r\nppmRVyqnFy2zL9rsMNsFoH11eLS0SO6xnIsEK5Tjja13y32Mg4sGRHgLL+Ul\r\nY79kPvPG+uRW7V0rrv98dV8m9xn3G9Ck3wlJPrHrbJ013jjlJyqx2aeUP6Hl\r\n8wJbIlmWfGXAQZ/zxhsHeJG43H0KNGZzBBVl2VtXj9XtYG2l8oG6lryTkwv7\r\ngYIl1mRSrbvacxusgVtsnmWiLqDo6cO08lBXepa2//q6sQESrPSIkD2JLr9R\r\no0WfGQlmNWf6NKdU123s8HvXwdeUOuqrwFt/1Sha4LYi66TKKJvxGhVYSpui\r\nT271M9jgUbqjgUXrUnrQiQn2oNup+J1lyLciLNzVa/cdNrAZzKMzlAJA4eai\r\nAZISLneO8DltdqToP1XcvTtJf1+lz9N0b6Kd5wRpt2yAfI7TkSLr9FvAjERZ\r\nxnBpFPZzu5I7hN9NstW1dF3rK7qVt8E+Zbc6MJHLLIxRr1xcHqO3vCVhah4o\r\nW8Rpl0QXgB2hWGO0YYoD0PUw2raVfLMbvc4kgeOiJUn/0RTJKF6439/q4vih\r\n1/0bqcR2mqKkUanm2i2SVaDfUgwh+ZhtIn0=\r\n=wkuF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"50391554f3524d4490f9689a7efcb027725adc9e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.20-beta.3989"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.20-beta.3989_1648094132399_0.9909712843219742","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4005":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4005","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4005","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e8d80bc62da698c846d18df0fb7d90fa15d6d127","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4005.tgz","fileCount":40,"integrity":"sha512-UavVVLzsjsjA403xRD9XTgtnQWJJKPvbqxObEMhPhu5/IJrycRobQUMN1gfzVqCMTQMp1re+RwpFp9k8Rhey3Q==","signatures":[{"sig":"MEUCIQDMJbilqXLNtCy8rTquSk3wyLKwC1M6gIlasfWjsCNmrwIgPeB/EEPRyOLAyYQTTzBKpUKk8nK5JbIIFHYuaMTj7nE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPhagACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrcrg/9HvuMtMqpVrRjJ9QYEvYgPrb96DGorH6M6C6ucXav6n6GyzZp\r\nAkbV20pUmRG5FiQeEdDDy2Qo+QJT3Wcpeise5EKolU77PNt4UrulM4Hq0uv9\r\nXYB5W4C8tuygQN+/QOBiTfzIuYXSNzd33T243sV7p55D5/LI6qR6VRQkrJjX\r\nN9+ffBf0BAGXUbacVCaogs16ZLIOqePAHmD/Qq32V45iBv+Ma/8BnxgAZiin\r\nAKoqbn6Z8Og3vLfWpqlwKCuc9yeBDZTD7Y21m+F9pqhrhNH4hPoge4KnV4US\r\n9jxr9Vn/oWLpP12i6IoKRYI1rOvXfTwP2BHsjcrQ779oUEPjxYARi0QJZzzC\r\nDyHgeD4Y6is9nqXE/j3ebdpAFiXJkHFwBVxd3HYXnxeE7s7y2OQrkonAaq7z\r\nWtM++GU6SqUduA0FuLjwPEZIxyvoRGR4YQeq3PFhCkmJqCHmqfNv9v70c79i\r\nnMJ6oKoKam+PTUQZVL9soFKGx/dy0u+yIuCC0xSLzK1j1emyAdOiCT7xY2Bz\r\nlEyX6BZ5Gt9D+o/JggyiRb2L/KjHe4QE9bvQdpXqwr1+HDTCRULD2xAyztM8\r\nhOR2QxXo6JGRpz3qcrjm2a98dgZum/HsD0U7OMusAgnWMYDmj/8tWDtNi3+Z\r\n8hMtvpHLyCsg/Wl/ZvsPip7r7BGJ8KUyz/Y=\r\n=/v1a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"612f2072dea6b5d02e3672be3972e850ae95d446","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4005"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4005_1648236192009_0.5954353349063777","host":"s3://npm-registry-packages"}},"0.14.20-beta.4013":{"name":"piral-ssr-utils","version":"0.14.20-beta.4013","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.20-beta.4013","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6fb48226236c96ee5109b2d6250cb243577de371","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.20-beta.4013.tgz","fileCount":40,"integrity":"sha512-wS5KOw/+C6bdjktEV6tjS3SVXDevEyfU1lnSYSOlSYC0KNwpTaPNEx4X16sA4kd0R28KdfeqyptbRvycVK9EIg==","signatures":[{"sig":"MEYCIQCkyOAYT+Xc1qYvo7T4Wu6O1iUgShGD/t/2TNCJ4RRpFgIhAOTZzT62mQyUom+3GArkyA9Cq8vpN1shON9UKZAaM4BE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMdhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYAw/+Mhyvw1SvXGDeK4T6NQ6mFh+lx0vfpfgT5e4UfDHl7PpFLG71\r\nOAKjni160x06XWDmydGKfcASmZwok8aZGjzNBETJHkRHDmMgR9aRrbv5GTEh\r\nPJSCTNUmj0ojQuZO7P+GavgNdsFOUxmHcNJZOMjAtS1fHQ2+HUl2Yfi/Caqy\r\nQFiLDxqgEKtDYWOGEr4j6oGDfwdE56XvHxdLASR/15+j6CcC/kcNKI0hwESR\r\nBZW/fkyUVjC0G0AZ+EPmuUNWEUBiTj53PM1SHo+qAERlgTIAT4MsC3kKSxkf\r\nQ2OFq3FPMfnGrs5wlnsH7Cm1NZArX9SX5ZJbX6A1AhRHfOVj+B1A0tYJ3x2e\r\nnpIvuX0EXkAbbbIl8j0uE36kFT+GfqeIhK8K+Mc+ZCxIcUoaUbKyau8cXkTp\r\njL2GADc9ctJHWt3m/m6VxGr4UONA+3x4pHM9l2dTju1g9YzVNZoDdqskJG3Y\r\ndPtAEFV3kq0nKDHVq8VHBEWYFqfx6q/RVWb1RP0nfXs5aSknFQDI7/Q8WNgP\r\nlD1Yg7j7tiqIcI82sQTvloHgErmCUH61ozxxxNoCj2rR6xeePw1IjfXO6Fmx\r\nWI5Ldh7SMCnRsEWsMdS/aj2QAk122ApsJvOM71TfZamkEJ4LCLVyPHvjywFU\r\nofKcP+9CgbeWsNGQt99uoE1PAUnUKeVExso=\r\n=zKmO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"a3fbe2ef8cfba60b090224c262b79d5af5bb321f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.20-beta.4013"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.20-beta.4013_1648674657120_0.8470240176689399","host":"s3://npm-registry-packages"}},"0.14.20-beta.4017":{"name":"piral-ssr-utils","version":"0.14.20-beta.4017","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.20-beta.4017","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ff8c5f6eb2dff45fa4e48293716956720defb689","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.20-beta.4017.tgz","fileCount":40,"integrity":"sha512-c/T/0gcAijBp2GhTVW7tewz6ajKCD9XPz2WqKIJsf/zDy03pMIx0bMpniJPsoukIH+s/22GeHKo69I92eJu8WQ==","signatures":[{"sig":"MEYCIQCj/ApnoYiL3pnmdG3Qct8ChZSjqcLLxQeVIGm7qMqU0gIhAK/o0kS+U8romTyFvt8yry5ra3nJgW8rI//CB+wd5Dxq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRVhxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmppRhAAiE4qEp0X8vvRpWUISP9anaCS9spYqLM+mUmBjUkEoin2sSWS\r\noush1J4B/NppvA6W1/2bTB6brQDdonKFZQyEMxw0FmV+ub4GnDWHTrJPuzwg\r\n+3u0BsYB1CRtsuNpPDgovqu/ud/SxyUdsb2sAS5AjmhPOqFKho1QDuND2OJB\r\nYURxLYvx2/jwStwSpc6kPpMCskltgFP9QqR3+uXH2K+NwahEFBWUNoJ7xJO5\r\nj0jM80cltGXqqa+QvmEyRn3axgxlaTRXa+mFlAVSUyuYTKEiePkoFLX/sDO2\r\nZYMkl3CZiJ71s+bFnqubjfqY1hbdD1u3RxLHdrRqhheU+ACqXjTSshpqV+tt\r\nsPhKxYl0Z4a3cFV9FbKyklY7Izd69yBdq95M2Y6WUG29Q0GYOuzk+ul3iPhp\r\nY6nw6t2jZRSVj4uhc4xcy2e1xBXEsLoZBkSa6u+BpfgWTkzVlY+Ds2dhM6G4\r\nzkS1akXXgm0zvnKghnz8fyl5y3UeQ4VagG9wYYUkkBxP4tocdpbst6GwVLo5\r\nnA8eW8LYQXgozWNoKmhDSCHl4tyx3rXVK27RJqfpVHglfYASEzo4EoIls2v8\r\nBs7+/OaWxXGmYaTAgdQYb2xH72PhF1v4L3cBK0xgqRv6woin9VdJ6J6uHgml\r\n+a4fY2moiJ0F2TyZMwNKIJNaTtzP1kB4118=\r\n=Mfyj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"cc5c00f21b8ed4e09a8bb65b8aed04f0deeffb9c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.20-beta.4017"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.20-beta.4017_1648711793669_0.5428814377699769","host":"s3://npm-registry-packages"}},"0.14.20":{"name":"piral-ssr-utils","version":"0.14.20","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.20","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"aadbe1f6b60aa50e556c8c5e085e7c4caa86949e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.20.tgz","fileCount":40,"integrity":"sha512-dYkjHe27DYEIMZc0gMmcHRKR+TApGAeBNNxS/x611z3LiO//81ZyEgVXg5fIRfEd/bHCQm5hk0Ds//V9uWNFxg==","signatures":[{"sig":"MEUCIHnOzjgW2Z+hf0IbHm2gqtvaiTQfnEkJ/wtw+/S3OsbQAiEAszJsL5k6zfbudAuJZzGMqS2I+WHI9BNiHugnawYYGS8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRrd7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpv5w//SpVCld1RGkq9xPLiwlgK+HJUuZitd3WjQlcnNpT1CzFZ61iy\r\n3R5BbDAuw5AT7kmmbGelMV3qMgY/UjE3qA6QK74pABDz01rRBRwjEXB/KmQa\r\nfhL8v53FUXelqjhpZIfNwlAQXOTnPl2QWCTyG57oVi0s3iGaBmW0ND1LusKV\r\n7JNpjBa+m0dUGhvbbv434hlpG5crTa+3txNQ+sbCHgqRsWgekTRPUcjXuemK\r\nBiVURO7KHspKeUp0j+K5UTNjt4oHpIKLvuFud3U5QxhDEC99gt6DB/FgT4uU\r\nySp5OEZINLGslWIfUJylzpm+pRGitoWFbjZhXzJlcpfMK+l1CMYUfbWQvWv1\r\neabuQeVtQSQROSNZcTaA4w7079EKGp6X/3F3Mxgb0aYNR2e+Wl9+Yz1GZbGj\r\nNPEiX++OWbmkF3JFZJGt4OwSIbjnVeXLGwqOEAvBBBfC/QTyx7CHNIwLOuvS\r\n1+3XyG067O6iVmGQ1zRanVglcZ68aYpMmX8qSkSeIJlmVhHHZfElQY84B5BI\r\nLfCz2xeNhQaniELcP/mxletaexI/0FESxpciQy8fLP42aNUooJaV7IbybLO8\r\nLR52IamvRSnuNGnIeO1p5Rr8/urMuKr3/2vzww1Hj3SBClJkT0k5BJSzHYef\r\ngtxGg3CN7WzX564DX1bS13pbjE/ECIBIs80=\r\n=DKQk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"9a7775dbe470e2b10d31d40cfa9f286309b43ff9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.20"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.20_1648801659358_0.2688920837664195","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4027":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4027","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4027","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5f969ca25d416777517cebbdf816748df4110e0c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4027.tgz","fileCount":40,"integrity":"sha512-pNrTEboHr73lLDOuxClk+v6v2fjJfBgEBUqzUNl9cjVeS3Xr/uvuvgB2RlcYFmimKzy7CXKgM036zzAh8JOY2Q==","signatures":[{"sig":"MEUCIDz0dhyDcsxk7D4fnEULp8pfMAz4pEkYZO2zOPrompEpAiEArnMznN5Q4xe9JWqakzCdWUNX5gjCSaTyLToKyndYzsA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiSGnmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofFg//YInPbnA1/12Cx24CGMQh2rsLrJIseCEqNp7MUEPnSy8NR5E7\r\n5V8a72VKOg90wjc9Z2LAgeTv+wy8WjG2FDw5ZErTMpQe4Izdp2pzuOV4guI9\r\nfeZxPrm5cGfXC7RADn8HMTxusfx2+LB6xhOJY/xZ2JIIQKPFlt1apu/H+mpg\r\nYtY6IMzDTIhq2Dml05yK6vDu+Ifomx10lGjz322t9/UdYvdYsW42oI8HTKXr\r\n2zw9vZfApy5ePhaSDrv4v3GJhJOBwN7zTLWue8Vfiyqu8iJGHA2Q0OM006Q+\r\nbsXPcY4LgJr7Vw3702jwOuJT5kT1iZC9HglJ8rT6k0+hoXv3ZZfxYFEepUr0\r\nJMm65zzIW1y4xz/cLhvAe1YpCgmMcZ/5DdG5vW4slp1x2SoM+lZBmVoqzKdI\r\ngeieKArT4V2rESqzQgBlKEJ4lXGkyj3LtorUVKXNnFkXYzhhqdpuqTUgeugi\r\nWe2/ovXL8XPpQLTjDXaQTKsCdqY57AD8S38YcI6BATW9nT3+UrnoVf/6xDRK\r\nuIoAmlVBrkV6NOX5XBfPdfZmgqHYkXR6UB0+JD44i/sLzjnS5I7MxbqnIRo3\r\nHa8BxwBTPSZ4m+pyi45RRtnnQ2SeU3s77O+KD7+yT3vWjGu/0Wn4U+Yi7YqW\r\nd7LT7QBwcw/fLOJ99jROpifiolhYm68IfB4=\r\n=pQO6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"324ff88850415188d0015efc509346705224a4dc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4027"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4027_1648912870019_0.6698172013349306","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4028":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4028","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4028","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"96ed2187631d5a0cb5a581bdd12cf8a7e096cc17","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4028.tgz","fileCount":40,"integrity":"sha512-qN29RVF82NpqCNkZx8slSzo3/b/0DEhcDovsQuIQg0jvdt9bnvJC7rmpzyIWnI+2miLWvE1l8v58NAiHpUHvZA==","signatures":[{"sig":"MEUCIAn9He5xARUNI6OBnN6oI6y1Xy6x/e8nau47TMPKZF+RAiEAig4bDL/+7OBBNa6On4trrFlv6d5K4loTx2hCXaUsd8I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiSXgmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqK1A//YaZSd3xwJ3W2ji00MnmFfGQhccnQYSeWu0SdxXsLVKdGdWMC\r\nQuxB9zCvcKUzEKWV4dQB0giB7bEfBqi2zGkqxD8lRZSlsoXnKGH9ZTyYsHm1\r\n0o4jb1Xg99aEawFSL9ouHaGftzUD7jAKE9tjLP9rHaFxUv5onDFmEDxpxgtb\r\nSnLnRWAu9L3IfHKwdpeWuG1FztsE0+376ZBudWj3CY12CnUv0p+0VlPpUz+u\r\nRq2wU+HNrIBNaFnZIevdT4IKnBT0PVSn4MW2DtIiVr2rrUAbbVdri2wKPfaL\r\nzYSXOjXSAi1Q30BdTvhGbgHfsyTBbXATfXbk59muhHqGQ+nYdmnEvOAdpXfV\r\nxmiD2UDnxZTfq3Kg0eeRjmJixGR4EQTiG0KUzTRL6MebTZXlLkIOdC2uM0Kh\r\nHbdmaxD/oUhQSrFQ30R+jN5JtTzmb4N/7Ub7vNpLd2u+Y4k5avOQr4FlkYMI\r\n1TJGZbE7plMlgvgnI8eZ0ty8Mfr/S+7fc/aLBM9aylXA5zqr+K0XIaMjlNZ0\r\nXfJPNtUuTWdBAMMdszWIL7rUwbTH4YpMZdLMzpHKBRIJAZG5wF1lbaJRdvt5\r\nZOCfckflAwv8wjXMps/bU/Nz7MHygQrx3DzXfc30wbywaMcy6o+Q1C+M5LzY\r\n909bLQCt+U67lr1GJIxlQyViR8sfiqI+3G8=\r\n=/Plr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"1ba5128a17c1ed2276cf6eccaf53f59339888336","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4028"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4028_1648982054477_0.17803432097557215","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4029":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4029","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4029","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3602b2266e92da741de158cb9de01fe05983e050","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4029.tgz","fileCount":40,"integrity":"sha512-Ebhfg9LqE0L7Pe9MhOe47Sb9/WECndi/pr1Lhi/TKIUhqYQ/q2n0bDPZpqv8OdZHoNEYCYgFiZiOByYFNr86iQ==","signatures":[{"sig":"MEQCIHtACNVWabHGbbk2eKAYBHOyIPEvbMsfbqnddliTciiFAiAugQQ3oQwMgZ/4wbl4lmdp/4mcu2cIy7zfPpdScTthoA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiSkCyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnkA//UTQLtR5JnM02aHwN3vn4JD/KtUsDC/f+KL/OVkBMkG9ZrDcQ\r\n+QK1U8o5hFU3OWXsyKfebIfTYYVjtgaGUJ3JPLTubwEfhaL5fYV3qXD8leoD\r\ns/dKN84VAKkGqmW40K2gne8QEcRogT+k7L5IRWJUiHMTQ4+2rrxnhi98P4qX\r\nh/0Qhpfw9L+iJ3Y9UmKMJLBAoJN1WqxdjZZE3jjgoBlpL2p0roNWHzIaFlFD\r\na6fc13qn3SOjnVB5uY7BqCFOdZUl8rqm0D8Siwe66iY57Pk5x4Zyz8qiY0a1\r\nxcUqdy2MKoMFvQX5hTJIZ2fIWgF4E14R/9LWQt1uZRgj1+8s9W8VsEY/6twL\r\nxW5+PeuxzmxrQZopUf7iVscHyf3QtZxPjMSmMbNNfEIpLxqCaSjTr0FW+cTp\r\nampmz31qu8bRjResaaCZMW/EJANlCjBAmkR49dwtANL08h8lauRoAMaq7OSE\r\ny79jjgJE8VRW24WE2ydJSi1FMjEvDGMu63O4mof1H6RtqzPNOK2Y0osgFuze\r\n3e383n177oLdWDf0SjbKoieWQvkkF0kHR+HDGl2WaAXAT+87R7i4CRc8QW4j\r\nAhZvG4VeU1CVuE081WwbFmQ0ygws++OMBNWacpGe26Ru2Bx9m9BGddDDD4tr\r\nIZhkweJTJJOciFBZYtNNf5wccBHqU6/T8q0=\r\n=rpS4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"3015b782967998dbfd41ebb7367c9b4d7836ba7a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4029"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4029_1649033393980_0.6133844530481987","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4034":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4034","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4034","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e8b1c3c4b9c08632c23dc11b7a603ed3b05dec05","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4034.tgz","fileCount":40,"integrity":"sha512-7m58/F1NRd1VRmuPnt3VC2VTmjehBks5DIkesV2Wf5G0rXElSdxR9Hnv5UqcBwXpsHastVb6PlUJAJntExLYHA==","signatures":[{"sig":"MEQCIEToBNNYi1yViXyCekY2OLhptq8aMKOq9SPXWh+EllPtAiBckGnCMXrL8X3exe3Zr8ooGKgPdSb9DAIiIBx/+VlmZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiSrP1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUeg//aJP5cZw7kRAWMz729sh/scF8w2K7DIWhKAhjPZujzjhBqWtN\r\nRjSIAWYuHKtt1hAh5D8uNIlTaJDzopmOTnMvOCa6wPqh8Ix/D5AoQ2jJAi64\r\nymAcFBoNNOLsTdld3hN52y2xVwKBN4TQSzGs7DwbTRrDdDcUOI2a78iM9Axm\r\nct5swcUu2LAZ7AIG7AVq3UjKwy+RGuPDVFNNqU/H0wHsfx2IcWEJv23JuS9K\r\n1bTAAx3UaQLWJC3Th5RLBJP6qhnQFSYhqrdDssK01ahvwclcluTCJy1l38Ig\r\nh0NMgEYHIdCkfTM7ZYwfDFYKZSecZLFwz09YdrnsZfJM3pOChX50eoewEe+M\r\nKoVfcYrtF9z7u5reOAbPw3aw16AeIvs4wtEPXAxLaHzqa0HpHVEi35kdUSEU\r\nBYpsMzEjYgorTpSN8FYr2en+bzqe9U0MJ4jqO9w42G2pJgvIoRYKa48nfKxr\r\nY0lzpgpuEUbO3GGqxnqhWz+RGQ/tIzfnwq8ht3EQ1QNHoHxirFYYbe8PTzG4\r\n+DR7ODlY+kq6jV3Jwxpm2GdQ//Bwyv4p4K4KATfQM2VkXvtRlVRw5tc43ysF\r\n3TfSS7WvtExjTFNnHmmf+e3exOt9+FCj2bFwsBjGoHKFh3iPWi8xVLwreVa5\r\nNLPXaXsNFSFqq3eTiYNYaAeq5LmSxQHJgYI=\r\n=lUfu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"7f9158d7fd10d640ba9c092564275e4cc426dff9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4034"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4034_1649062901035_0.8119980310240886","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4036":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4036","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4036","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a245bb835002bcbd83807841870e2705a0d49589","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4036.tgz","fileCount":40,"integrity":"sha512-jGrHmpMCszO1XIF66KjS139j51NJU4d2d9opQqqELoO8VD0Y3M8PD1gvC+OUXAPPn6SgjLztdSycCbOo2p0slw==","signatures":[{"sig":"MEUCIAUUgHdPTiAcmHOWeAAL5ZyEjQVeZRX9ZN2Aobe6u47ZAiEA4IXjxkh9jdnnAFkqi83+j++al4g2EZl8IM5E5NZ0zds=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTFqMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrp1g//aqp0r1+lApSknGtp/gFwxf3aUmFrpMbXmumsHE4ko5m7iCuX\r\nO2VT7gg75D8FlNujIxtz0vc3jTGLx2OzBIpTUY/FOy/VJn6rs6Kz6IEHEMAI\r\nUk0ila2BpziI6i1RNetKuR5i65cDk4Kk31+u2p+bz43N+oQo5G5nUGTKcf22\r\n4tlOkcqsyzsex4N+dcgwSsYao+iHLJorgap1xogSjfWr2slRmoKQ8n47lVJ+\r\nqMYs5vExs70CnGYbDOKk9mROGBfC0FnV66/vU2f9Srh7FOqT8qLtJtr3tDrq\r\nqPhkU9MadANhtJFP0z+fVh2haEJLkKMC0rQzRa5TCkdDj9WMcmclIt+EN+yN\r\nqSzy7ohm7QR+yV1EQIP06T+4EO0e9pqoQ2gD8jbnWOiQSd1FM0gDH4uAbKOh\r\nn7Pawtq64lNRoMkevfkxi3duPtEoDE92LRgYCAUfiToOUY6XJ4046iyV2hMh\r\nyKJKOfBxAPPDyt6YodH7lwQDbsozunF0E/TH7PRoVXHvo7eBky2kzQFvqeqz\r\nYtDWDZUubTWxnePi7yRtHMT5EZdloORudT9rb5d6jS7g87OHO6kSppoNYHjE\r\nIzswaqJAL5OBk6rVxYec5YN3GCwQTuc8BFgPeAgp4QUa2rKd73yLgWzysN8Z\r\nS9RBbgFaPrhTUjc8xk5ByNBCnK5O9dIJXSo=\r\n=avLd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"5bd5efc3af82380f20e25d821a0de8a88c16a670","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4036"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4036_1649171084533_0.8529975976939668","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4041":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4041","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4041","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"df5c1ee838953de694f36f97b6ad9b16904e3bd5","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4041.tgz","fileCount":40,"integrity":"sha512-8x9NYBaU2HzxCVEUGHJ6b/4QOK5wubg7Rs8CX60eeuEQhIn17KjLxHPv0RMKjIBBSSUiLpLCll6qU5RzTy0wIg==","signatures":[{"sig":"MEYCIQCltVrvHWhuurRoOIMLYp7OgF3r3RNkbPjj8/+wn3BEFwIhAIydlL/cWLmtF20HeQIKfNVhj/o/7lt+uPgPoMgCef4z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTuRsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4iBAAkQcQ6DcMyeQ/bVtSA6dUUNGxk+Z2KDyHbvITz5cBct9dMWtG\r\n8iEvHdjtPye4NOQhfqimGy5aglz/xgZb/6S1eXALTIVzv4k2vRMRSyBWd0CD\r\naRMZwo8rj5Hvm4SAe5lCIQWzw3QgzrPR3grovdLPVS850YKc/2oxlBXLoRVA\r\nTmEzIixtY+cWqT+z4sKrjd6mID4VGnMbCDMNFUDwGRYf0gbxR6PEmxDgAkQi\r\nq+zZimVBHKSfYoJfrlc8y52204R5NGDWL/rKI+nsgFZWqbcna9Ejuu9+aHU6\r\nTv2v0c5S5XZ0KVdym8rQnzAJx9ginPIsqVLE35dToUOURSNkk1j8pOhOcnXZ\r\nyzzKaGA4yqoEHiYdoc8KVQPW+6uNYieu8P91HPpWr6ls4Y/z7NiX19D6F558\r\nsN58NPRdylqoyXQCZUQ0ZjxKN1h+EIJ/qa3LLSMaofeOQZq2CEuWcc0Vq8LQ\r\n2EZq7WD5DvwaVdg+rF0DTqQ/KxeI7RqlX8hbm0FMWegf4ftgbFR4s6lJkWEJ\r\nbPHGLo4RlIz6I2Mf158RISHZbM1ibc4LNwY/uDrb1M1ZcVa9mWX6HLXJ26YO\r\nitmzBPyDKJCsRcAwlRa6ZCEEd2bjQocY5/s7MXuHJmHbUOWSWDqfnZ/JeLc6\r\nL/HVpjnEqhJ2ItAAgH84nKic3jtAFO+kCKw=\r\n=yt9b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"3d305d88c72e3e05a44acbf240a38f6ad7b03959","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4041"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4041_1649337452728_0.6238096211295692","host":"s3://npm-registry-packages"}},"0.14.20-beta.4064":{"name":"piral-ssr-utils","version":"0.14.20-beta.4064","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.20-beta.4064","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"347099deff9b9d8e7e8dba94ca16b456440d1f55","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.20-beta.4064.tgz","fileCount":40,"integrity":"sha512-JjWXJ6Rps5VUwtopDse6s87E9czCeE1pQLXF3pKZ4jsJiDJBfwXcMVTJ80zvP2HKQvmkMPv9v7r1Gh6PcgS4AQ==","signatures":[{"sig":"MEUCIBwu22JOX5PiomUbqeNB4oxPmXh/5C38mJIrl63DygqIAiEAy45pIzVSBMcc7ATrC2/rtf4kVpF5KoY6Qrgw5Ao4mcU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiUrx3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp92g/+I3irTv7+vH23W1mDUlc3d6562VgHn3/aw6ITaw/kLQrzwce0\r\n9jis4epXWSJA/CcSX24J93Ysx3OQhVou7zFljdY3H6Qg863fIdj23eusNtHd\r\nsyVtaKPQEVhcYaYK+NZnmR1ICtZWs/Gvo/K8QwDtkE6gJ9aS/g9kYF9fZbzH\r\nt7vFMLqwgKcPn47cixfTn7qiEbqmEqdJCkqifDSMl+eEUswDRDi1GS7vVQCW\r\nbb/TayI4xpUmQrFwWHS6TAMbREJhelVSYGMdCrz75liwozGBwEdbwtKr+Rz9\r\n+7PNMp1Vs4mYt30w1/n0vEMG+ZO2zmxsuFKiBGnp73s6VhAHAwRlOIC3U79F\r\nfKKFAYunJMHOYvK1+i5KdGhS/vkMXa+ONu7N0nJ12Qo/v5CU38+EWql4U4WJ\r\npXrv+5FvBbJySB9rMy9SXnJoGj3J6dGNqiG/eaMMYSYtttBvYOCwZWd9jDRZ\r\n0sq9cgrCchfQkxykPboh5xu1niqmv6JufxuHsXWHwM68RrzfCIxpbwGucZm4\r\nqM+UJfp/MrowZusanA1KLwVV6nCwoEZi4dC8jgDCihSumx9AqWcA9c8uHxt0\r\nYAMACLh2GaFvEnf7/+bcmcpqzYV1og+bvj7O1JsXkl8Xrs6YmM94RLKWg0Tf\r\n6glLgal0I9rMLtc6dwpE4/Mxr5ib7FICzCM=\r\n=eoEz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"bc570a7fe7c77065c4afc481953d711e32c84858","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.20-beta.4064"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.20-beta.4064_1649589367521_0.138653893318758","host":"s3://npm-registry-packages"}},"0.14.20-beta.4067":{"name":"piral-ssr-utils","version":"0.14.20-beta.4067","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.20-beta.4067","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"28fa531feeab0c90c86511f3e7fb02ef7db1dc34","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.20-beta.4067.tgz","fileCount":40,"integrity":"sha512-EJOc5OjQCjmauQsqUtjyb80Uu9p5ti7FHaEEXAhBl0hF0ScDIvOa9uiiLbFGC+D3w40rdb3eycyqIaX3DzPjZA==","signatures":[{"sig":"MEYCIQCpbWDrZaEpGbNQvXkVsZdEy1Mqkhj5He+Aghg/BKYvIAIhAKVmaKKfu8ke54OST5qmGXxJS7vO7Bv6ePxNbfj5HZq8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiUu7uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq32A//ThckHM+05oi7EkZCpjdQFzPYhEo0+KJTakYpegRrG9AiswVE\r\noMNpOjUciTwYadw/v1qFjYEFLtW3vbzsiF0FWQvNAAz+irSP6R7ihxEnBKwA\r\nizNZgh7f1krkwRsyeDsCe1Lwyly8NqNDufQDTmlQ8X95i+aIT8EBxm9NYlfX\r\nEP5HRY7VTBT4FO9Bzvl7raus7sb85KzcorNeDdYLkeKIA6qYZZIQcWPSi/Hx\r\nWJtsCJE+X1ypen9FCUiD5eRioFstb3hwFPZMAKALbLeLW65dUHDBgv72d2ZS\r\nyMTt1wDsn7igi9ujnGN0/QRHjzwtnCBXxtBIVSLYIGrjtaIRvBWmbWjD5H+r\r\nSwSLfSEXs6f3bmSjB6+jdqxYL4ZlwGLRtz5xbIiXJOfCuw43wdTd72bNVRfD\r\nopkeYDnsCdsAAGXgexghDzTnQsTufmGGgXbDSXxhHRGbfHYxnkugcfFFOiNT\r\nzpkZ9z/1KCJmsltGi5w+DG9x7HN8DHYnATzJB5fHoAHMRfqsMw+t6b6P99al\r\nMGqY/eoVv/VplacVrCOwDH5RMeovQmEmqncX8zzUNwF+uyTzAmYB5KCl+iuu\r\nIP5JT2/1fy6ZQtq5P05nqpYSYMoAt71JAi2y5Aahc8Zfy9TaeRaqoAeVV20V\r\njCgO84wLJuyPIl6de1PaoDxKvbtt0Acxl8Q=\r\n=KvnO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"5b43da5b2d6fab54ddc757fc76e34a603e3d6b0d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.20-beta.4067"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.20-beta.4067_1649602286414_0.6675658468498062","host":"s3://npm-registry-packages"}},"0.14.21-beta.4074":{"name":"piral-ssr-utils","version":"0.14.21-beta.4074","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.21-beta.4074","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"083af171c829b65968ade26f17f94a0c0108e9e4","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.21-beta.4074.tgz","fileCount":40,"integrity":"sha512-lz9BYOgXD8Kv88mgneyRpPnxRv3IQhw/7NbWiAGmoznMoAD/7Y2KOuwtW4Hht29mVSfu+LoUG9Cdnc+8hZp3/g==","signatures":[{"sig":"MEUCIQDjaR6DXXvPG+LOhWkZB7WI13rh5o6CWSdLC1/Z9SP25QIgNz3RKmNpyZPNbJfKZnXxYR8sJ8aPqLIeLAxXGj38YK8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVASWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmriqg/+JVqNUMo0vy0u5feOcPB0b48ItKmcwhH0YL8KjdSkUX+J1OSI\r\nvZm0WPRuEdQ3+E93cOsRhuT2LTBNOm2NuawVPbkRIp50CoZ1FXkm436c3bpq\r\n0DzlaOlQafbAyBIueE+7sygXC+Prgp8CfWkNazx0DNvflyykPe/eBRV+kIDN\r\nELR2fOJDwbKcUneaOGvyYrA3vp2INfJFiQQY58IBupCxgy2xu6AI/ShQ35E4\r\nj6F96P5VfJHKeWARPHlK3wIJss/HtXcxWIqcCa8SFY+x1ZOO/1xFM+9Vc1m2\r\nmERZolv5lRXtuk4XOXDZF3ETeY0MYRKApioToSq8xnHivauzHyDeRNb+TX21\r\ne1EdCYPw1KjVWDqt1+8Xr5kCf4+W/O4ErPEL/BapMCtYi4Idbw0oq2g1uHb4\r\npy7FzgreH5/v/JHYWfwzsg/v5Jad3a8iTA/zgpOzkQVAxYwjRSdmk2/5s0qL\r\npLzd3480S4Bz00tK2QsmVy9H09ux+zgeW4MQgEdiWeObGTnlMeRmULpdqMWJ\r\n3RHVKCxEX3hXeR+Gpa7vFXdN/nQwJEKhDnqW2Ybyyrj/i5VDi42uVCH559Fg\r\neBD9DoIxpCsiFY1OuBmKpLWQbryoWXPU7hdZ0ExsA3HfYUkQlvgDmAwUlFaS\r\nhabMDozTE8PG+7yzcsWNLM3sxpMbUfOWXVU=\r\n=JqXC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"dcc8d22f7d2b122da4cd1038cc57771089694c1a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.21-beta.4074"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.21-beta.4074_1649673366418_0.36895929741049005","host":"s3://npm-registry-packages"}},"0.14.21-beta.4078":{"name":"piral-ssr-utils","version":"0.14.21-beta.4078","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.21-beta.4078","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"773d13ee3ddebb9072ce3cd57b5f610de066613d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.21-beta.4078.tgz","fileCount":40,"integrity":"sha512-ndqBr0PsoB/el1UuhbrxqyRDeXU8vFI6B2JFEd7E03B3/cTL/I6aqp3OWg1VnEUi1JD+onQxOJ0tvjP4sSI+Iw==","signatures":[{"sig":"MEUCIDxLtqCAMyDCND/T3iuJlmdJzj73xVcaCkiFiXmlb0uEAiEAruhP6TnUb5AvT2KYmsc/FBzcEEza6akv2UEg9TDcBJg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVGA2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/Rg//R3tvaYJDSh9qz5G1lVDPi6w2kz7D4N8HyGuYzN0HTe+GU/B9\r\nuKKUdJN7nKAqYUCo9iLNAn5MCtLQC/8R8UJO6/UlFAdqd9d2YV53QmCnKA6Q\r\n0+5ngZ+52Qg02eHlqZjp0HBdSNTExEYuugdDe8hVsBz2FUZkXTiouJheBrLM\r\nsTOvWV3lUyHlMhWQlLMyJyiqtKsMFwgP4f74UpcYOW+xZsmgRWbeS3G/oF3I\r\nSizReoCq8jVQ1uDKhJME7jodUG5IReSvYXJWzva/KT1P3c0G9CWiEkGPmeZn\r\nw4o8x8dZlIiEAScwbNDQMnKSKgNIWB48cL0SuOIftm3D8aeEhrMf/+6pfI5w\r\nf9oAif6P43Px+Xr6zNhbanPl6I4hrzvcgiU8LM85TwlIiAw/CcIAbLyF9fGS\r\nvmTMiIUTc521+HyVOOjpQ5ajiKizW/veBgLVhE8BmoAnPvKs7lunPjHQmBkn\r\npGprC7I5ceSXnRTpNCjIPWp6Lvvex8aBwHAc8QWyUKzgM0HDZvVxDZtI04sP\r\nWpDBenTLI2bpUoqkkGJ/QOkuDqFvifMLmhXIZX2S4GNkZvHFDbovSVoIqBMU\r\nO5QWwqahzLYWbBE8jHWe8kmYdZNcLHaAJ/Rf+svi98wP7WHo2VypIF7mMc3B\r\nMZMvUOjeT0l1sZbz5xBFiHaz+5NRfW7/sdA=\r\n=7qYt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"d749c0bccec08ba46738559a398f276d4adff221","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.21-beta.4078"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.21-beta.4078_1649696822228_0.5069236442598843","host":"s3://npm-registry-packages"}},"0.14.21":{"name":"piral-ssr-utils","version":"0.14.21","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.21","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"45f2e2ce3e410ea91e3802acfb95cafe48b069d7","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.21.tgz","fileCount":40,"integrity":"sha512-jM3Jna54+8OSPHL9xMZ+BACVVrXHzWJ4uA6jyNbDZZxMl3K48ovTZtfM635ZrlQA4r4n9WDuSwrivGXQyXeltA==","signatures":[{"sig":"MEYCIQCHacY0Qv8DZhkwHpXjHLgky1NfaO2fD24ISfKt9PiH/QIhAJUxQjQU1p3LvKVCiH31/QbBq766Wpmk8jaLz2AR8Bx2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVa9IACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqOnA/+I4EyURzrwFN83uaeyxvGoCAaw8rs7fEUBZEm62whwgVWBJAl\r\n/W4L/YrMuK9d/TDbSJbRXr7rPDeRzEp0RgRzKv5urr35o7gQuUFZp9lIckB1\r\nyAhfCv+q/YO1KYCdTUGLPVjb9ywslz3Z27YS2u/1+ruDYhOM9gvldHupioy4\r\nGIJUYRFW7Zl4vN8AkABE7pCfZ/wiJ/sYsMmmAKT6B/8GVBh6wXGlkyfj8I1H\r\nxfz5f0oT39TsoR3D8agubU/lMDc4/KbSV/Mb5uGWCUVRJb7V1GelVLdQMm39\r\njYSHGWGP+u4iJRjWfD7KTqroVaxGAfPJt9TlVITASKuddDbv11zlWL3hrCfL\r\na9YDWuotUf2h5sDbJ1+0sOLa1uFB4K/K/mVSf48U94+XXG7DSnHgwcRzCOrv\r\nBx5vdQ4FqXkare8uCA8tJCZZmNXoNqWlNN47XQYC0kJEhq0qP38KIM7XqCgB\r\ncSoIOazGBjFIKa3CfMS7xYbtWt0ZGiQIikAxVY0YBLrfjNzBQ/StUy+XtYUd\r\nBkUsvRtPEqF0oChkuYe6QG0+JG5nkCxJypc1GUggino/g3vc0aQDu62VRu7z\r\neCNHOZeDTD3QDdIKGK8VKHZfpuKD2MgxM8CSJhBwQDVn9dD8lP/Na+Z9upPS\r\nH0sk+HfsBTX7+N75C/05oMyWv0g5rIzHnMQ=\r\n=/zZZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","gitHead":"28d12711859b01c425da9242f08b6a7270cc3686","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.21"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.21_1649782600608_0.6463268545877294","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4098":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4098","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4098","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"efd7ae95c0c101277cf364a16152d611e84dbac4","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4098.tgz","fileCount":40,"integrity":"sha512-moeakCTF89SrOj9bVq8Hln+aCQqk2VkgN8Q4wsC2q/QQuYu+WopP4S5fOGvys74tesYl+Q/PcB+s2Fx2OmEe+w==","signatures":[{"sig":"MEQCIA6KONb+QlXALEH28fG5vyQerMziCLztyTCfGlxyZqFzAiBQeJLbjfz0pr4epROYE9GYqMbAaHMC+FEG2buYdsMNjA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVuqNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHShAAnKihqneDmeCPiwj6tEPsxjrcvN0wJ1/iNDQb+q+aJ7N5Ryic\r\nVgLYetrQgp04vpvFn7o3ihu3fOtfVt4AhCLJdBJwZ5rsdK2Vx5M1U/XVeETo\r\nPXzxGN5HUNA8dMl0u5VHMOlTxsXrsSoQ+bxn3hIYFs4bMAy3rdyWycwM7JQF\r\n/NNcMfVfEfEyQ4n8jFlG2hJf1NmycQcPaOwnF2b6K/CYu6Z47iHdSz37xuXR\r\nmk+nUes8G+cL71mw3D2kaGMfH4ZPstItWQIQNTJwE7PW9D3nNmu9RmpMdTMP\r\nfOWI26tjv5K5JGCGbF8kOb2e8TLSHyAUW73E5xgOfv4kk8vehmRmUiI8txZT\r\nAbOcS1lTn6//g8dQtUh85kKcz1IZEYLCm8Y6PCXgh4/DXVnkLY2nfsPfY4MF\r\nA5Fna+nL2ERNMC7hI0KmHK3ii2O0kq/9RkozPt0favP1dbujbS0uC1t0GEPN\r\nn1PMxEP7STgfObDYLhlgjrzM/7uhHfv6qGMWkm18MkcB7yPVRF2JytAiHpKa\r\nVje5pAGtgGGZpCg/l3bTR4AbcuXilb+F08E38doVc5MuJfN0WoHVwij6Dd8h\r\numSXta8YOUinMEPsIAp0AYNXnoCgSHCutsPzVD9qJLjKrt1+7FfWEQvsgRfi\r\n6t9Z6GR4M0aPF8Un0Fl4GnFzvt5IIQJ9HWw=\r\n=XjHo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"02ef35574b29cc5dd93c515bfdf27dd523893b28","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4098"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4098_1649863309468_0.29700426432993776","host":"s3://npm-registry-packages"}},"0.14.22-beta.4103":{"name":"piral-ssr-utils","version":"0.14.22-beta.4103","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.22-beta.4103","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e92764f97b4c6fa9189fae2e246287b84af1c3c7","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.22-beta.4103.tgz","fileCount":40,"integrity":"sha512-nYyDAiwN9Gj1cEa/1e+L1/J2Q85vzWyXrHUF+squiUn0mRUo1RfYTRLeA6Wz2xqRr09nVmMXKGH9ldLPSW7RNQ==","signatures":[{"sig":"MEUCIQCQRMXETxW2+IQ8IzSkJorNH8sp2Ww/CXhYb23Tskw3GwIgZ+9vMFosqc3iwxrAONetGWQ90JUaroCUyqQiYjGDmco=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXdqnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqTSA/+PZt7Jmd7Ptomoj859J4W6z03sRU4s6OaLgGcIV9LfGhY2iIa\r\n1VgGMO/SWDa0GRywqywdVxXg1jpaEJ205Azw9R4Ajdg4orEWAF1KKR81A3R7\r\nP2ZyaMTfSFU9kOb4yf0BvK+STjoX82TAYLFNDSPLF7a3SiXIPNWflPp4S2Yg\r\ntzV1lW5aaKN3xHC4lMiPPkqtGlRjCPOcKHKKZ82T+1BonGFPN8qs30kXyz3H\r\n+xiBGKg5QjBjcxGgTdA8OHUGNoHZjrh+UNTeKdA0H256mrjtYNb4xlnv3CZa\r\n4U5w7o7NjgAYDeZs7wV40/YVA3avgkkec9ptxEHyBV59HNU9opsScbF1W0Ez\r\nF6spj7XMM0sTS3A+AxDc2Vgzl5aKc+ZXwgzjIzeQVKoPxiY8ujj8wedSWbEC\r\nk6uepyoo6TutJaQUmRIcD5AAkEV1InUMg6pUd44oeITE1ZHGSsRIn7y+bTVI\r\nFnQsXPVj4FZV53mMNiHN8ge0mjGpaZWLPsbugkRLAyipvAiNW/LZLHOCrZFy\r\n7xMTq7ITazMFsapQXWyA+DGE6vqEncepO+oFcTHyAbleWrw/xVtlK9n8UTif\r\nv/GSUPvzvlqy/w9eR/Ndnkt1haskidEBdkkAUPMxK7hCZFKenNG/vbvzfWMs\r\nwM7rARhsHf9/OIlI86pvilhrMUVeDvvCUTM=\r\n=CWOj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","gitHead":"0c44955d9c1d88a3b081bd779a2d60537ead1abc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.22-beta.4103"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.22-beta.4103_1650317991130_0.1306009589688264","host":"s3://npm-registry-packages"}},"0.14.22-beta.4113":{"name":"piral-ssr-utils","version":"0.14.22-beta.4113","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.22-beta.4113","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0713d9bf3ab765657bf9c5ac013d3c5412a81741","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.22-beta.4113.tgz","fileCount":40,"integrity":"sha512-8Wlh/RWRvV+83RyLFz1FY/W99FbwVIUl8rmpehFYG20aLa5dROgC5stRtypIwnOVx4PKfyFzVL6sw0821NVhNw==","signatures":[{"sig":"MEYCIQCVzk2katVBIusHR3M7j1kp9998BBDwv2E3+s1/pidiPAIhAIVc3/D0WoWfZ4KcuM41HzDV0P9l+EH4rZKpkoGkBJHV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZpuzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqOBA/6AuWx3xMg6auCp1KhLfFpNrUOHj3dNtZFrRb9Xh1i6/JDuYo+\r\njfoqnPomIBQZuCD2Sqmspc5+gaYpsv10EdCkP8BSDpxLEMfTF27iz2FaGpJx\r\nI5rrm3LDmh+g/jXpK0ukBq5jBrxLXitYNLCOJKARjBcPBAt6eXMybekBN6Ey\r\nPBewFCF3aC2lQqQw9XN1i8h9E+tKbG9aqkRkORW0/Vd4GUvY/fBtrlG23ZBM\r\n6w3w2yo5SiQtiAY/rbUlcbwp7z2rvnN1tA1cBXXQEG+o4wSHI+po1vpXRIUp\r\nh1tthG2UG5JKQgZolwpboFhLgSazmWdQap2Iy2I0rUfSQXV1cjnKl0jD3wVP\r\nif5qlIiaE+yksXbeBjvkgILcozFpsjbN5A5EFj430P7ejfkyKO+0wteqfccX\r\nhCJh2EwnaG7xP8bJYcLcCiSz+wl6BX1hBbmfhthOWpkDxufzFXoZbPRcsRcJ\r\na6o+Vcy/gGSRk7qkLU+m2aHlDCSMHK/HxCZV5F3LEVuqAZ7UGvkQ438oAcGO\r\ngElISoRqLMxF/dd6z+Ml11YYNIkTHLiNeO6a0GhM3KukQsGCXj5fSPzhrc4s\r\npQ2xFiljnO+1qK0jqzZWStX3hpG/fK5PpLkybnu/GgQ2emGuHDUN1+CwIlrf\r\nX3Likba7A/njL+y2bSgbWMpApZMU7oLdwrI=\r\n=2DOJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/":{"import":"./esm/"},"./lib/":{"require":"./lib/"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"3997f0175dd1e48b0fb0258468d094a7f97d7f81","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.22-beta.4113"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.22-beta.4113_1650891699326_0.6592892991179553","host":"s3://npm-registry-packages"}},"0.14.22":{"name":"piral-ssr-utils","version":"0.14.22","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.22","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cfa69cf31405a693ed4f48945478c74a8aa11cfc","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.22.tgz","fileCount":40,"integrity":"sha512-flTKLrLuoVtn0s0Cc3E599B7n8t/w4lN64kwFsnyMpN2bCWZx0e0kvZVkYGQgHlCCvKWIvjMZxbs3y9Bmaze6g==","signatures":[{"sig":"MEQCIBZKcMRIguGT+SZjQPkra7qlP8mhaTKeWh+RHQtNuAAYAiAsfT746WhKaMRzLCLo40eUG6dq6baXdcBm08t41/JYhA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZsipACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoKwA//aSMBkdZs5hGGu2QryqYtniPffFfCnG3IWReIeQBZQuNf+DUl\r\nBlAD3gttK7tbI1VHCgbUpyuVFFAtkTxEK4dwuJbY+GOcpBILpfPq3AtXhbbR\r\nyHjt2cJ/2G0V7CGLfX1UXBhogXAoK3PTjHSi4cOtWWnWrLh7RQQx59ysdzM9\r\nznM7Rq33QoaH47FtaKmJvy+Qsklc7nhR7nLovtEyXfHXLMPVPhrAUCP0hCkQ\r\nc9IfYHRtGj1kyUjaOqDkUAXA04qcq444f067OeSpFpL0dp5Zn6vG4QkAfMVt\r\nP04mKIjI79V20JVsgM5nTqdZ8VmEtpU+frzgGxNigmp4hewRbkFF8r2SeLfA\r\npc00oVph4YWDMMo23HGpaLpdBdJbWW6P0jLBkN4zcHFnSgOMn2Zlt2rW5sTm\r\nvRf8Wh2weD5cVYomcCOxgfiRSw1DozV6C9VmUEOrTTRQ4H0PmAXwReT7fXtm\r\naR/djA5mnkvjrSJHwAOaylqFhjQg7PO8i2ZX04zgpIUM6MCVp8dRAYt/73Fq\r\nho2egUDU5GhtkgCWl+EEgM3vNEtsQN/GYYUNCYOMhXJWAA2mXXxdONBHWg3+\r\nP4qHx/ybA3Jr1T+YhkBtlqYX9X2zWzHXFIVx3yp1W3x3tRMKGmtQIPBHT2j5\r\nY4eNg5C7iRDDC65R7enJJQS1J6k+suLjww4=\r\n=3ER7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/":{"import":"./esm/"},"./lib/":{"require":"./lib/"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"5b6e4ac5e478900d398c71adb6a4af9fd35bd1d7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.22"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.22_1650903209297_0.5432245214158344","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4122":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4122","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4122","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6512a7ed8559a551735958dab4da203753864afa","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4122.tgz","fileCount":40,"integrity":"sha512-bjn1UOCmEc3Xunpr9esGtg5VnPxseZSB2n6u/AZtvWvucI6DjBsC9ktE9/BwHYeWYm+WZB4J73Cn2IkC+5sBOA==","signatures":[{"sig":"MEUCIQCMwEn934zr0ZNfoP5EOOT6PfnhKRvrEXReWRo2FzhxmgIgF19PTqE34YlzUTDSXf+97W+rvJx+38Wow53/PrBNEow=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42375,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZ/U9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqizg//WUNZeTaXE9jq9MAgVqdlO0+Gso9ORCYaNmt+AnMVsOtxQZZc\r\nV41XR4QbM4nDkVdgYSqjdGfOriQWNR+V6MvxDd+2qagXfLsGFik72ROKoO0s\r\nVLAXU/QiGfrlOzGWEov/0uDzhpPcJeIiabz1f0yVirnnnsKE6oNttHPglU0W\r\naeDbcy0yczHsshFcEUO768etJJU20k3oSKZaOmkZ/+RwzdD6tyOHWA/fy2kR\r\nuMkkp1upYr/lQyhUGGoMzxICoStJ25olOAxRFzvpr5ZiYXDazVAeFtabLiVn\r\nD/FK7zlPi2lJ6ZyxiPqj96TmTl8ZRVOV8VNc4Irp7iJ5M9k+RIwMhH6UbjHR\r\n15RdzylBwaynM4fqxwD/nw3c5rdw8vPTH3RguEZNGqVYQ+tG/dMlWQG2nSZi\r\nynO05sPQgb/QFuIdr621HTLd78EQPTp1+PrHCQmq1CnMs/+ve+EOJPMtsIvV\r\ntGEyvmcV4cI+aeat67a/uF824WAmTPfTqLGi1XxWbnY+q038VtMkDBhInzNG\r\na4hTNwSlbWMaSf4ZocD9v5A/RXnDWF48XMReYgmJv7HOD7NNDBL/OcuKif82\r\n7TBAlNRMhRjyabNfFCmELQ94WbUndX8BDzL4y07bt38x+eWr7YmhrXS+8uaS\r\nOTBVh2uagMfGXbpH574tTSWEUiekD4NMIXU=\r\n=laQS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/":{"import":"./esm/"},"./lib/":{"require":"./lib/"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"fa0957fe7dedebbbd97a530e518c1a2b7754d475","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4122"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4122_1650980157210_0.1624055196020875","host":"s3://npm-registry-packages"}},"0.14.23-beta.4124":{"name":"piral-ssr-utils","version":"0.14.23-beta.4124","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.23-beta.4124","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"be7a6883ea3b86df40be34ad4863782cd0a2d1a3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.23-beta.4124.tgz","fileCount":40,"integrity":"sha512-XuWvF0Gcupxnl9xbbYmZZOp7eTcRCzSvez1Bxg/M2s/WVbXsoXzlTBQGxL3JuikqrEfShLnwcpiuFrICCc9Yrg==","signatures":[{"sig":"MEYCIQDYBFDzjy6yty2ISkK+gdD0Pd830tuWp2k2lMkw3XmcCAIhAKUOpS1WPTLLfKtIFU4NRKyQkzXX0kBX3E8/w3QupQs3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaV09ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrKqQ//ev1HEdMUvVP4RPd2RNGfB4HwR4svEmcuw4phZo3Rcn3sjCiQ\r\nSJ22WbHH2DWhXd4eiIKDxkTcPFgx1g8HQIzEPiDPWHAjHJJ3w5FiDD96IfNf\r\nBqta9JBNEyU31XbVY1BGgsE/OqwriYWhtWhavlBGuqAfoC79mgIe+mb9/ags\r\nGNERm25R3Mo0pzMT3T4gaCQsjLJZQQKBlwTGROI6uayjIeborGg1pjqiMmC5\r\niBOH+q4Do7NP1tuZ5NEdbmIGVpDtO02sRSn3HhI55u9jwX78iN0AcMSTwcLZ\r\n88ccmeMG3iTIhOg8JdMmnEr5u/k8MZDuE75t/YLXCRK56sha5ZTSjzcCIU0k\r\nFo2j9bqJRC7Cu0V44IYI6KiOGG7+tmVmEo61OwVkI1RH6IOIPiAkhoZO5eJT\r\n8AMPZqhXxEVXIQEvXFzk5GJSlArZd1rbuK3ECnojIOk0o49b+qqTSmuEi4YI\r\nuMC7+HGYXxBdB6tyDp2yBeNVPVFTT0Ui1XnbMAvLKeqNw2NQmze16HhXJdvt\r\nfvab1XX1CVK+WwQZgofmvs7hUcJHP5bIr9kHTcFOXlG3Rgi3nsfvs9FTb8Ws\r\npBWPEfKo1rIBGUAeBF5QvCVfejHDLScrvWng6AhD4aBA59YyK8cL10vqSzD/\r\nyeBc9W/jUbLQoFBONMriMC1cTPxDyhftCXQ=\r\n=Xu4I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/":{"import":"./esm/"},"./lib/":{"require":"./lib/"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"cc9d2e72edff0faffad79f84d28a114e195461a0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.23-beta.4124"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.23-beta.4124_1651072317812_0.9239046093024061","host":"s3://npm-registry-packages"}},"0.14.23-beta.4129":{"name":"piral-ssr-utils","version":"0.14.23-beta.4129","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.23-beta.4129","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"46618f8bff6f8adda5ed66a72dce86d6afc16c51","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.23-beta.4129.tgz","fileCount":40,"integrity":"sha512-LSgq/v8rRAG88wBAaoCQ69r1+KVIK89oWPSNRUpPZxuv+DXpOL9csObcujRRur66DFW/I/MlG/uBB87Mw9CfaQ==","signatures":[{"sig":"MEUCIAVeqXV2ZAp1aKt4LFbe984aI1qYaaHylak0rdhLSgbyAiEAnUyJPz+XzLUq43wJRskUu1qhwSGZQlMhEzqFnlxI+Ok=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibPURACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqXuw/+OVAwd4+M1Xr4nZQW6/dtHZ0mMLGKkaJ3D5F0nlT6Tu+HwePt\r\nSwYaHrEpNiTskLrbLUZNF57UcuXstJs/z3sTBiPh5vIsvdaHB2F02V/sae63\r\n2yQU2ae3OUVyDgRJpzAl9aMqDkyC+cPV+GCD8WfxsF5YqqwkwqKhw8jwpzMH\r\nfYj1YNGRcakV5h0QjrovJSQZMRvcm3gsWmeSu2qwD6vmsxkOBshKkLmhrt1a\r\nd+g1v1A0fv/iLrQiNhxMOtX+CvfHWd9WslI2TyBjvC7Ey19UpD508P70nZ3f\r\ntxXggRggSAGQEOHhgMI5/nyIYZHWmviGKd4jRdrgtNYEMpeCTUYBMoA73sAH\r\nVcPrszb459JGNN27iYUeTtwsMHtlO7dFHJHCxC0H/g6yJeklIzR5+Z73VJeM\r\n/MF0UB1hkqkPuqC/aFaQI1a0QmFI4sqUlct+26UJkXcu7VkSnstSlQ5R3Zcl\r\nvOhFqkwgwXj+kadsS+MuC618dkzC6WtEH/E9W5ih9WXuNXofgSGyJPN9Z62l\r\nhsqNu1kGcod84sGLeS28K2hSxmWZeiPWypAw6i2S7q9WPG84LN0FO/wnk7cX\r\nm+xVQd+XhC+UPK0t89Wb8H74jKi9t12NC46kxbAxCFa5ElBvwtp8kgu5IxHL\r\nYNnROVw49k1P6nWaFjIPIFG6gASlI1A4MHY=\r\n=Zt+W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/":{"import":"./esm/"},"./lib/":{"require":"./lib/"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"713afe482d732f86c193c8defdc493d2f5da9b57","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.23-beta.4129"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.23-beta.4129_1651307793041_0.1289584837045834","host":"s3://npm-registry-packages"}},"0.14.23-beta.4131":{"name":"piral-ssr-utils","version":"0.14.23-beta.4131","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.23-beta.4131","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2bc0f287393b713afdb6ebf223e079cf8fda23a8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.23-beta.4131.tgz","fileCount":40,"integrity":"sha512-N913SeMOxxRi9JTpQoMEst8JgURtxjKa1U9f96Yuqx1KEOURjyMZu8xYAXDd59Qrt9VUim6AA0Yt1/PiBOvRiQ==","signatures":[{"sig":"MEQCIHw6SO4ljz7j2tR4kGgUaJEOcRRYxLHz1CALRvil689IAiArLXyIUKTM/FHKVlt5HD/kxSeKnn+0csrFagMzOJTYIA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibUn4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpRgA/9F4LZOWxaX9IdEVVdA36wwEWDDUX2ti1hNKev3CTqxmqrN0p+\r\n/MXq4W+iUYFv7Lgl6+69tFoAE2lqXSx9AJmrlj8JYWXaa0u98ey/oyw5LRDX\r\nOdQx0JAKHN4b5TfjJ/WvLGaiq6H3AoQKGYVACnQ/FPEM189EtNxkR6h+L5D9\r\nJmPgHIMIHG3iBaPt86KTCkz8HIyTRXxb9rUQUtB8P14U6n2w1jkAo8SdZAEm\r\niSXoqfU2Srqf9xXd70UgEqbw1ghhr7AoajN8dtb7CQcmr9JC2+C95iPdh8zD\r\nHhoX6akM582FsE+oJjl8t9BF7SKbMkPEa+ip48AhReJVmqImZRttdKMbsFBt\r\nLdZNlPUR80DkJPjuFiHT3GL2H3w5xKhgiqKe33jODdCqfeX4o2nOCqudT5Bp\r\nTR7KL9Aj6WesP+5EDlnPrJehEqjzVrAXlTG84qSVhvUVfnmND2d7aqcWCAqi\r\nTVcHzqG3GnWE0p+eiQj24aJ5lUXC0YmFB/gdfffs0ZoewyKR5MEJBNAOPGvG\r\nXKTKkcxS43mKh1x+ykcn2yTp1yVv4GPMsLs5l7EGpu0tFH7Lg7gG4w2gh8xB\r\nX5G1MFkDUWaPuIyUUsOmmhrKO4LL+IDhoyeygbwRGFlgrNHtDkskvhIjVMS6\r\nDmCT29AG/QvRpJUdxFk9IpwxVSnygg49Ehw=\r\n=aAtW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/":{"import":"./esm/"},"./lib/":{"require":"./lib/"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"94b0dd7a96bfe2c941b7130ad735be8ea253b052","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.23-beta.4131"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.23-beta.4131_1651329528641_0.8173300933103698","host":"s3://npm-registry-packages"}},"0.14.23":{"name":"piral-ssr-utils","version":"0.14.23","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.23","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1eef426feee34bceb4d849525cb57c6c35eb28ed","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.23.tgz","fileCount":40,"integrity":"sha512-0CkojjuGfPvlzIc9x3KxRHujsi6TUvrqM9oZ2UqIfnMPrw2pxH5soqHVlp4vsD9KYlN6K7LoVOjqZqUyZyN9iw==","signatures":[{"sig":"MEYCIQDTtMYyvHjPjWPMTXqS1hOFl+M4+vUVx/lsyDiPh1BrkwIhAMZ2oM4Ma6SdMYkCg8QpIK+5t4M/E1qu0oeOAOkYZGCD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiboJ2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqtlw//VeCnNNPX+BFzkLzY618RfXbzuUJTtCMvdOfyy9RjRl7QwrqS\r\nGrS0H4eN+X2zs+VxobexHu4R5casNegUvcpbGVBYs/9fJTwt9BuxdNFt9pwX\r\nYxDHlQv3c3P+cDPyb2UVorwZkfOVSPUI4LP491hZno4kO0by24FL8T115OM5\r\nPwfIpVJzH/Ln9pxnaLd0YJ3cvohd5bc7JjPox1tL1+ukYBvmp51WHPMfqck5\r\nC0aE38vQK7fWATJt3Y05dTyWkw0qfwrnAzTmaBPPJzVRemppj/TqE+BM0rbp\r\nWeEamUJxWTVFfxCPDyiZ/nxUEQuW79ylnZsNHekEr4qWXRB5Qhxnxt/gBEQC\r\nZLbDQAvu6dz7oZ9QbnpR2dLILWQFytZ1wYanGiwaUS0q6maFIBCCvnZ+LV6T\r\nHMBvpaTEbE9lV/gztCW+TCgxkT8irQXqo75gx8Aq54bZJV+jKKA5d/i728V1\r\nW+yaWbuiZ0x+rtBYQN93A1TxevMXDKYfq2tt4JBUteVO8BfyKJyxwguhenMw\r\n3MPEsJjHLKzjQDtueUxqzdEKqjjEQ7Sf/h8RGFz0ewc1oEP6vKCbBveF/e9T\r\n5WziO9bjrAYqjoug/pxyAJ2I4jOSSY0cUwFDYvIOOhoYJTmAYfVVhjdVjN/N\r\nyMgj5yz9Y31P0IjytGoXhMwalx7uruPogpI=\r\n=s7WL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/":{"import":"./esm/"},"./lib/":{"require":"./lib/"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"a571cbce69564b5d69a683826d2f83a9cf036fb7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.23"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.23_1651409526137_0.7631969467884769","host":"s3://npm-registry-packages"}},"0.14.24-beta.4144":{"name":"piral-ssr-utils","version":"0.14.24-beta.4144","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.24-beta.4144","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d0cefe08a8be17e7c81ab94f199fee3e7908c9d9","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.24-beta.4144.tgz","fileCount":40,"integrity":"sha512-333/ncIwP/x+wCdnMAxyRrR+Wjfxo0wrcOzvEC5Zo/vv8xSZeaJT8uSmsiPtySO6mbZCvzarXaEHHEFgDrk/dQ==","signatures":[{"sig":"MEYCIQDYj3GhVeH72rEwjJi+DepFtC/lamFh8Dmv8qg0SYpeLAIhAMk6YaTY2SzqHBu041NL5wcuKUr+93X5DObUmUY1Kztt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicnhLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmocFg//XOn7HEgydvAnh1RTLLKe3H4hyZtbH1ZF6lR2/kgF/K7zZ0h5\r\nypU6OY0cS5zg743iQGkVMpMfrq+sovI/q2ciYHkpJwDMJey1mHHZPAbQAcOT\r\nDnezcjEIQMc0uYX6B1aCK/UhdHf9zP3gmtIFdTyUBdzJYaMZgXIszqY5kGuu\r\nR3aE8SO2lLV+HNoU/0PbzLOusbQq3WTpr1Wgbg0QXL6Ycoot6pUJZ4vzoYle\r\n4Wa6rN2A21v9bpyvSY6vYJVlfDq8cAdej5u6aeNo/OAZVyympEFTN3FgJiyW\r\n5TrgEte4C/L+HA1XRyihPybFMLswDx7VJ7D03eLahF2DQRwnqeaA8i5z7SB7\r\nvXQw4cqYCYnV1OEmXphopMZ7lfIBJxK7Y8/B8eYWZlxd3g13JUu+zN9zNW06\r\naw9zCMXh9Hh58jSDNKNuAuB7hGg2T/H1jUlbm0tu/LEJ/XhIACHZ/3AAjTaR\r\nwng5OeXqQL8dghbCWeE90WYXG2xReQ7J3qAExcLyU0iI23ZBI0joRUs0lAoe\r\nKHENphROz++iUH11Aa9NUQ70wlc1gAQERrAs48sQtwgjY8V+nPrUEugEM6LG\r\nfmgVUgkJjZ21MD94UrJdksxZ/RvMSRJU/UQvCpk0rOx8XMgjTDzQjBN7ak20\r\nAdjNsT51KKXDFNCwOt3g/HWKA3nCuZIDK6U=\r\n=gb4C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"b14c6360d67ae6fc0af29567eaf3011d782fd4b2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4144"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.24-beta.4144_1651669067728_0.16856483644870868","host":"s3://npm-registry-packages"}},"0.14.24-beta.4150":{"name":"piral-ssr-utils","version":"0.14.24-beta.4150","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.24-beta.4150","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f4a47bdc12d8a6ea338928a3a8264dac92f645d7","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.24-beta.4150.tgz","fileCount":40,"integrity":"sha512-OhjkUAdl4Qcc3t7/TWjS1kt3r4218FR9N8H37qtH+UusxiFtI1Kdi4FxOrlEq5znHd1GmciBwlpdPJ9uD4MlPg==","signatures":[{"sig":"MEQCID8iABsDh3zpH1gVbdKPL/+Q7SlDKIF4jdcBcsRRSXCOAiAiQXuUiEfU+cqOH7lAzHTlWm3Bl2gCAruKHkKqLO8bHA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicwM5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq8ng/+PNrfoF6kPGZkMbI1xRSB0tSN6QbE0fjF65sSasF9/mGq/RUH\r\nOSsBDTqzGtm9BwZgEFChspVH53BExnBmW9sIwpvTjz2JkqYc18v3iNR4SA0/\r\nyGweraWFCO0Am8Rbjj0C/vsS8ujsmP+D8JuSHf/0bccJwQiW+rDvLqmyOJ15\r\n0OTR+EvgvLJ4egBFOgilTDtTq1bamIsLPfMcMxR7Nozvxg0Cr8lOLNOJdEve\r\n5icCtMD9WVGu58CZR5PrhIDR4nOrNJGuD/jCpGjN3dQpcz/QW1V3frB+WFJE\r\n1p9q5HOxZeHYkNBvB4rG3pGa9D2+IZFa5++SYSsj6oRoIJqfLDI8UEF7VhBs\r\nlcHgn7QeNxYB1cfNguZeAvRFjZzFrMEy1ad1xwpI8kM4iwGT4CA2ieBtseoI\r\nwJuzyaaHncR+nBv5jQU5AJFhtswn+MWSnBNNIk9MhdMYxTHLP5fO1yIQ/3kj\r\n2eY74FaK+CGe8SErfZ/jA1SpqSkYCReC64Ty+zYQHNkW3fMgJYjliTuj/MdW\r\nW1v9i28VdkKeTS8FFZLqloMfCED594LqFraFg9H19d3jUTspfRzXTRGCjAB7\r\nckAS9AN3zj8+FUVWSB5ayx+P1WWp+K7qtMTedudO7IZ+PSiCzzKOH/rsetBy\r\nvUVdSicopOgs8HLPgCcXcS9uqeofx7FNDgQ=\r\n=MJpm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"3a3b6461ff039a1751494b6481aefa6fffbf22a7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4150"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.24-beta.4150_1651704633172_0.9761360444682767","host":"s3://npm-registry-packages"}},"0.14.24-beta.4157":{"name":"piral-ssr-utils","version":"0.14.24-beta.4157","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.24-beta.4157","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c528fded1ce79fd92771f1c3db568b75e59d1c6b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.24-beta.4157.tgz","fileCount":40,"integrity":"sha512-0JeBTGAvfQI06TcjtCpAvrsuZL59BuznLCrYLXXwsL3iyjlnb3ADjjV/55U4AG2maRYMAvcDTcvTibls1x9xRA==","signatures":[{"sig":"MEQCIFkocO2GwXtvTYiHM5LZ7RO4nwL4S/5YsAzfnI+p4uX8AiBl0q9tOUHSBl3noOBhflE8oxnmDhjLb/Zquq+1jMfrHw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJic9b7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHpQ/9GXVsG87MEE5k9X9d5F0E9s+eACh76uNBQgSMqV6BvShn8iAU\r\nEb+jR1sqhXF+xgMLnDw05i4Xal9DQDNVNJ+71WqJsKbjnJUcClArJMoASBSX\r\n9n9HCPTCDCjL9l8DQo/Vqy8UyVFhJKmgcfprPF1A0rnbDpw0WYcdTFtCa4+8\r\nmrE8rL7mp8L0YzfEkHT0cJovAIXCE+8+Hvvr9lDrzJGw6kZMg51c7ek61w05\r\n0g3zeZr03k8KH6yh0nDIf7S86hJrJv3oIBUppsgHECd9PZdLo8gjuWt+GTO2\r\ng6wP1lXrawiMSJVLoy5QwJZNQMeQvlV/dtPzcyj7I3GFhRK5SAp1cHGTi6NU\r\nar3gvjabs6Ngcv9zW/z2oDo4yRVohiF2/IZq5+u54gF2ifDQkWc6e704MKOo\r\nuAjmJ/3TpSKx5fx1pDgaG8pJAN8kkMgTP5dwRf3x1/ILCcbz4kQUglGUIAcD\r\nbJNTRuPNmmnJHfVgeFJXMCqhA+An2IXZyqFzO0+NM6t5sRUY/QzlVm+JbA/B\r\nWz0tRqZ1qCGr2VvV/hvGemijRQKiK2zeh0Nc3AifBm3ejdIGjGsbE7z6aVKQ\r\niFofdwRS0ywE5YkMDAvDadRXZG/ugjOqoJVGRt11T7RCrA9f9CucD/GBrfjl\r\n17KdNQk8baYVyJZ+biHbw52mCKY9aumv6Q8=\r\n=NJk0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"5a447634711daadfbe68b73396cfe75360070f2a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4157"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.24-beta.4157_1651758843334_0.406089190895198","host":"s3://npm-registry-packages"}},"0.14.24-beta.4161":{"name":"piral-ssr-utils","version":"0.14.24-beta.4161","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.24-beta.4161","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"aa8dcdb11f975c60b9d3d8d7fda216effc3656b1","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.24-beta.4161.tgz","fileCount":40,"integrity":"sha512-kz2mhElUFWYzxiYJaz35zsPveXzhngtnxtHylOOM+FPzsYgG2MquVKI14GsoZVNLH/Tk2vhqgHXQ7lO063/uNA==","signatures":[{"sig":"MEQCIFuvVmwqF4wEk6RgA+papqv3UaP2yrDUajjFEu5/VSQaAiAI103cNAM6n7PdcUZUg+GDXFq3F1xbrAmN8cOfiGjCwg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidTJZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqW0A//eIGFb40f188f5v+Hfh1/GwyHv9HSOC3X3LxucN2m6aPLr0rX\r\nrhEA28o8e20mxMSrL9mYYx3cBV3dsMBBoBAT9E6N4zAMn534BU5cr06ls+2V\r\n+Ojro/K7bcqrDNQoULSsX8kT90uZvNlQ5zTnE3XYalGYekQ5NCrQYcJ4qGpQ\r\nYDtzcopUJ0+aFW8KtNUNHS7ItzLH65epTV7aPxoA69QJkVvY0cUChl4UwFIX\r\n7PJMx+VwYdjPXC06GIRe70bF+oIu39LQv2fW2sKbjpXApU1z0/YSz2trynLQ\r\nn9jkyR+8xg3W+UY+iwIBrm9UI98YvqAVVPQqgJ1aDPhFQdaWDeqV0bEVgYnE\r\nuhaD0Kz4bRYT6a/sQTuOA7N/HUh2/AzszW5NBSHcjvtHslbAPBqtYCM1MQMd\r\n9FSy6iflfeWTHA5dr1+0NDEVTu2T8kQcYGmZ7OYT+TP9XP2CZ8+iItJ5KhD8\r\nAgTY/TsOeili8MqxqAwOfqeIGYzYqtSZqlylUELLcwhOOYTpUMChpKWc8t4y\r\nsfom2YJv6HyplVemyq+Eo540axjbSX1QCExddQ1a8KlHn9aBufkdo8/NUmmQ\r\ndsIIqXDrnyN0wkYP5I65PWozY8h2pLrQsOziOjtOEay3SXgmuCrioUgQCjjI\r\nZTcL1KemxbTwc66weqTSUCOlvK1hEiL0Edc=\r\n=e+R5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"a3e3fde68f96231ad3a65b25b90d358d2648fc68","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4161"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.24-beta.4161_1651847768956_0.6727890611047773","host":"s3://npm-registry-packages"}},"0.14.24-beta.4163":{"name":"piral-ssr-utils","version":"0.14.24-beta.4163","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.24-beta.4163","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8a5169e771cdcb18cacc85c876252ee5b8ec3d25","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.24-beta.4163.tgz","fileCount":40,"integrity":"sha512-u8IAoYNna2qrAV6BP5oUlBgoW+kUxKlL2LB1H9gG6Vrg17S9dxhZn2pGGDZTvnYtOPdNHFtwJpIeqN4lCNU/DA==","signatures":[{"sig":"MEYCIQCc/SjJiZ0diy8DuqMVBN/RpK/1jnh2xvdmUXQTGmKENAIhAJdiYfUulmr3/88jCSZxDLlM4i4Wjm9uVbClFywti46K","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidbbQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqlWw//fYH+BJha/OV9j3q150NNvPQ+zlKni7oSTOZosJ/ih0HIlgS5\r\nv8tW9gbAhL9lVMPqv3wYXRnJ4XuJzCl0RjjiRvd/bphIIGBbL6OzjBBKZ8S+\r\nHikITZaJABDKFbK6BkFhhYnYNd5iugzJ4msi5UoWvxLQQcTDkYL2sWXhC6zj\r\nmyMCuJlHqpj1U/nrYWMQrruQbn1O8pxQVVkIeSZFhaBsOfPhm1dnThIb4oXH\r\nmbD98bCe0yK53yBz+9XiHqTEtxwfqFW8lRxsEG1KnzTf5l4hOlRKe2EjFtC7\r\nliXgp4pJ95ROSgAwcBmc4xVgm6lmaWA9d3rHb3cOeQSf4/nxfnAOXD2+NRwm\r\n/X5rw7l8GasvEDzbFwONoXAaPgrMugPqbpLaS30ArqWzeCIjJgu1uVk+jA8f\r\n9Zea3C5BblrM3GDwEW1vpsymEqMVmXBAHin+MqhLZmlyPo1Ocell4AOofc52\r\n3AuVWj1dMoTYGI1ju1DuxvSEm2CkRhwbfuF9W83oJ8u2rkwSY4nFNnNmeaY3\r\nJcnClCPPX+DEV6VUDZkHT6pVhK+oCj9VVdMzvvn5Cg8dQ2EkWYQFmrcIAiNH\r\n/up4xqFXlX5lbOOcnXy7t1z3jT8asEGH8X0VWSXRQYdfqoITPXdgFIz/ftvy\r\nnPWhUMeLcMcKnfk5mjPoBH5oqUX+7UhSNxg=\r\n=HW7T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"2b95511ed75a140e1657d7791245cddb3f57f9fe","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4163"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.24-beta.4163_1651881679994_0.45042792336703497","host":"s3://npm-registry-packages"}},"0.14.24-beta.4168":{"name":"piral-ssr-utils","version":"0.14.24-beta.4168","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.24-beta.4168","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0bf59939731333970f4f13bd5f1d11adf3ca4323","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.24-beta.4168.tgz","fileCount":40,"integrity":"sha512-MAgLDWp3ojSnH3e6wyrS8Rqe6xWk60N+7Do2H9t7yXDY2fuoW2UB/b3Gx9n2paiFLNtYVsAsOHtfIVK18AQE2w==","signatures":[{"sig":"MEUCIGlFIhkiYx2yZ7Tgzs/PQb557+DokzJJ0yghtnmu2+b9AiEA9S87RZCMqA2rAkJithz/PL4fridSR6YH5Ed253j3MBI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieRXsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJxg//Q4rGlT3H3b+JiM8TUAqwnDW66c+ZTA6LeukEocnRHPGA9Bub\r\ncG3+3EW1na9+Y4pj+ILbRq6fM/7NGZ7veNElFKJuvx8pLRWKrpzz0uSr5tlC\r\nXqeGedxdq0TcgbDCWdhlBVfwtGK9PUeLx2Bt/LDDSTmc+TEBq6W/gPAuGIZ7\r\no5pK4Wb8jxw5JdO063TzY3qLCvIPR98gWP0sbHYFyPOOtNtPXAoH+a+aDTBR\r\nEkR6k0C4lbmGsjYFmaPkbWT07fOzOyPRAJm9e0BtCyEhyPknnUGNCu/FFQdB\r\nJhv/f/Vaydiux5MoVmv6BPvcYw2df0PEiEzXzGUiA5kKua5OmW4TMVUhWxiG\r\n0+sB9RBDBpY+YjGnSRKnJNsOzCD0p3oifFWQYR1rtM9hBj0cQMbsyIrX4vAC\r\nIV/Ef22MITQfwQho5ii/ZOSyULbq1Dct9fIntsLAysxe2g/njj8O+LTAN0f2\r\nHQia1grD7RL1OkATGBpYo+d1n2c1amZg5GdvXjgu9I3mWsdkOYdadvSv7Nny\r\n5PISBggjEDPtWTX2JtbbxyTFiYyVTpUc5d39vuiM1pg+kf+osd6WSM5voJQA\r\nyOfWzk5rJasNHIM1Z0UPbEnM+9MerV6DEPYWNOCzRT9XzlzUeNTwAuEDMyGP\r\naNQd4nwz5I5h+ckPDR0A6D/25OyE8rjVWCE=\r\n=3Mmn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"5c3d75e1148d7def9bbc0d5c2628671c2356f816","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4168"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.24-beta.4168_1652102635954_0.0524906530619651","host":"s3://npm-registry-packages"}},"0.14.24-beta.4171":{"name":"piral-ssr-utils","version":"0.14.24-beta.4171","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.24-beta.4171","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a2f95ca2ff4690505196d424d8b557f73ca6d20c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.24-beta.4171.tgz","fileCount":40,"integrity":"sha512-3Jfg2A7dAh70H93OLMUYAEcSkLdJGyhYXkXQz8m+xUQf/Mu1Hszhl3o/fpINnyvyGl1/7ljoZkRFStbCsYqFPw==","signatures":[{"sig":"MEUCIQDo6M3ELAFGCxfWmFR8UmnV5pfJMVjUj2v97PcZspJP0AIgLVW5lvSU5Q7N06B2bctcRSM8tDyyhtOFGg9Mlncg1VE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieUcUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqeKQ/9EtsNmYLxFrqi+gHraLMpLOTDEGGGGK5rLpwH7dWg/AD5KOBO\r\niTpHr0f7xhrkz/7CZ8FY6ArUWguhibn6C23BZqncsdmfR+3hO4SGyZr26cfU\r\nzlBrZIz8VA8SnleMOOFczrrIOs2T0H9LuR9azGUDx1L/dwxHfGltetd2xdBH\r\nGFyzuts2mu3V7Q3HJaoLETsxho8WwJAmN1bXyF3XvvGiJ9FPRkYiYF7iRHUg\r\nsMq+ll3R6MlQ1+dggMS/SmRdfjgBX5VdYc1NFUHVO6jgG6MA6FKFHIhZ8CHj\r\nXK406b9EWSR1aNXPRgPodtQLBAO14OdFuG97ywQttN7cYJh8pUPpyOczRFVe\r\nOUuBnxhZTgneSVpsiM4gOOae7+hChL2P6FbsGrM9/KYDH37Li6qSTBrXokFK\r\nWz05RFwDu+kTdtssoW6woNnko7vjbWDxM83W32LZ68E1scYdtMsQ2MI3T8FP\r\ngRDReXMckmdLAtZAgzgoqQjP1nIErndpL4PHLPBzFm/1+jaZzn3BpxzYrTf3\r\nbeAGhC7lp+6W1lqJWDXL0kWaIkIODSGBbWM2oQy9xHJ2TcgP/2HuN0j6bkDR\r\nZzysVwK/dJXWWKXq1QyRwXjbTWseejtS2M8N60b4F8Lugtsg2c5WY0sFiBBf\r\n1dSpk9UQPxMlj4ojcmCmsIhMEGxtiH92kKE=\r\n=sDGT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"1073f96f7199c1ca5b64cf3bdf9d06b6be60045e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4171"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.24-beta.4171_1652115220529_0.21014282629917558","host":"s3://npm-registry-packages"}},"0.14.24-beta.4191":{"name":"piral-ssr-utils","version":"0.14.24-beta.4191","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.24-beta.4191","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2aaa3f5313bdc00be68da166da9d08c1b1e84b04","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.24-beta.4191.tgz","fileCount":40,"integrity":"sha512-fLyFnuBKpvKafGluxmhhMMbn2wmGoNRfHqMSbJyrPz5bEUgdpjuPaMqr03ioAQ6FTIfgQBqbfDtkxOjONbwdSA==","signatures":[{"sig":"MEUCIQDvjC4iWo44bL9gTexmePDGfBVgjKFyY6R4b+r9GalnEgIgOwTPgO7LPM35dROLY3NYKEiUcTqSU31lrcVMuQ4SUgE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifSe7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2zg//bG9ERHV94sE/HlNW2mnsVMJetdMMl/ieYrg4B3flNZueE+X2\r\nNtTO2ePfaqmbuQ/IZwRZRze4e3peFMhYjbXrA4xybpWKc5703QoXTzkZuqeL\r\nN1ryMQp7SQg9rvzXL8U2J7v+QldT1VBA9/W27yqLhShDIFvAcK/ts0z25PA/\r\nRai3g+n7HPW06bhlr42DUuARvdLMko2n73zSviADO0vOFJJe4wxVUZK6YH/o\r\nGdLqeK1lItAXvQxeDC6U/WLpy2QdmSj/+8yXL0X9iIS1YWNvjx2wH3/DvHDT\r\ntBr/+33xc7ZfYRoS2C3DbW3GsBmPnZmFQqwtZQnLar0K6St01AHBdvdlSM4z\r\nWQP0CJ/HviRq1trUPT4V07OlDrzwy0CAY0u5N+oorrJHeSWQR3mFHaU+OcdJ\r\nayXFsBCHCzq2v6I5gNrQkQ41W4t2dnU2Q+Um3LUR4pHTzzHq+N4VUXC2gcxD\r\n23YKv/rBB6aaZMnqCxt1NwkPSDmZxh3uNqsaFHTd73JPwiskPrMJdQN5LMdw\r\nkegClrCPn4I0Gu1Zg6E++k/opuUDDS8XhPo1bkx26NNYGF+NBLc4Bm7poqeE\r\n0u9kSa4qIDRJflXPsSlNbtCLlFmxTbvECbql919Wu4EbL72BC0eOBYGBRb/+\r\nW5LVFMfg6yzeGKtOYQ6rGHG+gjRcNriCAfg=\r\n=sbtn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"ae605bd9075d6d70abb0c159521f00aebcb6ea4b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4191"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.24-beta.4191_1652369339399_0.33122686054091743","host":"s3://npm-registry-packages"}},"0.14.24-beta.4195":{"name":"piral-ssr-utils","version":"0.14.24-beta.4195","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.24-beta.4195","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9426a1a95764bfe700a84cd7c0681fcdbdabfc10","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.24-beta.4195.tgz","fileCount":40,"integrity":"sha512-2TP3nazW6vJ9a23EZYSCUlGtkKTXWhFgEwuc4vYhcEhIPXJZ6g3hceawMXyhUGrOiE2ptGTuhBA5CQqCPbenwQ==","signatures":[{"sig":"MEQCIDg9BRFhnl2GHlU8hFG2ZWHL/cLR7fNnBOkYSQoS9tIoAiBieyQ/bff+2NRMrYXcFSF2xv/tBkP535Pu9V/DalWigQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifjE0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqB1A//cQmyxv0H0dh91jeX0/cylPJNxWkjae9Y99V8cH5ZRNDhEW76\r\nWyaD4YHm/o7czpcM0R5OURCskkx2sZY8hgc3FI5vkwxDq/iOEDWCkR08LFE4\r\nhP68AF3csDUNK7d+kipbIl6citXPi7xmPo2fN5CVH2nneMGLID67VBeuqpfh\r\n8ohvpg8JqnfbGBpQPyzLhTPnHi/RzpMHrJF0z/dz7GKa3fdNKwvV+9Z4BD0N\r\niLPeKmEms6G83+LEln8wXSq6GIpizyjStqjb+Ub2+451t74mWOeFSEmZJO1K\r\nI7hV0LswD12OxruZqZDiMdpjD+d+AsC4JzY26YKPEja3lAiEWyGOXf9PG26V\r\nqWozyAQSOTsB0SVutaos+bMn004XfYkBAAIlmckgc/WnWGJONQDeO/Taf0Sc\r\nmIC8k0aPc1Ah+hhTUa2t4zRUFDLHP5HltWHOGuWXooRpUcAeOGgc6RkEsSuW\r\nMSBwkfr3ShS075LuR0INLYrNEkmRATz4RsgBYJ8mN6zVhqMe2Q8g4DJyOSZM\r\nrIxkBovH/R95lXTc7bkEWWPgNc0ls7mPYThpOvACdD8QV8e91eKmiCLTpk/z\r\nCav48QdchBp+TD92LKUTW0zbdbKfjOrclU+FTjeyJqtucgNWqKpw3teVEDq4\r\n9c+ouA60hbmWmjQvK3BKmioQsmbd/JTYOtk=\r\n=P6vf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"c1bf2107c0d0330b5b93e0aefcf360356642563c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4195"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.24-beta.4195_1652437299855_0.016385529182823433","host":"s3://npm-registry-packages"}},"0.14.24":{"name":"piral-ssr-utils","version":"0.14.24","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.24","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"49a15df24a76e3e900cc0c043f82be37114d8d5c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.24.tgz","fileCount":40,"integrity":"sha512-KLG229tJTAI8ewAZt8BITy3xLqOGs3WZDstw36BGFA+P0bWmkqn5JMdudOXRxwrNT9GRA1mgh/69PIWLywDDdg==","signatures":[{"sig":"MEUCIQC3kNfCN4+ZRr81UfGIufeU6vTsjKADxQp/AVR5QRndwQIgGk5yGR8Ziolqog/YU+Ht1tnRnNwFto4qK/1KqX8IHdc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifms3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCQRAAoRHOTkGRpJuu/RSz7iZN9Lak3lBcTxN5oMZyE25BZs06YEtx\r\nhCfLW5YLih00R4O0RXbPjbmc6uulGQ0faiqAcLi40czUZ20mdLsnjfl51kRT\r\nTuyNuwSEYuaEOdkvPTNishFizpiySnGGP6JKegGq5pPRATKVQKA4KMBoUoXT\r\n01I/0aW8jIak9g5p2Tykz0Klb3MqqWIPRl6GsIHLtEsqWNJbYMc9W7K86/tT\r\nG0ccD+cb5vWjmou3NfmAZVg86+dreMFaBOq/mfkGnHUiCqsaOfyB00I8DEQP\r\nnSdrRnKwbCLa/M6Zoy6I5w6NZ8g/1g4NOwIMfQgk56Ov62/vFKVCuzKswLDH\r\nxWpD48omIP62UkdQkIiBbNmG8ysv0bMyP9uUSl6C74rufwMMuCgR2FX7Nvj1\r\n/MAkHvDo53s5D8C30w9SLtdDklTKHL1JMVaYLTp+OBO1mzFyYJtoRs8DIa9d\r\nEBYaS/bNqarO6+S2tpDCnJrgtzswkxAUhXrsEuYmx3tvnrBSHB6V36eBBglo\r\neKgdABMBEruL1S2Z4gbzJu3YiyFqPi1kWWy6OQIpozuWx8OelX1fEkoofj/L\r\n2hT63esL1was9QtMR65YaNhOEqmIEzuFF+Lza0GbHZkrq3VteIveQDAkDh0O\r\ng3PSyU1mnq4ODJxeohpFdskOPrGr3Je3Hcc=\r\n=vMjo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"a21f63e9ed351bf2040afdbed1e12c59d2ca8f15","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.24"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.24_1652452151433_0.43447137397267976","host":"s3://npm-registry-packages"}},"0.14.25-beta.4229":{"name":"piral-ssr-utils","version":"0.14.25-beta.4229","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.25-beta.4229","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e180342e7d16d6296ad98da2c21e5f1526d934d0","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.25-beta.4229.tgz","fileCount":40,"integrity":"sha512-QgeSeWT18Jmgirqo6sAs+QJinfMZHb326froqnYpOePsPnb2l3OBnTcb1CWOGX1PCXq0uAz13dF7eeeGD30EZQ==","signatures":[{"sig":"MEQCIEX39QBFrJZpZYC9G98gCJZjeJBwyNyPJi2OVszH+ktUAiBUKKO02bEYn0LWTlTRWqj857NqM90DTx6vvqneBl0fWQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihsiUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo3Xg//UcM6dfrj+MhBtqKonruUupE63l9YNY20Fv409C3XCLaDWHnm\r\nQBs2T/1h3OT5ESjDK0HiDuhlnRdfj15Kx7wiyKdyQMvLc0s2opTHsGDDvsZG\r\nbI6KQkmg7qW7Rih1tMLD0RQKP0QyoW3oW859OnfHWQx3vvBgOhroosd5dOi1\r\nKg7dCzX5t4AUb8Tn5qe9vA+bI53d1sUNjy2hbDhj83QkUL4h+4vktNTwicpr\r\nD2ssnKuAnqqWhje8nZHmJSTg0qOqyPd/GcU3kAO557doWz32mBpI4nvw7Cr1\r\njHKLGb1/EhucV8FcWvBqEyJZqskEswNLBCMn5aYsmrmqSvcd1ujy6zovTq8K\r\ngCWTTTWMOvrKmkgugeHY3FTSnBFL9A/RkKtjFqlW+cYxlF6Ik2QTN5kA+J19\r\n6xVqMyV/3F0RoV3M9khFpKd+2TjCdajB2LMY4Np/Yhd2uwncuZmVAwSgaNVf\r\nFiLPJnjCRGXBphOt+u1WFwzGM+KC/pKNpXlKpn/9var8Kect9+7IdyONDdU0\r\nZAGJTlf8wkjEMjilTuZexeDuUUNLOfA5fLwOrUp8NCif0aupyS2KYdgnI7AZ\r\noAQ0a0liY6f1JVf5g2+S7nrXtv+ZhLoyq0sOLJ8jNala7Hre7+JXOTA3gop2\r\ndO9837tPA+NJTJhNGKh9nrLXM/sUXVsRE88=\r\n=lxzH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"fec92fc1eb798baeface15b5f2ea9bf52ef404ab","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.25-beta.4229"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.25-beta.4229_1653000340681_0.7593926773916184","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4231":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4231","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4231","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ee344fa0518eb6b100e2971b86bd8736234b524b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4231.tgz","fileCount":40,"integrity":"sha512-jvpdYX2h3czWKP8biBwLSQU72CpD/H/D+aylcfXS921RUkntPHYfUriO3+lLn2Am1hauoS3KQH0W7wxm5Rkn0A==","signatures":[{"sig":"MEUCIQCDZnbPXxW0s/6vl5lENHRLw9bp3EqxHJn0kqp4R93oOwIgP1Qd/67f6LsSYwN5ZUqS7kyp/N96xaEh5QAxiKnRkqc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihsptACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrwMQ//fANsLLYb6JX3xQrsvREkD5stC5Qxd9xBfsz27E1GYPzX9N14\r\nSJGe64euT529QmyuTxeU+tU8dnOx+lx/+ux2RRrOUmhIw+33azD50GRl8vtS\r\n3+lbq5Ihm3dpChaRRRMVcaYG4gqNDqKGClF1DMx2wqa3xdeGyf0k2vzSQsnb\r\nEPhn8cKfTcDeg1DLzEPF9kFSzAuvzzUS4c7DCMxTDsHZYh6z4TWqsph1TfAn\r\nxFPKExakRQk9OZgcYWHcJpV/0zy0i0FCFD4l35IJOdAHzUE6ZryLJ2Gae5TS\r\nmiN7QewOKFtNBJ/Rl7/m1GyYLIO8duiy2QIvsHwur2NnnyEuppzKVR4j9/sm\r\nK0bLcvOkfK0uHcC80CcO3JvxFswmHEsH560PaEYrS3uzx6egtjSgzG0viDFM\r\naS0id9sXKYAEXDuLkBw5T44LdhbhXtFCRjRK0uP+8OxHTw9rmHuGfDOMXQls\r\n8ehpR2wEVNaTro96b9Sf4kyn0ZeF+W2/e12ICsKrT+o5bv7nvzizPTZz79fa\r\n6lh4WffasupFPIWgHWHMNWiWsVb3ka1juwGzwDu0/Z43MC9xQkVJEUmy4rmi\r\n4dWj9HZu3fNUokdj7os9f+RbDYRAZrnBxWStOKLBDqlfmnb5xfk/1qNXJLtz\r\nqnu/WJ5DKjdmNvY0NtPMXJTOQ8HziRGqx48=\r\n=D0eI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"4e7f158bd276d82c5bf2c19d47ccfb3604f38e38","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4231"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4231_1653000813714_0.4612946909627227","host":"s3://npm-registry-packages"}},"0.14.25-beta.4238":{"name":"piral-ssr-utils","version":"0.14.25-beta.4238","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.25-beta.4238","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4b1e475622ca6e3a81fc3d128b9f780d86404486","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.25-beta.4238.tgz","fileCount":40,"integrity":"sha512-uex737hCzshryzpL9lOU9y83FatnkffSFmMdJxh7gT2BiL622PIP0/QSnH0iVO+v61LR86WaNF9Uf5nskSrUCQ==","signatures":[{"sig":"MEQCIAP6pAG9FEtcw7ppzowwQ4szCU/nOw3BXcnpdvmbFKVwAiAK52HAZ6E7BkLE5gC9w47lC8ADJ77TX2VGNpRccd3z3w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJih6IcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq+Hg/+K5mOOLTmgW3tmUts55VoLS1OJ4wQOY/U6Mqrl3/K3rVg25bf\r\ncJDlinApaYr49Dm5cQV5bz85N31MdcriTmbr82YUyLPKQVcThJdTEDzOCLQ6\r\nV7Fs7JpVRySG/WNj2M9tXe7/C6qb3IjSsS+QiRWKKi2wlpepCYEBcjak71w+\r\n31N1NtSIDq5E3f6meTTOFnd5sWKkSodbxw0pIW7aDS5YRoTStZbT8paHLigp\r\nl+ObaXqgbfdeeDpsrsgMHQi4NInAUdjVbz7x8FHa2+vgkARFfvPz8AehzyTQ\r\njCGh32tMre74I/g7Ezm1Kn17v4FQTuTXIPywkj3VDzBSj3HagE2EDFlOOP2q\r\nwf7tycIOQwOFHkVIZMbd4NPssVTurT6/MJWpjxYJb18snKqj8jaJXTms3wwC\r\nhlNBJgXMtkZfIoqKypjWYKT8W6UIFo9AGbyz2s2hoqa7S0PBQirOd/qpHEis\r\nSlQRHRwOWvOeq0p46s46sRaRwIK2TtK+YKsNNEaAKDCOdPqbobGqfWJIU+TU\r\n1eaJUmUriFc31WMPj+AzlvRvBTe1pL/9mJGTl9laAIpmPPj1uI0TgEOrhfuO\r\naRtFRcb8ipOr0GjyaipszeAXTcVgTj+OWncv8UTdSdkYXNSz78pdNeocELEz\r\noGpqVZVLIF+wCYwnXPOXdQl8UxsAJ+FLsJg=\r\n=RAVk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"de6aedd24c8b3503f89a175d3c58a0f652cb3b54","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.25-beta.4238"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.25-beta.4238_1653056027784_0.47104628808441396","host":"s3://npm-registry-packages"}},"0.14.25-beta.4245":{"name":"piral-ssr-utils","version":"0.14.25-beta.4245","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.25-beta.4245","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"66df4ba4a8d8c86a5ff4e1679933be13642bcfeb","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.25-beta.4245.tgz","fileCount":40,"integrity":"sha512-/VfnHL2eUnjFTRQ0QMQCb9jCvIYCe/hovM7+GdwCpE3w2ITJjLLwhR9+zfQW6eWcvb5dt7uGjrFREYuH9nXaGg==","signatures":[{"sig":"MEUCIF4WnRalm+9GgKbH1eY2S3kjEa5rc8fgkhDFPYL87gTjAiEA16BzhXmYu91PjDWREqFM0zxcdf4uSx3GBgGGK5dgazI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiiW/tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrqSRAAifl0o44uFcjWVyeBKRtcydh78yWyMbz1A55y0AjuiEeyj3rp\r\nDrSu6FryvaOHfLzjkt+DF9RmTQWJviFXDJIBXhIm0p25NHLDrp9kcNbjEE9l\r\n9QYJiE46Hv90NA91n8zq0fKSaWBnDYg9A3uWU1MzXICuuXgi3gIa5j+G0599\r\naFL5EyNIXyckqmoGPtPTJWSKt85jmNmzHFXCMonbxp2p8Zq90v/IfqVq6zqt\r\nGV/iFqe1ZC294Yp/QcZD2/lG3u+WE7HRO/rGYrtgu3wUkRL0XsC56GbRuHRs\r\ng3TTQnenCg5D78WTvvhmhpbxAGyA+o4wJLcM3Wd84qodjufqy3y5gADojjkX\r\nb3s6efWSf2CWUgfnU4G5k29iMOIJlLm8pbF3QybSV0Pg/R4OAmiwByzULqtG\r\nOCyXtpMRS7UaGQdPibORySCnZjcUu9+AEAVNa3ytS9OfD0+Q+yP8IcOPYYcg\r\n6Ui8h6wd+GWFg5uCHSeROC6JVRhtOz+h/fkdSNaFmeTjvBtS8lTVVjLEusq2\r\ndauONU7rzTxERFkkaetIiUvwKFsuDBpGfrREOXGh2RBlrRTrRS+yM3uaq9l9\r\nt9Ak5A/Ap4LOeWY8St4ALoc91pmKiam9VJbpMDAFJRTMpzgU9UI2dhEE3Tvd\r\n1Q25FJg5W2phXPmqx/tPFyH46MdLdBvEaZs=\r\n=qKcm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"1ab62c6f6d1eb4442c866882310953c2a67c5998","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.25-beta.4245"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.25-beta.4245_1653174253614_0.014529536660319753","host":"s3://npm-registry-packages"}},"0.14.25":{"name":"piral-ssr-utils","version":"0.14.25","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.25","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b826adcb82d9361525e6e772f8e96c18481aa420","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.25.tgz","fileCount":40,"integrity":"sha512-H/WpgZhhU0FutNmRt4FddKfNe7LY7gEZ3LNTSA80/79oOvfm11AzLCsIcL5Pr7rCj+6anYufcFPsUlfHH0EPtA==","signatures":[{"sig":"MEUCIDcbeJzVeP6/KISDnvIQd/TfvFX9/3oo2oGm/aLDncdTAiEArsz4RxpJdgZzbGJAO3n8k9xGbzDN5tSFM+GIMKzrR0Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiisi9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrPzQ//aHLNAC/2BtXGEPDk+hW9ZFuuyFS/nl8lNg/vyaGjcF4wP7vt\r\nSIyfGBER+hkxOM1JA4J9J0DFhHTzlX8ik/PM9xTdnwNhbh98d16BZ46+NXxM\r\ndRqBudwPKUHw5Wlkvih0NaSiT7kis6pvCPvqcS7R3RiC4tRVlStV2RFpoYyY\r\nvPpno//K6HVmQuX1AGLR/zJibmtR1N3o1MPMNA7ayjohW9ZJiGmiInxtQsS+\r\nzO92vNmLHe/IQvoBwWe4UnV2PUZ6ZNZuJbSH/HxMP6PaCyL8DmIMCzzlbVrB\r\nFj9A5W49uAOXRBpohsGuLY9k2yhbwAMk00pp3oE9a4egjnRN54ROBDXsz4wH\r\nZdx3fUXss3DPDowkOkuMDl0EcTOuLUflHcqB2UmYe4xb8xI1AnhRAiC3qlMU\r\nvjTNFfcfcerM7x1/dM5GkFWXcRtZIvtUJ2+R3cQR3kRB+BuzN0RETXK5nZkH\r\n46jWAYApzmqCzf2ufVr6W17qxdns3S8ApiWJTTS9tCDXHIzsBBT5edfNrw3F\r\nuTSbpcI5yrVTNTlhxixk8iy+TyQ7Cx8uz/uzSAe7/gtclEAHZsZZIx7DIsLi\r\nKZDmVkpYH4Onvcsylt4UxmeCKg9XRhC2bHIi/C4SCy4NjotJ/jPtUgzV1qxr\r\nZM5igq8+GcNF8j+QRwfgVNHgk3H9PFamDvw=\r\n=Qz1E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"87e857039f4f1ba5dcb80bb58e2a0c595fb496c0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.25"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.25_1653262525746_0.2228255598128741","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4257":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4257","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4257","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f2f222bb34716cde6f10ed4ff1021185423e3f22","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4257.tgz","fileCount":40,"integrity":"sha512-JnjIKCkZXo8wWsKKNvw61g8ASYb3DB2uPEH4eqpxF/tTVy+V3hVhjJsqVGGZpJH0X6PP/heCJyhiQYYZrxYIkA==","signatures":[{"sig":"MEQCIGk4kLR2DGxCIoE+2aeQryxrHnUq38RVUTcGBQizswBQAiAztCD2ZHJTSTG+PmDCAq7BGdk/DETpic/EvZmqfvjHuQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijPIUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrPbw//aq7BzbZAbYu4kI6+0mSmXadMBts6xLBHlSgLZZC2gL6nM0Oy\r\nWNKa4vtko6dv3OgePXVfor2meaPUzpiN2WWH2OwreCtUioRkifIHIFv158Y2\r\nimBYYLMmCXy8zIsHk/TKLdsi50QgtxFI0y/KqAl0LcF199VxpgOfJmxQ6zhJ\r\npQOC7IVWat3+MCv3rc2HACxK4SkZzli8fCVcdXJSeZw/o9iRdE30CpzGKTzh\r\n3aJXSGMHoHq/p1xbO1PwzjFf2h7rKsE+IBLUAFGMz9dO7f6BXpNT/KX3+i0J\r\neOiCOJ1PvGzGKzl1lcXpibQnRz2m8YTHe00MxA5IKgtSytezb9V/h7rGrPwJ\r\nwOYTwF+x2PsMZFv9pWy/036pLYvO5Ky9vpqtPC8DJrS9h+B6E7i77IRmTcBl\r\nEGUUHZWbajnobfgXHx8CKpMdFamUD8txMyEY1kQEXZyBP+Qawq7IHLzP8mBI\r\nIYZuiM/UELS9VdRUrqwGQXGMMD6HYOD+sLNvckEti9FsBv0iDysBWEsE7e5B\r\nJwGyCe8Qfwl2UCnbbm26L1WfV5MziarREynCm6gDWCpmB4DqlkU65tpyMzJd\r\nXRIlXuhl/PbUXl37CffnCBSI+JMuESokEdxd7z5qbZ/Rk0VUpbzhFCVIHxgJ\r\ngG1DTXxYYg950asavKcBmeSE25G0YFODDMA=\r\n=aQxI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"61f4ebc7b6c7cea553e2159b075cb761216f8e85","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4257"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4257_1653404180212_0.9013036579248488","host":"s3://npm-registry-packages"}},"0.14.25-beta.4266":{"name":"piral-ssr-utils","version":"0.14.25-beta.4266","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.25-beta.4266","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"55ff17c05210c50f5b2ca48bb34728e15d5dc06e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.25-beta.4266.tgz","fileCount":40,"integrity":"sha512-ZEnpR+pYYESc+iKei4cZzKGW5QokHinaM39LDJKDNpF/f5PbzeyLYzMQz0AAHQweQ+qMZcu9+4/enAJCRo/XPg==","signatures":[{"sig":"MEUCIQDBYsgrwAtRM1p1mSnlFqKX0gCLMR2qfFurvEMtfiVVLgIgXtRdFhDx2KemlD/b+g62RU7Fp9DqX0GT0HgY/YTirRQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimGvLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsgQ/9EP542GV4NmWfnUjOVMax5mI8k/90hWBuQuDRkVgNNcoL5jmy\r\nSte19DokmTAvYqG6Ia9d6CAGiiuBCXkawl8Re6xgocyVhZBqNfwytL8ehuy9\r\nmwRy5PUIaorcp7HhSWPPAHSPzS0L0LndROkPdfjhC1mRt2TkIjLS14EMhSxs\r\nlUhZA6LUOemmtrPD7CMotPC7o1gR+fqj5LkNHxAlxxZL0RPMHxP5ADO9T0yK\r\n6MJzcAHI0fT6xyBMU7BqSf5Rx3oLLvDiqi3q1gnQvfIVtxXgHISKCOIDL8qd\r\nGS9iR9Y36li8W4Rc6Yu2LiLpjQ0xuWSjle8/rjNBP6LWdkzUj8fKoDNdTMhY\r\nJZXVamihzhaTukLFl6hIGxdAK2Hy+MBdhP6BGSYMep7lqmizAZsHeJFGT97j\r\nsarJ+nFDwmQ5Lbg1h3xDTLKY4O/rd/iGklP9NhJwBin0pD4gVFJbjhIf/YKU\r\nZcasTKpkaDyn1qXAIW9HR5ozqZRLT9LfA9kJX5dnoyHtbl8xs/qbhtAZNBJO\r\nl+2c6hDAv2bzOMV3b51nlYmC96p4HECIJdtqMsYpJMdfBdq9hDlyfst5hKHm\r\nQAfpT+07CiCpNyKufom4MjgIFH1dxOg6XvEhw8V7w8d5fx81/zBATw/d1Nc/\r\n6Nc5y9LP5Pn+fGaVxXPS4+OSynXAVkqcxF0=\r\n=FOYb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"6e3235a5a6d27ea6b9f0bf178951642824d6b3b5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.25-beta.4266"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.25-beta.4266_1654156234939_0.4659641262268568","host":"s3://npm-registry-packages"}},"0.14.26-beta.4273":{"name":"piral-ssr-utils","version":"0.14.26-beta.4273","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.26-beta.4273","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"90c8afe5304e7c414d6c7fe13fbe59b45d52a0cd","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.26-beta.4273.tgz","fileCount":40,"integrity":"sha512-wWePp1noC1i6TawXTQT/5jMxR1f5Bf+BkRP6WFlKc+rKv2CmcGNtzP0N3Zfe1B+f10ubCRi50+JaJw9JU2fylA==","signatures":[{"sig":"MEYCIQDdxF2pdxvIBkWkYG3V+DCplPiwvR1h/dL7OVLVVqo8egIhAJy/Eb1rGvLByosjcKC0wlYwpgIHogzL3AJEwDGDcs56","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimwYzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp4AQ/+Kag4OhnvGt3fNg5CfVaTv/5jSqbJvO81EB56NqeYtey1zrJ8\r\nr9x709MjBE8xNVWuqf2HiOAwSV9WXpE5SgdwsYwsJiDKQce6jVpu2xbKFenS\r\nm0ALPOusenuXTtkQ2OWsNE1L3yP64ZhSgt11gs+SwpQgCy1QJwUjTCh6Xr4b\r\nhJMerEouOMQZQ43l9GHK7kZTpj6W5iYGZ0a5oXPgTVp/AjMZ0LgDuuUuSQSZ\r\nwbQMQMD3mOEAyozhuDZx7ZD8Vxi+x8ok/nZ1u43WieuCHKAALR37qCd9vLpK\r\nulnHtPBeSZrfABxqloBa1Xcu28kCQ83xQkkYhNhL9MBqzjjo8moQCQvyRGG9\r\nCC3UBnXpwk1Q6pJwWJHhtLXVr/Z2xKxZz8rLrumqfrvVxk2/ModW91K2QTyR\r\nBOYMYXkr7GgC00kbRbqNrunA8V91ohINu7jtQxdzcGbZAp6zHr6IMJ8KqYDF\r\nW8bmF1AuJU4qwTfsU7+/IQ+RfCnwt3I7VLBXZpXbkdRSZI3YbdU/wRzWgNJG\r\nJlbSlMd/HaSyKVfU68vjY7RGj1n+VgwD3WLJBLg38Ma27V+C+I3dTyGNkHzs\r\n8YWq3qIRKtcovNvw1eiu/TmV68uXK2TCw4uHxfLqzhMbwHAQIjTrnq3sM0MU\r\n0iDLkE8XlTNeb8X/PfWtOD34+7gtXAXqPyY=\r\n=OlH3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"f8504701ef573abb3ddeb6cf4e9ff9013ef98501","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.26-beta.4273"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.26-beta.4273_1654326834933_0.39564277399910663","host":"s3://npm-registry-packages"}},"0.14.26-beta.4274":{"name":"piral-ssr-utils","version":"0.14.26-beta.4274","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.26-beta.4274","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3de895b2efd96a03342fc19f393dd17227932187","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.26-beta.4274.tgz","fileCount":40,"integrity":"sha512-SU0Sp2A0JHSD2DNDrAuDVmx0GmPjiSpc6npFyQErnwuMPcKeExNdCX74A3PAfAZdTnIU14QrHZz1FF0ii2qXJQ==","signatures":[{"sig":"MEQCIAaqHFD+kHTShlQLAWLIUgrMrdtKyXreRSN/6e8I/jkIAiBEmqR6Llp8djap7tL6JOZA+ikfYrQMlxqPODFSi5b/8g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimxFNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqnrw//fOfhR6GP1biel+jQZjLkygTLl80Vu+YiqVzmiJPt11nMDQM2\r\nQnVAK2Y6HrCXZrqWFVsRhOB/WQ6nnNna2qI61MVr7M+/C15foDDMLkP9zUIQ\r\nARCCpC7/87pJRbOVUfV3T1up6/reZQI/+dNVGeenRmOGD0hFXq9/IWIWFOxb\r\nlyYAEfB/QKXD/cHYnMBQxHRNEgBw3B9/LOw/7gSHMhXR2ef9JNFT/GjDj1dI\r\nqU3yJxa35A8UUGTj0YrDx9FhiEO0JsHBuEk2GrJB7zgRwmVuZujW0GbqHHoJ\r\ny3366uD2fuPqKMlk+7DezAgqqOVczFXrwyCumOZKU/7GDS/xn4MBU2WofNNc\r\nellKbGQrH/LXCw0naHrx0TGIn7ssUTwaKAVWj8wKO8BovTCRejqgD/tIk3p8\r\nK8IRkJQ+Dqnd9hSPHSwaCHRHMcvN1wnDw1CeSJTi4EEDO8fo1WfVJMll/2QW\r\nlSSaX1TXeA6pkBrtDehMoWKBA97IriKS1hws4FF/wifhco99VvY2PLFzjaNX\r\ndZWsu2I2yvFSXr7b81/X47+T6NyYsKGDmLXWDHPmCVkyEH34kuUsVtK+/mwK\r\noTn6SZXT5BJ47A+a3FSbq7x79jEpETQMsEd50koQioZNO5SODzArC834ZXNA\r\nJtiWNemldyi/4XysnlqQoE2gvv4c1ipRCaE=\r\n=LshQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"fb1672c17322edc438c614d6ea277843f3b98433","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.26-beta.4274"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.26-beta.4274_1654329676992_0.2357921962614915","host":"s3://npm-registry-packages"}},"0.14.26":{"name":"piral-ssr-utils","version":"0.14.26","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.26","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b552bb9a47a8d20dd863e3dd029d6f0df9149456","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.26.tgz","fileCount":40,"integrity":"sha512-iqPDbcPlcz5+tS/J2+4qc7UdPF3YCwGKJ6Cv1JK9AaqlyDDWKd3BkCw/xw3R0SBO1OI2j1i0d2JPLLvnsp4DXA==","signatures":[{"sig":"MEUCIAqm4TOoOaiyGrj2WFfMI+1RIg9lPEDWnQ385xbEDHtHAiEA+gaS/4xNgx7onM9R1klKy/3p0F9wX3+z0JpSSSx+5Gk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinLvYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpTvQ//d+pc7MRjkwxRIvvGslcbY5VjYvZa8+LF5mZWRblksI33UENY\r\nbcDLY5HpXeDnESoKb/jtcYajaDiOXn8qpkFq2jzi8QaudvPMazWAidiQlMeZ\r\nBC7XbGldimb06M+4hJPQ11Tb9W7jDH+iEEaXsu4tyVmxhGL7p6JYOX342avn\r\nPS7Ezu7QFzBgOUwgJWs2SonexIwncudYQx+rYIWsFP1MOV3R9XCc1Wg6+99+\r\noz4lFzTrUvwSKMEWrDWoLJQosVvn9iWy5UDwVPmyeaia+929VCOq83inayls\r\n0ZPNhMDTKHTu1E0VIe68HqmDFi14xdTaaDnDYGS45BhTA4NWMeRFRy8Ln3a/\r\naDae1XiD44NELUH0KDNRyO0G5BTqa9EEz8ZvcmD62pbAS7pPifby3qYfbk4h\r\nYFlKjaOUc7ON5qElRKKDlvJq7r1IyB28GeUi0Y1wffGpB0O+xEDWDMF5pn0x\r\nRdDArWUOHV4Ek5v9gpsGPAbb+tTOpl0Wxts1bN/LwDFf8W3mqs+NiBSpICOG\r\n0gQtd25HqYB7bnSEduwlsnRrD1v8IwQOJ8ELVzc/6aNTb4DOJFZFLX8LGK1o\r\nhj8tMj1wKYpJF+egYIsL9xmORGI+4wL4H7i4MWp1wTBxSS2jh+uuNa/MYU/e\r\nx4Q0UNJHWuoT2SijJlxTtdd+/qr1OlwCC/Q=\r\n=HhCz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"8de8644cd7d8af46c85188c31459e1bd171f7ae0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.26"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.26_1654438872598_0.4097196527372189","host":"s3://npm-registry-packages"}},"0.14.27-beta.4280":{"name":"piral-ssr-utils","version":"0.14.27-beta.4280","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.27-beta.4280","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"40e37a24d7723c989883095157a454fe5d7bc906","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.27-beta.4280.tgz","fileCount":40,"integrity":"sha512-iydlr2Nl50vnj4xeGM6HeAttaXjTY7edpbkxZs9UKQcJTnlDnHLzIMvSDbVPv3qAWOgt/YJcCLSxQzC1O2Bixg==","signatures":[{"sig":"MEUCIHzpSidf8sIDfUTVinvDAzqa0j8ZNtGleKnCCtdcCqJ5AiEAqyQ5t5HUBB9nI+ez2lzzzU7ZjOBH5Ma+MiBaB9Y9NlI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinT95ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoadw//YxJH7alT4G4H1rPCI7fJTCst9dOKlpmjdnZYG/Qk/fWqAhIP\r\nIgLhZcvmrN8KH9BgN+FB8WEQJ+qDZtmg2QsF9PKefB+vFceG/5aYKrd3I8+Q\r\n6ql12Vc04dez6wwxq6YRew8Ykb6Rhww/UMdGzB3oVbgIMI0lk7E/IuuG7+mK\r\nCBGSghwmGLgbUpKEralkluAoy+4DEi0xc17rEMGn3OXlXSt5RAsMSvdjaxnV\r\njHleGoExeynE3LlAGcD3I7+7FdjbmcrrWYaKJg1GEPseBTrEhy8WrH6p4V4O\r\nmt276LEmFQmJ4H1LWF/uy+cSJBhYkcbx5XNO3iNQ8j8FKC7OIRGtlBRl6fcO\r\n9AxnjxkToy9uByYsUntnz/DJm39AmDyMEfS0ZsoC2w86WbmZez7BDVMw9dzx\r\njPf+WeUcaOeRfYFiBMPvw/d401MDjBQBS0QEKBBM8WptaVpiWvt1AIU782MQ\r\nU2PPr+k4co0eD31mZJVcEqneSpMPYPG4ZswDj0WaFQeOxzyh4nBMT3mBRnsX\r\n1WJz1ovtmZYWXFs9kyoqsNuJ/hvDSH3g8+QfAWpYBIueewHtiEBUpFLUIuSJ\r\n3TXCG5CzkG/kZQmTf3y6qoM7V/T8xdhaGVa4VTK3pQ0CqdNDiqulWKKNolPf\r\naDAGSe98v1vBbEKbhsF98lHlh2RHEkhyNz4=\r\n=iPFg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"eca73d221819f50225ca335cb8913c529f252e33","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.27-beta.4280"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.27-beta.4280_1654472569188_0.09660678628278041","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4284":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4284","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4284","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1c0398780db4eb47597375a72270530e5f1b9a14","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4284.tgz","fileCount":40,"integrity":"sha512-86pIHOsE+6/eWMi2im2QPpQHduyQjv56Xt2jnljCiCuxa+wgUD849Nfu2gmjTwajj0FcKmPrefbgyz9HGAOaAw==","signatures":[{"sig":"MEYCIQCg/J5CG5Uyopos/pbLlH24lxgYocsi9tIw4Q1TMCpwiwIhAO+K8pIe+5wIMMS38DyssgOroVAcdx+5GGP6dvovRej0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinc5rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7Og//ZIwXIxZMmY9W8hwsoHN6ERP5uXrPx7BtmBeSlD33WSeWIvQL\r\n2TxTFDZT+Dnnd0+KYjjKHEipjahb1SkIsQY1iboZ2Gy+RER4D50ZucbiaYYT\r\nlqU/3devAgQnb60pWkdWh9b0Unb98GAF3KHMDcsh1r02pIKlqb0zKhglKcnd\r\nn+1TDjW4ZSObbpN0CE66oH2RpD1Dh/uzThvVBGmk05PyxNNWm7djRxTFdr5u\r\nAB8GvohLvgUTNWGQMQjg9Y1plgUUGct38pIsfnRXe5kP/6Y22s3WRdLqmptZ\r\nRuYoofqdDk3fyFlN7oFscsyTATPf1uNnoUt0yV3wxiPoUat68ioDipFN/3q5\r\n//NE0ZCZjGlqLiY0vKzeVmZ28eM+j3GoN3hIPbKpvjR6Yl8Zr0ssPS98FMMk\r\ni+pbHHI4WdAvH4nrBfn+HN5BJuBNYqIdQJyEZ1HM8GP9cWDpUNzY2m4Qm4ee\r\nTCQ2aRc5SduwRVNxN7E+bzytMZIoZvVqylJ1xmJC3onGkpnWnscBNJzAUALZ\r\nYWMschSdq+Nao9lYS0dsxQivPsK/NyTTWBzCqPGjRwv3FiiUzkQX02PLb5SZ\r\n3cc1D+Bu+LeTZZ/6xhYDRDmRigV/UplZoQHgJFh8G7CYup2tz0VyBPdpgiHS\r\n808KxHJzlQZ6rYU71jkEmN9dCd7c56WwYAk=\r\n=5WXX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"c48d6a2c320241d04e3c9c4c4edb423345003587","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4284"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4284_1654509162819_0.0984507115609794","host":"s3://npm-registry-packages"}},"0.14.27-beta.4285":{"name":"piral-ssr-utils","version":"0.14.27-beta.4285","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.27-beta.4285","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"43969a823c572d69c4b6ee746a7c47e6aa2f37e8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.27-beta.4285.tgz","fileCount":40,"integrity":"sha512-dn3rPbe8TynhrjKKslzSQI1OIKM6G2p0A1dvAWQCYn6BTffkYpCl0hSH3Us/J/HgGMTasm+mBDnUZQa2NzgWdw==","signatures":[{"sig":"MEUCIFxdkjarkZ6CFv9017DZxXkY7m0fthUwycmp9wDOKPqfAiEAwwO+iOBfc82S6+q65cYyLgepGtMXoFfo2t9TowrzPWY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJine37ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp+6w/9HxXHwueIFLt2UyxfMqkVsR2p1sMSiPPLa9dasQz68MrynZC8\r\naF2xgtEQeEeuvEXIG7X6lpMv7DcyrhZQ97URuxtd5Uvh7owqA8sovr+WvZb1\r\nDZQjmpZeEj7Tid82RSJDZNcYit+1nsJFik77pUtqUlf2B0ZB+zBroXqAm3Ud\r\nRGgMrUpAWYrqgcUouycRb2H11BzFCb8pxPwY5jHuJFgETNOWQazK4bAv237v\r\nY8GZXTgzlKSLnG/8THQXDTrR26W3DLpmC4x3a2UT3JtWVsW1+oG51LjJjynM\r\n3k6w6shos1Mh1vWFoPJpL2Tg2udemBVPMRAlgS7my/Tq1BaNWyzdydkMHebH\r\nV8N9/7d08iVzDVfgokjmuHKnW7iof3D2iTcQVclIkqKDKTWy276KcZcieuYF\r\nB2XJ4flOnihBdSOUAqsRjXZUraZ8R3wBSRgzcnsfqyC7xvmGEycQuND9iBTO\r\nfB+2Zqmx5/+miQHGELJH51sJgI9laxJFe23EDzmmyjY8WxqI1k13Ay3WVzNY\r\nSFuoBgmLDSPqU5l2LdLBWS/FINsZ01CuHcvERsAGcF+6/BAMEA+Xhi93uQZA\r\nsCmIQJEFn6bk5l2Wfi0XCy+j69+Vm07VsaHG6ESUuy9tiilMmjKstEideLL3\r\n1cS31vKDX+0pZWUc2QT3ddccamVv3vqsbUc=\r\n=UMHn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"a727acee9d9793ac10e7db71999059cf7c31a88a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.27-beta.4285"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.27-beta.4285_1654517243166_0.7446143735630262","host":"s3://npm-registry-packages"}},"0.14.27-beta.4290":{"name":"piral-ssr-utils","version":"0.14.27-beta.4290","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.27-beta.4290","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"399196695c0b9819536fa7bc68677c84961ce4b5","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.27-beta.4290.tgz","fileCount":40,"integrity":"sha512-UQgnZY1LX6OYY6bZo8SffnuaRJjqEizAtvvsoUrEOdDS9Jdb3OpHaMwTVpwqesUYdvliMSff4erAtpXUpxNqVg==","signatures":[{"sig":"MEUCIQDojQ4wKF/z0ya1HkKV1Usd40I5SIdO/sltO5/T13pm6QIgPMGaVAu9DCZeLjxiADity8J4Vu3FJkGA6BI2rhzVIco=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinn3hACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZrg/+JzwcAduyD/PzNFOX3cbiV+X6wEtfR4JCkjlbtqpFJfKjZvPb\r\nOdu7KPp4+g/j3QDig4uS27SMznDLWEU2qlttFDYCAt/bev8JyO7EaBYFTPR4\r\nq4AjHtUsIDcPDpNoVbXREazAWbqeA8B4kQ1aI8VmUWcNTDte9dfd5uNqx5iz\r\n8w+9r+m9gCbC0ZpINmO2EK7CznDUdMav35O/rM8caAZNsavTGqspV72k748H\r\n0kIhVa5pLMTb4CvCpyR+wS3kdMi5lq7LK5VaC1uMT5A/nRAlwsK4gpR+x9Tc\r\niS5N8T8u6qtM+PMDz5P8YCjQm6/qMqIsivUpmsnDDNs3AlIkR8D6I6V5Kwx5\r\nQ1iM3VJnJdP7tgVCcV/u8NiBHC8zfm4Co3TYvZK/A2wtSQfv9Kqfa9+ruoEZ\r\nN6LrDVCY2GDBqf4/kX+QVtIYxX5aCp4yBvevm8djj8+PSW0xHXPBmJ319mrx\r\nWAgitEB1R4EJBAvt1pGS60llq4DYtLpqzlSQ33pDZRYo31Vb1mGy45jl36T/\r\nOYXmP9526FUSHxbSD9KNJkltQqX0a6MbdheGgBp999A0kRGzcDNjyFPkYZON\r\nT4HVXji2s67BT7DmyVO1a+A5utOfM0H6ws/7qIFsWBR56TYqmYqs8VkLfxCv\r\nJQPciKRrccm0SUd5rFlmghPy6BkzA1tEni8=\r\n=C+LV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"82fec640a46c17aa9ae03dcf2c8ac3895bbabfcb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.27-beta.4290"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.27-beta.4290_1654554080845_0.6581374905988655","host":"s3://npm-registry-packages"}},"0.14.27":{"name":"piral-ssr-utils","version":"0.14.27","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.27","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"705809e196fe8f0a1da08b4be96eff6bcd3a8c32","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.27.tgz","fileCount":40,"integrity":"sha512-Ywj/Xi7BccMVI5F/v7NqaKqL2n71NKYsjhdITiDdjfCSp/gdKtVISplpxcA+J2JYWFRCcfjAOuX/3rCTJSjS9g==","signatures":[{"sig":"MEQCIDpvC8g4X+JIvEwglYvnXQGPm0meLpfDGl1Ep5QgINuCAiAincqKG+htNxcBoax7oZJGTtt4qouE8Y0+nnnYuRfQhw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinpm0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpXgg/9F95aZ/loaoDq5DCttvzewXA9I1y/ENCXP3ASQoNFaB7eLg78\r\nsumF+Mg65wcK4VNRYOAL6MqPr59mk3pPypeUKND0RgQYcnLnUqMhvCUnlDik\r\nr/1MDaFls9WbbfaMkscD9t5wCNIPY/gEh5I5KIQ3x8sFFWs40aXgfcSuN8kd\r\npucPX4svC2uyKMm9a/PCPo3kKsrqrwZR3Mkbra4Zy8oEMVXaHKWiEjBOLOTJ\r\n5tBA0Akn2JWWKbVC5585tJ3YOYExc91L+zGYdxAfT9+QJWfja0pubYPVqdsD\r\nFZaZUcYGWRzSCFFk1EzkVEEE1zYH4zXeXwM6J7XN5aQWbMRfgTCRxIse4LTx\r\n5hWhTougERk9ckOZoV5Dwi9bhI2eb2uhmnxSvEGXTQ7jqu0BSC8i+BoRMVx/\r\n2S5R/v2E//sQaFt0kXYe0pAz79hVDBOn7BJ3sksva41uisc/Gac3WNQDfvL3\r\nFBaAwzKKtnerbNesD4aWpHdMyI5KyCd4TCm4pEEg8GcRykXJwBTy0DZBO+B2\r\nRisRvZmdEzhN7qJfe/P9gXnqZj5bDHVL8Lk+Co/NCE1YVE3ocEPfDIW9ydrp\r\n6Hht033yP149MbB8vLuxUqt0EB3ytPKDYdxYbm17u5HO1AKnKjKX9Gk5eo4Q\r\n1YSg6nPG2+Rkxr2Et1IXqkcnKy1D6RkrIuQ=\r\n=zO1g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"fc4bee782e8cef7d071fc9b0209e485b6f30941d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.27"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.27_1654561204120_0.10975575789585901","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4311":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4311","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4311","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"18148c3e7d3e3d178db1768d43fa1b7d49b3a623","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4311.tgz","fileCount":40,"integrity":"sha512-deDsOhdl9YbY+/v6cKYH3jTCHbarwKUaPkxjEC+W2w6Hryygh3x7oUHj8mMbPvagHLqwGPakGUYoy+vu+W3mLA==","signatures":[{"sig":"MEYCIQCiiBJ+WQRThxjoUYZ/HfmzKLKM0RifpmwgyiN1RGMjLwIhAOMcPYJZ0P5VrFfQzV4WjGWf3aDj19AtZurri6vU1F0h","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJioKcbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrCwg/+KqWPvP4QaloPFVDVDNuG9nS+xWZrG/Z+nX+tLrbtPAxuLRO4\r\ntWLm7EVOElylBW0O0vQxlI75ZkIZA9W6za+UWAe+W+8ylhm2yHDMFZfpBMp9\r\nu36xFFFF8XQG/I32WPmsCzs7Fb3iz0z6mh92/gdWVXM6r/mLaD2P3LvoK1Hd\r\nqrQxncOxX5gHPne/pUfSG51PT18ph4LugugecofJpX+LMmcvqG9W7NW+QYd5\r\nezD5nzvkCnvgIkiohZWmTIEMwWAAhvJJZiBTCfRUnQzy3ZqKDpScb1/2LbCq\r\n0NKD3kIffAm6xMhrbnOYPu14+Na/VA3eEL5alpKNgzSmvjzaCBGMBTyKzFLF\r\nJ0WQIF7xpxiI25Gjqfa5lfCElehgtlKeu48xyTAC8zMGvxgc6CN4sXy+yc/A\r\nOiufipOkNldAeFQbN8tDwoI495U8/6TbvQlCeC0WnvkPbNNcIb/fKvXLJkTB\r\nM1ECY6z+2tfPhvDpXQElLStpk2Zf1+X+Ins4iAFen/x+WiPFwM2yeTJHFcbh\r\nBONBfF/kV48MWEYSNbKxmsrhg5v5xpiBFAIwu4vrJ/aLHQx8SRhnz6bjNcT1\r\n6kbXRGkI5P8CBR+uCr4IiyaQI8O8pOEX2G7gaI0xkspuM9q1JsWNTdNfYg+T\r\nNne58pFIeg3y6Hsqs7IrFX2v11ckWa6BiKU=\r\n=YglD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"394262be7ca4f7883adf6d34d5635445fd1ef9b8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4311"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4311_1654695707568_0.03497771404784311","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4314":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4314","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4314","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"13837e6e5043135378d92aa17b7fd4e6a1b7ceb8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4314.tgz","fileCount":40,"integrity":"sha512-9cx184cn8iT8ZO/s2CDk6U1PKU/PzBWCyjwj5KLiGoDH3yz1u6oYBb3SNg7je6zCdoi+YQLEKTWJYkYVs6ZKSQ==","signatures":[{"sig":"MEQCIHzFVwFW3aipiQHVcTh8FpO5S5EcufaV+hDui8dKWkWcAiB8aofTszajHugjf9od4W1RrHrqEsbpCNcldchfmBSemA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiogseACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoxLA/6AlKOk+NCrFGTNOnRmWJpibAE25w4HXggwbUjPVEgFBDX0Vqu\r\nwU4WaOisQPLlgqEe4HjrLbyduStWQjM/RJjmrcAQukP8v4uWhkGrFPaxPu5r\r\nLTJ3ibXRH2laqJnHBtsNqOG0ltJPMv7kHa4JgA+bq4GKpXDtB8L8M2G4jk4D\r\nBgbCl09EhIcfBoxRS3R7tI9BxdmS9PIhhdv2mQzO4MfXrP2QqAJLtWiq0dxG\r\nTjuStddTbEahAxld5gK2RfYh3dFTho0NYvSqw3u+oGEyVDZOiCR0fSWAjhhJ\r\nLvjmFJ62wyOrlDNP83bfm4V6I+8m0Zt4TPHkYAbtc92vFdN5qCxFXdmoHZwR\r\nKdYjD1okthhwukPRvrdBZPubaT22gMZKn4mwjaaSd4QuZBA5/PWgJ0JrLBAS\r\nUNQxwkUqo2XEsUZWmoA76eY1XULvE/242sCE7fwtL0BM/eYEK7kC1tyWO3BQ\r\nS/n7CfDJZYley5LNSRQQReN9PWssMikpgB1ixiXY4JbyKHJ+S4aM9skGEcV1\r\n5wEvC0CmBYQU4SCRF5A38NRfrPjE1dV1J3jElJp07ARyRnyQVcQiqlna9s5J\r\nIrNGmeZEAMikxQy6wNimfd42tYqtu/zeyr039loDuebOB5y9srO/pExRsB+U\r\nKphzctmaU1mdyTKS87/dc/JUOW3O6On9m5M=\r\n=DI7W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"8bd59debe22a0fed137458a5295eb2ea43d9e0d3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4314"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4314_1654786846518_0.8430210715568749","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4332":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4332","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4332","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b71d2bf37b3f9b2beb563bc4c38b669df49646fd","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4332.tgz","fileCount":40,"integrity":"sha512-qdaF98sGuEy8kNcmWWGAzI3SaC/sWNXPwnDUTTwURfR24GZD5+n3uu7bJ4U4Exm1lws2LEsxsrh6210TG9PNuw==","signatures":[{"sig":"MEUCIQCVZ3WmQR9UE9vd3UDrInTd4pN0X08hC/gCil+pThykSAIgYVYUJrgelyOvRFd7Obq3z9eUGKVqWTG999tK+Nd8yTI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqGHpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpaQhAAmLTrcvuNVP1mtAh+aPQU+iYUJ6ugFOkfYGMYB7AYe3PXPNO8\r\nyuT3M1LQG4HZ8MBBRcCHvBKLGDaH4RmAF8ri1UkClPjNNIpYLsrXiYlw7chC\r\ndbRXg8JSvY1H3VQZt4XIcT84fwztMFWkO5fFBYzX3pLy1Fh11JShHyLHdaFd\r\nC1WtUJrlEFXHTUtYyy3ReFw/BSl4mSNBQUy06L2fwzZfUgTmrjCqKpDZ4FO0\r\nVyUwIietIENsYO17WLJRFnOyGDjWlpD5i76xGj5YEz0GtDfTi8A3lx3sNRpS\r\n+uGZzoz77l+B+bJLHsJuZCZto3ocb9i69rqU5fA2i6gn0rVsA3B//whfy2N0\r\nbHxXUM6NR0dN9h8HlpmIktiy9wuW+3B/UblK7vPjEq4o12IGbxOszb10LJTq\r\nZtGnUsOl6lncF66BF5Ymvsl+KoNUPAJ5d2P0y0Tx8Ffsx1eSMePSHm3AArBR\r\ncYtbeGRRcG2hXZ57gdChGDBWa+Gf3sKGMgaStn031loWMiwC4je/ej0elUFA\r\nsi3f591aFb7J3q6k4GSfVSF18k+54wnAjLGRJYqP0uW5TqN0JyZY9olPFNyu\r\nA6NGa8eHZRsI9o6Ewjfr4oiEV+gj19F3R1JFA1sLh3afDEidec5g3nrJjzyI\r\nwoCKLCTs7bR00P+bZ4qudXv3lmNC7RsuZW0=\r\n=4NXn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"109cacf66ffee5af60faf7bc861e5ffe8c9a7cd2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4332"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4332_1655202281294_0.34577495422444393","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4345":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4345","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4345","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6bbcdb0ec90665416e3068930d097251ad5a57b9","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4345.tgz","fileCount":40,"integrity":"sha512-KQ3bJPhAaRI0Pi9wUqASZCclzQbCrWWQg2Z6x7v3o96VDCi5Cjjr6bvtn9vs4jTz2AlulfQ/ppSlBBz6QdMolA==","signatures":[{"sig":"MEQCIHF09RtyhJA6r4PqBfGqDJj0H/DKpDIjYO3Mx+VerqH+AiBqdIZ8E9CONlSBq4M9DiMytt5g8RXWIkGIPgqf6WIt8g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisQFuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2bA/9HLtqk3s3XU5EPqdmR3dQrjqwOq/XAEwn2DeaNYGzbt8xhGZT\r\ncjc7nwvh1i4V2PRvPdjfYFZ3e2Gdyae9pZQTiRpplbwVrptnDXu6gPxzrT2I\r\nxu4AH43w3zgBWJ7DZ4jOp5ZQ3ol0p4MoZyTsWWUmdUf6NihpqIs5iHc75jzv\r\nF8nf0jV4LfLZFk8eaDxvWS641mJtEbDcLrS6rzvIcwcu0J15pe9Yia5ma1Ni\r\nb1axgOeXsvwptc/OmhaNdNlqTPn6mfmoPBVqMeed6uj0f7Mb4o2kel47eQCJ\r\nJqgmqcI+jADYbqHXm35pz1IeyR50m2X0YmOc0473zsYJJiGOqdYx0O3boenC\r\n5/kJEEZr4HHXoQ+orJ0+KHyjWrQ/b99W2//BJ3LycLBgFnXher0rIeFyOztE\r\ngGNoodPLC4GbfMJJhg3r/vtJhgH/mvKh7s9EGteUhcAKzNMbALY3OOzv4385\r\nNVD+02zVYt6xm7WclVH8AAtnIJnB3kGznSAoGxE7f4gyXb9E31JuAC0zWlVz\r\nQO53wm8BtZpeEyaEOIgL7ngWQqu2YZmt8g6YNlUVlSKwrOq/JmZITvI0USWL\r\nysUe0UVydW8u6yWpltd1M8J2g++Nq27UDkK8rRrHv8qYX3GI48CgLIDfBYG8\r\n1KIQm8lcCtuK6BtgqcC1k4kyYh4CxLoxjKs=\r\n=m6jR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"56ecd6ad080b3d275752b19afcf8435e4bd09140","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4345"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4345_1655767406718_0.07456470831229467","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4355":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4355","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4355","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d31de5130ac2b907d563e24e22d28a935e64fb9c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4355.tgz","fileCount":40,"integrity":"sha512-t6ht+suHGOZorTZMMh0VzzecL1vqIcpsmdPDhm6IO3LSG/dgIAiZxCBOGN3sVLDcIUbZb2f9zjhuywl0U4sW8A==","signatures":[{"sig":"MEQCIHLv6ZApVMNlOMQ1vD189jLZhU4enS5usSqPIXLjcolsAiBpgU23qSzAfkFKe9YZawLwkXEbau2GJMsWfP5RYK6Sbg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJitaL2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqIxQ//dszGAEtkcb55ntYKw7FsUtkuoN01o+qA4+QvOIjs2H9IyE9w\r\n4fjKtn5Xlv2i3s6AbEBjLJV7Yl/45QGUld1/vdRH0A9ZN7LDs6VYX/XD97yd\r\n3E/JZg9RzsTYaNebuKE1BUBgudQ+QwePmT8kTGlxKqgQYb6h+B93qtr4HnAX\r\nl9ZGiR6gFfG40OnFoxBEWrbsJL5bhzGOCJFeE5Z5vudOLvS13IYfZm4ins7w\r\nqYR/HB+g/hNT6TSOe0MdDzTfnWvdIbR92lXTG5pe5NeNRNQcoViziAEP+ZwM\r\nnav2Pr1YSYk3hYTeZA5eMSuqCISUD/MhAc5jZKPg/jEKa4JHKushIFatZ4WX\r\nl7DIRQ0Zn8pyfozf2Ofb5PABg4JZVeOJ/vwifNvQnPRAOFsqYp+OVvViEOKz\r\nttwJJIXAqdMlS4m9PTLlvgdGdOMT9p19yTIs8AtQ0KhiwR52twFtvXRkeA7J\r\nAxNAmKfTV3ZmmL7mYquAfuFNd0A26tNqUzeNGOJcVccEoB3lYWzeRiAWbeFx\r\nO9CIC6lda0JUY8ay8esAOTIjFiy4whryQubFOunP6FS6IoL3gf0zWhAUaQm7\r\nun3UIJ43q1z9Bq4BvZ/1YJxFDPg7fDhYIhoOIG6Dv0TNhVtQmleUTYlwwuCX\r\nXsbindU0Ve/82tHqvCAT4urUjyrUMTWGXjg=\r\n=mFTW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"a4dda359fe03992cd06bfb808df916747beb065d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4355"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4355_1656070902686_0.7399832582355583","host":"s3://npm-registry-packages"}},"0.14.28-beta.4360":{"name":"piral-ssr-utils","version":"0.14.28-beta.4360","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.28-beta.4360","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"362691dfc57463d3ba42e754ec34daedd138c198","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.28-beta.4360.tgz","fileCount":40,"integrity":"sha512-MuLVGOT7XUgMf/4MslOyzu6WnlTeS2yTrRUVmr8XkJYeCsjPLhoG/C+AGX6a04Csjbo8TB8NhggBKulSEAZMxg==","signatures":[{"sig":"MEUCIQDjAQqqnw7uFDYh5/oKQ4BidLfMxdCge3YZdeuXgjbCNgIgKgcW5ogIuBmXJe61pGRWJeUodODJE7fhqYuQbdXDmeI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuaOZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWVw//Tr8CoyUNIE03E1dI5a6iOjxx9ZzHag8/UFZJtX1FwGd+9yap\r\nSq8WcE6s6vpHYkZkU3oouTDfIzGlYVdTkU/wi5/eh7Zb7WKlVcTWqMpwnRFX\r\nNS7i0epqRHSXy/odvh0cZANS2mYIBaIgBp3s4oPezvnPdCuiOr6M3LCT6w3e\r\n/lv121Wsf7QOlu2ot+NpYmMxWjvLLjksbjbulHVZJ3RoS4v/Vz3bx29quSt4\r\n2kmpX3VSRfX3wLlUcXb+/QpdIrlUosIpdWa40s6Q19XoGG5cJ+A97uBR/BXH\r\ni36k43K3G53eiV1uUbPItr03VfAuSBSO1MwbE60OY7t0GmKQoXJRYY6WpubU\r\ncnEbxcVDRav3s7dSD61wxdxbP7HSTBsfVcqP4vW2G5dbH1YSBgr7X5RrdDHi\r\nyHDamSc8D1UaUuMNKasKreSpwcYQVYEa3vwNQ2YAs5wYebZjuLZCfF5E1rXk\r\nKM499kUBk3GGcAyXuj15tZK4/POYS/atob3jS7IhVMIMCtpsRpwKihaLbn1D\r\nyqpSuAGFp5p6HWn6bwc0BVC6EKbwnUnT0lwlXttNanHxSGaYP5IJ2KMJA1Ug\r\nSPyVZBO+Bip2UQnMtU1xO8JQ8OYZDFlUuPuHMpZzwv72OJXs+Gt+/+fnR4fP\r\nmOm8cap4iPk95qHenSVXAdERZfbykCkuZYI=\r\n=GPMX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"d7d2a311e7c9c2707d46f41a78d435ff44bc7169","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.28-beta.4360"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.28-beta.4360_1656333209362_0.5726679713099057","host":"s3://npm-registry-packages"}},"0.14.28-beta.4363":{"name":"piral-ssr-utils","version":"0.14.28-beta.4363","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.28-beta.4363","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"344101454d0a484f427be9d52dd2573396d7de5a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.28-beta.4363.tgz","fileCount":40,"integrity":"sha512-7FFDTrDGBR6GvV/AVJ+xaZDRD5jEYUzCsvQtD0xkAB93CsHTgQeOpInwyM1aM4zdzBCG+39upPNS9Yhxmzn0Fw==","signatures":[{"sig":"MEUCICT/vFH0yWgpUEPAhMXnCKwr53/hHvPFS0yXIljfIPZJAiEAw++yqnVlEUmUbYWa/gC6BiIPf0puRw+5bkS32weOOD0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiusw6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrB5A/+PL5JqwKJtWrgbUl9bhJ/ycsgUx85J72gooUHoYJok/AIwElo\r\nlKHiIkE8/JepssSA7kP4Jk0/l0DXomOCnmvp/Bl9wsHNFDUKg/4sGDUtdQcx\r\nMuMy1wvGWZeKdcSF0IPDO3Jp7UIvCd4etQUUUcFpjot5KWljhJUgj97L1D4T\r\n8ZMxahQkQtnj/VMMt0u0mqlVzvIP83dgGj8iG8EIkABvb05/4/77AO37I8OE\r\noxuaqzOZI0zZKxQTCl14OLN+goGVikCiz1/ehWfoEoCOGXxP8g4MeFIA4TFO\r\nVnAD/drtHZY9W5UHstgkc+/U+qVgn5x21zhnX5rk7yzeieGngi/TnPNaqPqr\r\nL9AO76jYb8o2gfQbZ8Aw1CEy7E1O2SzhcMt3Vx7X4rLX6UzrreT8Tiwwi3kG\r\nVH7yyMssykZ83lo0s1KQ2w8qW7q5n6WDFuxr+uLd3KkGDtGjPpKbCRhxevGz\r\nRGJI782YkN9Ru2LdcVUO10MJLNtvHmt+QjeV4kYpDOGlebKgFeo/L/54NMNT\r\nO/G2swSZ6GEYbRpXOdm1R3bFzgZCuBTCa+iqy0lJT+4J9CPCskZCWtBFpJUL\r\nmZnniRPQ+RJ+aIW8QTHA8eybta/qMk7D92//XuMq2KMzRrzSjyEcOhbn8uDY\r\n2RjcXMZtdFORKXVNS7aMH3woZgAlFEfHRDM=\r\n=ioRs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"d9425ff60676c2a1ae73f1d5c13527c58242badd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.28-beta.4363"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.28-beta.4363_1656409145826_0.8214579740855248","host":"s3://npm-registry-packages"}},"0.14.28-beta.4379":{"name":"piral-ssr-utils","version":"0.14.28-beta.4379","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.28-beta.4379","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"479f2dbcef4d590fe233f0a6a0025765ba38a318","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.28-beta.4379.tgz","fileCount":40,"integrity":"sha512-7avfJPK5q2bVHDEUv38eJtuXcH6VcVu3QFii2eX2mNYajN32mZFT0NAhpD/ZbXwVY68dUd4DS8N7YCzatVAKCA==","signatures":[{"sig":"MEUCIQCayfJmGr6iNP4DQv+geR3bt46089qZ0ImecItoxMox5QIgYPhe4rnWxACyUAl1VTocQqQ9YPEOLivx9vocVc4pKe0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivp2OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqjKQ/+NiYYfMw87MUJNZmpfY8u56LqkcwB9G4GsgnvdQyEAVliNL/b\r\nWoS5j8IMkh1iIw7XN1dspRqF4g6hq58fotKm7SgOhg9+iEb3YYYjNubjaLqn\r\nNLRKvldJ3vrQ247aybBx0l8CyIlosQxkkr8zFwrec0RqB/4Zs7BuFhz0411M\r\ngnAonBya3dMBIDssIPlGmpLCix5ozB4ZoGXVG5c+0uUwXFKUIM97jGPqBMbc\r\n7ZvdJRaCl47rwlClQ0SVLn1ED0JPHmIzaVOFbQjHHNma5dEnGHMW29sgubv4\r\nO5CZMp8vyGtW433cfePqpOzxROilrZ0owXb/kQ7nSkF1S9uPPxAPnXoSUuS7\r\nCWwnQKnWwVWb9/XUkyvhy8WvdogJFnL23MlGmjTgfANi6mpgxPb8ukegUhws\r\nzI6rqxoGB9/8R9l4CUFCo1dDd3vBkmhpeQKbgvzwmoSv0VHSUZze1YYcAAkq\r\nm1AWe6l3hfkIbbcu5GFbCrYBxw5CSPpmftIjkrbBvboJ7OGIcTCEBlKziW1n\r\nYB9z5Zt3k86YAbijJIUj2GTbgoJrV9TbvDFcbVvLiib4PGFzG5iQpbLpV99C\r\n8QYIUZIHxcLPyddt66jGsEfE9ZdqHq1gTt5If6fwDBz/x0SzQnKgcPfx9gRO\r\nMSF/9RG4PU67mG993tqdc1XHOU110bfbZN4=\r\n=jKHr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"b709551801efd8c4db99e1e6aa97b7479c59dcd6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.28-beta.4379"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.28-beta.4379_1656659342255_0.09051210009196375","host":"s3://npm-registry-packages"}},"0.14.28":{"name":"piral-ssr-utils","version":"0.14.28","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.28","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e3b12de727b90bfdf0de1ad899225cb78aa3574a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.28.tgz","fileCount":40,"integrity":"sha512-fTKKw5w49DC7zo/1p7KVULeXCBkg7EZjE1M3Fuyj5273cTqDB0bKS1k+4mr8YJhk2ncoB37BCwd/+YOREiFeqQ==","signatures":[{"sig":"MEUCIQCQrJAFjJah38/KCBB7h6T54trlhEHnAPwt029LHJIjfwIgZE+S2y6QfEpAXrYmuYUAdIar7UV2lhAUxs6fy+f/9b4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivs3tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpaSg/+LqwSZzCyIWlTA6o7tt5NeK+WVYtVYS+mfoTqzDWO7fnkH/EZ\r\n6CTFRpBvx5zPqL0eYwsNkBcPIuSypbNt2hrdcTsDKLRNbPxqpia8Wcp1lM4o\r\nOHSlUNwGBvm7XEMF/M+4m9AUiWmkiwmWST8S4kU4LQHx3uVSU1EUF9f6RPDf\r\nZCdNJygIqbm+kGFKD/g02DIlmjUWcPUuQMX8yD2SbvTv6EnTF9TyzlxYZgyc\r\n4Nk+EFoHDgGqjRsUjU2aV8QGm/INkES9MSZpyqSvCzse3fY14LU2ulmmnlRL\r\n1Z62GyL/lZfEVG/1NTGdn92EvMHtArR1M4zDC/LK5ByeULL3xVt5SWEHI/XG\r\nS90rV8wxACSnX4u2HHt33P0YMVWZer8+MwTmpmGqFTEgIIXuW9nM3eYxV+Wr\r\ng+s8GSmdoJp0ACxm68NLbkrGPhr05FisJVgVObe9MLXwLdU/tk4EEfFSdbkF\r\nuN9KeLCs1z1OVBgnZEO+QdUWhmioVr53lPPMnz2Vr/VdOaFG7aZjzDskWdyv\r\naHeAeiSDBFnwHKTxT6olyN1NsacriAxSUK7tML9s67cup7CzuLIE8XBfXJpm\r\nt1QgT9EI011r7DIPHcV3sCp4pJs1S4BkHG+wM3DaYEx45m9QmLOKLyTMcE78\r\nkNiSXgVcTwP9e7QjMYgtI59OcIwrTfdAyD4=\r\n=sIHw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"d76ab003556bd113dd00fd41af144411ae974b6c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.28"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.28_1656671724851_0.6969028757793658","host":"s3://npm-registry-packages"}},"0.14.29":{"name":"piral-ssr-utils","version":"0.14.29","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.29","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1a29604333d404f3131b20b3bb9b80259e38518f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.29.tgz","fileCount":40,"integrity":"sha512-KIYQko2uvzygu08MmIhjTcQ5LmB7kYE5awf5Y2DYQ5ZGKsoTdbYM75IJ4oc/ysvXALMbnZb8aGq51IdhUJWqLw==","signatures":[{"sig":"MEUCIQDzm/QTC2aFFMU6ubPCiorgML6j3z+fT6wj7OrsEgFX9QIgdG/4U5U6kjQV09G0ryJIEgl7r+UzAh4qd8CRKqnMh/s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixAi8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmomvQ/9ELZLYU3JASxRY7SPSQd9bd0BF2XZ/gFQ4KzhooHj80z4NeSe\r\nnJKJgH1rvYLPMTsfjt+/XGB20HZowoCBarytmM2RIxxJKFrxLoy5Oz+jANtH\r\n28RuO33RtoRp9MsNhqfurlGFMAsbGGDxvlvlI42Uu3bkryviTYr5fBZf1fPc\r\npyuYk7LTma6am+lfnHEQ+ibp0CTcvtTZWPcUjDDzwZi71hNeOxDs9/W6MFAc\r\n7NnNFKZf+LyzxcoHDXC1rB5i0VMDp6fJRgXGOou0lYTnXoFx2oP//extPzNB\r\nhvKCgxnGp2nXmdGQdfHGD6Obagv/eYM20oK9R53xN9llmIfhOEDBiUfHCdZ3\r\ny3Vr3TraConwVYac7ELfJ/5KBeTmX6aYvV1C7xUN/hQvqxhcivwSrHaYfvqt\r\niN++578m5Rl4v2UlsNvOd/0/NAVhTsexBch3kvgudZSuobBuMbSiHWbXbj8N\r\nUFUD0OJ5h/StuPAhKY65wClVbTwpfMN9iQtIqoz9bI+WeR5Yk3X3yKFxi3BL\r\n4g0A8ltLQqhLuibgepJV0EaVfqq5EeNmrbUDpUyOacdRo0Tq5zy/75TyCNEA\r\nvdrgreNGPkt/ZV7dC9EpUM/brjO03SkB6EfiFZsD0/zn+3GfiTzuDZcAt7sq\r\nU17yEwOWiEY9m667Ob+U5sn03T5XDQadCqk=\r\n=FRTM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"ebec021d9d6d469e1a318588a5c45ecedb43b35f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.29"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.29_1657014460757_0.5848571337481288","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4396":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4396","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4396","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"41babb3cd99e9640a84247f461465dd740e1f60f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4396.tgz","fileCount":40,"integrity":"sha512-cM9yO4+tOw+m7u6uVNuzlIMerE/Y2YP04Zs0bVZtb9jKsIdKw4YJV645wTtY/AXXXhcanNKUVOhqdRLev8sMNA==","signatures":[{"sig":"MEUCIQDwdWqzbiItPTIj5HBFfXdhJ5M4vhlcI36jxhpQSW72fwIgIg9SRsuvV2OZqAOcC0p88sdSyNVF2/zFAKzwhzSd/MA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixMPPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpICA//eh0FjHNJkBh4RhdbNQauV495c25daUUkkgrvqU/tZNu9Swtp\r\nH7CAPOjXvyOPhYWj6Kp+YFYbiG6jJrZMoxjh9xmp/Cp1Jlf3/YBYhtPSL9ll\r\nBNa5h52JSm/eBj9Jm0NLJJ2UCQjcaFeFiYAhQvEvNEXNVr07UHDvbodCk/R2\r\nRnXRiz/rjN8QgMOdINPiuLHF2gxv29kqPv/B9dC4tWBAYlIsV/TkWmDrDkfB\r\nhnbi6ou/QAPpvvReHQsGXJUb9NyzACVf7sLwNgdM5I+EDeXBs4qqdJXjLi8B\r\nDhwA/PCqfDGB5v527HyI1YozC1K5tNTVRoQ7uUhpnzze437oVekVcxuLE5nO\r\nECZNrzN0ynGETMwkG8mbtr0Y/hHLofwWMO0u28gFJIU3gDjrNXrhI8Yl/SUj\r\nv/+5oStOdd0FKAjlZsBkyRqHziTpjsQfMmEC9jw/wns8CkcSgxwhWFFKFTG0\r\nvFxDa2xhD+WyiipWTfyOY+2IVKDiVmaoincYqV+lLYiooX9/JqNttn3Qs3GW\r\ncqoMgQo1KALhR4iG6BzDnPGjNm8fXEJOUsji2B8xCAu7OWphOGdX6XNHn4rx\r\nagU57aF8DmDvaYo1JdajXW5kQ99PKMIK0UJLFHowUdxclWvD52zSxhrZTReM\r\nWXSL6M+gs/ilJmdF8hMRmPkxIULT6Au7nZE=\r\n=ETVO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"62abff4d61634b3ecffda2407f1c29f1de929b4c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4396"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4396_1657062350953_0.13182376173579136","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4399":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4399","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4399","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"96e40813c8093a3a11d48a2df34f815610ba77d6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4399.tgz","fileCount":40,"integrity":"sha512-llXnDC9dY4fCBNiManLpk8sQNQMcluSshYgmRLYzpKEi/ZwDyfYxm7vzgiFLTz8gFjKtTUGupafkyhLTcE8EgQ==","signatures":[{"sig":"MEYCIQDVSq5H5TSAg9tf0JwN+MVDGq3limV8EPRXrgKzrpfwWgIhAPgVXhk6ER3Ag2ynZUlXDS4Hms2fn5EZgYv4ZDBaoJcc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixZMXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoucw/8DBHNb3SkqBMZM/9SKzEpxdK3uGbonHBbw8D0q5jeZWbBmuGq\r\n4fR1F38wCvZrwmZwQk2TXtkt/ONmriD7/pqZN2OmobtoNFUh0VYQWbaSuyS+\r\nJkY6RrVbkDpVQ49ZziqeK48Ugj7DNdHcnVMjqtvrffuJiBYGiSCNX5izpk1H\r\nPYjQEMf8JlrGOtsCA/FpbVGZ0Ng0z52LyC0Dj8S/1hpLRU5pijJTuuzmagpH\r\ngq+C6Gv3mJIYcC8odsDnePDKj5Q/E+aIZZZ+/OovanbEc1UhRkeG4eLxadQw\r\nHX0KcqpB9R4hNLicRh+A9GZGYBm97/NoZY6K9vZAYyq4thuU9hrTILGYaPY9\r\n75VUYQ4Sgmk3L5gbIPp/c/3XmcXyp/EZPKqoB4T3+aBD0KafMZWRHcrDy+M3\r\nD//X9JyJFt47LAYql2Q+vGwSBerJQGnWt2svCuxDSzUrTJIyxxG8oIFDVQcw\r\nuDK1Va7iSxOZ2i4A4iJ7YunTxtH0q63E+YOBtUD4OmbJ6ayd7sB6HhfWrRba\r\njBgQB/Kn4yyMfsm97xSjcgmpnmKfgrdSn7ECFLTOThFPPOmHOfRqPjQWPCq6\r\nDsbxjeUEyeX2YNqk50Crm4pdTtOKubl5JaSj8zqMGqvaurmKiWTx9aBAxYML\r\n5eLo7ZeaZgeEUy6oS5Bu9FPLn2NeTPdegAw=\r\n=hHXB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"34be0cac6948a92981ab4994b01b34e44462e7a0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4399"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4399_1657115415362_0.19099321443247885","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4409":{"name":"piral-ssr-utils","version":"0.15.0-alpha.4409","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-alpha.4409","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ac5a7309e5be6c400b716581246deedb679db177","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-alpha.4409.tgz","fileCount":40,"integrity":"sha512-6Y1sYD8/yM+fYsXnSbqMmaVuoaWQ8Zu4zUqJnq4/EdkYD4ttjYYkT7BvmZSxjMMXFpj1kiHwyjovQmDrbf2Q4w==","signatures":[{"sig":"MEUCIQCks8hP9vLd6Ka8EUzUQjwT519ZncTFp5T5XtL+QX8BfgIgWFhrJd0v21obWeqcTCEdMQXgdzPUV9SXVk73ro3Ei2I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixxOjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoHiQ//QqyELFjx2SibTSHatAUE76qF1HFFLM5R3xrY9sQ1vUmwdh7+\r\nhlA10BzauCpjgw9yajnXb7L91x879tCMdbCWTANNAW8Euk0HtNLlx76OVWn9\r\niZ3ICQQTW9PvAv75Z9gHEz7YPLRx7ffFzgjytIEQJheqRVUaq4+UPuBRLweY\r\nj9IdFx5YPobaBHFYsFRvVgvZBQq14oroZN4PuHhberAZBzDNK7xtydvVoGDX\r\nDYyctDb4Cm3m0GR1kptnY+je9+BVUWHi93q6cw6qOdn/O2pQ7jZSSwE26MYn\r\nj9ULV2LoK+BRvAFCkgtoJxpJf3tXLKyqrrJgOOxPoZrHNmFOXLqFX+n0OzVC\r\nCDBx2EFa8SO+C2Ygx17SdWdGITNRLaTDDzPGA1QZTfek+kOsh0FD+/WlgS+9\r\nL9Z2x6OSqv36/VPUce9ZZ02S/XPi0lDWCctzCJxDxsm851730UO/mFKtwkVr\r\ncM+oEzWXScwrMl10iyV+14Y7zYa+h9noZtz6QA4lX97Ha646lGtaobuoaJ36\r\nYD/i5uUcRnkCLKYQCjYUcsZ0hS5XHmZqeBTYevMaGsMLGp3U6pCW1ehEfXHl\r\ny0c6cDsMCDNtyKHZ5rIjWVZlOav5eoPGQbaXVISHnhR59XsIZC0q2JjyqXu8\r\nULfI4YnSEdbRvIcTuvch5Egk3Wc8Qsi3jXw=\r\n=MVlW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"f5a0a4bb26fa2074af90776fa4a8b85a3eb8369a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4409"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-alpha.4409_1657213858964_0.5154675498064658","host":"s3://npm-registry-packages"}},"0.15.0-beta.4411":{"name":"piral-ssr-utils","version":"0.15.0-beta.4411","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4411","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"76e163f728ce9d20fdb4a910d483996cea07a3e3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4411.tgz","fileCount":40,"integrity":"sha512-rlZ63+ZL0sVzp+/k7Fk5s5PU40Zh5ogPEXzFQjiDuYrJ48cr7M8sGMdxHxinFKKl4Bj0aPAhhv77+C7VBvXtXQ==","signatures":[{"sig":"MEQCIGxfhxnnYDfETzX4d2wYblV3VGaWL5zk7yT+bAjVAioWAiBiBZNVoBxJ5dBaPD4QG+dH3wC1MvEJiQ18oAYCXIqKTA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiyXOTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgdQ/9HyYvaACaYYx2rSrAgDvVfDb3rhb1XEI/aRX15IXYnW0FVqYn\r\nWe6TAQjSM48LoOe/s/7fnXnGUbRBc+lto87wUXubZb2/jFEwlJADniqJDaqV\r\nzcwOxxrxxoqUde82jZbb1/f39Ev/UD2LIUY2a255vBhFUjfb00d/6IHoRuhS\r\nlTOP/WJi71VJxFnZRhIpsyRrdH16oOHn7j1UWbSInSAj0898/Jx8nMDAafXM\r\nrvsGz1COLKDAaI1FSGaBn6ofB91eYAe8pqq+ld1u8PAj/2szXmSRf4V41Tku\r\n0WFaDwSFMLJRm8qq9DcB1Bqxwkot2rbC2vQ9SRqp4bra6NWfKecmQe6bYZtc\r\n3cWRwCywrs6yW06x1rxioBb8iMXzNlI+xNniifLpQLywnzOKBjoI6qOr+dzS\r\noy8xdO10YalM2f+c6rRUpWK6nHOJTPfdO7y8VpRe7ysVSd9a/UHTq7Bzlgzi\r\nsX3n0uguG0Wg84tT+uL92TlgXxEItm3NJLxqQFFOraVP3YJMhIs6uDYbJs9V\r\nivnob6hc7rJqG/WzOs9QGa+pOpatg+KeYyx6HprRUGgWheiZRlzkH3VCHJgX\r\nTmMyxfHzBwcJGK5Lh6+PhmwCCu1DM9qd59w7xErExow8OtYkNkvz/GAnHhcC\r\nxrc0rLS74rYPQa/4GB/Fi2QOu/UmOpDzjgs=\r\n=NEbo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"4f5faf811d34692b5f2d3042b9fb732fa8d64cb0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4411"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4411_1657369491141_0.7646950882241406","host":"s3://npm-registry-packages"}},"0.15.0-beta.4465":{"name":"piral-ssr-utils","version":"0.15.0-beta.4465","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4465","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3f814c4eb3a084d7cd002c7ec76d446b6ecb0d07","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4465.tgz","fileCount":40,"integrity":"sha512-T1+DdMj5UNO0NwqKGP+KNKdr0p5R6H+ynNbhUHOyzxQSE05OI98A49BzUtYKQnJVzG+0kcPEIVF6O5HYcXqgLQ==","signatures":[{"sig":"MEUCIBGU7h469bhs0t3jq+mHjjib1cd/3hZkfWK1O1SjzyxzAiEAsrlA/b0Uvx+AI3+8RY5jFqzPfmp5tkZXB6qWrnQB/OM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2QuNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpdPQ/8DGvyw+YBVHHoH1lEApAKYEKe1i0eimfIiu/udwHJ7tmXp8vF\r\nbZL6YD9hMQ0InxjRziKtPkt96htgNYkqdMcH/N/wxXl/2eYp9zxVWc1rxHNF\r\n5IFrhiDUpBfF2jtdbntcUBSFZ74g/+7SK4HsZIifqS6TjAZAMSKETeyKgf/s\r\ndkvwu+me3UGx5q9yvnaJjPNth4aQNULFc7pOFjJ6+TzDcl70MUsU1IKjLsB4\r\nnZryLKdxyAcQV1AwLPQpt5X1KZZWfiZUXZz9GJ7SjelyYsJd/LubM0+wz7ed\r\n9aszbaGuGuFxTfi736X0E1zs2g7+GOfZKrqhrmJkwBPFWwm9TgZ5HKBz8HuV\r\nqQrjVOWHXtDWrESViLGWwTfj+lljilVLm0FHCxLQyC9Jes/yGE2JvgJT6SAd\r\n/ES30T2XmrYrb/5bjgn0aFccgUQnmrr5u+iYhlLf6saIDErioE4JoeDi3Irv\r\nxzmkgmBZclkBgVJ6GI7pSx7hRT8USibEzvcKWx5YLmr0oTkI1IZ9sz+3q5OY\r\nhUmPrL+G846T0P1IQJQV+3/MnXvWCIvWDjJB1JjU88AdahzEFYfQQJJKUOfS\r\nM/NdBCeeM9H6CFivIP7Sb6m48cFSoiuO2qGuo0zhm7uaDSHvFcdYGxZB63Uj\r\n0bVlK0UpaLcgMzYOirYK+fErcZx1WbUjHa4=\r\n=FoC3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"3c7c64ebefd180d4e1cfbf0a397ea1c68063ae08","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4465"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4465_1658391437708_0.2284427665125659","host":"s3://npm-registry-packages"}},"0.15.0-beta.4466":{"name":"piral-ssr-utils","version":"0.15.0-beta.4466","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4466","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"34f98fa75444f30b298bb6df5bab2b354ca315f3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4466.tgz","fileCount":40,"integrity":"sha512-Jdf64Cy4hWyx3BzbOrAj80wnbwLTiJbzlej0LCJPNu5HGylMSHQFLuOY5lFs96rEC1J499DHILitatenEApIUg==","signatures":[{"sig":"MEUCIFtJ+JlKrRYoDTbH614dl1XaK00x7TxBxxm8vMg6hELMAiEA2AuCdKGAMtdZMFDfrYhngKD213ORiyNdwcgpnCYQHgk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2YsDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp9Zw//YOYVHgXgLqppUS5d5OtN1wvIaXqgRlXdvCgTRPZBt19VQhA8\r\nI5lD8KO3xYoYIgMry05l/vXNfrir9jjVCPbnjGhj/Mjp5g4wT/wXRQ1ViTJ0\r\n0obJRZkb4naHwOB4snYljCpcVMx2g6F5xNCH7ABdjAflrtGTRRXXBdKfQlIQ\r\nsZdlNYJsBtxtg+vQwTc0t1ZNPhCAZ7i7zeSU4iRr/0WfAUK76RUaPOb9AyaK\r\n9zqtKOWVJQcpy6It/abruPQzvqkKtzoTf9FZYsI1iz1Cwy8P40OuY6uU3yfw\r\nvvuAZIb0b4YFmv7qBWpl0s71Plldvvla7tqAqTza4S1ZP2mGyAeTkjIudaMJ\r\npmaGA+ZVaLAPLud2m1WnpsD1/bnxHMSjjCD2UHGFIrTr7QZs7cg9UCFn6FSn\r\nceXj9NMRE0WZudmVRSEK+jrVfvgkMnwtho0l3u63hgtTI7nArT7HNFN7TZTX\r\ncxnJFHrV9GZSXn4sVaQ6eDPPtyHN2+x1Ar7sdv8A1L3xuXMKG3bH8LXhWZ5s\r\nIW39tHzwjXo0Dvpoay0nhrVCVonwTBNdcMqeFvRj2Zm1r8d8Z2qkjfRzz7im\r\nh0QkL5I9egkGiLdJ4sAYi86IwfbOnw2Ul79Ram9aP3OPEReMFvgFpRXHEcHa\r\nPAvm7Thn57uMn6yHaAkbPsRLtt9qGCApmp8=\r\n=PbsI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"35d20c9cd14ad55ef8148f13a4fbf70b0e730df4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4466"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4466_1658424067700_0.538905006867971","host":"s3://npm-registry-packages"}},"0.15.0-beta.4472":{"name":"piral-ssr-utils","version":"0.15.0-beta.4472","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4472","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e7a595999c5ad4292cf65078148052c93d0d0ddf","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4472.tgz","fileCount":40,"integrity":"sha512-hiYljIgVoK/716vXb9T38EAbZWzcS441PDHQdVzGXCTkk40nx9vcPs6tgOaG8cGW/7Bf3enTo6ccDMhkeMRIvQ==","signatures":[{"sig":"MEUCIHn49XaYQ0D9EguWK6PffExsClp14dJF1XbwWGrX81ocAiEA6x94zQ1vFNadNs/kxZuc7WGjGPj2fN7+rGJpyW7T1gc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3ySxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHehAAlYo7FPV7lLBVt6Guw94QOm2rEMazXKaQIqex1Aj53cCX/GKq\r\nrZkV+l8Vi5ItfH1FcLfejXrrhmscegilnKKUt0AIYlMglJc5dbOUJO6CjojN\r\nGYUIqAsewoYOULdgz+Vsdj9GiIdpXZVGra3L4nd6aqldaVSRTbIt1kxwsQbE\r\n7k0KX+qVHLdhxpJt6/7dhSwxwP4e9ZCzCIFfQrbrTlGYyOncc7iUieFA3VCZ\r\ny/VG7qn3AsDAUKkqRaL1bb8nmcTcamay+1eFcovGMw5a13vNNzr5KGIYJQ1T\r\nbV3ciHrryKnp7YGr39lRAvFWcJ7Nur9SiO4Ub+YuJuRx45s6kY44SDQKtkM3\r\nxYUs9T2ZRRqHKPe3uKTt1VbT0BDbxap69vznIj71zuSOU3IXmpZPVrjFTV5i\r\n5GVWH9dTwWZsbsE2Bk9JCVqQofOhjvqCdizuGvFurlr6mTPHs4kDM+7hLzhq\r\nGaDINklAOIIu+HkvMNhASetCns++tLpa8N4hZY3hPhowHDpzMPftUPPaT024\r\nBF0spSdRuOL8bcsGi6VdR3vTRxkWCRdTbATQfSNt2iaQn2OBYmeWMF8M4NAH\r\na2bfblOfWTqGwiXnAb+pKZi37/VczdiaoSsyYNflo7KfDJCx7FdNy3XOEZC3\r\n6PTMgNNO5crKRaTDhHXNdWD3nZo+zOj2PHE=\r\n=XajI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"327a25c420b779caf6d2ea2edfc7ee59acd94a5b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4472"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4472_1658791089382_0.013485499244272114","host":"s3://npm-registry-packages"}},"0.15.0-beta.4512":{"name":"piral-ssr-utils","version":"0.15.0-beta.4512","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4512","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6b9a82ca4f2b82ce10509d2b200f4b7f105a30f0","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4512.tgz","fileCount":40,"integrity":"sha512-JfMtrhgsJ4j2YUzu9HJFIiT12dp1fRmY725oZl1pPR3Zhr0gG3iPPTyYnGWv5WYwytxrORJUPlPQZKquknW5PA==","signatures":[{"sig":"MEYCIQD6/Lx8MmE1XBdDUC/sX+CahQ/0W5a4WdQaWJV4jWvJCQIhAI4uKkPsMAnXghM5izX+a5bnQwgFwojbisckNJCJFYd0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5GkIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpbrw//Wneb1CoaL1t3z8QGWb4i2eVxlzLfc0OgA4x/v8q1blmuW33Z\r\n6ErtxOZka6bb/NSbK8L2BY27l3EDdjG6J1P6iM2MHuDnu0OUeM5soKSlxmKO\r\nzeeksTVcXbYX+gZr6+SVCZV2qHYm/yF52T3JRzxr1ifoV2dGLqtjB7+B3u8P\r\n27RJGJNdx6xIRfvtOjn6nVv1Oug/MYaCykOhfuQNRDu5Vlb9kpyV1qNokPYF\r\nwRZtrMhLG1XmIp+YDEQ2gtogdJI1c1j1AJnVxV1fV1NGYuo2Fm089a/BtGl1\r\nzK+jcwGZCH3OGvVOQTx4QUDs/V2GlPn5/AIdgggCMLiQy4xTCA93W2xt7KHv\r\nGOPvJ8TLHkE9M2ENxvo/gpyKHG0rsEGTq7I8FcMF4X+nFVyIq0iPSt2xXQXJ\r\nYUwMekG2EwRcYZ2TdPESG7MIwvYpIyeS6IbMS2LVyMh8DtZSqXPh+MNORe6F\r\nHCT8/huW/YnIz9k2D4tlAmQFnamt2KYq58/8NVP+OWnGoKag1NW834aiQrO/\r\nRIIaX4PpZ0nzyzoOKlfGZV4JXw/KjXv/Fx2ZASxH5zRC4KRVcu4ZYzse9eWV\r\n9MwTgfNAOATnYpEpWRBe136w2fZcfjMK1hSMTMlVfh03/3WxON7t9QbSQNRX\r\n9cBylyYdJpQAwevxXjXOnNYMXLqzpbwqQcI=\r\n=JboN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"8c26175fb38ac3323c30b154d7ff28c13c29cb39","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4512"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4512_1659136264117_0.8058398631891941","host":"s3://npm-registry-packages"}},"0.15.0-beta.4544":{"name":"piral-ssr-utils","version":"0.15.0-beta.4544","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4544","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d96b998f0c445546da4a50bcaa7061a12c916f23","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4544.tgz","fileCount":40,"integrity":"sha512-sGWWPBWSe6I29rpY6KYfY7ygkcE+rcy5Cy1LZ3bghNMJHm7pgbbJaqpMyA9+rbJm5ZrRwlIB3To7aVk4MYMZ6g==","signatures":[{"sig":"MEQCIGZt3bYSiyUKzxO23svMgUDDACpssHEyp80wl3s4k68TAiA08femUE/Zp75zvf4gp2Lc9Fr0ejF9iuTpa9f3uaaxnw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7N/nACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoSRRAAgaUJU6Y64Ivgrveq3u1ol8iKkDykNTvSS+29+1juPh31hPmY\r\nXylQW6629bMpLwtzt2ghsi6DHJt1kEcKNJst7xoS3PysSznX8WjTgRFzcTWJ\r\nvrDItrOb5xqg+qSB79imwtTsdyi0V2rf/39i7a901rHbz7bMVd2i8Ut6GLqp\r\nW+y8ATjfAYR6HNdSluXiI4EvguOinkaTk0bexx6KqBMczvlRC5aMKhdoO7UY\r\n9c6Ej0wCwepFzbHpaywEbJ3ckdz7Cukv+QsFaWGpVN7SdjoYQtCfUg4VQjdN\r\n2BCcj87I8qK6+Z8q1HEj4Et4tcrHf88c1FROD4C+6Ohzv+z8pdlG+XfqgnBL\r\nV8JpA1mE+gl3BXyxzVN31QT6z71Jayfr6ugHzc7QyKbs4zoG87u0STSaen52\r\ngtK4O3dnGqYeVZc1uHAUYwQE2r108SCBtCJuhDWnFXtgCEHTvv25Robvd82c\r\nNnHUWC05hjlVhKp6qUEjbaRjxpJiLuW4+BiEDqNQGv7dE3IfUHfvvbgv2YO6\r\nDg/gSiX2F3pc7zvYF89vvpEvHqC5luo7/dY2lR24ZtQKqoSHZsSEBItFoR7u\r\npI5/c7RnwGG+Mtut/RumM7hq4RO4EtxfU2wSKlLkopYLfVWxE9XsslGbFdh9\r\nXw6ycfpQcErbUOLVHOTgYpajhIxu9BJZZuI=\r\n=rI1w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"d128ed2e80430bbedcc16644455dd47c958addfc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4544"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4544_1659690983622_0.36566386744384527","host":"s3://npm-registry-packages"}},"0.15.0-beta.4549":{"name":"piral-ssr-utils","version":"0.15.0-beta.4549","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4549","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8f7d7a0d6de5e9ff8692c00a58d7f9a489eb8752","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4549.tgz","fileCount":40,"integrity":"sha512-zvU/GBNww3pHnV6DhqZqFaL/QBbR5rnANHpD+JDoBirP1SehL7lTsJyuTbBpX/qO7Xv0vVpj/wSfRvsxgsqC1Q==","signatures":[{"sig":"MEQCICYS2idqMP36CPrhiFHnpl5UdMOnivzX+NisoXY8GOB1AiBS3KIedt8hFsVWOYtEc6SQktpHt3y97W13ZCXRReBvuA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7o8yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo66RAAkcWR7Svxxx1/0tEe8k++Qt/nUjATZu7X2ZOVrF2/T16ZuGVU\r\n83ykzo373aF4ip4LdJjPFuUJPjWsFKhXvkz2Fry6BLD51bVPCqfYJkri8pZC\r\ncvVptYE5h3Z059X3SY/KZVW9OZi6y+O8Y1cSd/du1k+m8UKepJUeOWzGDN+P\r\nkUSjp23dmmUYKRVMNYXXisHtlTNa6Xg1+oCrLmlK6lEjpbC7FUiISJWs7PJS\r\n1Q+VeoUYfSeJ9rS06QuLXQxyPa0rLZFsDsOunGUjrykbzcKCKP9FEEeo/V4v\r\nwYFqn3pnPqxPNg4/B3sqfQHYcDWeKXZv7uxPvrZeWeo7tLjvxIM29eqTTcIH\r\n+yGd1J9EUSi0uZB4T0XRhE/feDgI/vw+kDbFRZRtorW/lNBuBuioOjLDITaM\r\nefo8KbRq33/FAic+i+XHyOw3qHifQSmE6aaCdife8mavZKDHk1PBhMPQSFXg\r\npAYFD+jx+lqd7GSjOaiL5gd6DwGZ4qYQJP28hw67qeqKqzPhLrHpJIC51EQn\r\nvmFzLUjVA9lYScFoRjh+I2QQoVu5gUPA8SMgHF7c6PV9UFzaUPBpIDRT+wVt\r\nzNaK7QHRGLSoHWvJYJvJVAo0gzjxgFgb+eZL52HZqjLqAi0rfbnZ00eVPQ8b\r\ncHIwSdbeM84zykwyV2SlQZlDmrZtDu3qmk4=\r\n=XokZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"ca7224ab671fd632fe9e5cfe9b7f573d9a105ce8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4549"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4549_1659801394760_0.43857684365863947","host":"s3://npm-registry-packages"}},"0.15.0-beta.4560":{"name":"piral-ssr-utils","version":"0.15.0-beta.4560","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4560","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"28c7a8587e04022da813c31c697cd4c07269bd95","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4560.tgz","fileCount":40,"integrity":"sha512-z3HaMEw9FhtfuYK4Iu3iPpg+wHhZW3goJyj78SQYxMiTorS4qkMv6uIJ2aTzpjGOAUvhBPDJeV26E1N5F3Zfyg==","signatures":[{"sig":"MEUCIQDR344mlbYMiHu2uvcwJYaBXDj7/u2FyC+9YEXzjJl+3wIge7ujY2Cx4BEw6yiWHBafI62es40YIKw5qzy7E8cSDNk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8OBeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4AQ/+KWw00qlmm79TrvHd2ljUl73E9xIZAlJY8X0bd8DTjGVXIGyo\r\nn4sM+H/BUsrZWnQ0udJOfDrgAqdSlquhj0k048i/IyvGPCCqbvKqDzQrH59k\r\nLhD9HPzaz7LYq7REAOxQYFxDipkEnaJbAVq7DXBH9Bha5aBKMTdb+hahrzXn\r\nuPWX+VjwxoxdSj/6e481kblWdlH+2jaDOt2u/RTJoomyzXYEkUO0KsPgP5N1\r\nGSN6Tg0glvhfS7v8hcKR8n8Qx0CfYywrnaBlUYIvl8EQOduNUFsFgzAidGDi\r\nug0fCfRk1jnl2jBx/QUAjK4dLfwqlp8C8zUptQabdAItbhLdyaBtdnbuGuoz\r\n3iZXDJ26dh32jJp/OMAyDrlWdRZDQ6RuAcZBd0oxSFL0RX1fEMRpE1NSzCJk\r\nMLWzXVsZU2IARpJ70Y/2I90xHdcmYCXiyvjPfUHpQJnBVqtCUSVSofu0ykFo\r\nsL+LYvIFuD1UjDtkB83mvt3Qz3RGvysDvw7XnRgOqur3RYvQZnAqyVz/zzUD\r\n0TGKlzA4XfHwsK7gEKBY9U0nMqB02gStmFjrAVur5FvyuzeAvB1w7k4RLP5z\r\ngXDvcx0XZfHii30KPJkfGm5aAaSka7VSlpFGmqIyMxH6s0UQY6qLGT6aDFQx\r\nTG7VR6tnLKohaNH7l4AVtG/2T1PApdXpVwE=\r\n=aMAa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"b4fa0e9b24f7b8e340dc3a32d0e37d21b3d26c3d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4560"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4560_1659953246556_0.7247038980008726","host":"s3://npm-registry-packages"}},"0.15.0-beta.4574":{"name":"piral-ssr-utils","version":"0.15.0-beta.4574","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4574","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2cb5d5c1fd618455a26dab0827441d0cf3a3f158","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4574.tgz","fileCount":40,"integrity":"sha512-CtBW3Q3XlEbFHwv1jrUFn1ibh/H9sbTVU/+xrh+qckPhF7OlUPyIN0mvdHy/WuYY6EkDIPgvz5IkuKwNrz7sTQ==","signatures":[{"sig":"MEUCIFDq1QdPEx6NfDbg8Ix+nYDyLwx684LduDOrpZaXBu5VAiEAkfmS38QfPZKtVFSp5OS1+aOISbSGH8qZCm4yDs2U1Ys=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9Qr+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqStBAAg0E7LVOxO8CSLMLxyD8pKbg4L9sXPmtUeJsJPM0DKMXRtNau\r\ng7dnwW9vKitTUM9vy243sVXmSDQr5fvX4aRVOynnPKpV8rNZxoKgF2jdnC0U\r\nQ7YAtTrYRGiXouwDuGlxPkyYz4YBUBTVnZbiNTvCpMkeS9/6E3TVAmKVEU8+\r\nzhFwuiIbMZj6UKkrA4eK666RiEJDvt993QYnjr9ET/gcP+a2IKJXjmmjtZKN\r\nrL5u7yyDx3+CYAsSqljk7WqlpFSY/guv2QzcpF5sqvGl5kaxy9/KmtElFITz\r\nnrQ1TTmu3jUvVG5Guk6JK8wcP6xmQF9197ES4e0nh0+TSb7Ub8x+JoYa6+CA\r\nhCa/o25RMaSp9LWTXtLFcUpfarp7RPXtSjbBcFnWjA214nBc1oqsdTbkqrue\r\nYD4b/69t+rGi3KZ9EKBVMY5OYgniCKkR1VkqA/rUZjn3wGFq4vxYHgOz5p5M\r\nx5w88TUmEwVfHaWb4s08yBvTupRQPH2Qmhrc24+ah96Y7j8oitl3n2Fs/pfr\r\nf88KasIRPszaqA6MZQhebpU1uK1mXZi/LvBxxes69BF3AB+jPQTL8uLMcB7T\r\ni+gVRjZqKUz6lInFjxI3F3GqEQgyvntYRVV91/t1ihHWkUOPj3qFcU1buNzo\r\nJuzqkhjixYduTk+Tsy2avAvqkBTVAg4NGZc=\r\n=lF25\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"914a7b4c14d9b161731f80756f3e175f0444e874","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4574"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4574_1660226302149_0.9834628567090193","host":"s3://npm-registry-packages"}},"0.15.0-beta.4579":{"name":"piral-ssr-utils","version":"0.15.0-beta.4579","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4579","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0b9a187585e4b980b799ecb9472d4db4a9697c34","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4579.tgz","fileCount":40,"integrity":"sha512-CAQgLx2+3LnA3wRlQkoBZcRsPS5zzwpFF8LTIW5NnBsEJw5L898qT+Y4DCOIiquOB2Juxp/b3Q+TlC3prM4udw==","signatures":[{"sig":"MEUCIQDEtGdv5axCEAvQv98uk4sErV5UW3HYiFwaNNUdMZ5DOwIgCAjgtLRsTqTlPgu6S3EM6yGaIdoaFZO/NaFQylCi4HI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/AyRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpq9w//XeQRSlFWh0j6NceoShFQUmg0f8OiN5dK0FWkOo3webMIE7nm\r\n7qTICplNjGYWWSP7+oII9GvfUamdUI7TXZwId140ufScyyA11jWQ3A3V+QfP\r\nZKJbkQ8VNI1TezVveDs8yth026VNZS0T0Etm0O3iXLzy+HPht5Vnn1rpiZkw\r\nWtAqugyZ+vasuNAuahO/JJrwmm8x2rh/zmWwj+iGmI3dyRURNC6lDyot/o7t\r\nviVfhmFnkLrFABYEoj4BSP7SQGwb7JsmYWE2aM3mpwwbYUsQQ6tskEYiq/ON\r\nk45gS92Ueh4tuY9IfNiF3UiEm4/qkjHNOSsgP9KC4hwtWBgGlAVLUHE8HfQL\r\nZy4eJVlXZ6YDU4g+nege/M1ewDP6iMV+/zIZo6J/NyWe/YS03cQi//lyeudX\r\nrVUJE74cSqM5XRvIfqIpCCIEG8yJg0Fo2qmhhYQgdcFVtTeQ44rIrkAh71XW\r\n/yP/Y8/3kLo6e6YZxeKgyRG/LMo6TN2Jwx5hrQ+MR+kod4DfAilfUXJh1POt\r\nPP373b8WaDkD70yCNh4BhZ5yUf7IKi4IIr4+Pxbjs4V/Cw0CU2e5UOAwEjua\r\n9Lffdhem37vZBSH9+Cpy+oy/3PYXJyb03/bmGle86v5y3r+CpbsV6lzfX0pB\r\ndlMw/2fnh1RNEk5buGFihfdIpZF4qBuXlJw=\r\n=btNJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"a7c4837c23014ba2038aadce3045315164a98fc0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4579"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4579_1660685457229_0.5069230355498557","host":"s3://npm-registry-packages"}},"0.15.0-beta.4607":{"name":"piral-ssr-utils","version":"0.15.0-beta.4607","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4607","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5109597c76fb7bb604d9680412bd4f8cb3be5b1f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4607.tgz","fileCount":40,"integrity":"sha512-Npn25KZSlmKmUI/JR33GivFOfy64nkgf4cfKmRcCHreZVCOgbNSUk5GyfKGJFsGb+zD1ZBt1ldJDjbWOtUzBCQ==","signatures":[{"sig":"MEUCIQDWvvfcco5Q4fpXgqOAM+bGZoUu9hEEYVBCoe19SM9VogIgBqrEAvQnVpJjtq1jNF8NhBVerxMkjCcvZ6NVkNq6Eaw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjB3WYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpyEQ//WTI39oIv4gA03peut8bAmzj5dsh1s7GGnR3EjFecq1JQE/Qo\r\nEaeJMFz2HZH2wis9FQv52BIc6Ae+Hp3hTTfL1MT8n9CTrg6hbxjRTGEvdDko\r\n6p5KL0WNp5PmM+vZTqb15UEDjAR4uXns6SIDmz3dREYf/pSSis7d3QkR63m0\r\npqFdkRCGM2IcCCV413D509eAecxGkEVMVEGwPW2iTKRgHZOFRJq6BZvBLmgZ\r\nRo/JQNsHWsUExUd9KBuyg68WfvqGTVjZimWO6fAd7rOhi6z4gvYH3346UmtI\r\nb8kN4CgqEuuJane3SsagzmKfgMX95kcJj1RGiEaFZpYn+MKuMN8+MH26Zwvo\r\nUYy0R0AqP1XYIy2MQHWRAGl9aYdKzzJvlY4pnBodBnsYYxaVvWZm+5PpmQqW\r\np0zWD69yf/CO6IlDMrJhkGiaoS6wZPXQHXS92Nglz7xGb29oaj11cFa2bL64\r\n2hfomvVZXvCpYvhgtNSCpeMztuvDDWKYMhGCUdhK4RuJSuxYXQ8icm9R8Wp0\r\nUOM2wbF7F+NPgCQMoN+5rse3XK08oumRp/Ub59UUDdt4EQs70n2OZ1qdL2WU\r\n0G1SsO/ZjkmY4Xb8Oo2ChKNbh7VJ7SBeokDZkzBJJXGz1RX0t3q750+RvbGz\r\n1/UH9hvC0hEo+nWjtqPnPIxbmFH5sNIY4DI=\r\n=JoIU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"2b1f8f84149c0ddb5020a5df0bb1b94dad56f386","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4607"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4607_1661433239875_0.934137791563898","host":"s3://npm-registry-packages"}},"0.14.30":{"name":"piral-ssr-utils","version":"0.14.30","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.30","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e50a3e9d6060bcf7fad4c0a156b5489cc684a9eb","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.30.tgz","fileCount":40,"integrity":"sha512-4yuWaRgMfGi3M1N0ZpMqPKQKFPb4axePkg584gMLhfTzQakEmHVNNoiaY3LxqOma02fuMWQPR8KR5hvJi+dwSg==","signatures":[{"sig":"MEQCIDAs8WyCsWcTfiP9XHEBG50+E9UKe5g5WLp4B6jH9u0HAiAMfuytAVJVXDF9M9XPjR7ZS5ZEO8LunBTUOKd8be6qiA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCIDsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3/RAAhGO2FGqqUsmC/aO7L6Y4it9M3QyAOyh9Re1kx4N1aoXtdz/w\r\nTTw5ojMo++hxaf778pVJuZ2ODUrIAMHQ9QnNDzHmTthOrrUrCgJwMwGh2RQZ\r\nrespiwhxOk/POjaHXhX3Mr3xQ9ngYBm1Sti4cLT1X/IJQU29t8WEzOjHo13q\r\nGfmZZyLJbfQJwdcuVj3v2vx+d816e0n1heBRaorcxXi2ZWc5Osx6NtubB8lX\r\nhlgA/SzTFBXoKTPP2yWrwHuHp3mgyuAKMAW2aiq1aW7VaD75rYPtII/15sbg\r\neFNf8JOF9QQ8NFMGtAxVfKyMzhHjcM5nvyyaIOp+d+0PshbaVwCVZLlH2LeB\r\ncddDd9W9ZR6ZDPv6YbcwUatnmzspgZCFjtvz5RnRRzRjzC0IAPWcxZvoUYZA\r\nSqAieh4ePdFYLCE/5kWrZAGVF+9wsMhXWOc1HMcaqqqIeHy1zu3wsSQqovYW\r\nhuJJlN7DPWDqfS9Tiywh/Ua1ubrZ1w/TimrBcP/nHch3DDTEiST4zSncCKYK\r\nYyN8ckQITraxb+j+Xob+TbK4kXQ3zKmV1O1eK4EGn9J98bYr+pU+RrELCuhp\r\nbkKn/PUb7vrwOyJxBfw2w8l7ul6sF1vU6LUiA0l4tvl4/t3Pb1YhgNEM4/OE\r\n4K9ZZ46N6uC5AF8nNuf2N/0ek6NLUtMdzJY=\r\n=7hod\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"f8fa71fb0f71425771ceda09c17080bf15412002","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.30"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.30_1661501676001_0.7124854974989123","host":"s3://npm-registry-packages"}},"0.15.0-beta.4630":{"name":"piral-ssr-utils","version":"0.15.0-beta.4630","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4630","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fe9a3f275989f9a11ef584bef4018c8f6cf20649","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4630.tgz","fileCount":40,"integrity":"sha512-a1iu/ewcLjOi9Y/zJ31r03JpyuwvaDLAivxbTKgmM47SUFh3pwkWQ4cvwa7wK53g2i3ipVghZ11DGeZfeJaUKw==","signatures":[{"sig":"MEYCIQCCE4PxjftlIAxADFEUfCWYOdgKLarzUtawen7irHc5YwIhAPnEnXiG7seYwgHgUAXlImgez9Ae9O+Jk/ewo47xg47Y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDVKXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqeCw/9E/Awutxt4d+nG6+vet2MsaTd3H5o7AgBKc12/XSRQTlj0vD/\r\nU6cR5Fj6VTN/+BNwioEDRxCK8Pty89+MXsoz0EQ07dGaruPIFw3uB6lXMVfb\r\nEZlkJlHZXOSpZAa68SlvYfbPLey5gqQidNUccgJQJz+/S0HR+VysWtiyUv/D\r\n665oQ5ndsPBOaxZOhAKYJ//tbJk4wIyR/HGTgZZnuaVIB3HxVWqQDLQT3i9n\r\nqT1O+HeKjWs8F+dtM3UOovFX5DpoRcv2zDa3TNQO72p3ROa/wEfcNLjH3Dh9\r\nhhrBdfKKWkLbdIGBxts6livpxQAp9xiZ3UQsE5N5XCd2TyZoZ+UHbUS15w6V\r\nDrHS121RqtwamOKlwCZscAMie/HRmHTetOD7ZKKDG2s/bRAoeF26nHjPbIqN\r\n5kmk36PPkEju+Tl48vXlyW0nBf7up/3kEnZ5URgopEGmXktOw6iTctYR3vNb\r\n1QWKNVftCTrsI92kYjDVRt+7SaFMI37+51IfvZ1Y06HSEsN3Yg1ftCbE3nU4\r\nrXiIfb731WLRWeHPvjcQxl3084Y39L2fUBBIFSGS8bcIeFs1qNGBBCwlypGS\r\nhDWt4FTkd2ADh0OCKZdcNNnRDHIROGKulNSheu3x0iETWHxnCkfVVCT37TmW\r\nqSsumiKsdsWfhiijg7i7e9cnCxT52xbpprU=\r\n=OPHm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"08aea96af9587e73b1a6c4eb108f94f285186b10","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4630"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4630_1661817495486_0.9756867743726774","host":"s3://npm-registry-packages"}},"0.15.0-beta.4633":{"name":"piral-ssr-utils","version":"0.15.0-beta.4633","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4633","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e95a9820ac51a4830ff55c5ebf74fd78741df253","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4633.tgz","fileCount":40,"integrity":"sha512-wlw9jIthtRHxOzR+Uj2UIJeisHNaUczmf9ZV6Z+QOUp3HQNd9zfGc8CFSvqDB1khexGFNGyK5X1Ny1bCYAN2tA==","signatures":[{"sig":"MEQCIAUod7JUQjFxp9swc3E/e3eAeMb3JZKNGdGeELfIn0nSAiBOZYqyBaWAB+5K7NwXHnp2jFt3VcKoIS0LW8gRXjdiRg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDmRzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpo7xAAoeip90xvIUxCzc8OZQXAQqveyCxedpGL2xRV+JdhYfCj2PUe\r\n0Ng4Tiz2bC+v1kiBDqJqrSjaoth26MU2TH0Hh2ZAQmPT1Udm0RfIOL0gFBV9\r\n1w2WNlGSxTyWHMyH2p8AFKuVV1BLqATCRpaOJcy9w6xwYexafOSZSSFPqZxM\r\nxhSqjGAQdxJSrennpU5OccDcZF1okQiq3+WfOsLMiTMUrxARBiSdh8yNqbeH\r\nld4gOznaHF0Y/FpE+6CnSSjHzU8FzJOOPSP1+Ana8ZT627MwT94jalsGa6j/\r\n+7vKbNPcEf7gkg1HO2MsaCa1VlIE0AMdfjapbjiw+TZsvgt4QIK3Ywg9PXvq\r\nwiIxYuCz/0zMbZwBgaAlRu3ex2CBLQkq9GwNwzBfyVcgw+mLQN3r2PNpu5Ek\r\na+lCUHp1bBmzT3SvqUuPujfAse1y6wS4fyfbSHbRcCwN7u+BOjUCeFFK51q9\r\ny0dPLzTIVem0qEmvuWP1cgYXgwJFxyU4ZfTaF3JiHwAQqeGUmAPpH0eLuwsw\r\nj7/Ks0Cq9IfjZ9DSCWE7DdKQ4e3UL5zYVCGBObSyqa89H4nndTAOKOoDl0F8\r\nXmp9m+YvszW98iwYJhJDAJ2rrlhpVRbhnOs4krag8CVCXs4MvTDQ+XyieSQh\r\n4/g9gBc2ts0NdPZh7szPtNk6mQUiH31Btfs=\r\n=0R8U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"96b950f26e9673595f68518103508dfc76001761","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4633"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4633_1661887602784_0.5418978974487805","host":"s3://npm-registry-packages"}},"0.14.31":{"name":"piral-ssr-utils","version":"0.14.31","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.31","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2f74009cb23e516a8b879b9da328e7997cd40224","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.31.tgz","fileCount":40,"integrity":"sha512-Fg1Ee8JwFab2i9LCjUOzltQUC8fbJS+2K4Vq+86K3OZUkFqFYBOGxYCUmN8qNbX1YO8cIsOK5xwk50O+eYZhew==","signatures":[{"sig":"MEUCIHinVJJ4dbaOx2pReWwY/XbhAYtDT5zYDnPpoU/8aqjJAiEA4bzhu3310PCCXxpQ+zy2f0yjuhZY75uHRLNuiNf5wo0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGS/gACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrw5A//eARurjNVheSVtu20+zMXhFoPjwEMrdHaWUio1ZfCvLrWXfc5\r\nUL0wZgaTRbtVIBLwUpGM5mbwVMC4PPBMwBspa0P0qEZ/bGMYIF82Iu88lCvX\r\ngc0Am5OGnAAboDHykSqYH9YF2c1KO7zkARfdRFIFB/mqriaqGSmBLXOQ8C4J\r\nHxXqveB0v+1EiPfcsFacw14/y6r8rd9pmv44qvMtCbs8CT0EExEv0EqhZMr0\r\nOcN3T19n+5/8Matoaksel/EUzYHrrlSSDJliXok3prvi+sp0PPGuAm6PWNaP\r\nkSaJl03pif/2a27KzS4RE9IhHhhfsnKSazaT5GI6ykbo075Tc9HW3FuZcUg3\r\nmXET4KnCg7qYrBr/57N7xPTGK1U807F6hhlZPexaFFumJVBUmbmJpCDFFSos\r\nYwhSoIPIGzuitt/c5Dxl9uEHuPpawprcFal6WAUNiqPYhmSi8rBfnTeVsN31\r\n+rZzrAGyIiimX/UIW5+0BH03TMDFIVO2DWAzAxddr0qw/JoKJkbgY31pYrI6\r\nBzUbW5ouMtcaNvCRHyQ02nWsNQ/AVcuPFlypuFAtoUqQi3cLLK5LCMtqMLeO\r\nDp0PlfzswdZ65SPngPq5J7RKkw/HhT78z9gXw6xGhaxrfIY+X2DsW85ugkO+\r\nxRiGl7xRKH1DKpjSBm2r4gW7Uj3U852jjmA=\r\n=m1fg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"47ba4276f021e8f933b1fdcc1385450e53412d80","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.31"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.31_1662595039863_0.32978338014105013","host":"s3://npm-registry-packages"}},"0.15.0-beta.4670":{"name":"piral-ssr-utils","version":"0.15.0-beta.4670","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4670","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ded12bec215a1d65a692ccb7713fb768f2566e31","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4670.tgz","fileCount":40,"integrity":"sha512-ZqeNhU+eFasvabs6NuLnvoYkMIcJcmoGbYlRXW3zc9W5gw5c1L6xSgcbWO8RAajPN8RbeHvKB4iBlzIID3XTfQ==","signatures":[{"sig":"MEYCIQCQZrCRdkcI3GPjtC+OBp1Pit4RyzTqNlidh15HZ1K3KwIhAOOMh/Vm1d4vH84650r1ZhqLiyis5LMJW0y+ifZuNile","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKkANACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAhRAAmacR9pNDmYUf6i4ypg4SHYzDLXW07DXDuDn7z8YsntDYY34U\r\nP5Zapfw8hTF6NAw05mPUgg7AoJrRrvWDalWWXTF+2/4KIdyVWLUaVsRmFu1e\r\nNjgKvEy7s/QFUXDUHEUbBeijR5FWNKM61bmcpj9PG2f8PerhD79NLyvjsXbv\r\nmfR1XwuUM4+oGwSOiXCPtqjFao5mqmK67dbF28DtbPAWO+xrOxpmOrRwEO88\r\nm2D10ZDrzSpAbO9Ytu+Yh9GTgm6GtljGxOcsFyU8hhXBrICBjyIp3qUnxA0L\r\njLQVgNeGjB4Buq2fgJqvHLM+Ks/Y1n1EkLScqklzBY31qx9KlJxQynv/RMoT\r\nIr60SgYi1xxCwHF7AF1aLMuKh7DFGPmAkZWTuA2nI772PxVEBH7HxuwfwbXN\r\nbjnEKGey8yiDPBSGmybsvqyESZU8EgfxlKdpLIEmtEGt07L2ZHkFBp8frPt2\r\nwreDZIdIlXc2Um8o6QnK9abN3TiwYwrInRI4qHvtsREjVLb+hS0F7+2t6h/E\r\n1px5id6N32py/magP6MRe8EubL1kdVzOjuvUF4BpaDZLNc006kcryDmuLmC6\r\nNezIEDqcPe4rce7EV6vHwNh5kdNtlw4YrAjMrFNF+qeSwJIoGIvWLzrpKhW/\r\nerd1Hb4TRAxaWwF+rw+UmTn9MAq36qO7UbY=\r\n=A4kJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"ffd8707600e028a55258028d394b76fe3a0cd175","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4670"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4670_1663713293591_0.5234274460834605","host":"s3://npm-registry-packages"}},"0.15.0-beta.4672":{"name":"piral-ssr-utils","version":"0.15.0-beta.4672","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4672","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"be87581f44b0c82f7500050cfe06a4ccc626c063","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4672.tgz","fileCount":40,"integrity":"sha512-1TgubTuhrfQt5XwAvzRo/upCrgnOaz7IhnkrpPSr4ybDu259BMas81Jy332GHZGE8Xk+NrX2VGFjkG+ZM4ze0w==","signatures":[{"sig":"MEQCIDbppAd10fHmfjhuknzu+Ah1yWebzgfqf1cHqvbyZ8dVAiBLt0Jy88TN7AnfDqpDLyBTsF10KDeJpHoeAcbT/mAKDA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjK5OdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmru6RAAm4ksWcXSPEs6dCscm0kIQSmptU8R/vwnhHGVUzmjIkBAOLM5\r\neWCKsHRa24jrh38c33yL3ROT8e77ImEn4TueRli4AzuhkFHZCZSUUPcc5DwI\r\n3lR5Jt1aPgTwYtVdaKB4CCnujs2904ML+ZwKZto0fQ4PkFZZg+AUub0UptZF\r\nN8UamqEwER8Fy8IXG/G0u/25kx/OF4zQxO1Hni2AGTDK75z8w7h+vqfHMPUQ\r\nEPjLHMIoXVsGQTjL8DwKX41vnhSu9ug9Rli0iZ/Qs9mhgOmSxdg8FxMZOVYi\r\nEf4vE5FLoAmrZePZBMmVj2m0/2iGqK92BAio2DLutwW7fuMj0k5vnoJjsvs6\r\n5EycjwrG9o2kcs0UH0BCkG9ueK0c3yOYQSowZEiheJY881xOZwFKoXXrd3RP\r\nX+FJ7hC+tyogkBj4omEKo2q7cG6JtihwOGKGy/c52WmNahSrrTX8CxepkEic\r\nQKf7/Ew0mw9q6A8LfOBN1qFWIAzg5+sc43LAJ56Hl576Dlr9aB1QJ/O+Y7ZI\r\n5H/pD7k1/J21DVmG/+GWcC9YS0k2ob6omDKzdSd7zn39mUXzetVu5K//tHaL\r\nMFos/eCHUayA+Gzuc/8XCC9UNuEVh2Mj/VVnmMuZUEM8EhrlbkbW00oN/B5z\r\nvDpQTi4RCBOhA3kTHYGmsY4/BJA6Mq6yoLg=\r\n=gcTr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"cd1026b70c90290fa5ba3f9b86c038eb852595be","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4672"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4672_1663800221315_0.7833714248056656","host":"s3://npm-registry-packages"}},"0.14.32":{"name":"piral-ssr-utils","version":"0.14.32","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.14.32","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"794d5e5d62c3ea7edae5ef42373f9ad2ebf09ed2","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.14.32.tgz","fileCount":40,"integrity":"sha512-QQc/Zb4zH4wjdzjzUwvo0fBe+Vr5gwjCrwuR2Ffrop193M4x0MgD24dRydW0uIkIPvhol4Fla++FVovQpwGqNQ==","signatures":[{"sig":"MEQCIDwK/W6fu+yVTkqI5gPVmBNVl/dRRvoGCCrX1ml2FODFAiAYI2l2NGSewB+DQLS47xzwYSuNuZuJGa+tVRzROq1+1A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjK5oiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQwQ//QSBqK+wFoEQHZn53GW6o9wkl4voezRAnxZVlIDAfSjSeeWYt\r\n0uVYiOwobLBo1tlF6a0XmMNOZl4FOif1TK1puy6ZtUmK9xLvLt4hxUaLxmZJ\r\nP/fSa3w+myG4/27OirxYN4EfRILA+q6Q8t8JtnYQg6xIdkKMsw0rnToq6Usr\r\n1BEGl97Eoi7W9KjLtck770Xckzf4Xu3kLqt536XeAEYBGS6njPwHg8VJoDU1\r\nduCRtsTdc23Bb8dlL15U12meiFFttHW2s7mKiQEaxW9LapxiiGXQp6TXqvzl\r\nXWhE/9Y07iZiCyuVmfiPDsSpSkNntRoyUOUs/5cZUwL0oEjvFCPav3KlzK5H\r\nWQ0nte5ws3l5jMGeeMvnNWRCtmo/Q214N8VK1PFP6H9abM+gAY+amsMDjebr\r\nok0g25F6PrOC3MlJbxnv54h/DTq4EzAsCzOzjhpmUmGFVMdESH94L46XmFzh\r\n+u5nkRRShv93LGwxYcm2Z54E9AIdqcm9Wt9ShW0t6j+M35xV/rei0hyM/ojU\r\nFudvWLJ7UXe035YdXURL+XA0YpUx/KHpKU5LuAJ+ep17rl386jiPbBJ7AbCT\r\nhnNuxQ2O8JH8Aw+IMFlo5+Y+7mkUs2EC43hbySLM21Ib3tMHT5qSJG2hdUnN\r\n5ZOFBvRe5OhyOpK51aqTwuZJPNInnniZtJA=\r\n=dM1f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"8a27552a2ad6150e58d6d841937538b8158afc4b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.32"},"peerDependencies":{"piral-core":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.14.32_1663801890678_0.18120434110137373","host":"s3://npm-registry-packages"}},"0.15.0-beta.4696":{"name":"piral-ssr-utils","version":"0.15.0-beta.4696","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4696","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cc100ae740c41b66d541993343c7f8f53fb4462f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4696.tgz","fileCount":40,"integrity":"sha512-hPxyI4Rgv7LY2yodAuRykVqp2RVLqoxTtJWawtkZvle7NPswmoJJSM7HWIDI2opFZl75b58Ke8f/OUoVr3vuTw==","signatures":[{"sig":"MEUCIBkZVJ2w/MEZzh/y8Qjazk5NfpeLvkYOU4aEEtmh0t4UAiEAy3onuIFJPqmHuaGzD2za2oU5BaJEcF2VMWyyW9miUTE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNbrqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMiQ//fOEQmUxJ9c/HN3gTTiGU/U6q3sw3I/0pZmcVdhw82dPqXtvA\r\nFn4mnjzhUnk/0/5apq6pGBDC+uNlkkQIm1snjpPyGKcTdOtM1RfYXTs5mjG2\r\nXPoUZ+ZqsZKGYW8MU9hNryWvY3o15wr1Bp6bTCi5xxYUjkDlGEZymvgudsBS\r\nFX7tpjmuSRikoDXH9udSGamuI6LD5I0I6mFFrzncao5c0eUGyILT5CWYkwtA\r\n3j4oSpCK1I/9DzjNDFfw2QWy4EYdNlX3Cn5XNaXdgSDhDG+mNYrKAXA/m7sh\r\n4MA78byxVKzPHfq2sq8JVU2hwsYL4/MyHBzdk57zNxdEYELKTtGaUGcGI/jY\r\nCmH+meJy2hrJGydcrYB8OoYx+Tf6GL6oHY5AvI+GssCLun3uM1R0eN9RhGB/\r\nfypqtUwlwIGD1GdfZhOIgTpblMwROZ5/1NOQajv6X3QGLPMoJThnebeZjK6s\r\nLniaqICvsEldr92O1pW0vTszyijuKKgW1KLnJOq+V0wwl+gjN3CFQyc+03JB\r\nKPA69rVNggdFcXjjz0oRQMmpn3dFSsx1V0mnSHb18tsKPXraT8PdhOcpIdSG\r\nktiPc8ljMx76Yg15pUMGw6WbTeLHpVW9oRLpiCZ0wbGZpYyiANti3utcuuTN\r\nmeH1c/54+y4B3L7e1bN4PfhSm5QyFBqCz2c=\r\n=MCMZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"65701e0e33084e0c5a127f735bd3897019bfa7b7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4696"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4696_1664465641791_0.9867357957920713","host":"s3://npm-registry-packages"}},"0.15.0-beta.4699":{"name":"piral-ssr-utils","version":"0.15.0-beta.4699","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4699","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d1203ab5a55f98d0299b311fe225e9b05e63d1c2","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4699.tgz","fileCount":40,"integrity":"sha512-02YzKdJhUE3kMxHTR1f/QKe4xyfovSV+f+IeKQISVWLFlJE6mRTYaLfq7bnVJPRCQqQRUKzJZbtKzCNKw2+lwg==","signatures":[{"sig":"MEUCIHDEnZLmOve3+AzzBuAq6ugM36XPzX6GxGK8pkbNkD/AAiEAsUjgpMl7d3cDJ3bD4D6v4p+mMbutyiAaUN36BPcZIzg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjONItACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIFhAAlbBpMc8FeWgP90hPWuszduhXCIi7QRXXH4JuKrLrLCdAiG4q\r\nMIhDopCS903+66ZR+B454Zfo1YUMnPBxqbvM6hhZzghKEo7uJWADKT+sL/IK\r\nueiCgJdZy4HDooXhwDt1e1rQQ8qoV02U9ankMI/SwzGaNnixbWHaH9S/8fNw\r\nCTWpFp4HZKzaVt2cMsaRveOvZ0L+yfseRp5qvnBiMVkaxSmDRpdvKuZR2pSh\r\nrUwF01OXKj1sq8Wf7mw0ZpQIqXszLHGZr2/Jrn2hACUCRbbOMJoj0n1cNJAv\r\nef3kMmiUe7SgQ5Sz9p/YYDWR9DEr8PgDXoDSt56tkh1rS/wOFNnPZajEoVrM\r\ncV+dzqQ7sII/Qrt0UKZfjb0sYFOroxioJT8Us4rQM8tKWUmGdH9uNLL/5v77\r\n+CmUJQcBWUCDBp0NAP7+RfrBuNZTxxxVshgh7PDPpGqIQ9gk16OSIF1SBWCx\r\ngPimdf3V5vqRMnHj0zxe/PZhc81gnGKhaH1YkOBhd9Jq6yplJsmK/oBn9Y+l\r\n0IXLovXu2w1w4HhGlwGH3e9PxmeSWlnDRgpGrO5tqPRJxb5WI2EJX0Isd7gz\r\nYRjoWgNIX2xuQZWT/XXQGMK+v40scPrrlwwR1P6ZuhYUEiODVqpFSOKF14pY\r\nky/utAmGAdEsUrRyCrt+foP4lNr5rRE24Xc=\r\n=xICt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"1d7d09c7a953009ade1470abf74b5e7e627f2bc2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4699"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4699_1664668204878_0.7020387926010274","host":"s3://npm-registry-packages"}},"0.15.0-beta.4708":{"name":"piral-ssr-utils","version":"0.15.0-beta.4708","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4708","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"68f1def7a7b019d0f1b46242ce352c22f1559c4c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4708.tgz","fileCount":40,"integrity":"sha512-n98X9pJavos86Nfv3uojLWYOrPDjqx09p74u++DhQ4cHgy9UzoHaZlTKujMmgLdevoO9/i+mZ1uvFunGycWZFA==","signatures":[{"sig":"MEUCIQCWjA8RfNr4xSF31moFWTfy1pXxTbRyd759nFsqiWbD9AIgSo1pAr1Zg4bjJgw4TMjqVi+zqWM5UrFxQrJJwhUyRxA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOgcmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoa2A/9EauKIamlLJIFWU+Rh3BqFWsED1GsPWKwKhBfBzgTy5f02skY\r\nKNlBcYT9FqvDlF7UBkHhLrXejKPaR5e/paR6kyoaNPmQ/ougl6eaHHcEzT5y\r\n+YfMY5zbeStGR0EjNtB+OhJHQSN9Y8/6XpRYYOsUg5a/ozR/LE+vb0lv52sl\r\n4w2ckeGFuVogTCx/Ngc+mqWqFKxop8e25J5mcAJfvVpfDFG1d612ABJHKz4/\r\nt+ebo6P7p19sxXGFW5poDcmAW7mFf5Jx21YaNKzd7OT/VfGYa+ncZt/lpC5d\r\n4AUUveiQoOdhhjwMfNKinZozeGfMtBOAYFurkeSrLAdHt9erx3V1HbGh352I\r\n/6tUN/Qflz70GefBCoXGQjp2usIdHAz1dKjx/AyyH8aO+6q1gee7S+S7hHGC\r\nxC9NL2AMGPzsMA9+p/DZDvqgXFIlaZrop+RXdLM8DgupN7Zc/QTSAgyFE7Kt\r\nLwsmbz88PRUMjuiUaUUX2azTfRs6SqUArV9EFI9m0ivu4bqX7Hc3v5127hVM\r\nNSKFUCIZ5Nws3CmBsG0JeJA/5RnP/SINlRP68Vo7a/LyCnk/Uxo3itPaemgI\r\nPQ0Ci7hNoh/vwHLrBxHndGeFyjN0BwMLpQzSAbZSXh416V5y8PiHQwVZQV6F\r\nCimHsH7hRKQ5ysAjLOiSpTtsx1TFHkDh/c0=\r\n=9ig4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"c0d9ed70f3a5ff7cf9bdebae379f30af361914c3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4708"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4708_1664747302785_0.13499412756405071","host":"s3://npm-registry-packages"}},"0.15.0-beta.4715":{"name":"piral-ssr-utils","version":"0.15.0-beta.4715","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4715","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"24324cef69ac82f5ab51793338cda0c7b6771685","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4715.tgz","fileCount":40,"integrity":"sha512-O9gktdnaZlNe+cLGLFE2/6nJJ5w4ezoA655nxUUyV4B+lPfL5V0gTKUOSh92sUEiJA+4OQ6tr8iFl2TctQ4/2g==","signatures":[{"sig":"MEUCIQCwYtHxtfdCxGjYGNhgxKosdAGRrG9a6seFM3BiwIlLdgIgWMJ5hs5VCHJJ9niKindMoMFyHysCVqFFG0t7OIwlxqE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOzFxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/dg/7BOwSPyHpXDpCqW6Goj6kD/1qMfUzh6+CEMaCDs3G8J3cVp/B\r\ncJMJWXZy5ErVg+57oD0PiTYEXQrjQ+K5hJz48lJSx4tz3eVE8CJ8PSYfDcV9\r\nT5aHEzC3WDRwXYDVODAlw2nQhXUS69iUTzcJ3FcbJKxBiyQAKVSPEMqAQOBi\r\n6INVRhAX4acha7lF+3dg1MFTwgAdNN+QuJ/u6PENSLuIccOcOZPFRAF594XM\r\nqB8LwllGc87hU3unkyh78IXeE/7IU3SMg4SU17J25d5S7fZSQqIziS5n5Drj\r\nXLrMhAok00rSGf4eL5GzHTkEOC7LdmiVlK2dC4qiSQN9ahIXZ5VtkCT8o3fS\r\nHAr48Ff/QorxAZaVMUfAMX3Ae5sI+W8Zpc30L4GWBxit1DeMa2CozC/aHsfS\r\n7ZoeIJWAdM5lf76iXmpUaMbSKsMtQlcDPw8IO0GS8q3Pjn4yrOEUw0CYW6gZ\r\nbe1xpC4GwYsqL/u2XULbHEoNJiERt1S62Fr+MAa3ksmZ34cJXvXrXYoa1XHg\r\n8WhrLnAGebuMxx7fKKIAGa3DkqTWl2P5N430pH0Ww/pnjEnfRE+m0WlQ39lG\r\nSHqF4HB3LPdzTDnT06iY657kXUTlY+Edt6fGn42QGCG8+aMt8yZO5Zo4+EM+\r\nZ44PaltNAsj/8YYFL4qkKCWW23HkJ2V8L4E=\r\n=+HzO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"d60f35a862f4f4d452a504fae843c60d083a88f4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4715"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4715_1664823665002_0.3526937527224798","host":"s3://npm-registry-packages"}},"0.15.0-beta.4725":{"name":"piral-ssr-utils","version":"0.15.0-beta.4725","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4725","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1a8227ead87e3db260b6e09f14a9e6c55c578ebb","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4725.tgz","fileCount":40,"integrity":"sha512-Pj71pYhEDwJAcOrL1LerKX+Bn3phGyl5xc6nnZc3ZcC2kWtNpFNetZSNglIysaUjYYwIpsHlGhywWiPqCxrcdA==","signatures":[{"sig":"MEUCIBOB9OP6Y3YCjnjMq1+IVoHd/l7gMcmNH/esVdnd0pXkAiEA7XZAlhSdo8dPxO8btebwaf4dP2ZuoQWUrgU9hVqMox0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPIJJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmomIg/+LOhGMErxmz6fVKgAJnyiosz9hweXD7fAX9QXGEcVnwsWjLpB\r\n6gBcFSF4qukY7MIkD8JBAUlIYoAh77uiiSuKGtxOOBybQzjK2JAibqYwlJQE\r\ndCJO5blv3kMcFgSCjasF53LyuX7lAyGh5MJKZLI2BNGMtWtaogudW1R0Sf0H\r\n5ks8tK4BAmTK9fMJknu7XCwud2NAxEtDMNdW0+XlfHpXbDX1LwdiC8gCpMVK\r\nxNi5w5dvKlr7vAB3YYEOWgKIgPShOFbtNDwNWtT7/IF/XKSIGAk4TetNheV2\r\nyZkCN55wzp3Hg90kfgMg2G47602S0oaMcH3UYRFw6wldSNzfmqvtMxZXAqsw\r\nDeQFeaddl9tcQuSoOj9IvlOJXwPFzIXUcBw1gLctw5vTAFQn2suJEcG4UqD8\r\njQTp2TNvbmMX+yVSyrsNFaFVuu9bv0VRCFnQYI/WMpVuxCYEqhVHF1jSpP40\r\nrkFJGFmOFIQY8l02aEF692bz52ayFFjVLl7lAwMQ/syXXzUSNsie5m0P1r4o\r\nLBlc+e4BTkgCtWGLGJFwfO0yf89j7gzvo7bQ5Zp9Geq/r6TsTYQEE0V05Sfo\r\nAsWIHlt763w8viS0IJGMF2VRfhH9m+wCboy6bbgfZUH54n/sFxAlU6OSmAnb\r\n1loGS7fIP3LcRiThkHfayN/J/4kteTj5cPM=\r\n=Smdh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"75f9470ac248fe45f806bd16b2adabde86b48e8f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4725"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4725_1664909897246_0.688757360179032","host":"s3://npm-registry-packages"}},"0.15.0-beta.4739":{"name":"piral-ssr-utils","version":"0.15.0-beta.4739","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4739","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a46378fe5150119bb936e81458c3d6d6cd9673eb","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4739.tgz","fileCount":40,"integrity":"sha512-pTnRhta9NJK1aL5fe4fBn0hHwROxb7s/Gb9ORGgcGSAlJ1uGivxsYu66L1RuroSIv4WBDLW2C8rBlwA9f3152g==","signatures":[{"sig":"MEQCIElleBXSYaybe1j3cEpvgL1aLDjkaHcLTOvHzFYel6i/AiBfxc7BzG4Dd2EGIP4RhJIKX7hLjjPVmChsygjHhuc5ag==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQpo7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHRQ/9EFHSZjfnSmcpOFC5BjnFoJWW3nt9GH2Qvn4bZXyNkJIEYFTS\r\n+bgtIXfHd9RrSvsQlvkgVbyjq1KQ5t+8J452iC4BVECjHa88CZBGRduiAFgO\r\nJ8+uj/WnCDUFj8e7TSX87nqtSSWoPZDdteJtZv1tA6EgFXG7hFAE5bWmatLr\r\nk7lfeQYJLLe+zKoJMpPSjc0J9S3tgiaM1taVdVbqyvaq3wXLqYbGZpC07mYo\r\n+KL2SsVO/+Hm6xUfepuuVK3rKeth+ySLbrjhEy8HM+BaWqQ7WKGBDRoaVqES\r\nWnH5MfPFaDko5JbL/SIyoGaHrqlFyIB68c6Q2jy3ewhnaA3GZTwdvxiHl4Wm\r\nyyMWLqpbhjPa2uN5lMd3LWzxoPEPZsqmTckNPIoZvLwycJ/UTiSqcaDKFQSD\r\ntz4M04FdNWbYB2mUScoRlBOTVvedSgXHE7VbfykqnGfLfWp4eWLwcOGZ/44C\r\nzkHURbSFTF98idGEndmriclfQ3ixVCepbY/5jbkL8IsstOga7nZYtLBfVTsO\r\nik9Sa8qc/jqsS34OIp0wG8AUeWx0vceLkAqui6BuUcI07ggSukx0Q9MHv73F\r\nzIwcVuH8Fkuicwxxux8HNzaagXykgbmWETI+pjZD7kjll831B5DmrvdwZlcP\r\nHej6fuuDPO+QTLp+X61t9KWFMugU46dI7Vc=\r\n=5giY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"6e7b1a13a5178d9123a80e44bc59d52a7310e41f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4739"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4739_1665309242777_0.8488060521869611","host":"s3://npm-registry-packages"}},"0.15.0-beta.4751":{"name":"piral-ssr-utils","version":"0.15.0-beta.4751","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4751","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cbe81db6f720c84a1eaefd2d8a87438cc01e07fb","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4751.tgz","fileCount":40,"integrity":"sha512-utxI6sCARwF+a1yfq3Y3P2aDEMKL8EiOGfJWhUS4cYGfMKYSerAtw9orW/cuqUks2dK7bUt/9RrqevheDaMmzw==","signatures":[{"sig":"MEYCIQD1Y+zfDeEhNZFb0xaJJuSI2O56/zA+YQejY7vwKSADbgIhALU8F7vgChugPn59eLxAeeyBcXRyOTEKdZPfirfDR+ku","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSsCcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpd+g/9G1i7V68R8NuIvddaNL4QwNyuZX18NAAVsexGAEa9fnL02HdO\r\nWwGnyPaSIxQLoDdoYLdIGslZ7d676cN0EhY7gb8AB194nXG3cI+rOB9Lvy//\r\nLyiDFZlb8bzSUM/NyuVGZ0ygqRS98v6bxsCHKToOKkYB6F3JySCwGi2Cnou4\r\nhWIk+R9l1fv1wThch+GNRA3ibRg7GX6VAWhyKu9Go/6sOMkFRK8M/j/dLPH2\r\nH5vu2rGD0kLjGLX+qov1lyMQIb239o7xtMRcSInfO3Nm4GeU2czzb+8g25/N\r\niNuWbJloOW3BUgO7gkjfBwtU57rGh7sAaWnHS0K1Y6gQX7fzcMR7yTWfDY/S\r\nwMQsEeCx42//ruPN+AdbDNQTBZtxpHkVwxb9wkkkuGdXVW8jxldq7mVOkxiR\r\nXcib3sg2v/qsjhR83uOD2CxBqhKiylXE7M5qmjErnugDmFCwXwMitEAuNJR8\r\npcMVUbh67EIc+2+6iJOHz1rXAFCzpi3qDq9IE030eTpv6NR9Kr5h8tugfB7+\r\n+1VMTtORMAqSYNCZQ55TRqypxfiNy7IRjIecISRgJUK1JxWnT6Yy4wv6Dos2\r\nf1i5mXFqAPsLF54lxyJrjvDTWztOiLI7ggXfhXwKhZUt+KZyPxrSsAGiAJLC\r\nJKdCpBR9ztiTG3A5iiRoLVodRhjMjllD3aM=\r\n=wsRJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"b919766c22a76e2e815815d8becf645e45a1aa96","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4751"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4751_1665843356456_0.7466011623050361","host":"s3://npm-registry-packages"}},"0.15.0-beta.4756":{"name":"piral-ssr-utils","version":"0.15.0-beta.4756","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4756","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e074e27e752368b55c47043c7e7c241b3eeb033a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4756.tgz","fileCount":40,"integrity":"sha512-KMeC44lg2yw/aqjYWoWFK4RbNTtAoq5sFCS74s/m0aIbYd7MgKrRHgdDQEZjJifwldrNEkc5UpRdacKmASFCEw==","signatures":[{"sig":"MEUCIQCLCaUcwmLFEdHBJylSVkjp4fXPhU0d5YQmmABUnazENgIgXoUud/O1Iq+zBI1jfWOKmoO1ZjkU1LwGXRD0WB3Um0s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjUI2DACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMMQ//eZhH3C7mLaUWwpcjJEQ0o9gHB6jPejBYchMTkSOLWB3lhArV\r\nlmwr6Rj0yYrmvzFBEV92YwUn9Pr+7y3OL80qD5ue/tSzBoBEQ1O1QEZBQPeh\r\nh+cH7ewx0/DB3tBE2fZtYdxrNIKYxqCmzYhWSJK4nL8fSbJHgUtldt7GpbFy\r\nHWDg2rdApoavogEF2qW5OhRlE3/JsK4OQupYr7tPlQrV2ydFGQVi61nY9i9+\r\n3n1fBBffHEANufWKebZF0zjK1Iid9Iq2w5Laj6AUzWGLYz2bnFOb20tU3RZ0\r\nxm/GvKi0p+E4D6AcRssRV/XqfBIfdCwu70wm4bCRzNAsW1wZlG0JwIweISsR\r\nRaCEdMXUEN/Ot8Rfbi+bfY1M+dLadq5qAdd/iwBD1T8SuKshCQFxY6MzufDT\r\ncL62LyrvdkuadhgZaSeL9QCZf5ngbbjHWdENud6VNqdHmXnhQ07ofb/B4UGL\r\n9wj1kB6Ny4dxc06Io2k38Y1AvCpA7fing8h6/ZAT73nWP/TuDl0fhLS4wuB/\r\nehQy/ql4FBbgJbntkJpeTuu2o259UMjKlq3ZtWSzDwfzgK8grfLNiEU6qFCk\r\nfhDYzAibIlSlXrdzFmnntIscYm/F/s9yhMX7uW0Otf5AOMi9n3e47D0IXx+k\r\n7+9e8NwmvCrb6zdrdzEyslVIJNckmnUvg6k=\r\n=jGPJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"ef910b00c2fca5f4df24f6e370bfda8e2ab7822e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4756"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4756_1666223490865_0.8568233286742726","host":"s3://npm-registry-packages"}},"0.15.0-beta.4790":{"name":"piral-ssr-utils","version":"0.15.0-beta.4790","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4790","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"69fd8301c901ea4eb856bd0f919c2f96feac37e8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4790.tgz","fileCount":40,"integrity":"sha512-u+nyA4BrM2hXnd2+szHkWdXLKJgRJ2+bxgIguJDw4W7SGrlwRNOUc9EOaJN1pPTW/VFvC6ec6uMSUe3f8B2kMQ==","signatures":[{"sig":"MEUCIEZdDS7g8WzbhRMIg9d8Lkg77Y3Sk2cSTVqGHmQWvieQAiEAilkeOsbGDNHMM4nrTP1OypNEYdFCr/4r6hnmVFqtnIw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjV/ujACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpPfw/9FZwtpTmi6X3ikLHOGMtFGuO21KLCvLyFdcwAbn38DUaMIF3a\r\nrClMSA4Wy9WoYbkPgd2RhLqvH6wDv2prwHdZoJE1/BJjhIg5SkSqd1hLqJgN\r\npj+bu8zELQe8sovpbSo2qJeCYUJg8ol2fsUdR02q2vTAHyfGwerVeUN++SlV\r\nJvhXmaYLQuQbJ0kNmD9DsCJL3zJDV95/Cy6ZidQa4kO0jy65uR6DjzI1ORPD\r\ncSYpPvBarfm8F30U0zOi23YwaqN/fkWzXOCQtnE0uUhu9r6tLKJMRy8zXKKV\r\nJ6ONsLyItLsDfC/uWLGVfXNauKafd+lrAfTaaJUdPgxcNS63Lqs23qARQmaQ\r\nYuuMBb8ttGXBa0ubs3ycvXayhMqF+Cn6FNfKVRX9/mzmW2GQHnXANR9cRfzx\r\nJ5YMGimnOKTFSDy9jVZjx+HBZNIfwyGR3PzTYhHfBpGae8sUncMbHSKPkDcp\r\nJGBIVZFWn+PjhDmHSvYUL3ndHbwf7JPveVOQIdKFbc9LVHuth2/yl1Bo/Xhy\r\n4k4QqMypRgVHC1Bf4DSywtEczpaHuQszGMMnEkJKw+AIAqJkYFU3BM8D/L9o\r\nB1QSfgalXeLIBGey2sql0pGZaH43L7rKjVkgpX0wAvePaJfAkK9oXhYx37tV\r\nXTGDq96mEpls20gA7SB8xRXMmYRRITYW08k=\r\n=8gzL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"610db60e98f53cd53a20aaf48f58b87e69e6abc9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4790"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4790_1666710435079_0.09159353254745706","host":"s3://npm-registry-packages"}},"0.15.0-beta.4791":{"name":"piral-ssr-utils","version":"0.15.0-beta.4791","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4791","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"af391d1d32ebaaafb6b9c970577b7f5de5231afe","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4791.tgz","fileCount":40,"integrity":"sha512-jKIzSVFaJ2D8Rni3ZCAgY6+tgZh1T4VN97yITJgxHeHsJOLGaCG+FDWhB2qgW6PX6w7zcyhWn4IvHAIy4C+Kjw==","signatures":[{"sig":"MEQCIHF5GGM6r+JQQGhZBo8Vjbn8mPA2m5z8uSbG0peZqbwNAiBWQYNnqNHhATfzG7dX9itBb6TfamhuxXQQgHpmZOGJvQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWEpnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpG8w/9F8RPty36cw7eeiNWx4duUQa96hMWmQT+VlDTeM3yQ1B4Z/dO\r\nIClpgcWnWWf1W7lsPxt1xzVVUCBba82rifXvCnFUP0Xr/qffOKmLdRJZNL9C\r\nmCDtMdiJl759HFPmK5Vot9M91GzHJXw2YebVgj90sfOObj3y9P/H7+TOBIA9\r\nmHJTnZx7XGhZG/IJ37M/QJfoQ0NjwjdKrsct25Rio2L1hxDG+pLAoGfHToKU\r\n//7fswEJbGQL86F8o4M20My2osikJ4wpTQ4de1sgtTBJ4IWuRCJixRvARFuy\r\nfoTuh/l7V2kiylKmNRNB1ZqgtEVwQ2pbqygnPx2DN0cqGyv/srAwptw449of\r\nl6yKjwlDFu1BUvMgS6mLuM3fRTMEE2hxzpfppLF1cM4A51YYUFtwH1SMM02v\r\njVFc6eqJVl+7env9s3XmQ4D00Ga/7G4+4UIaDhGuxPJuxEXKMT7TkBTSYjxm\r\nnxPf53iMtmslefggFxpbbfrH4SxU9zGJ2Xs2q/abPP445K+lcPVqb+SJQXKt\r\nxorq3l0TT6NpLOfys905jItpJbIaOI/kadrBnuHX2xPOwb1p1feIAp7Ju2lG\r\n0+UUZ5OeTYgy19chUhJc1Sf+0osJdQow2ETk5mD3e7wImJCFECaAnZrFeXOV\r\nkhjgUQMDKrtYW17A2Goo80cbW1mV0qRA40k=\r\n=BVms\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"9acec0b945406f141dbb5b0db12760245f911bc6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4791"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4791_1666730598869_0.2289577277284771","host":"s3://npm-registry-packages"}},"0.15.0-beta.4798":{"name":"piral-ssr-utils","version":"0.15.0-beta.4798","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4798","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9dd2fda3f0f22202a6a8c1f5c737c72fff6b9c22","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4798.tgz","fileCount":40,"integrity":"sha512-z4sYAnAmRTR5Qmx+BkZ2yW/stXBtODqf9sAPzom44RYPk8VKJ5T72Oi30OSquTBXWIQjSE35hZEqqQdugD59bQ==","signatures":[{"sig":"MEQCIDdmAnADNIfTaVVfEOvJhps3ECiCnF/l6K7vMmppMZQKAiA+f7q5+MizVEPO6mp6btFONwai3b+MN63nZYdA27IeFg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYY0sACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnGQ/7BZL0CpPgI1uX4Pv5f22Zuj52RREdL4pxV6iElOPsZFJwR9kL\r\nzotQhsYZJfZoA9FB0cfDvzzHoZW969VwztXEOtEvWZ5Tv1+OEEB4YWv0Azyq\r\nKMWSEazA2nNhAF6J9twgxylUS8HNYP+ibw321dSEMnUg5Ex1CTDc9OAAIljx\r\ngaem74EofRwAa2kjSs9MxWTITwUkXPnRnca4uioIcu3U+Ou5u+ffF3xyvpnU\r\nI/rJ7W1hrk8aVTFaktAgt6U8J8zeBrm961kW9KzOGSWRPrTWwU6TaFMsSSE9\r\nF4o09UIKVCVhBwf/8UlTYZkkjU08BmyfjTAbt7+TQNFG+0wgwCwFWIG6tbYy\r\n8k0kC4fQlQjVxbB6+W9sN5Dx+6+Nus75kN8F74GsEcwPWZILc6fqF3IpoL3g\r\nU1txOZT6XCgLHIYAmBly4/Mxc7fBw1eL75BSjKuhTR4LtoQNJIleV7qgwg8P\r\nFbAYV3NYS8Oit3mZko8rZd8HhgfVjZcJwSP2w3He3CINOZtBW3DqaHW+tnp+\r\nFnVxjn5+/jj9fC/3Xsr3olUqi6r9CnC8nlJ4BcBRD9MWGn3iztCUkRZ3zRzO\r\nUny6bNMGIL1C31An1Pl+Gm8o9g3nWuIUJqPadQtenCipj/KyX6uaxjG7DLz6\r\n88If4y2Gn79OyVg2UgdNHHF02iwKSpiMydM=\r\n=jfMv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"ee715b27a48b4ec7bb69a761344f1eb2eb731494","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4798"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4798_1667337516738_0.5216332460252309","host":"s3://npm-registry-packages"}},"0.15.0-beta.4801":{"name":"piral-ssr-utils","version":"0.15.0-beta.4801","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4801","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"62bf128e03f0925ab81413e5684ea8676fea956a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4801.tgz","fileCount":40,"integrity":"sha512-zPIo1oGl7Pu964rDFOsWLDIXGg+wDqkVgRMAr6xrpWwuq48NzjhbYAQniT25/+CAXgVu9ZlH8MHISujRA0q42w==","signatures":[{"sig":"MEYCIQCC+J88pISF1oJ98RfLXMd5Eac0+1Z4dI8Eb0TI8NHz1wIhAMgkOd2S/ERtBbvRWPtYUZEDKcDBZ/8ksZOlNmw8w3yq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY8pDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoKXQ//Xr64A8Hpxf43LW1npKO6Fy/WinEWHrIJcv9kwtouVQakdh0K\r\nUDAOw47kuYDXwopt+UUdKoQdNddcWN+tplPBIKH8ZNdgAigug/q4DZ9KB7sX\r\nGtnDgDQZcFrm5e2cPErXcugbSmzcCpXklkZpwg+Hmih+mUT71XPxvFzVVGem\r\nYUFy6JHVGDTbaCy61t8To/VG+yYlKp9atT8AntEO7KRVklzJIpq/20XDOEXo\r\nyQIbTfxjhaU9UMlFmTISp3AOP6alBiEspStP89SMnize6ojxkYcWXlGZ0dGB\r\ntYSNKlCI+ujnFws3dammLsGDPDFZ8Sy6sk+lHtOHVe2oEYU9JHI0idylyY8n\r\nbGbcX3tWquYjQzYaRKRZs6DPicp8HNN68DtBgEkUvjTh2TCIHOSEFn/39XRu\r\n76qPTv4CupLBJx3cJQKDXWgNXaTOL1XctRb87YjzI6vIvKxEOPAzz4U6kqGF\r\n2MMae9VYKCqlR3LqlNlK6ub8hTBfehZUTnZJoje5h7gXPh3kFlK3wfqcauBh\r\nZc1F8OvZqnqEbGEIJjT0njz1FqBPQFf21zM9RgIAWJ3MblUsnjVnSyIMfbNz\r\nJ4VNa0CZEuxDvObPfkZN1WLiuLDBR0N20EvAeApmkXJ0fUkztRW0G0Zn6I43\r\nhZH9LoH33IpdlDtht3MGnJgZ5IFnV6/kov8=\r\n=N8s8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"ba4acd10b46e8c233841863206f9fb2ccc8f1958","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4801"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4801_1667484227168_0.799532722015388","host":"s3://npm-registry-packages"}},"0.15.0-beta.4803":{"name":"piral-ssr-utils","version":"0.15.0-beta.4803","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4803","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"188f5252b98e77b10a6033b6ebe7a05be4bb131b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4803.tgz","fileCount":40,"integrity":"sha512-sU/LmPsXQsjBPlXqFjDKPZ7DgQoSz7D+aRRjkx8o4RL/rzxdqVjuf55JNXDRa8TdrVNZVABhSVFKXGyouUM+FA==","signatures":[{"sig":"MEUCIEBK9lWzE2ZoI7A7DmeRhO/v863O17f5ChQKwC3K/m5kAiEAvGGmSNkDpRfTzxk87aEZDnVhHS4qq/Dlal2ZjSzMYog=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZcdHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmosrxAAjTU5lkRE/qAyI2pz9819trlKhSxWOQtISWD7sGdn707wCbzw\r\nh+JxLYE46SbzdMbzSQySnSecGDPJ2bwyzUaoRznASe/TeP6eEDufBffVb61n\r\nUdydUW4GjRv4MoRB2wqjqcZMVeIgzwyuozMSTEjIANZf4yXCT7xLn4e6sc2b\r\nTdFBwCYaCuh8mmmn5lL6Wqs5ld+CwexTUK8uaoISyH5o+0ikPGww516o2qPi\r\nSfOpwROPD13fn2QVjN4WLGoaiY9qCZgj8xhj08Hw7BWy/sEiLw/0vHS6//0t\r\ne3XjcgPqLYLldYa+ulh7OW8e/OAvFjPTqnLwrRHUnaV58MUftiyXws2hIsy3\r\n9YUBApkR6ItMgRKesdb8Eu59D10wyIn/HyP7rK1jT4nElPyXIrAGnudEaLbX\r\nWjZAqkGSZVKs+SkiNG1OfjlsDY/QFeWRFQbe/Prh6vlFd2ANqWWg9UjBaXcS\r\nTOQZqzOtj1z4mB+aGLDRNWWJI9HCJgrHmE+0anh1sS8ou4lbLNSwt8fgVZZP\r\nnMqycsfykN2iU9RyHgjm83BsyECWh00csZKfK88dHH1tr5wvwhbNeD8zqqB+\r\n59+43XgcXBa9/04u9CdV66Z6r/KCj3HsZg0UVgMJL5NXcIhpGc7Ri21Np4Eu\r\nuHA7JCFU8585FQ4odiB1cf1L4ukYBE1kqSg=\r\n=0Hpt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"38c4b5994e2235e20d6aa6d4b188d98a5cedf85c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4803"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4803_1667614535300_0.6985430976178706","host":"s3://npm-registry-packages"}},"0.15.0-beta.4808":{"name":"piral-ssr-utils","version":"0.15.0-beta.4808","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4808","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a57ed90ffcd643558b1ee0740c419deda126c0cf","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4808.tgz","fileCount":40,"integrity":"sha512-WkJfelB4HLJtPqFK5eth5i+AzGOZmRK+TpmyE6KsMGceC245mkFAncd5JqbiF4p2UX8NcUoO8RvT5u6AjrM1+A==","signatures":[{"sig":"MEUCIQD3pBB+RTjfNMSplszpKN83PdgFy2Cn/oLiZIA6SjRxRQIgXM/UxQIshogS4I/f6Wg8ay9Fn6Zur2NguSg2oqN6vg8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJja5RgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUbA/8Dov+pE9nlrAKnNK3vmdO27xQ2iS64UYV2p9aPYNAoTiGjyl+\r\nCJnAfp3j3RpdVuv5dgiiQS5wD4wrVRE9vUohpQHIPHVLDvRTHLJiJr/+PWFD\r\nccyxiuOQDWJJ34I3FYPwmzPEChCyRlz4M0QLyyAYv4QzAUqQed4Xv5lGg2+9\r\nPO/zYra8cuIcj5hRNBfP6ltcKyKasaPvW0g2hKBtXRkC9suTK8s+o12z5YPg\r\n0K5Xs5mmY9DqPu3sWW9K1ADFJbQzEV3XJwM6GC/Vharl5G7v/yoJYv3dU/8F\r\nD/l1+QtZ9WG7a6Sc/ezulZh3rllD3aHUKIhV7l90HW2KxyXeeMwybZn3858f\r\nW0uU/7uTuy1I3ArxS5v6QvcF+PAYp44weF55BWIvA5U2a/ciEBiNXCpHkTPZ\r\nHp+DZE/QQs2PV7Dl0YygvMnhIwfShAndpJcGLM42QlinJvvtl7WOu+ne92Us\r\nqA9oJytr+sE/m4KkOYvy1zW9yARkSn5KCBR5Tg89MJOnLb2Ul63Llh2ryZ8C\r\nINf1Pmm4uuPidMUs7iPEC2ZMOhDD0C2c+UYrM7myUJk/BzX6d01EYsFs2rK9\r\nMc3Ppp0C9KP4DFNRiBt7Wv5BrQIvMTu/Zy++GjLOVO/XVsEjlXZvWTBsScYS\r\naX9YSlAx9+5A8Q64O1a66sfvMO25YV315Uo=\r\n=uN4i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"27e68a7d947210860a3bc6025b6ab569ae2f69fc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4808"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4808_1667994719908_0.9932016203286127","host":"s3://npm-registry-packages"}},"0.15.0-beta.4812":{"name":"piral-ssr-utils","version":"0.15.0-beta.4812","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4812","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9e82c7859d3fafd814589be2c35bfd95449b70bf","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4812.tgz","fileCount":40,"integrity":"sha512-P/W8qEIHH+khk1otdq7EtHnoXoxIJaPaevk0Ey2Az405FkUzLD//Fn6EWCI77dV71tsiDmEL3UXQR9SbJf6cVQ==","signatures":[{"sig":"MEYCIQC65/7GJkscP8U4CfgYlC1vW8fQjni6sC4zMjcvAsE3QwIhANZO7r8vE1lONnK0e7ZNadlBJxu/GtsK/RLx38AM9D8h","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcEVfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpM9A/+JhyFY36oBXSLSAjj0vD+fFPEeLt+nIzqPR9wFGu6KH68i9my\r\n+zpYPfZ8PucVWMOSeeqBebfmfyrgkx8o/4qUsOcEyX33OB29JoQWR6LF89HO\r\n1YdN8/N1/AEm7O27+R0mKlZJocVjeQs8xaJL8WNKH0KJzAx8JTJZB9A+3nCx\r\npl6KGXLIUgNouHElsmR3H+rOUm298fak59PmEguNjWe0r9b7HrMzfMNzZcnw\r\n9rei+k8rJSxy+5sxzAZnG36YWYqdeduXL0ETQMEPUKlrEkgcoo1pi7zuvc+2\r\nG2Zj1F8rAsuFBXOS39AhZ5GjPO71wQrG4pE8a95ZWXucmCkPI+6P6OYy9c67\r\nwOfWtC2f7jt4AWYm5ngjYSb4I5fow57rQPzzBxlZeIVE/qNgS4X0AtT5k4QB\r\nX38XsTMTTDMq5SYE1oa/Hs/EZ8sdYMvzvboSLCIAG438XUDsGp+QXyD6vp16\r\n8gYor564Aqp3ZQsqgU1uZJD2gqdg5uGGx46QuFMz/sg2qy9wHNp8sawmTg+6\r\nGaoLCByQcj8BBiaWSs1/gHEHEF7AjJct+LcDV4rFFXbrH9FmU8P01vTmPhBD\r\nua7MccwJhe02Si6FG1d4ej4t0tG8k+Q0GXPBBRIPUsNiIAq+6NlraeiA4IAk\r\n6yjIQiz/5QGL0FFGtkiftFrsXcoUPI5aIwU=\r\n=xv0D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"96956ad19ce349b35acd7992979466f911d33156","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4812"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4812_1668302175379_0.7388498434018107","host":"s3://npm-registry-packages"}},"0.15.0-beta.4813":{"name":"piral-ssr-utils","version":"0.15.0-beta.4813","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4813","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cf1a923c7743cfbf88953b92da00949fc5913336","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4813.tgz","fileCount":40,"integrity":"sha512-D8nbxHeVt5QMtll+DJcT61D92Hwi/s36VCiuod4t/ETuisXnMqIGKwnfhpRATtEfDYDE7cGCxQv1RyelSJ5gYA==","signatures":[{"sig":"MEYCIQD6u/LZWxGcUsvVpJ2nX1B8Zlmay9F+Znhv7Qmi0+Bz+AIhAMlD2HNzawxozf+LCScbyOMYuFk15vFQvvPa2fx1oSWn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcZC6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmocMQ//Um554nBdkJr6nY0/zwFLNHIwGL0Goio0oFU1YYmKsPMS9qyc\r\nHJDYU7alghKMLMH51hpAapMsPkvAGj6rWanMICeXubvA4so0IoWREpiWtoXl\r\n6e8R8xj14xYHftKpJrSjc2gNnHlKm2PR3HSQg9I/YC0W38Wt0M6i0eY1OW3V\r\nbF6TaBm1BXAWl7/gRwLoYVlHC8grzqMono9jXKHLcJZ7dQYdretrYLBhfVSM\r\n9bAPW7Z0qoegPitoa+mV7T88mq5vNB89vevahJ6it0KCo6EgFA/Z302rcI9g\r\nJBpM1x8lUxbnk4qW8CmiPQqZbX5wEiEjjQsA5YOcGGVKV8R1kZeF2e7jnFyX\r\ns3WArG5tyBkGT4Xgw/82JjgzhS24vmXY86MONhFi8plXI9jaI/FrmofYKggk\r\nE17BBQ3er5CsMj2NeAVeKJmUcEVN42luy3UZhkN3dI2NdWcpbhsngmltgjKt\r\nlpOjgX7N2jnDGibkaLe4sAvpkEoCINhrdFExGIfwt3xo58GzS5HQVp9tEL4p\r\nJR4COjxW+b+JENgov1GnMPyYrGBvqitCztIvPf/AdVJ8rTwF6MycVE4BPxDw\r\nHb5dKMnqK0BHAPfsuQgRfkg5QZ91HMH/aNzGuNtvwdeUeu+w6aNfv9qtC77I\r\nCZZmJfXA24QiSghJjvudy0s1HOt/AbzkK8o=\r\n=UsuG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"2790199e9c9e3792899f3325f0584d97af77e795","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4813"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4813_1668387001911_0.14828686797989699","host":"s3://npm-registry-packages"}},"0.15.0-beta.4815":{"name":"piral-ssr-utils","version":"0.15.0-beta.4815","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4815","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fc9f38d013379b181abf8df5cf13450a2448092e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4815.tgz","fileCount":40,"integrity":"sha512-47Ci17gWbS7z22HE0JAVuRd3Yh04g8DrN6qLdBuN8BDmhXwKjCoyPHmWZ3AmIpAJvbBiHfEN6vHihpLrc9bOVA==","signatures":[{"sig":"MEQCIDr0GUE3JZImrukXXArpQDHLO6E+gtL/e500ylgrQhiOAiBC4rHCq/6pnSDMCt9B7PI1203c5SueCugZncwoxEC9eA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjch8aACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo93A/+NIiH0IRKoesCZtxnXyJ+Z+pqjX4Yopn3q5XmaKVsW0MMxHR0\r\nc5fE+cZarZ1gSgldsA9123eUlcrgMfSNPhsS9vNNTMKgC0cp4SjfSJLCDvpz\r\nwYZfhQrmW7wGzzjB4t2TI2AWh8JhayrjZM0VM2RtDHcJX8YTiFMcvEYXYMGF\r\nM6HeVD2vxjzT5ixHCBKPDz0+lOhDbwg3Mn2C5MLh89jRCt5UlxnHDnKBdMSZ\r\nqobnorPBrFbzCRpd6BBSYU0BGhobpWQ371ultU5dLQ6ObwV+e2IYqtcSl6yA\r\nMinTVe52uWuJ0+fqiG0Y1IArIhWMPvcuC6G2pC6lhGlTKboI3CYdMDFPP7R/\r\nu02u7gXvwJ/djrGFpQ1XSyr3zH/8+ukknPlrmcq46NP/1Tz0BvoTB3zbJe8u\r\nRqaKaSNcUsXkJFjxp4jYE0IVGC8LxJz4s3CjCN28D3KA5q/eLQF7VPk9I9E4\r\nRxWWUSj4hsuejfyMRRx/nLGPk1KSds+/9ilHDE49dA3B26L/h0duHATEgBC8\r\nw3VkKxIgDWxOEz7DzTpXmojgJ6o/yKRPz54VrcbXKvzSGHuqqVtjlhYYsGii\r\niwPTTWUsttpvOtv51hTT9vSFtz4m4VwbxUcnmeUWd/KBLOTajwmETaB/vnsb\r\nrJYIF2E2KgC7leMCLNpvSAdnVvByyqJ4IHY=\r\n=lJY7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"4942bf8aff67eca5fce289da420399421f0d27de","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4815"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4815_1668423450068_0.6971943215325043","host":"s3://npm-registry-packages"}},"0.15.0-beta.4816":{"name":"piral-ssr-utils","version":"0.15.0-beta.4816","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4816","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a0ae37cb9db00e312befaeeabb1ad6f35bcb152b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4816.tgz","fileCount":40,"integrity":"sha512-h5hvKKr0Xicjee4SFb10vtsnYPELFFxZPZx/KXcBUTCLf9/7f4Q7b75hW0dJd0Wuquxr7K2LZB8VetcPtlgOVQ==","signatures":[{"sig":"MEQCICEgQlz8e1vBcDAMUsIR8kCEhZi1Ocez+oqbjI1r0cyeAiBza6gK8HoL37at9h4gjZqwlAe6gfEfqAlaU62RsrgNyA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcqpFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofdRAAnMO3CBubgBHdp+MMHhJZ2eX2YWfQ+DCe18T4bpzwLY8ZBsIG\r\n5t+SN666ucnByma4Go5FvKwIsMfPdbgnEkhS16ioY8Vm7gdLmNvpmb2IlZDy\r\nnlBpwxpN8DekGgTBJRSudtKXGdHlxEsmpOtesuXSyLAKZGGemIkwOzEU2LKu\r\nnzRTkNmpdwMLgJT8qDivOt3ky0so/vmKZxnklldHGmlfCAPKksKSsCgGxl66\r\nMo2qspTcE+IC4VEnUvIALbefcqYhBUPD2EPk/9zyJqwCOW7lWjCKZdFfQ2GJ\r\nNumZmjKVTGLINyrpgF8j6Bdbs3gpFFWcGGsgxRUmtGJnOAVgMK2E7QQ2YXpf\r\n/JZ+VSQ2D9NEdHbr1qgXW/BxbLTaFLnisc9UmyPQjQMhi13ia1kQKV/jgm9i\r\nldvptMDYSSzucRDRvi17ifemmCjBXuSx8w4fQt8bGediPOiuWZ67z8zfguwv\r\n0GZPrgv6NZ8gfsPskvoEBpgn6CXQ11eYs5stk+GqkP+7Ua4ku3vXMaFJ5ZYL\r\nA1Rs7QXjO7uCwKSFJkoEd3M50f7oNKDTah5ljJUKoJbfwBH+TDWcWzFDrrNg\r\npP5xLaW2VVPDrlUcrf43IV2cAbC2goVFfQL42i59eKb9ePd5xjVFOoPZ+t1Y\r\nadILdjqjN+fsaX74EBvh55f7ygfRLBEMQ0k=\r\n=lP5R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"f6af0640e919d26b25a5dc51d6559c9201728ccd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4816"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4816_1668459076782_0.7121752642192081","host":"s3://npm-registry-packages"}},"0.15.0-beta.4820":{"name":"piral-ssr-utils","version":"0.15.0-beta.4820","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4820","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"36c92cba978d753e2f9ddfad2cad4ba4b9a209f9","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4820.tgz","fileCount":40,"integrity":"sha512-ceUvvd8JMY9sK0RXHQZQyvbr8df5aOZh+p7WVEh8JGNSym9L/eYnHh+OwtrwYF81k/Z05+nKiexIvjognYS+Zg==","signatures":[{"sig":"MEUCIQD3a+EfOjP53PPTeVw8p4whP7dpYQYFTuhD7DcX9/Pe+gIgSYLeSgy9XIdXWwIm6HZgFr6vKPHEPMWJtpJh3TB9hls=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdBSxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoKeg/8DAvksCkE9XYjjrwsDI1zEw9L7g38MO3xNYho0v7Rs0KUHoeI\r\nuiPs0s6WE5usvf4UdZhigg7JHPplbROuyrmty+QewC/2MOnEoKTJsjKHd1ka\r\nXmAKImQSgGT+D3LRIaym76jgMBhnWsR4WF3PhJlQpgP348WxoA9AfQcj8xBw\r\n2rgXNoHkWWpZdj3Cmh3juK+/NvU4wDNnMfOeaVk+kTht8mh0EIhn4c0CUqCf\r\nHMgv17UJh9F87kZ8d/3viD5/7/ofsVbUJY4SrUKvEeKveWWxs+QEeAHD8nqe\r\nLHyRporrjFVU2+fxgb19kZyoUyG+Qy1Jf1l0vyO53iKzwa6ldKfwTo1Za73R\r\nV7+deJQsIYtRUYQZw2N7UCJQzIJmXUzXXX2+iuLk6NNyJYd1UyASZNPa61te\r\nj5l82HR88kmBXym3meXfLu2+IyfOS/r5DspYUvO/Esfk8ZCHhwTDxxZxglsd\r\nADvwCiv3qK0O+FYjG/zXYFpmNLadtmXZ0vgCBD/ZkPxDD/yIRBfVPbj72arx\r\n29IB56TqkMjn5jBo5llZP0okcys+UUQXYnDGBrx79n+qpKz7GlREw0TA/pea\r\nvWPUQ8AUA7NwYJtC2zA5f21ws6onfEehd4XjHVdiZnushIoYSMfvTP7MSACN\r\n1KHOZ6F8OorRGoOGimskvtQeIKS/h4O9UWs=\r\n=0vNx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"2b5a24273c5893cb5573429396d8991d282268b8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4820"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4820_1668551857200_0.6008085953625237","host":"s3://npm-registry-packages"}},"0.15.0-beta.4828":{"name":"piral-ssr-utils","version":"0.15.0-beta.4828","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4828","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"47531d0691a77938b8fb27f0c9f93674293f4250","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4828.tgz","fileCount":40,"integrity":"sha512-k5O1OLUtDWZsk1NA4Zb6lNK0MbsSCUzz3qMw0e0iyuj+OljgDup4c8wCKBrWDJ1ZrPzY1AhiDU+opqrJdXCGTg==","signatures":[{"sig":"MEUCIF4D52P+hVKtL+7J0IdetWpVnIRbVG3tx9AQueL/i6rCAiEA9CRomvvmmfboVSlwyzcaBnDCJzUekhZ1vhfM60gFtsA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdRPSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq/IBAAkf0sniNECHDpJWaro4CPLINxdoaVU+J6TxCHcUmM9nf96oJe\r\n22uxqpf7tqTVxDFm9PULMS0gDlXsZrgoCQgQKemholeH+QywGFOP19KSi1rz\r\nOIeOIKcJsrQEBenv8KpLzgvQJZNxTC9bjFXPUkqLAfhQ9reXvr8xozzVohgs\r\nUTDvq2JNUHGf5rRcxWxgDaO39yK0MekVh50B3V/uF/oiRFSU6wR/74xchjTz\r\n4qlTk9hTpIF/2flk+qa6J4OYwQEZxfUjBEO8xc83ztlRrM9AtglW5L8AgJTf\r\n7zA8g52vVoifH3EsocMYITq9GqKgZxP7abbrrVKMZADr1KNsqi5nhmR5YNMU\r\n71Nr1cmqCDjxQrVfbGcaBYlwvbhiU4PaDHHSoZS3OwaexL1iROGF5Qv+L75W\r\nnIJl/RFefVR6XDyJS6CsDvS7MaBD6MWPDy68JiZ803JUdJtISb7VYtzG3jqo\r\nUEnG53vftN7CuZBz6hbyE7HdwUXHLc9UkoPoJCBF6j7mWgp8KNfAqGCAnMvt\r\nr/9f6HeY33SiwdgmYcWaUtYY5laU9I384QNfOZHc44128N2b0RzBfyENFmiR\r\nGG8jdo65llzzl8RvsQtGWGBIlXyrCDE/RChq31xQWTzZuGxEQidk5Slmb2Yp\r\njen4b28xtRF+4uxyafoZMsI7Z5Z2RpJ5R7c=\r\n=9a08\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"88be8e7bc38cdb48e6a8bbe20e14644ed790a2b4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4828"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4828_1668617170201_0.8510076081993099","host":"s3://npm-registry-packages"}},"0.15.0-beta.4830":{"name":"piral-ssr-utils","version":"0.15.0-beta.4830","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0-beta.4830","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9300700019fbfa1fb574779a41b0bbfd5051b590","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0-beta.4830.tgz","fileCount":40,"integrity":"sha512-154YGZ/r79bq3hYy7rU9uSMZ5Jub1WAoR5qXsVJb1JIXMHABck+sPvAZYoBzjA2azHHdnkoOdNGGGgsrMR4ymw==","signatures":[{"sig":"MEQCIDCzOtsFbvRPRb9YDDgEjd+KzNJlvk8ftGkMYmoIimATAiAJuXLH61MXBbHalpxrn3gzo5NScYZQu0Wta7WoZkyPOg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdSRtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq/aA/5ATyMOv4qQROxgvDf/q6LqEHnQa+BRNR8Bsx1PEreKDl4/qEN\r\nNs6AGIePwlIrBXGFHI2YTn2NmSX5Qk9h3wzABDasD33CWxKPVpl0ixo5RSgJ\r\nQxysSCQiBx9y/cWyAi0V7K8VYHY0Nvfz63VBAzgPTtaAZwaYbPzUYoh63boe\r\nC+JIUDR/lo73Ye9YUOozypSwicR6idk6sqi+CQC/oLMw1Z0+kKti4xR/Wy87\r\n0pyyn/kUwlZKK8hjFcNL48GWV2hPfx7ZLO0SZtl0iER8/7+SV0SRDpUeSdxW\r\nlgdI2seizXCfDcDy7eHWE/8MRCy7MuvzDtF6lWHcN368EBUh1tMElnU5pB9l\r\n0OY9Ub5s22IN1J5rEqmqQVAanDpEMEBSUje6mwfUjj9ep2NrM8d4ibb6D19w\r\nWh1WTou0+1x5UPfsXtP9LHTsNix5flYgy0Dnrw9O1PLXPvZNzYPQpcasmtvY\r\neSIo3I5sN+GVzKm6gTK3okAROTcUpD49Tiyds+hVv+a8NkHPqxaJc8Sp8x59\r\no/zDRNcd3qx3kiQWyCnT77n5ghU/jJRwxDqY7NhEhuouU9nWrKZiBUuAmSPo\r\njMjjJN6ckfb19sZaukQf8Z68P7TUvI8u/7jhqA2HvQZb0h4Vx376U3ZX7aLH\r\nxHA/7fAaBsgPlcisVX6SUx2M2mJT/YsRPBA=\r\n=Htua\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"da4b488c09b90a28ae06be0bdef173b98a175f14","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4830"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0-beta.4830_1668621421232_0.6034562003572728","host":"s3://npm-registry-packages"}},"0.15.0":{"name":"piral-ssr-utils","version":"0.15.0","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.0","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"90803c5e118f68271595fc4a882ef2e0e7a9001b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.0.tgz","fileCount":40,"integrity":"sha512-5KHNbG2lg37Mi8P/o9Bl81BWlWvC+EoHjsvU3jPRasRRHar5bwMImwJJqsWhSvL/ovkYCYfLb1/TYo6ecxSSEg==","signatures":[{"sig":"MEQCIGsoMfVT/tOG5AgPdDlKwvOheZ5RNQ7GFl6IWa9F0sSlAiAiG5qY7Wq0mtFwQFUxwFmwBzothEgU0KWBpkw00BMMcw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdYRDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrTqRAAmGinwRsLfbGLiF8X7eJd9qDGLenbNKo4tfN80SZPRiMKDKH6\r\nqKzrgAfeyTAtZ/rOzqyMRy0wjJmYKxlRDaEdBIRAH+rikiy2i0YanHaIkfLO\r\nRfhwDtOz1SuNxkhighpQqyY8/v35DACr6akSy32aAs3xHKw7XXaI2/W/6A40\r\n2wrJMMad0jHkcdcl8s9yUsf56gckSrYiCVor1xGcqdOgoQjxeStjv2FVy9PH\r\nxNgMr7gAT7R3i4YFfIEk0cJ5sSm0NbEtg9s0WvjTgL1qyvNWxaXKL0MX1vt2\r\np8wJTFTqEBpUess9mfw3nJY6Nxud2/huuxgmWbdRfgxVCWAWO0xwqrHFj2bY\r\nKjiMimxGTVG3zISErsYJ8JB4v/aw88L8M8wVox0GDnzbGB139u/cVLzrVOPM\r\nERHA12vck0VhzLfY/bfVEbW2NyX9cXQ46X42EeyXVF7BqlmIiIFsgvFV4agq\r\nglyFzYGlRLaa8LYTYelGZjtdctPEJDBP1rgL2s/P0OF4Ff9Mg4DubkO2s7tn\r\nu9jW5hdLUQWs6CXyRnsvL2Tmf1/bEv0OUtIO+3n4I8g7IuHWimTtWZz89itg\r\nZcG2vUF75kZlrpaKx0fxRBbtVKSaMYUGJ0JSxjccDEvrggpA0Kkcyhounjb+\r\nac27pQx5LRvK7D1PAp2Q5aN8wB9v6YjcZnA=\r\n=tDje\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"0a8a48f663dc0e1b6f09eff75af45a5377a05347","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.0"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.0_1668645955536_0.21937301800950082","host":"s3://npm-registry-packages"}},"0.15.1-beta.4903":{"name":"piral-ssr-utils","version":"0.15.1-beta.4903","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.1-beta.4903","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1003a57fcfd66afbd46d8d57e9febfd585703f3f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.1-beta.4903.tgz","fileCount":40,"integrity":"sha512-qKStMRV+k4pYrB+0LoksfL2qUzzJIECFbVXPbnnA28NNvv13yX6w4+p6V1+gyLtHsYg5A/mv7mn3bKlZLd/CWw==","signatures":[{"sig":"MEQCIB4zCUj9//AMfvTtPXyBuwhfSc41Re0x1uM5V6dAfaI1AiA2OwEbO6+9HAygIBdsP4IeXyudl+oOJCN0sjji8uYL9w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfq6JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMwRAAlx2E9eiLhsv5pKJDqxPET2RtxPJp7dxgStnFKa6QulvnsfNV\r\n/bMKtUe/D6hpinqhx4Ygd4xm5nxn1FxJGaSvq/DC5O+Im7DqOS3yAYECpPBy\r\nQv7a253xIS25lUvFEI8K52n0YP9l0uFMzdb0fuloqUN5mfS4qmmHQBBdMNaW\r\nsF6XJ2FmmCXwyA+nTQkIEYYHBHoYhoSMaZOb0ZbFuUNpV1vb3umFdbE8IHLZ\r\nCOil3piTuf4d0gHZE7Nvc5QXKR1O17IDHSuRvmSfBZco/E84fDHy8lCqvZ55\r\nyBkXat0lTSYAPTQkz3E8VOM2oLejqRzT7XZFc8zvHzZWFFwUfhRA7qETJ3PV\r\nMXgNbhaAGwu66hU08WZEf1dLHOWCpBY0cJ5tke1mztEE469EXFWnTBuqjDwh\r\nkIRyYX8YFNb1nZ27tB5essVcXGeR5CQXAC8BESuyaLDa+Hz21aw8K8pMk2Ur\r\nlaCNbJIW9FUYGiZyIRIlNearI9U/fgA4LX2QUqKcDvWbUbdlt3aug7GoZ7I1\r\nDk+GCtod5+V4nhGgH3k6VfivsyhSSvt5mYq7rpn6piXAcbsMZrxjZ/wECmgL\r\neDpfxaklsBMrRQgKzOhyBY13In3gIy5aj+7lGgkCo43z3twOd1RzjAw9gxpm\r\n8WNVwqn5qr+hDrMMKYI2Hm5U8iRSDNzgt3Y=\r\n=g20q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"352007618501b20c32b9d159744ea6ec0b3bfbb3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.1-beta.4903"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.1-beta.4903_1669246601754_0.8676699966617627","host":"s3://npm-registry-packages"}},"0.15.1-beta.4906":{"name":"piral-ssr-utils","version":"0.15.1-beta.4906","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.1-beta.4906","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"620f8faef0df3f0ce68e0afd21140ce38fecff94","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.1-beta.4906.tgz","fileCount":40,"integrity":"sha512-gk272hMVR7KyB3LXy44tJ9bCZ0VI/m+NSn7oCQkkZ6d9fkKKDI82yd/+x8MOA7zZ783q3Tl4bI8It4htHqNLSg==","signatures":[{"sig":"MEUCIQCd2c88/GPPn07sZOqG49zvqaCpKU3/avjga0srMkfWuwIgZXNkBmhe1YevzUdbzwSyEisjxFDYOVfuQfsNItKspmc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjf398ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqEIw/8DzbIsb4VOtQrTvUfAPNzNxIhpOFK0m42xZTfVN5SsaQ3G26u\r\nQo3DAgcxcI5GNpjHORQ/IrFYk3HCy4V6ucKN6fI8sjmtjsvcUI6cZx9JaSjK\r\nJjGGPD7TwGx7WDbY6h5btnM1RWgr7WRkvICjVmmbIDJC+QBcUNgEM8dhVEmk\r\noMN3FuKW5yomwE990BvSrBQ5+ZStX6dAriGU8q2gK1z1BAg962zx5Sk4sLUC\r\ncD4S6GS/D9xtJzvpUIjUiKYRNOJX0v8ACmyfoTAwa071dQk98//d39w4rZll\r\nfQpzGnKUmkr7bTTgYQDlVT3+SRFwJHegEiJKC2rcebCxK9aFsRp6ydW/9eyI\r\nutUxYtHBeT5XRKwzN8QRZjXahFJhnBLdZfs8FiJgOb7BBqQB4LS5falQ0Nbz\r\n4ZEuFP2DssbYrPBcf3FEOc5NbAfKxj1w8SpZ0Sdgy1n4sZU0TQW8sf0FeEwU\r\nt1XtcpvdrayWaRCIqBKzYhzgXxXLolGFBO9mlin/ed1PF2EIAODXGoLoso8J\r\nX/KhLbZ/iVAM2RR1071y73Wr9seUw69/FVDedw/lHkXqlXBjbFaANhcZv6lq\r\npc0+1cLz244JV6O4dBiJdnuizDXTDaSKFnkR4FeNyZ9Miz3gt1P6pAtozn84\r\nVRdQU+G2L3hSNeu4v0Bkoym1zGzJf4z8UVY=\r\n=4x5t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"478dd9009975d891b6734ea0a0ba499fc9212126","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.1-beta.4906"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.1-beta.4906_1669300091966_0.36138617902713177","host":"s3://npm-registry-packages"}},"0.15.1-beta.4908":{"name":"piral-ssr-utils","version":"0.15.1-beta.4908","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.1-beta.4908","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fbf4098951e135178fe1e3afb56713017593870a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.1-beta.4908.tgz","fileCount":40,"integrity":"sha512-sql/l0bZGzWE4sUhaHNAIaoStn492zQngOoEGpe7S4W08KNPgG59snT4rEsGPPhWvAL2jGOdTZ+dJYhem8vj+w==","signatures":[{"sig":"MEQCIC9D916djaEARlmTWTRCsCB8oqULKaLT4l06BqsenHP2AiBDgp6cN1Kq2QFcUE58+8JUPbciAXqWKj8fYWb9NvOR1w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgAI6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpdlA/9HYNvoDu+UNK48NblL5muh1XqW1jBojYzPUL2dRVsDGE83vg4\r\nGnNVC6AhzebysG7jHW7bu6/s691ORQ2lQQjFTO2405JInP8q39OEr/KKuhsh\r\nn2k75wrkp1AHF/dz9t+cX8CM+Y+rRorPoc1LCWYA6xxC2c18sfz2JuL3aSEP\r\n5ckt38drKJ4tqUA1YL1UE/b7t0TZZkYRdy/twOEgxilO5m/V1s+lEEMAEvfI\r\noNXXkCA2VI4HUa7wLVSEW0bQ9TZ58d5aEnjWERhgqrEwrYFRl1yq1WtwVCl9\r\nyJ5uFc/3veT2RyQdLjXkyEVioL2UT/aIVnRDqj21lIZIFA/AJkFfQs62NB08\r\neA3TxyFpGbFQH0u3Lw7hCFpu2nqHVNr7QsbRKxke3ziEJxgZ6xKKC20ljrqo\r\n3308feLac5x3MbufB0aPU524katPxHoO0mF8ypTlodmjYfo0mYM4JVWvVeHG\r\nWYpmzQI1l0/AedD1pFIyWFZxmO1VjY7YuBz9WSZftupZnym12ihTO2/Zba26\r\nymFRmqXfLtUao8PKqqeNWgPFRRHqGGEfrnh+hEOjnO9IRIUFazhxyYb6dcJ/\r\n68qwDd1jVn+A+bQpmJAyHJWK00pClKiGVADe2R4Fo1VD2nE81SnhtKdlm7eK\r\n3oub+L2DpC2Wzxpnzg4NZn1HSQ3Nwe4iCzg=\r\n=Deuh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"83a8aa5c0a1994ca184276864022e09da2e87195","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.1-beta.4908"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.1-beta.4908_1669333561997_0.9418483797039567","host":"s3://npm-registry-packages"}},"0.15.1-beta.4910":{"name":"piral-ssr-utils","version":"0.15.1-beta.4910","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.1-beta.4910","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cb97c4d0c2020f60e4c4190180de2ab3c8adef4c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.1-beta.4910.tgz","fileCount":40,"integrity":"sha512-dlGMU6UwybcRwlX4vdtqu29UD885wgg7ENEK+va3qIui5+zE5PMNUAases3CR07XhXV2qtKJIERRKvs1fZSvfA==","signatures":[{"sig":"MEYCIQC79jmjYs/62VS/NZ9CI6qwia7d3tCA4aeyOAeqDY/lxwIhAPXdJoeCEJxrMQJLo90SBh/JHBG1nhE1eVvF8Ny9rH2n","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgAUeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp7jA/9FuLyjYZqTJx6a4SFGcPH4EH0D4zTRuMWwlzTbv9/Hlgnf8Zq\r\nHocZG56RA7QneXyrPegcznET32XoCifK7A50MwGbUmLrGwh1Wq7Ev5ZQkxfc\r\nX5B95WA8kMUonQb44DjN2jf1+0yUsC1AHlSSWIz/vA/CW6Mc77Gqm9xAM99G\r\nflPZlFI8HM3bvJi3ZiMT5/TpycP396XKAZz2YsAkUiJLn2nmLvPgrakYbgAy\r\nj+G7c4QvDIFRHrJWlvLlDVNFK3O48uBYb5me0khSyHd0vzTMZBGFp5w7frau\r\nn4rSE/g2ZmBY/+ZOi7tDwKS6bi8bYm/CTfdkhPOsZcKNpKWUZGubnOPEfCSc\r\n4BK4/ORNXZerkakjFWk0KwSKUNVNyJvLmxzIRNfW0hjpZWg3yZYMtonxw50A\r\ntzB7Mj7Ttao/e6hvhVk3zSC3ixKX9Mn2ooAiF64Si7UcCBSGZdNOz480fPgo\r\nvLHjzKsEXOQzSn3EcgpiKzaTWf+I2lZPLAw8vjts95OtUhwtaNqh8tcmOQdL\r\nzUcObm2xx+Tj7N3lFLVbH3TP/MwV+fPFih50e0j1E1rkZurjPYlooZi4o1CC\r\nZGZTgJDpI60Oh48UN3PWp/NkSEujM9sMZTRpRIFzk7VIcJcVfktTPUz1Wt89\r\nlsiIppmHUmmM9npmU4onFypNbyy/ONOX1lk=\r\n=3s1l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"83a8aa5c0a1994ca184276864022e09da2e87195","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.1-beta.4910"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.1-beta.4910_1669334302014_0.07411394150780737","host":"s3://npm-registry-packages"}},"0.15.1":{"name":"piral-ssr-utils","version":"0.15.1","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.1","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"14d7edcad855de818d44a3334571beb86c561ec3","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.1.tgz","fileCount":40,"integrity":"sha512-w1a9ubiC9IRTcsWSe3MJ9l/qFP4bXhtXHVTlUAFagCXBhx6TdNvTcRljV7pMDXAOAfhWjFuwGiPguVHZYXvZbQ==","signatures":[{"sig":"MEUCIQCT22hvdPk/AY3gfOIvZgNOHjyPXQcJt7hQy9xq89F7twIgW7V/I/Bfcy1w7YSRHo536x9yjLeAC+BSxdV46ERMTrE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgKqgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpmgg/9FhSvsTnJj5SZ2jKyQ2HQ7rlXp2YVsCaekC/pmCYxWt1U3beg\r\nMhSWqHsHddP1hyoRbB6Ub6zNrDOV9sOC+VqmQ+bN2cNxfBba/TGwjz1XIAC4\r\na4roBiasgON2M0MmAgkRlr1AbWZByjuWVa3D5D5fUhP8Lwwilyms6Fop+E2m\r\nCFX02UUUI9/+gW8kkvsiThQCt0o4dNpbRtDqeDhdHEXm0KBnqsqoeiEZ6PI8\r\nI5Rs1ih5zlX0ZlO7pn1ERXq5VTFMYmMNFFiCPvUHAAF41qK7pHRtEpyLfMFx\r\nvAZC1/99yRg3kaSXXDnCn5wwoVnhHS9C4KM7QRE1d+mlQLgZcjX6t0AMruXO\r\nM1EZ38g/3VcTSzAQKncTyMdZsvFqzRoHXzYeQM0jGxWIZB/5IYLChABgg206\r\nK3+6t14L4g43jkYjxcE5aYXjrRMrpP7gHA7OqwLPdxAVWDE0Hy3jQTryvXsu\r\nE85uemPfPBJpcuyKgQBs35/jlFYTXkQEbaoMLY2RpItc5x51PA33U6Dak/rn\r\njYEx5NN1H1aRAN/QP1IDrgcW3y2bM6BudR5TdHURVZ0y2a/a5U+vaEOA/UrH\r\nHBaJdcuu0YpYd9rs4b3GbZgh5pVCnBw6GZ7WoVMttksZinxAro9s3h1OjmSc\r\n3cchk1OB3bRMua+FfGZev845502NwA0bIh0=\r\n=kEqf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"b1e17ccc03bd4a256ba20ff7e7bb2b899ef35102","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.1"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.1_1669376672674_0.7439399636894963","host":"s3://npm-registry-packages"}},"0.15.2-beta.4915":{"name":"piral-ssr-utils","version":"0.15.2-beta.4915","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.2-beta.4915","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a91231432bb057d18af8f2d9a4b225be22d61f7b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.2-beta.4915.tgz","fileCount":40,"integrity":"sha512-Za0G5wAQ+3ROb81yNdYcXHhscDkaRjBewRFAEeT78rdWWRykMG5CnA3kOs2VmoOWe+hLQ9bxNWiuqLulNaZZ2w==","signatures":[{"sig":"MEYCIQC9X11qP7NT4yrbnfUiHjohphVbnDzdBseS+WG5NZW0YAIhAJ+cHx4vm4kNXvO66HczlvReM8CAUuYYebFHgjKN+n1T","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgxnOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqyhQ/+PVsVaFt+ZR1lMQpv96N6Hm6XYJtCGgsdHJBbq1HMIQQQdlRL\r\nAmZ3vvynDV2kmh2vM3j2SrpFiXYbLmmkfNUFBBH3ji6hQykYhwiDFnqSBInN\r\nbjuJ+q2LMtpdnMrVF7duJEFIVVSxYcmXBe5lbCrJvc5Ki7rNxqETer6w5X9N\r\ncSWwuLkvr7YBtQgRipSQ+H7Rvw1mGJAgrh5slm0xMnvDBA1xFpFUVG0auxA6\r\nAqAaHFnM56EabK3tQU0KZSRbFr/cpuYddjDCnTeQMNS7iBi4B1aUCXKyJjfP\r\no6BhJ7fRd7uw/pa8qd2PoyosN/VLT1hocB8SopDP/UGBBZQFXPwHuCeFcefk\r\ngkMspcKcjnI7OtcSpiOgQggz4Cne6N5pRPHFGjhsYUC4fcnmSVcTTwOh85ve\r\nqukV2gkQgzLDdRh5mvAzXRo79ZR0tO7rjupOWpawLJ2SPJv6++R+OQeGbe0z\r\nJkJKPdBcJHUSu9sPplketa3AD/NrawNXH91WFF6V72s4V9d/W7fKydRbZpSl\r\nJDMixsXlgM49QS3dr7v4SX1G1/4bbFPeZiCa5vMp5rE9pPpZ+95G1LxZhC6f\r\nSVLhDRH/Ws5i5X0DvMA6dCABsStFTfOJp9mKu8uVmrGrcQ/QC9CNZt9URxV+\r\nSbTe1KOwJniSAtv9Tus2D86FmxIAMsuJQUU=\r\n=F4aJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"5ab47435e95f3a568931505084459f6b59bf80c0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.2-beta.4915"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.2-beta.4915_1669536206101_0.43858206975881986","host":"s3://npm-registry-packages"}},"0.15.2-beta.4921":{"name":"piral-ssr-utils","version":"0.15.2-beta.4921","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.2-beta.4921","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7f964a25e4e269e8d3e38428c5121826723b7ba0","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.2-beta.4921.tgz","fileCount":40,"integrity":"sha512-q3hlmzs24wio+Sox95iRCnNCVJs9VxMyy7zyNgsxdJozV8g7dGC8W7M3Uw2UbKQrjL9e4C6lfa36QbqV2fs+GQ==","signatures":[{"sig":"MEUCIFVhS+BbXqnWQolYEqdcqyodd/Iya9R3uzkj1roZvKGgAiEAj9kUtGkR5IHD8TQgb6g/mKQQZDWmYMdQGqZHJv/Ss3Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhAQcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrb0RAAlynW5YLF+uzrpUydymCcnK60NqR3HdwMb0eQwrLAworThwX/\r\n8NjGFAjpEkqcp7pwTdKLW6AVu+ucB7p2ZF18nBVtMys8zb8u8U4hV0ZAiOqI\r\nk1ZQ/nNQtNF3+UUovjI7SO84wQpB83Nh7usydh7tbc1fBAyCUnBrZR0oSeed\r\nSWqRHBleg314ITpU/gmpOES6hMq9zEt720+2+eWdW7TKO8FB5CSNqTClZyIy\r\n6WyHynUPW4CwXHDtTvGubxygA7WcXI78vFS+jgZrEwgJ9wQJNRDFr2CS1LB1\r\nAxhOFYpAB8xOhb3YDQniRdfiWqU7exNIQdmB/ZDSjaTeMClQB1M9VMP2hzxX\r\n00luf+W5nPkn5PCRV3oEnohfPJ0X7Stj5QCMLzvhM414YPmmcma8OoZXw4DJ\r\nG9MH7togyfRa0HmgiA5JJxzpGaQC3gi+1xvCZkBfur1lr6tgMqKMRwazFYjV\r\nnBnGmsMNIMBP/zv45OmfNhSNRbd7iyc+hCzFb3HHns5YrnX0uJ0jeDt9Pc0v\r\nV0Oni5pTAtTJ3aa7l9H80OM8lp8aOltNGH4nzPd521Uyv721i3jFmvEACTKv\r\n8a3PFSIeHgQzpz88rns6tQjUgSCU8XeUZlNip/0HnF56k2rHpUm6FBx+6CM/\r\nMx1PYjvld9TzQ8dnGBsYdn9A2MYfwBDkY+Y=\r\n=Mpfw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"e112a3859cfe8b9f7a4ee02be3cf5493f2482a94","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.2-beta.4921"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.2-beta.4921_1669596187991_0.6083289407750561","host":"s3://npm-registry-packages"}},"0.15.2-beta.4923":{"name":"piral-ssr-utils","version":"0.15.2-beta.4923","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.2-beta.4923","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fe88b81de4b3d4b40a25b0251e9b220e867977d6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.2-beta.4923.tgz","fileCount":40,"integrity":"sha512-hvAFqW5ons1YSGQE57EjhEQBeeQkQH1IMRX/NCYT2LXgzbKOVZx30A80x1WI1xZVJS0R0ii3/KxnCNPwVZkNKw==","signatures":[{"sig":"MEYCIQCDdT1XJaDM/VQ9Vg5U5/5imUG4/KcxPhAgn9xRUD1AtgIhANw0YbB7gsvGPUgcfCgS+gWQmTOQxvoK5Q+62VaCAd8C","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhOFKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpiIxAAjitPVwsFDy5f87eJr9eF4RPaGdkc2Y8UBwfirAku/84Zf4NF\r\njaEBnNDwDsN8dvZL7MN/XYJcVmERbZC2Tln80oJNtFfiT36zUH8aR3bMPnn+\r\nxDYL/M2BQQaeqgQQ0bKTdTXkGpi/vR8XTt+vEUIJjK4blKkCuhhVMH67e/AC\r\nZTJW1qDtyXz87Qa9VdJhVwoOwSbiCp5mY98ufjXmEJyI8ugJfjbNG7KYOpJQ\r\n4yHqhZgtUSQNPndIfNMcjVPWhw+mN0P6V42x72OUWRxASkVo5U+NsuGDOIJ/\r\nP/PhRcHJmn9YQxHG13dlGYBFr4ZQcfPygggQwzUulX514LyKQylgku+GG3EP\r\nhf+jrpZDTccS500qhWBUAZ48JmjZSVEP2iBudxt329AeOiYleWYJnHi9bGjC\r\nbpo3t3V3yKCIAqcly40e6UQULh71YLK5Ws125G6jMPvAT5mVUTge2IqKECJs\r\n29A/g0T1VioCQ1ubm1KCkEbXwZMAEbkSSLop3+Rk8P3USeDSYnqZZYE/Xiat\r\nf9wNgb8s9/GjvhbWkxQcyWYo39zi0/l4kxjjx65hu5/NpAOkGhKZRXbrLjTJ\r\nxpdqCEw9eB21SoB30SnJuqXzMh27R7fEIGBBzbvC04d8yPx5g7E05yg+n3Am\r\nWLDSyoJKtQnW5jVW1zsTdQPlxYlOluT83rg=\r\n=1zgS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"f4547fa8ee856430f74ae3c46f92df77c6700b8d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.2-beta.4923"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.2-beta.4923_1669652810468_0.6495167945642943","host":"s3://npm-registry-packages"}},"0.15.2-beta.4932":{"name":"piral-ssr-utils","version":"0.15.2-beta.4932","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.2-beta.4932","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"be278494ada5f13702555374597c09e727f91c1c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.2-beta.4932.tgz","fileCount":40,"integrity":"sha512-5dAZLIxbyzcpsPeAc13rtNyOsY7xzTIkHKNP2Kkpf+MeyEGbnFkrU7N2WDTBwNRRXNI9z3GdqxEhhtbfsTjrhg==","signatures":[{"sig":"MEQCIAdHznwyFT7ex2We7E8bxHzRa4HIkWWU9Evc/uZvuA7jAiAR4D0HfZ9XA0R9VLhRWBfs2QjVEMPlISdB7p1BMBx0ng==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhrhzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp+EBAAhrpI2+NAMM/DEb/58MHKziFKol4CN/tW9KKCx6p083QDXNp7\r\nvNMf4qWYtd4cOQWCFTL/QBu7Cztihg5gYQoQXyGyvNga1B1S4Uz/tnh6uwDa\r\nWInY6v2622bjYEr7G16yMOOgzeUleKkuoQhL2zaCIGuoMVOoQ0ezLtBcOoLu\r\nGaA4vNKXbVzaugHLl+N70/Jf+2c6AHtoRL0GNrkePXGqqHTyJYXdnQByXgXe\r\nKgGG9XieGtMULet16IVJ0ZTon8qiulhWU3vSDZbWqkllbgDCHskK5bva8thA\r\n/ClZeg3FXBwYJaMyDAsdRwxT7B6dh4qYIHjV5FQW4eQYqGkOM+NSXBBKZPq1\r\nJAtroRsyrSRYh3VduXOfFbRTOIGBRBcma7VMzGD8W/n/5Ur416kcJf/7dZzY\r\nQ4IYsYhBSgV7SuLrJ554AYvdPrJbRqknS7Zdi0nx2GjejH1ce9H29OQho08t\r\nJOb8epMeplw4HrbLpPiSGzL3sgA6boH+RM2QlKvOVYgobN5I0H5zOGLsTYXS\r\nEFccv/kBkwiFXFTMJyknpvb+OS69zG4+NXNZhwAjhHDS/64Q9xTw2VHkT+QR\r\nab5Qpx2voZ68zD5EQIiI0MFASZ1LrjS9YZYu/jMBoOkyxrS8TNN2nZOncC3b\r\nOBjRS3HJVgvWYbzvhJv1p7uvbnTKatcmMdQ=\r\n=Do5P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"9c1242edc9f7bdd2255821500ca5503631cb7569","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.2-beta.4932"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.2-beta.4932_1669773426978_0.5120282863469099","host":"s3://npm-registry-packages"}},"0.15.2-beta.4938":{"name":"piral-ssr-utils","version":"0.15.2-beta.4938","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.2-beta.4938","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"06e9810710dc8b37f230f8c89e376db6b506833d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.2-beta.4938.tgz","fileCount":40,"integrity":"sha512-X3ThYcWv1t3BLiKTnvvo/G/75/Mk2mklxXe6Gd3utsq16vOoWIGWlCvDlGTWTVMXRWE2cUkEvnhok4UA/ocWZA==","signatures":[{"sig":"MEUCIQDAxnbAt4nvuTpbY9feKfFC6MK0gnGU4BBbke5ZvvAywQIgbPRSEzFX58CKx361T0VHANtF2Xs7HYxyTZP9H4+XPgQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjifMqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2CQ//bAIoe0uWQWN5rXHvL1pP7xFERu+Jc4AN+b8F8VuSBi710ZOV\r\noMNY2dJwMB9CjEG7/cvJjTVySEQfzPUlwCyHxLi0JzIXW+Kiwr8Kn33Hp18W\r\nCArBtRxi6vD9wQ9uEgJNAAICvBfR76y2dAR4Zia1Y7/NzvmUIYPXiyiOUHbs\r\nQIzvmYrnP/RgvRgE2E68CAbCHvHChqurIk/bh4CF9EOU1IRYKITW+R3E9zhk\r\n8+ow0iky0UWpBKV5uqDiZp9JmPpf56B/GIMtaJC9hK97TEHKy4uNQVXTQ9T9\r\nXRjj3xkNoo0FJs4bt//UQ69mkJJKACww1e29qVb5n8jTQXzgDYSYqS2JggCf\r\njyT4TRkMhJauO8tBb4BORB03wTwcOTOKYgdtvgkkquXLhUiFzSl/+yqhodsa\r\nlNRFsMHoqZlRlVmqRbZkuuviLUxFU2ZeozoMvethOcWZ0Vxsu6UfE5FLNWf5\r\neBZXtHxhTJ1Q6zWyY28XApxwanXLfpGUjbX8TLA8dCHha19eCh4FC3SRzyvV\r\n5bubG2EKpierC0epfxXsl9Pa0XCS+9r393bKLEDxQNlNqV1Ubu8INdbblm4Q\r\n+jw2ELI9bSHjOm7cEe1B/K8+lz7v7gjAsJIIgFPdj4S2a8/47W2K6Dzokk1T\r\n5VwPOoBetv/FoDWn1D06s1fxUxCXPwkkk1g=\r\n=mZLl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"f0447352d4b8883b6476b5d1a260d4ec9cf2660d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.2-beta.4938"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.2-beta.4938_1669985066418_0.9681955249938572","host":"s3://npm-registry-packages"}},"0.15.2-beta.4941":{"name":"piral-ssr-utils","version":"0.15.2-beta.4941","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.2-beta.4941","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d2384750c12f4427317e1283110ec2ff06eaf191","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.2-beta.4941.tgz","fileCount":40,"integrity":"sha512-VLZdB7cmQdUCaCPZ9uvtSSKguy0QmytEosuIBxsU/9DHOjMDcyGmqZ6fwM2Xtf9bCZ6ZDmgY6JrykLZWrRX1IA==","signatures":[{"sig":"MEUCIQC+6dVKfR9iEoK+rJMqFSYyAFGZt2gKc0SSGvcIgo35kwIgBIX7v2QI1RcQCJIhGe+g/e8tSPlv1dCTmKabLwxJVqc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJji2FeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqkQw//eXEdA16EIL2L8s2PC4+GzziKdGbeV1aqzBg0lZJ9vW8JJ9Ef\r\nKAj0NgDf6I+2z5tbQLVUNz6llm3iW91lQr15I/VPb8m3WgPNJbiit6qoxSPC\r\nLEGrRXAoVsBmOdTZ44rzo+fisikq8IRSbQabi3mnUazXvmxuY6EAPht4F+58\r\n8IGSYS0rU09EdM/bsN/wJ59L2G5gPgOQ3Bi7XdspU84UB1ecdLu8iLY9l3zO\r\nnaJmu1nx1VQdMSem3kyUS2YJ/f4n8eB4Kl401LjQIXtCzFIKCt9idxBkogxr\r\nZncvHEPQnxtbF81jsjx9AsrZqxvW8Jws/8j7+eXWllM7k7sXGjjbDmO3alSX\r\nyOs226qAsVJOqlwM07YcC52PvH1Mv/HvEEyFZHW7mOmAFHbeWYHor22li74a\r\nKTi0aZfkYXmc36NFvW40w4kZ7sFDlXPzcZKjQL8hLgqZCg2HLuszjRrr94eL\r\nDYWg9uQE6Ttg9A8TBBh/ERxnf65NH6xxMc33+dH9eXK9HqghoceClv1WoIPx\r\nJKsfOF3+jT0HIxuykvhvhHoJAewjEDhfTe51X2UakMxQQUqYJ7L8C73ZiqCq\r\nCaAwX32vPZ5u8Xzi6DRNHRbm+4tXzrRDdsivpBnHLWAwM9rJxFEbSmwzPd79\r\n4ySJGsERkost9Fpk8GQC6BDghGoetOen0o4=\r\n=yOGa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"4e71a1d41d662d8eefc520b2d9718d5d49e3df20","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.2-beta.4941"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.2-beta.4941_1670078813828_0.3963361799513183","host":"s3://npm-registry-packages"}},"0.15.2-beta.4943":{"name":"piral-ssr-utils","version":"0.15.2-beta.4943","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.2-beta.4943","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b421500f14d5cb16e79fe8a3b00a2b3bfe83a5df","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.2-beta.4943.tgz","fileCount":40,"integrity":"sha512-r8Ky8cvSUAH9JFpi7tKAnByMlSplUvyR+3a8QYIJ9NkWA+XNryxU0wAqwNIyps8lwB+uN6PQk29sp1EQ2OInaQ==","signatures":[{"sig":"MEUCIQDydWqTStl6a55iydQrBmWbnjNO7K3DeA35pIU81IoQWAIgRvryCF4B/SX+rUZglDWDFey/Ayuh4uMvB/Min25J8Lg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjSx0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr8ug/9FjZAB/X4qnLKb0jQWnTEgv/ShYgPZ/IvP2MKMKqiq4OXFAVv\r\n9yeSla8j3NHXGH2ErdVw/zNir0/FdJoTLkuGtD8ptl971qMUThR5OrfZb1XR\r\nWcF/677Vrp4tfHtA1tvuPVlAzjYgS+l6MVarW4DdlZZpxgIIYgsE9075XJNH\r\ni8ymXNk1RCQcFCWN+WGKnwjECW46Gy/NHQHc5Mj7rgRmOXFq8kxfNyY39Fqx\r\n680u7k3MlkSvLZC3QWmqHlvZXiTieuX7qrwctKzQ42TviCaCqjlkPDRb1EXi\r\nmH6aGpxG8DUSEq/HLlgOz0iSH4gPQX3Dnt1ykH4W+vK1qqt2ajK7zzg6QdEE\r\nQsR2tRPvhqzkBtcjwTtgkNBUm7ivZt+iuLDnyBdTNmH7vWK233DraGuzi5Mi\r\nvjHxFkyDy00T9pzmYVXlixmnntxRdmUM0nTuz9gUiopFp0fMa6PyVKME4NkQ\r\nMY+qFkgt/z+8CmGPoSYiRYZdw0DL/Yp2jb66zWsRsR0CT26/chTzFWGGdeK8\r\ne5tSMlzNCJvgiDIrGX1slkwttcHPCzDE9gGmXCNeg4cLhpnmgREARf51ILLq\r\n8YsislqzUNoDJIg10zCx81DQwc7KcszlW08wDEhsR0eY2Lkynk/8zMVHg80A\r\ntMrFmXLDSBO/gN5qo3k/I9uhJWobd0CkOCY=\r\n=is8n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"af611d19717d71e6fa2504d040d59cff858586e3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.2-beta.4943"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.2-beta.4943_1670196340202_0.8914921540047851","host":"s3://npm-registry-packages"}},"0.15.2":{"name":"piral-ssr-utils","version":"0.15.2","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.2","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ff5559589b80b754191e42e1f4a439689494fa1e","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.2.tgz","fileCount":40,"integrity":"sha512-6Ck2u1G+cdml3x8sJxhNAmKR06nRLJ/IwLJdWQPweHYACfeqxfxpGFqKKnqY02saPeipGUoIFhBhB7uBgF45wg==","signatures":[{"sig":"MEUCIQDRKKfXwsA5YOmDfJPvkNfrgyjEqOJWOiPb2A8xRF3iTQIgFc5WE8x6LzowaB4eeB5+qKJFUAvivNcBzHzG5fTWnC0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjUWKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpJJQ//evbk5V8k7njuAezFPyx9J0GpQhyfi6tGa3AfZRXI6Xfsfn4A\r\n4/C1PUn+dlTnKaHhmk+220XfW4f8+xdsmmw8wdsdQ2HBXX5ZiKWpbCv9Lh+r\r\n7Mp844J4vqCdFo0Hf+Bv73wih1TNL5C4abWb/5rRjocscz7tuoIIFZR8i1Hg\r\nqZ/MLPd3m5gRc1soMEQYpb9HN2uddRAqHJ5iyF7JfoatdLvtkZG+kBwwveIa\r\n0EhehIj4wUrj5gBaMziWY2i9L40u41xHTsTSoz+R8bTHrNrcbNle0A3ZTwM3\r\nW+ipisus1q20/91JWRhkTcaoHDhh1bADQGq3hFpPu0Xvxgurts7w5T5fNYV0\r\nBytHFm5t7CBTRIOy/qaLJzIuZaUzPj2hZMsEGHwnrfxC/oQMpZsFzFOGuK+u\r\nZbPLyAehOHenOJHUmxnJDXoKWgrMGNw8F+uFemAabf//+Xl9FHa9FGWHlPWQ\r\n1XcP7OnJKrsJtS+nhaTwLKeEXw+D86g8/D/1qBbdZhRwowRAngbNCiFXX9GG\r\n6O4BqLVPPYIJ4cKAtzTalUxLpJeAACt/9jlu9S4hdpHdXIOqfbFVVRWiQ8Tu\r\nI1SeZLlcYONJBbN4KTqY2Od2j+p9nCnwI3CtoK8BX8U9yeU6T3EFrwaB5Trx\r\n9laGUtNchhnjbTL/6ofSNSHR2IN8WVRxFkU=\r\n=QgzL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"bc75b95ab53edf3f6bda24bcc7682be0c578f68a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.2"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.2_1670202761792_0.941485182581133","host":"s3://npm-registry-packages"}},"0.15.3-beta.4955":{"name":"piral-ssr-utils","version":"0.15.3-beta.4955","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.3-beta.4955","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9f2cff690274c6dfa1ea8be23a01259448da2ff2","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.3-beta.4955.tgz","fileCount":40,"integrity":"sha512-cCoNyEHBjFVE/c9ueNd6VXm3cs9T34XbrR9fvWWVG8W131OSXkPU+gS22t4HcVwAYgmlTQ9W/Bv/3ugdHYQDTA==","signatures":[{"sig":"MEQCIBUdA/0Unzi0f/W0Zn+kzNKkXpkKiAU7R43j60XtiX0KAiBhdqNzGUEusZ27DcJ28TsbEOMT1GWq5qvv8pmLZNXhxQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjk27xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq/MQ//RxUkSd1pESzcXbOgEqF++9NSMN4jHxUl7ylgYzlwkqzmihFN\r\nVkhrwokUUx6qymXj9WhnlxpJnhGvy2ZGQ4qEdANDs56aPfbcI8cQMyFDAsQU\r\nKah6FHRpqKnWhdyuvUhyE5u8KJLatfutidUdX7XCuFxMK7hO7MQJxrCPeQTg\r\nsakt1moDMxLq6OrlafhR8TAlY/UvPmSDzjEbOLS4LLZz5RxJv6R4bLHRIq9M\r\n+Zp/yY3DDM0j59Abgc3DXwvy+qwzGtPBiLiHPXShIa1Bv28OYcYqaDuuvD1X\r\n7nbBCoLEE1/n+g9CyL0y1rJIt4CeQ9vOOapDZIUvwI3SQItYwW7TzdFJZYAV\r\nPAFDRO2MAOR6a33p6U0ClR3ayNEcZTd7SbuMOu9yo3/JvN3h14T3kaUlKKSx\r\nrsDh8AIWTSjCftGArQxsrzf9bM4G1PTkv0fj9/w8hl+NFg+nlaNh7iLTHzTu\r\nRcJDih5ag0I5rbL2V3BWJ2mcjL1VkIvqSHWnAGOJPFNClRuwlLRP5cEWYDon\r\nBGKl8w1Fuc1R5fDUa9viUu7/X63ObGUxdOLeEAfShoQ1PkcVNCQ1UPQmr5IU\r\nn79set+GYdKoWhVt3EN8z6I6AvOE0LbzBKNPPNu4ds6dY5xXGGQxWd6mVKYH\r\nZWsUy5FPdjJ1QiJzcrWcbQAnGYGYzLEWIr0=\r\n=J7vB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"598563720dff2995e2ccc4acb07167554ce788d9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.3-beta.4955"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.3-beta.4955_1670606577447_0.28744891851127097","host":"s3://npm-registry-packages"}},"0.15.3-beta.4970":{"name":"piral-ssr-utils","version":"0.15.3-beta.4970","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.3-beta.4970","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"de784009c40282f33571f609f530c574ccb11194","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.3-beta.4970.tgz","fileCount":40,"integrity":"sha512-n5QfIL4IZgaAII3WwsTOJR6VO9/x5n5afyJ0C//9Q3bNNimXQDvDHckM+3cbbavL3fkPLFswQlvAA0eWzhiTrg==","signatures":[{"sig":"MEYCIQD3BLXDIpTSyAGe4Z6+zl3rIHTCCN6ItJY+0z7rJAz3jQIhAJ6h5rvlEl0Y34oM2VcLcNGsdexoq7IftHB3/LfSoCTO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmF+aACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp5ixAAlFJ1DykwHosr1bbCSWP2IKIiLqLnfVibKUWYafQiA1t6WfA/\r\nJsTMI7/kV7z9BPgm6X1InBx0ufa+4zpeVwQm7dV1ssjO0K64cVPbKTGkN1xj\r\nNuO+fHJFIF0xGMtIFmX9I08YAaJ1k4hl5WbrvYLtC9rY0+jYqOMweAiLGqH5\r\nxbfNVVGQy15ZGJHltftxYUsMmJvimPNtrt1LlMqKspZ/z+I455XRh1wHBuM4\r\nJZ5hEVLxojnQLPj9W5G8HrWKBuk6PjCc7aCJm2XM9CuyIT8vMHyuFzhZK03S\r\n1z8KmNUnhdjnt18WaOtyM3b7yNekZsCrwlyfbR1IALTjzmFjwc8mv/HMDjv6\r\nHrmyTaDEnVXMHx4AqWOcIsjl+hvdHlxa+zxgRphn98OYA6gJev+6KUMxTjuR\r\nVNCG1RYN0Jwxq7Nq3yJgszFslfdOT4ySmw6YQ9+QpUrUMOZxBFBCqMfu7Vlv\r\nHCIz+m8g8gO145ArE/eMLo9rby1V7JNIf8SfCu7HjlYrnZdXrgiygnGn4X4L\r\nJgaM+RC/43bOXepyl4fla6HZzxJEDcj7PSIv7pv+B2/cAzvVtMOxW1rQYB4t\r\ngycZNa8afEd3eK9u+Y4tz183NbfL2t2zTzfdsFj9dAYHLICmVpFPpRnBpjDM\r\nLRrz0jA7gCO1mexFzAu9UbMBqfKCQ68R0mA=\r\n=1nUl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can / should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"f82139bec739a47bf7e7194c5e075e14e6064a8d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.3-beta.4970"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.3-beta.4970_1670930330166_0.7263779022598948","host":"s3://npm-registry-packages"}},"0.15.3-beta.4975":{"name":"piral-ssr-utils","version":"0.15.3-beta.4975","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.3-beta.4975","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9b3838210c9666c05fc12d923a4543c46c32d701","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.3-beta.4975.tgz","fileCount":40,"integrity":"sha512-3hAMKbzSP3/LwMsFc1eJCv9Kaxwmjf4/qNCl4NFvTqo4UIKS/xSgAhdfhEoXYk5rp+9zVE6l/7uT7UEzjkE1Ew==","signatures":[{"sig":"MEUCIB3eH9LD/T/L8AFaiaJAtIIv3+X7XvOyYs93jnHQc9kuAiEAj98nmD3vvOATcaNdrSQGrluC+DGg+QAlld2Bt5wgEIg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmLLBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQEQ//VGbxp8766JuuHOcdp5QRPFJS8C7qT8iwB3t4W0vHjS3LyNhE\r\nf8kghajxRqKLDNvVmJpjKHq6Xr0E2wltb565CFpjLT91fIaHZATO3MzJYQhy\r\n84zV3cbcLzI5ohaazHzlDq6J0KeCAeobCAaR3lRGszHLJcWdajWf7JkQKUMm\r\nmysKexxBwO9KNHOb7ayZFdJUIEBFNSpyQH4e6/7+viHUY21Ux3ZFW/4ytlIL\r\nbem4qjZKwuA966wKu+e5DX3fvKvKDro+OElSB0rvdUGgNzsRC+g/BMc3PxdN\r\nGQSOFhyTvg6BFeFHuJHAHIKpztu4xPA/ycymcZm6UrEFwDlg/2nDok9Y54a5\r\nFGOESwuevDsTthCsLbQQXxHF8Xqa/LCF4X0scSDdlZ7L+zmkU4gOsE/0Zczl\r\nqLHEuSUZ/JR2i/ctQUzuMLMSpS+xWIrGz1BAh/o4qlgZ+wCqc4jydkGGeQtc\r\nrslZZ6U5EJVe7ElFeaoDTt/2sNaQoW6+fnUiUcCNRv6RiZkZ3eapHykh7iL6\r\ndUQeEKKt7oxrk63Kxos+GLE1+NdL2iDK3Drt7X0eM9AJlcW6LHIb2/CWT1GQ\r\ncSvf53Z33KFPQOW/P203U1Do99TSNSTyW1eYeXYexEMp3vKhkSEjjrNw3KHh\r\npZUJ5vHZbBynN4CtRcyvZq/UVhWjUH7dWZg=\r\n=Hbl5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"5cf09cee48aa723ebe3fa9e48a98ff118f3cb6dc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.3-beta.4975"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.3-beta.4975_1670951616835_0.3520151980406028","host":"s3://npm-registry-packages"}},"0.15.3-beta.4989":{"name":"piral-ssr-utils","version":"0.15.3-beta.4989","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.3-beta.4989","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e84259d87e7510c9994e5c455eab04d07109c2d0","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.3-beta.4989.tgz","fileCount":40,"integrity":"sha512-GJ9Deg7X0pJhACaMBhm0sn8d0MBSrveaFZOG/p4+6PSnFkBv/x+7gauza1B+Aplo6Fm2w7MqUUAB/f64yE9EfA==","signatures":[{"sig":"MEQCIGcOjp5b611ymm+Eoiw41RamrYZAtg+R/fTyeaisGwQYAiB4viFns1CtEe0kdxhwovz9kMk8qjVwUdZq+/Q6Bdjh4Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjm740ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpSXxAAnx84FXFxfs13INZtRzdWrsKRRHaYsnBMgG+pw/L2PWrksSR0\r\nnttDZ2pFQpMO9VPbbQdB1zpfdXcZtU6bak9mn0C4AOZhoCmFMOL/dvpm38df\r\nJL78jJ+Y0rYopKj0PYUOk5WELPavwJfVgicMwS9ORcwku78dTpQCEVWkIqyq\r\nsSMjPnjRky1V1SevIZAKPI2fcjvmPg7hW6J8/r6+yfHGV3AxpA60clFszTdG\r\nw7SahbHTRlxEIa7z4QGSvodg+xLBH3640afEvadMvnMopklzLiBTQKsLZE7/\r\nzdTHUYUEPL/ViXHLilhU6846D9BruYyCxft9VlkQIFA0ZzhaOAXpKyZqqNtb\r\n/vgPO3L9CLaA4H0brK633FI2+mFRA9V/w+SZPZbWDEgf3QhgYv0W5FLlp3ut\r\n1OC5Yh/iuPYhKB02YVsKH4ZFyjf3EOpQXZnUS7U9gYcnTwO9hOeMCdPkEZ6t\r\nVug5HxHJdZm8ncA8CIlnDBrm+mZlc5tdnSuQ2IbOYUe4k0WgdiuQ458IEHMF\r\nzr96BlUkATZhGYFEMOsnuJ2j2b386Vwmt1Hjr0BdSDJ6eCaWS7VKs2yASBcq\r\nwdvuyoxQqCnkVaQf5nn/mxGFLtFkmE91vMsn5Y7Pxba6SVlapJnn7MnViOFq\r\ncFb/oCxFHflF3PKaoT4MmFPv6wuezued330=\r\n=cBio\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"57af209be93d79b5bbf2996f2c3b55fdd8e1e2d1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.3-beta.4989"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.3-beta.4989_1671151155810_0.40561754764490443","host":"s3://npm-registry-packages"}},"0.15.3":{"name":"piral-ssr-utils","version":"0.15.3","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.3","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"220dad37f1d880588ddd5b77d4e110db24ced884","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.3.tgz","fileCount":40,"integrity":"sha512-Vs5YXqFF6IxPOEUNs9ZypsEYcEhuVEAc27oqFvcpLrkA0/yrdihBHJHnrdLeZ/2Qo0UWls6kLOhmXza+SBqvOA==","signatures":[{"sig":"MEUCIQDY/MXfz0GJhUlyNp3vzGNX9G9TBOx73bgeog7RVbprXwIgIHsz9IEleNC45jQKBMx5QmkGwM7L54F2VsOcv+yINLY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjnJwpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpNeA//ZMv5alOIyiXeV2InyAwcGeF5hOLEZYqhmtX0WZ5scSus8FlV\r\nAACCzHTQJ7sDDkVMxtuP05vbeq4UNIVQjTsrMAVe8jPGIRnOELPp2epsAt8b\r\n7OYdTo8ul19pxnqAuF5ypdB4WPiHGkzQkMetJfwR5mFz5DftogFl8WuQZQeU\r\nh1RR24HmZTO/OR1eVQPbPJlH1y+FbOsVF/XnO7G//hMbUPhvD8De9WaEwJCE\r\njAvUvmltxCtJzrNcfdBFr2Lnv8w57lTMKovPaglvK9/0kuzj4sGP73YCrqT2\r\nk1Y8KyrUVHRhbR/y0p0mBO6CPEQke0ILWMol4fmwZsS62ThLWHid2gmr15ql\r\nDc9jaqk9Ac4TSrevkAC8qLStUcfoO9TS+xF3Tex3RZfaZ7k9kZcS8JuAWkqJ\r\nP9ADsgPrgN3wU/1mNNS3sNXdIE/7kUJljWIvwc+PJnRFCgTotvDgYOrxm7nu\r\nfA864qqoGtBgBpMnrx0bgo3AWzTemqW+x4HcpSRoD1cJisj9D+vqqRXb4tsm\r\nkhfUvybPUUogg8nCHURTYqYPazjc2H+q/SyqJweT6ue3T0ZTCHCyei8NEoii\r\nhCJMWZz7zKU+PWbwqK/4EHDt5DF/ot3a+NyoSICBBi9lypQCqd1+3gquBabN\r\nkeakyVCN89xSPbJb+4XCT9r3kXGXqWS+oEc=\r\n=lNYu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"14b0f1a34c86dd85bd66b66ebbca9c1dc5eb7f59","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.3"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.3_1671207977589_0.525826732223257","host":"s3://npm-registry-packages"}},"0.15.4-beta.5008":{"name":"piral-ssr-utils","version":"0.15.4-beta.5008","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.4-beta.5008","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f790ce6e8f81e89fad34bed86cd4a291feceb957","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.4-beta.5008.tgz","fileCount":40,"integrity":"sha512-3PmZsdqz8rlQ7MJshErxrtFUyNV89c8JbQRjlZ3YdER/mo0EN0SJlijSoNWRyYYIuSJ82b/0bLAFv2WS7PCOAg==","signatures":[{"sig":"MEYCIQComRgGYbTSHIN6LSuU63YPasYBiTwjwZ4K4MRdMXSpUgIhAIWrpSDWbwadVzMMkMutuSl8IhEVlRW2HQjDpln/AtWG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoIy1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoMRxAAjHei4tFts5V3tE8CHKDIGNrjc+Vz2kZzM9vXvrpZbQk+vCwE\r\n9ekiZnc3WpbKCz30xzflH+fRtXg0FItakFl//LTaucX5wrtIxAX1NitceXF6\r\n1I9KVu8fOTlhSOjgY33KFA7wHi/qGo1TCFX+9X0ByckKC9s6zs3zwwm0HBIA\r\npmGcBXhZg/+fMVvEryLZF9dzMXuFTpcfmmeDAEkb9ntjjGsLHLi3OEQ9/x4A\r\ns3SfSoJQDxPtCX2hOio7A4Ae+3haPAIPbReFaOcXs4ZGnU0Gnzx7WWPJ02e/\r\nd1DREIVZlCM94sc8DqzmwzN0FrLydd0YtQ9sdeaI9h0qzOVnB/8UCWYlTLdi\r\nvApMCz5zIeouE4O2ZgTcmTsAWQFWesJHeh/OABgdHWWytEl/rMPJE/f2fVO1\r\n0gONxbSQ0oTQjvZDz2nG9A9DR2xCAgqlQptdl9Q996h3uGOr5eqxgw0CrMJe\r\nwe6PaL97DwtsrX9DAFflgaW6tfimRKvW/IdBn+mgX2fXIzlhv2cym326Ab7F\r\n8kdIG5S/GV2rKubHa7ngGwRVBV9AMICFz2y0DeFHOLjOFNJItDrKNY7Fn2hO\r\ny3vaLBUdvgLXLoIjAKKg+sDMeX70bFQh7I+N4ScHO4f0AWlEhJ6TKKJ6KO6k\r\njB7jW4SIPS36NTqR+pBoBrsvcZ268oo6qVo=\r\n=BBk+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"5f49f50dddc72a067e51f83c023aab066e5479fc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.4-beta.5008"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.4-beta.5008_1671466165476_0.3830209313483852","host":"s3://npm-registry-packages"}},"0.15.4-beta.5013":{"name":"piral-ssr-utils","version":"0.15.4-beta.5013","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.4-beta.5013","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3f1166f6560e2292077a2f9c092a6c638c1a4e14","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.4-beta.5013.tgz","fileCount":40,"integrity":"sha512-/xlAO86N/GaoXmyuDBjh80HC4nOWUc9d1aigLcDPbzBFYrDTC1utm0MtjeRrjk/Zx0yMXD1+3h7eaXmTJJsxRg==","signatures":[{"sig":"MEYCIQDxUhnjKvW958bp1ecuim/FFcivnfYMNnGn2LbH+0XzIwIhAOQtl5L6mnPSx+BrGr1vniro27rGPoVsyeq5AAlGwvzE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjovddACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpqnA//dN2ffCgELCq/cWS5lbr6PBcy+e9XzXvudOGjq8wLGjhVD1uD\r\nFvetqZ0UZz+iek/5N1WxouZ0Mifhuqis2OzPaI9T5lDHGOsuZkUNDPN4CJJN\r\nM80wK6jQUH5Xq2RKTuoUG+Mt1xN6yk02JjXbn87VH/blpxCA8T7aQKnXt0IG\r\nIuCF+kqcya4gC6XiwnjNdgcABsLn8JsCNMUHsXIuTCY0UZmCYa6RHLPJpRjs\r\nUPvuBNyY5jmXB7pkB8hmHD5W+UkWJv5nR+QEmKEofahG9c7zSkCZ2t/Bwsba\r\n3e8v8ri3QrKPEMjZCB4shNOWmvfwI6hE0OtwBhBqcixVkkGlxQ+fhYzG/NdP\r\n1D7MrcUZqsEvY6hEpMJRefsyIK1o/1qFDIQfWDfm3MuCV8KfbGy1lW5WL/9P\r\nXYpyS774i9BqdON2tPWQc67F6hkfV+Rbgwe9Bh2qmOLjVgOZ9nd+eEcwxjNh\r\nfC3/CAQUxiZmt8vqGVyZqgIrr975UPPC01eaT/9q924YAKRQWcC+OPh6PCp0\r\n8ShUc2V9amovEMHze+Ef4mqYiegEstMVLLsSqdBZPIk7grPdDI6qdh76wWuu\r\n6VmY8wZ2MmVRa+HVNE/fCNVHLhnpe/ea1GwD3j8MmTmcxSFW1emAmr52zhAt\r\nhlm7Z96uKmbU3rjc6ttCjXVOSixtBmMdywc=\r\n=9oZ2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"58a5f43b7d8f4ed1bf34b8cf79ac6f38de998419","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.4-beta.5013"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.4-beta.5013_1671624541111_0.0012066330772124712","host":"s3://npm-registry-packages"}},"0.15.4-beta.5015":{"name":"piral-ssr-utils","version":"0.15.4-beta.5015","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.4-beta.5015","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"03f7a52b7cf509e4266be0dda67f992f98eb2e06","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.4-beta.5015.tgz","fileCount":40,"integrity":"sha512-6E6OmFqPngQ6MT4qN6Ak4Zjer9CCs54EKvUM7FFVfoIBXjL9ZcaOvMEuG8/dKmEdRRZZG0IGDhb1imkz/JljxQ==","signatures":[{"sig":"MEUCIQCYqGJrT/h43NPNMhhYJUUozT/1tFaZ6X/GiP56xLNj2QIgVTzjYkUNkZUAIilhjF+vAWlFuVnG3lQAj3qCpaMkyo4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoxn8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoadQ/7BIqJIDhFuVE7XpFGJTLX55aFqk283rU3BQIrWR5rN2wfqakH\r\noh3qwF4mKqZXYm6e+YRNMKzQbO48FT/KxjVlJT8COyV5ZLOTgmQqA3njtvZ5\r\nsuKD81DFATm72OKMe66PC/HTYp/lyzgbL5paJLS2BanMI1pJjQghSSQVRbMk\r\n20aEIQMW0W2DJ4DVgUmjN8cwU86Foie1kOaMs2Fv6yLfVx9pbtWnrBUgse3i\r\nQOGaTHTHED6FdNLevOMeMZPovrLsfATXhEzjXoj+AMEM/UBFBKpsX8PIlWhU\r\n5D8NF6sPoDB30vwevP5H+bQYRjeaHsNA31NtWXGlYaM1rTD2fE2lmGYf2EE+\r\nzvT1Qu2lhomm030Gx5KOQATstrbNW+lgeUMYc6sn3MJr9X/6miuwXU4tuTnV\r\nZuAsYMtTKQGCkgo0ZIo0zAmLLE5BD6NQ/dFY9H+tUeAZGVQscoJ+EgpYEk9T\r\n7CHNf0ng5477zFp2KBcyxu9DEijvyArtYtYhtnjqxkb+r+My2BgMDsbTru2j\r\nQERdegS5lrR80uvBI02e4aHiSRexm6rXvdEx7ADpzwSAQ04PdKUOzzPXuQtV\r\nO5ShyBgwUKX/grObJNtdAerpS2xETV3UDw2BYgyXGi/YmGDIcDCF7N+e/K2F\r\n9UjOx9WNDPw2AoVBBRK2LV9r9oa4P+BL730=\r\n=sf2x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"b82a02274c524dee34c75f51744de1e1a1e43b23","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.4-beta.5015"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.4-beta.5015_1671633404545_0.05713816825365603","host":"s3://npm-registry-packages"}},"0.15.4":{"name":"piral-ssr-utils","version":"0.15.4","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.4","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b287b2684c9ef59576b68b8ebf703789fb6c01f2","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.4.tgz","fileCount":40,"integrity":"sha512-y2QSETW2j6g5veYiyr2Ofhgo+SIJVgP+FTwmk+Ndhae6uzWWCizc1G4OhbxhnWSQRrouxEK1GFOuuWa3gXSrKA==","signatures":[{"sig":"MEUCIQCrNNz19HY2DQbyKlR+Ytclfka453QrFgNH9S+WHje75gIgQQF4A8J0i4FACCD2jxMMfKKfQ2k3bJObx62eHEHezpQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoyycACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3vw//TOXRYFUuhX5hlw2cfDtuOuQ/dkqtrdhvGszQNrMAR8BnLE0I\r\nQ871m7JsVHY9VgnYcFHLDTs3YETaOtsi4pICkCSXFHTnqNtZSsUcTLsVMdme\r\nMi04AIZQux2xS+pTJGd3QcT13QUfRRhtlY2gkD9iYsjmPVCGtkckh1iX97AK\r\njpiv7jYtnLMZPZ5hKc3aW4LD/jiqk1AAwjeWZDjsew5gPuPxuugO7am7tDIA\r\n9CUN+huEzSTeIlOF2TIG9O4E0SWTpj3m7JV4t8jdH0C94+2YT8xJmfrjW8mR\r\nTmlDsTTCgO5CZ3J8NELNbxVgGIQU4wAlBBWROrdTDdteJgpj2IKaoV0TrUre\r\nfKPErpjHSOqBtX0nh0lxFz+dnyAjrDWfBAfFfjoWoXYgsnky+eEJEusujLsC\r\njrZHPXq8wGfyF3QAzn1scsN4umdxtFe+do5JFa5MCKsPHchUN+qIm8/+gtT0\r\nQnaU8AVGGiItqh24f3VdmfVMkmUXDD0G3hAGWc3m7gLXdf7XIYfLgneTUFF4\r\njh8GFx6Aw4JK3FrFSZkkZaSd3vDfL4BugvRfceqYJyhROfgFHGOhRoU5R2oH\r\nDgLrs1tvNM64j6Z8XgTHVVZcMOwOD07qnWz8QM9PlX69Uhj0gcekV5c3QomK\r\nsUavqJ1HHHReL1LjHUPifc2SZ77pakyVpiA=\r\n=cjYf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"dd411b8135d77df856bd8b5b1cd3b7aab7366ff3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.4"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.4_1671638172170_0.010230808588479468","host":"s3://npm-registry-packages"}},"0.15.5-beta.5022":{"name":"piral-ssr-utils","version":"0.15.5-beta.5022","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.5-beta.5022","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4fe181a6817208c241f9def486174b3832e2b739","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.5-beta.5022.tgz","fileCount":40,"integrity":"sha512-HtvsX0460IVF0zmdh8tEKuC1YOWP9zZb515sQEb6Wl0bENUP7TwfcgAMKGJr4tdh/TJDBZqPuuvpK5o8kxY8NQ==","signatures":[{"sig":"MEQCIGu4AV4qYngu44hJbpqUkyPIia4liU4I+KY9B0BEB4GXAiAV2HfCPiwfgAOgwH2uaYYTkJ4Ocww2F9yCkJqRoHCWZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpLunACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1gA/+LKrRX9rIuRKFQkHpuR4+YmpnRTa3tCz0UDlX+3ZBg7VdbKSo\r\n0KuWsRpidxOuUlqdCGI3o0M/omwJtAxUWqX7yyxzpCdQPEBTJpWci9EuoOGE\r\njJWo6l/v5KDWFZ6XrPOZgwsTldU8GZB+gqXMeUejuZxfSlMm/nXDb6jIlOXe\r\nAMRDsuYKenDKnzY6Dm2r1LpZGh8ZzyDJLjnO8YL+uxlxI4gZqDw+QMuOkaYG\r\nrPjWaf34ShrDm5H+Ba3KYHFVUdl6zQOGGRtp4M8Rr6acz3TEs2CtiH/vcpeI\r\nWTpsS2gxMLVQwivDPfC9QPPEB5yUmxfIXXSkrKUNGCqhCoj/5YrPk124lQnc\r\nLGvwPweJPUxLyIgYaCr2vGXTwr3UFRK+HgtxVGfP63kKwhdoq0L8/WRp7Fxy\r\nOl8+K4Qz29Xg2tOC1w5rB/RWDDNfDKYYb08XByRPu+SHJR1KeWF06a/jbdJA\r\n5+FuSuivw5qyuw2ZdfThmJelZLocvugpMRuQuzG2TN8+u3g+Fa5lcQj3ZKbM\r\ntljBDko2xm18MkDUNW77qhKKFsksD/F4MGsSdNoqSrX6WNxWXeKyJcjcHWu1\r\nNk4EMMetphCb7MhdxajbVeQRTGmwE84l4CPjCwJSN2kLqZq5j6tpMh7lA/XD\r\nyYJ3UeUvqWOJa0d+5GYdFcKL0ItLvIIObPQ=\r\n=Bz9V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"6a7d7676f6ec04815529ba9a8e4ed012495a85c8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.5-beta.5022"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.5-beta.5022_1671740327325_0.1583811775775974","host":"s3://npm-registry-packages"}},"0.15.5-beta.5054":{"name":"piral-ssr-utils","version":"0.15.5-beta.5054","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.5-beta.5054","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2a8e797d1379d6eec5cdf9dcc7d424d25f61bcde","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.5-beta.5054.tgz","fileCount":40,"integrity":"sha512-HxyL5E9xUeVJkqawrJ7nTuzEi6Buj6u7tfPSy4ip+Ax/VqcjSz8RWb3+pBpd+oex2oceYeLov256eyb9CZvSQQ==","signatures":[{"sig":"MEQCIC94BD5ySzP/7dtDpw0UzObtnfGjzkwnVX95kLc9TlUnAiBla1KZnEhzr5HPXvs0lWFsCi3dMO8NekK/HU0dvkSGrw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxSIzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVKg/8CYv4VA74i8C/I76a7kAVh1Mh0r4QWPkHXBzeZrgtwA8ZkRO7\r\nweIwgAPI52egDbeQ36N1Gag1VP5l9Milzof2jXFRiTPVK6kJCeucEyxdv74x\r\nP05VqmbzKOgoBFA1yMT4V6UsJut3gqZlmLmUS9ssZ6oQbf1PH1x/WRTUQ/TZ\r\nMqn4a7bzWQDVkdSmmA/MKDlMIhmz/snh67a5OGxghagIrv0htpiANus4KEAI\r\nXCzADfAG70WSSfexsDYehOoW38a3uSWIq6vAqs5HwWkWhiYT6JJ2dj+V/jVN\r\nkM0/aBzGR+bnpnHECDQ/4HJCSm8ZNBDWQTfZCc7spQdJ2xToIcNbQTptAlpc\r\nqU1a38znd/2d2OqkyoRWGFPor9oOrcAiO25O+RjoGj/Pb0F3KezelH3LItJ1\r\n3cLJs6ij7VOlrLsfu6SDMo+S1JOVNBCmqPzdgekWpWAb/tehFWb0YqFaOyUo\r\nlqh0UQ7KiGzSGIYYnl+D5EvwIzn10z0eTfIaSOCNrAF+2Hmn4WkOpbC3eJKz\r\n74Impmsbq/QFp2fCZO1tZIsjdKOAqDcVOuHhivOkhHJcj7GKN5J4nMArpDsg\r\nu8WYng3VhhwFHA4qIZA0iaMAfRSYNkxYbWpzlxS48ncHFnSPRSX9gdk7USKw\r\nLaFKmFVsd6Tt7EI2eGWHLoTBsbPbKKPLgYM=\r\n=00Nt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"88a63d822efb26c0716e9364b6028b806aef1776","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.5-beta.5054"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.5-beta.5054_1673863731166_0.14086596950157437","host":"s3://npm-registry-packages"}},"0.15.5-beta.5073":{"name":"piral-ssr-utils","version":"0.15.5-beta.5073","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.5-beta.5073","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0d53f890a24af4805c19df3c8fc5709cddb6a7b6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.5-beta.5073.tgz","fileCount":40,"integrity":"sha512-7XWyFfemKad4BoqzHOxjyPAzURpLLWfKai6YSrjsjMyfNk9IxVHOZODe5UF95UrabVXLARG/T3x8o8Uj748urg==","signatures":[{"sig":"MEQCIFtr+2UI9oE8IdOvBbvy486VCdAvNFS0cek1aB/Gr1zOAiBezcOXrZGu2bSlHMsIgVNIUnhFop8kC/AEAt0OmKyoMg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjydu1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrqYg/+KUvYuLXhTzn/5+eJzxGnaUtwTV7ZQjTB1jBOby8kHHB0r3Ik\r\nSmsKvfMgUwP9Xn1MRFzD++KMsTbSCmWJCF0fCc4/foAqDRjRSzixKuZneG4O\r\nhmNeaQueqMh8Ms3c9EsugUF6urd2LsbZj1lw5nfaSeKu4+meJ5hCEzt8oNBY\r\nqcgFF5TMg8UqMgRsN6iy86zGHws4zua3kI6NZbrXpb0vHZjyF8hLxfs6uObg\r\nrA4aqnivxpOrq53KTL3CVmeEeDT845G3t8rNNNlbNYHTCqhZ6DGoclNu2ixk\r\nN5Z989w+s75Yhv5Chq5ez0TH3/QRmUO1GT0vHAhB81fZ/LPzqy/NruwvDIH2\r\n6aTbHtbsmIKSrrIQD16yheBFDckfZNW7qxVonizSPX6SAhzUXByVvnANYEUF\r\nzULmfCAdvZVsiYqZwDw6jtLgGii+blMQWtk/nCCT4vUoqktOA1CTm5m96cLu\r\nA06ScBisa2Ci8Zy6jA4uy6MXt5Yhw/KG1TAr/DTQd1xv+91TQ0Gk8th0WeQ/\r\nyjUFp5UsUKwFqeRN0lmJRIlmh6wauWblOh3fUuuYeGzR0lYJeIYaTUIxRtcZ\r\nyBFEcLtJqNU62B52Dru8EnfL33JU5vEpNFEocGnevVA7zAGZeVRxF1++TGF5\r\nb4kVKyyzjs83fy2sPrPtSxIA5kt80mAPp0Q=\r\n=9lVC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"40f4b17bd2cef4cdd5f38d71bd25d0459f043da6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.5-beta.5073"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.5-beta.5073_1674173364964_0.9861830155298612","host":"s3://npm-registry-packages"}},"0.15.5-beta.5087":{"name":"piral-ssr-utils","version":"0.15.5-beta.5087","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.5-beta.5087","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1af84538d1ce23d8a87f4891bbb93b5eecb99c70","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.5-beta.5087.tgz","fileCount":40,"integrity":"sha512-S8q1/HI81pJIKkgiwTGN5d9yqMmImPcxL2Dg8ZRFq6/YdNAsxu65bhLDx7PS/qattIW8Y9rJPsBGyDXVu1knKA==","signatures":[{"sig":"MEYCIQCezlR8+1qkm/gRy1dIlA0gO3dQLKq4TZ6PtsN9Ve7JfQIhALkfOmoidq5edkqK1O5lSJ5isL02eYzKTV+e8aJzvkXO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjzkG6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrK7w/+IdbMGdWfU0u7HLXYfufOnpzz7JMODGOlrC6Er3aIMVdm+6rP\r\nE+CV4OB5sMP/Rx5snU02HHM520W8InqEkYeh99PZ0WbGZ/TgoDl/9E+QMNEG\r\nyka2oxpiY7uJO9FX5xDuagX7CfCd7Pw4CiJj3dVIG0crQfqebfsm3ceaO7A+\r\n7dcpE5oW8tqd9y3FNJxkAGeyYFPNDxSLsv6WAzBxSEacF/7amzOms2WKNCay\r\nC5mpPKjbEuUWi5a/VguazUwxpYDQxeofmpNrZXjNe19wUocJ2PWczuJ3K2hl\r\nD+9t/Z8F41WabAEa/YIVkr5WdZDjkuuA6TGaim7+PL9uFbzgTBPTiqgDX3ur\r\nTOcvVAiUUJ4Iwm43atc/pgMtXpO3utrd5Mf65DwE/qsBiQqCIAvcweRyJME2\r\nqOfun9tB8Fw2AkuPiH4nTWOOAEV8L2Yqps/zhI/KTWrTzPygUfVQsNv953MU\r\n/JE1NmExaWkxyTm13hNU5QDIsD087w/O6jQXe9Bbt7bT1zwiRQyagslBb6UQ\r\nXJdrD03hMmUyiHlu7Ki1QLkCf2okNHwFzqr4iND+VOtA3am1HtAc8e5Qk5sp\r\nW8JTAwt5QNlOg1mwq1EtTum1P++iuQjRd+T7dWygQ6pL4Rdeakp3Hs3X3paq\r\n7GXqD9ZVriCO4vEmKwhU7xjWurOJi4FffhE=\r\n=u+4N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"1400433d425739439cf54a288334766ba0e84498","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.5-beta.5087"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.5-beta.5087_1674461626699_0.0010537991128451996","host":"s3://npm-registry-packages"}},"0.15.5":{"name":"piral-ssr-utils","version":"0.15.5","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.5","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"34edc5e4bea3c18985960b0db64c5a075d37e8c5","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.5.tgz","fileCount":40,"integrity":"sha512-M4ClPpiJO7F+bOvqmbQ6DZZmEO28UzEFajR6nddmorMF3UFw9DrWphnXMrrqO8374foQaoclV2mPRI271ONjPw==","signatures":[{"sig":"MEQCIAMQB+IJpIL78+MNMGnnP4PGaUWhbobzA0rIzdc+MdsGAiAoUltLiyANmxTDXavwWp2wb4JSM6CH5cysvLKgsqV67w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjzk6rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNnxAApE2TbyDK6/ZybQ0BNu4ReyXsuwy7p1Fvin40tJq6YGU52z4z\r\nVY3ZGzTAwdqSmx9zRkqnX+2n1Dk6UTu32J4AfEP3ciesMd1NPk9qk8EcKBXa\r\noezrHB9rFf6B0hBsauepfMtQN99qfioVH6LNhfWX0g9XA262NMXlfNr1Cb1Q\r\nlB6gAAtVPoSqh1Gn+K+OFac8/ljM9XY7Zo2PjAETWTFi/YS0gca0dBMstOrC\r\nKnl6B/xTv/7lyk07nGcA6hsa4Q30Fxmlz2qzLNVx+eglX0zcB7+8WHllg2aW\r\nznmjBd28s+IfW7rL5HkOzUVqAlAMhDuLVNoIuL7G9L3NiZE/uxKvDv5QCcS0\r\nroervPsbickcqyP86hY8OXVcNUeGrdBRyhTEQUHp/gQ8uJp1vAFdfHUiRG6t\r\nPRIA7BCPDB/ulxB66n2g1CzOyI9P2sp1/6gyVKV0vDCle2qjtYndpunfbBGN\r\nz1iP2OwunN8LI3MbujTLnBbfNpFs7wnvEyj/rjU3HtsUaRIdrPe3phdL6wgq\r\n7t6WdT/qCO+vDIvosaN+qOZjRjDbf2wH9I5kC61NfVnaYLmoX4Md6yethRkB\r\n/vxkuMNb4WGZNM8IvjO2i5zxp7wcaa+mVaPdxJa7CYtMjepD9Gmkf70HHvo2\r\nj4182An90X2RbsYumWSc12PJA6vxZfLXDio=\r\n=mb+4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"b11ff3cab9580040060120aa6f1b122b21668459","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.5"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.5_1674464939016_0.7603530770099789","host":"s3://npm-registry-packages"}},"0.15.6-beta.5100":{"name":"piral-ssr-utils","version":"0.15.6-beta.5100","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.6-beta.5100","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"206131a6758f64392ffb86484a5bf5ca25ec63ed","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.6-beta.5100.tgz","fileCount":40,"integrity":"sha512-KV356CgkxC3ksxh+3fFpGyLJUOgFeKen9m6HOk2B+E+SHHKBQB47w5dnUNrAUGS48d0DnLZUPJXbtEKxR23PTg==","signatures":[{"sig":"MEUCIQCaZPyhvPfiWXTSwS/+vwrbRg2esNMsHpToEer6xx3bAAIgN9PxhoVcXZ7l1RcxAHANqEkfKQHinyzuDlTyTSTPPm4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0yEPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrtcg/+I6FzT76f/ACv+4txbObQNeTeZ3a/FZLAEpUW+s3zno60EsmB\r\nCmX967izPO5Vbh2IzcBtOfdIRk4eICXr0s0SEShHO43WO503skGj/8kdnppw\r\nOegUVAgsDJa75rlnVTAJ6i46yrT2fVY9bWn2TGR8Tv/MPxUzSCUeJ2dAT+qS\r\npeoi6v5hQbmwFlYamRizUKcf/vR+iamZtuFassoJdAu3vKHot5cAOcSFEjrQ\r\nTGCcsxbYDD7kvHBXp4/zIqBzoJU218t9E0piKQaqhz5QwnW3AOn6GGN3l+Rl\r\nNf8YiLigEV1ozEcS32JbtCWZoOLSQfpCQryXTQ8CNg/fMqgHjSeZUlDOvq8d\r\nsQrBkQYux4Ez2zP6u8FXaEwgldbhcm7/FSZ3OiKQNzacoZANywqc5t67v58h\r\nkWtroKD/01qhr3mI5ghd/kpyfuMmMuvLPvrjFHu1QFyAjPoh0TE1OT9RHsgv\r\n9t338vTdBAM58rJW4K12mHuvLnpa49brSSrbZOMIlIaYiqLDE0+hhD5/Md+X\r\ncPs4N7TzOfOLDCYsNfz1EDoN0RT/CS3q7XWLRqsMrSdofXGJnfnGGr30XGN6\r\nVuvDfgng2CgmFs05QHlc/VW/+7smKC9tTrlN6Gs0kT34rst8uTAz3a9h8R/D\r\niVRXpb1rKU19GcFYlNQ8xVC8zJS6c8aGLns=\r\n=1MTg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"e3037bccd6f8bf036f49a057a9b92ca79e4b5442","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.6-beta.5100"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.6-beta.5100_1674780943350_0.42091958028402665","host":"s3://npm-registry-packages"}},"0.15.6-beta.5103":{"name":"piral-ssr-utils","version":"0.15.6-beta.5103","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.6-beta.5103","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"95ca99220de91cae9911e16abb02517052d203d0","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.6-beta.5103.tgz","fileCount":40,"integrity":"sha512-ejTdMCxu5ewoXYibnYMZ4SHZaNAmluBu7q0ytkWbMS9zCbRAHnpYq0MFBbRj3yUyXolS42HfDb95xSXOOdlnzw==","signatures":[{"sig":"MEUCIQCjx2dA2rKUNpzvuCelBwm673AmGzNQ+VcsTWvPa7ZaCwIgDMZi9BFUsf+y8TVGfWTRzLw+jR9qegPMYaKMO1wZ35g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj05SnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZPw/+LKgyMmVpsxGAfVq+H8MQuaCUB96pipmWoNDX9PGKg//kcQGf\r\nXT/TLw/J0RvgKuB/P+b/ZeE+4NjNEOOgxdwV3/S2Cz6bWCQZ5DGqIX+ynyeR\r\nrd95nEbjMLfZWJFpTFuS4FL8ziNU1nI8eDBpkkRVRDF925SmVql7RDplKUm0\r\nS9PKp8dNjxPw2rz7LfOB5NEEtGuh/CwTSZPPhuPDwlQh4pL124DFgoPyWHvK\r\nc85Gyqw4o/GiF6FGN/CFRQFDrVZGkM2GUpsT7PL5Buj3ZsNQyitCopgot6tF\r\n8e+MP+yIcOUWPL29Set3uq2rlr2zA8K+dNxb36IO7kgZXwKtgkhISwWTqTsw\r\n3E/zqbvWKZoconYeDY3gJx3ft5+QIWqUdezgPIt0Hgw62uaMQIvahEdMbjaa\r\nI60Hog5gunS8mQm4jTrjucXzU2RZJzwgQ1WhWvK0OegqZ8vBQW4CYuy5sK5x\r\nNeRd2NCG306ijmCmOWxfeFMNkyYjB4fSLFJmUKuuhkdSNWO82qAX0ODvRu1B\r\nvg5ohvTS/I4c2uqgiPsbZbyA2yRjHUMk27vWNhis3L82BxEveorqDkvrrKJv\r\nuzdjbhw81nC9EeJ/JmFy5+UDsU2/bM1kMAxlmEgMTsK1OqhoCvC+9vT1MZan\r\nUJYnd/ljQhmEk5izYaesNgxuT/NsjrNSZwA=\r\n=vLiP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"82e92cfa7ed1bf3ee711a1c22c5a15ed10ac902f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.6-beta.5103"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.6-beta.5103_1674810535520_0.2731114776894674","host":"s3://npm-registry-packages"}},"0.15.6-beta.5105":{"name":"piral-ssr-utils","version":"0.15.6-beta.5105","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.6-beta.5105","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"51a4c5e1d1fd043f0edc7347442bfc26b459b4b9","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.6-beta.5105.tgz","fileCount":40,"integrity":"sha512-iYntTlkdoyQuUb5V1+XO1XZGd4ya907/Nzr/nCs9Q/t7TvGY5Q6Xl8fvL1ZAcevYuzHUYRyRRzQB81G2RHaZwQ==","signatures":[{"sig":"MEYCIQDkcfGrmW2GeQ3XuoendLspfErbCvdTS2xD/NUHrcsu7wIhANXBvr50zIcamCNlWnIPEv4/atLVtdmepp0NDH7FJmIe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj080DACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYqA/8DsWYrGRLJO/eGinF/EWIzoIGT/UgweiLkFn5dSppKKtTHXMI\r\nem/IAqllVxfdwaZsYYem3mt3btbDvB8nP9Q8cYaWYRO2oBNfEpCr5CXsN7xf\r\noe7DXhLNEREpAPUlb3bhDa2aEaIXTsambF3OgnbG9mgxlX7r2bG7Oa19A2DK\r\n4+jUcrvaQ4keHRMrOHUd0M5ElsTmj7V3OiB0bDqmWxK9diJifWnPJ/8dG2Dz\r\nmz1GVjPAFpBAtEEWBIm0qjgrGgD6RaXYgnPmV7slS8nSu3hjA0LwvfkOSSYt\r\nCXeHkr6bK1+q2+F+3nZSdwNDMZ1ulqIxiNTHXV+9gmWvjneNFV3i+4MBkVZZ\r\nPG3H9SUhd1f245yprsyP00yj4/5dm7tic8hHAHyIYOjpZc7/SZc54GzbOeB+\r\n/IyPjmj8c7iUC4oPd3NizL8sXkdpUHhzYy+1SX4aJaWUh2t1cKPU0S8RV0Q5\r\nXgVBc0Vh6JKjmLxw8sMvtG5bHO/ZZEhRoGBT/YLrvpa/sNzZ3PJ+FI7W65D2\r\nNBNm4g78vOG843wOTccTzOhxT3F9X1HHSetUZt40MvDctv9Hv46jYfA6IO92\r\nWaXoyohsVsFV3EmT7omT4OPWxViTlWH6OEJhJffcchOLzlV/CKDYIf8Pr9Gj\r\n6uC0wgeW93zruVKJWCQ3QJppB3xEbJ0p6Vk=\r\n=UH39\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"fe9f4af00df8a9281ba22e253e4ace0171160768","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.6-beta.5105"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.6-beta.5105_1674824963335_0.2254018123492929","host":"s3://npm-registry-packages"}},"0.15.6-beta.5106":{"name":"piral-ssr-utils","version":"0.15.6-beta.5106","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.6-beta.5106","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4ae5c5ba098210b7389cb84b6d716c985b8128dd","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.6-beta.5106.tgz","fileCount":40,"integrity":"sha512-HTkcfNvgO/w+sK2z9+DLl8Z9soM57ZklLb8QBRd4vEmgf8iuDWk+apHz+TUQYnUGskj22JrVXZRgjHQvdQgknA==","signatures":[{"sig":"MEUCIQCCJJyve2g4xU4bq9G+qeR91VczQiwNI308Uz90Lpnq6wIgEK8i9kN4ljJYOpdOkyfPKtOcRbkJ6/ohkkaDP4b7B6c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1C4eACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrwKg/8DNpFdTjK+loLyBq+nT/oDw39/wkbr6ATh5Kk6yf/OTGflg9+\r\nps6FHW6FkAhRxNDH5Pt9Wxg7CwxGFJa/pM1fLjv4NUxKkpjvwfmNUw1EN01m\r\n8fYr3pgnGct/uIxU/4DofLlKS1C0GYvpFaq6nVj6Syx86/H6obIMehhkHaiX\r\nidiHHent2l/d/kqvRDxeT0tptHnA1io/Dc2TTdSwaLfLvrKt0a6u3q9+rYxv\r\nnsL5lmL6lCOL0aJE0d6HLbSrBryVsgrwROOkdtT9fAJxuB8Urxsta08y5YKC\r\nWm8ID2beKTQSE5DRQwYuQz/tSkq9W6F8Dc2PK7RZPkb2Mj+XQhqZW9NeRugQ\r\nNu6OMfDcLA1hQ4Ei5XHTf80y+YHp8kfTvaWehcFkBVPjoVKN0lSAIGzG++u7\r\n4b1s5tvkehfDMQACGEh8/iIw0bpsnANp0Wr5BtSFof567eSy6ez1yewNPfWg\r\nxsgihtst2FjQEUctEmNlxuxWUmsH3rh/bjg9n+gb5l1SxXWxFXxYg+1PB9Dt\r\nh5KdjeTtpZ0AECx90nudyAj15vT47JMuVHAJIi1zeHitc+IDSEwqbGDnA7ad\r\nh5CKkk1fY7OWLfPhj6hHVuWNr7Qj2awq6JT+8O7Si/i97xXDyzorfgpAJDBb\r\nO9iXA5EruGQWpeO7knAC7cBzAKmZGJ/+GrU=\r\n=wtsl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"98a0225f584d2da787255341b7e44df7e1137b94","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.6-beta.5106"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.6-beta.5106_1674849822569_0.6754249521066233","host":"s3://npm-registry-packages"}},"0.15.6-beta.5109":{"name":"piral-ssr-utils","version":"0.15.6-beta.5109","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.6-beta.5109","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a7a3ba1b440d439e2f5c05c341474d44142a4e5d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.6-beta.5109.tgz","fileCount":40,"integrity":"sha512-qfXDr1ASbLXwgskpC6rLUsEwHqfNb+xvWhwBnJMFHNuPtHf4kf0yfetpUo+8tpLQLEDKdsynqEcxYZ/S28xDlQ==","signatures":[{"sig":"MEQCIB8d11Y4IrDrnAjjVZS7nQvUESIE+n6zuHBPg8dhdssAAiBbkeA/EwpUJOcQ2cJ6roKnO7y4q5c2671Fu2p94/FOPQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1YoIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrVBBAAlywA2lu2en+Sx3Q/0Q1NCIjvOiqb7K02oqAsKw1HKiTFECR4\r\nKDQNpHzsHVhIFdKjjpMucCiZT8q+K/AlkOR19R0mDVamFIKdWVpsupIZpykk\r\n/EzGQCyZwP47mBXMtiUgwhl6F42dxxqEqHa0kj4SJBPA7xyMV7J06X4I9tMz\r\nXR+L0KQpg6bsO0gRxWkLY9dircqtj/let8k3zBxWJcl2/soEQqkyYTvK1UHS\r\nct9TcKhjQLMRljDmg/jd/QnFqrSIJNlgmCMWzKe9GTX6rT78lrWRdiittYiI\r\nVmyR6xRsQi3KmqKHWnBLcp9swFRspwNjlmcaObt4QUhNyF6J+3TckuUioD6L\r\nt1KpJjDju78EzFg4ZoZJKRClm/CDwlz+AjJBPOwWjS2gv31se+WGb8+zsG9Z\r\nVM+gSTFh+6gwfupTvnVztSwTcCBG25jcUOiMPrbierISFa9LmNdUHcmti1U4\r\nuMas/u5s/rXey+CyFN9qGROcxUr3bk+wVexW+i0U99naflOzT4rZOA6qPHLm\r\nQj1Woigat7IoSTpJsyu7MF3cPImUe2DKon1bKWU1kqx+ChlkTIcLo85NAdwv\r\n2eUMSt2MnleYOATJc1xAUu4hClhsdOOpRJWtEtYDbQ4Glt9ei/qLO1bCH5QY\r\nZO42F/0BFlB7UTw+Gon4Dx72bO3qVIbmuuI=\r\n=/jU0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"e944c2737f6ede8187b599509961f2314d2534c3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.6-beta.5109"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.6-beta.5109_1674938887946_0.9009736287171919","host":"s3://npm-registry-packages"}},"0.15.6":{"name":"piral-ssr-utils","version":"0.15.6","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.6","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0b9740f30779e57772cfd006a5361fc11c27010c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.6.tgz","fileCount":40,"integrity":"sha512-sHvhSzHSVwmoggtFjOAYbWb0vfUhEd8qaoxH2bSQ4I1cKZ66dnxEmfeHXxCZIc9coGRDndNmkC69kaK5E0pFcw==","signatures":[{"sig":"MEUCIQDBiiFSoFabBxVUNJK0kLebJgxcWeSa8hp87DV2lWRwogIgNDNjFc+L8KRfoojbCWD8id1K66ziHEJ8wTprMfxQQc0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj19JrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq31Q/8DGfGa3Q0XyKf5uwPqsns6UC51MdXQ1qQqQ6CkEd187KNuSzW\r\nk2lA5SOakcXZ465Th5JbFVDjfYilYb7Qh8vrUyy2t9BJMPBJIm+7Mbtz18vX\r\n36giV8p4WyMqtYrIWPmkyfiQNWF1kuOMKHA/oFshMwSPn3u4bBq/NI0X4Wvx\r\nze/ZswpCtfA9u7NVZdFW1mfq+krGnasnb4BkzP/84F7nTeqPEYDSP80vXeIi\r\nkDnus9FH1jxJvjJ3Q7tjdFhQfLvLO4xYf5PFj9pEaSLgrnnN8TlFivyJ1pLD\r\nnlbx+E2FZzG6DRbayb5ukP73xrdGInCGPkK5FnCc4J2I4FMYNWQ/ckEcPWK1\r\nc4ucMq5GjxgueuQklPMMSCudDSRXlu1BMij1wfafqvdUKoQHjGTTmGorAdU8\r\nmCLx6hYzQiB20h7OsQeaLvgh/DKiN2l9h/a3y0441G3g9WvuwRxlFSe+aIG7\r\nEN+kqp5h/Jhm0vxfroyQdHEQfwt0f0oWLaGJ32YBJsd+AlntlwctL5PxhwDa\r\noKSMII11lq2agBHD9Ghts2QsGvrza/9HWrfJwGml3ORBz8t+qGT1Q8yQa1e9\r\n+wdPcVUA9FaU76jFh04EGIFbiIxnvjvRqWKJdNbnw/PVlxIyQJ5kfDGC8yk9\r\na/5eI6rj0tIDgj/HhsX52qoRb1swWogsQL0=\r\n=IhR1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"7e96dd17512148b8363439879f40360c1527854b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.6"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.6_1675088490989_0.8140948567279758","host":"s3://npm-registry-packages"}},"0.15.7-beta.5126":{"name":"piral-ssr-utils","version":"0.15.7-beta.5126","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.7-beta.5126","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1de111dc15480f604063800488db080ad1614935","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.7-beta.5126.tgz","fileCount":40,"integrity":"sha512-QCCjOfX+A7DyuSDa8/sPEo1miFyujbRYNESbAeEKOjwHBzvfZr9k5cS1tYvZBrua2zuM3eAltjuF4DLPJpy2yw==","signatures":[{"sig":"MEYCIQDZ4m4eiFOv59dR7y7VTcXqIra7WV4nDcR1NuCIb8mm6QIhAMGFjU3JBF3ZsRB04fENsnwQiYPn18sIubSgkh5c9fGs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2jKeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrBMA//QtpcMGRnlyyjv2ipGmyuS+H8HMw9zgLpJ9LILACIDN+JOwwW\r\nhfpkT5Vu/Zm0LQlgx9kz1QMfeOt8tISoQossB/Ln+v0de+0uyonBjpUwoRTO\r\npTivuMztPPY2m/9baC3u13rTbvhfYWG0WCvzm+C8YXiUZUO0LP8NibX3IEgK\r\nZ2g9mZv/+ZzGkKkGq6wKqsc1bqrrCb8EMf6NvYdD7GzZ2h1j2i9fQGr+LUxE\r\n5oxv90JuUqff9XBtqqRy5uotGmYKIwdi5Y3s8oPNP5RRyWYAU7pYnpSZityZ\r\n3jvbGb/uWXAdXpK1tZDOPWPQbOIHm7X0dYM6sJJoj7mJ/YT0UxQVtT00YRH7\r\nuoemyp6Ecp6GtSY2SYtcOeLWfwwcOF7BuNIvq+/sViiFFI+fMOKfgf+5UVSD\r\n1wz+z43DKrYdEeE8Jeh2b36bFsAYWwNaeVZ3Oif+sb9LgNBbQH1cSgL5CbmZ\r\nZv3E2lvpQcX+CXTlG4e/dyuA/O6q6Zb5ZB8slbptMTjmu0ediUwjALhdWHDL\r\nFcuia4rEZysRjwOt7WKjlAc085Ogjxwtxt86Ao/NAczAdCk8CAjFcYNuXMji\r\nhg/xyz3kCB8jdYlUS/F2LUq9E5pHvih333UBdpQUc27I+dmZUUdwhHJE8KCm\r\nd1YHkrIL/k1AmSmXpUsNWFEb7dyuE2VGOhw=\r\n=yQ7y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"e23df08a2bcf0540974ac610ede2c9030fddcb82","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.7-beta.5126"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.7-beta.5126_1675244190033_0.2881513574532144","host":"s3://npm-registry-packages"}},"0.15.7-beta.5134":{"name":"piral-ssr-utils","version":"0.15.7-beta.5134","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.7-beta.5134","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6ea36d1ab7be6bc2a117617c51b79c4641f872ed","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.7-beta.5134.tgz","fileCount":40,"integrity":"sha512-9iIcc5UoDKd6DnVppboXhXXuzOmHP8UMALT6K+sBXc3lVUGTA/zUjKPw1wVxjwDGB9Z+iH2yNXTlM02gi/tHQA==","signatures":[{"sig":"MEUCIGla+NkLFJ4FqaVMg26QtJ8qnG8CTk/39w4z6WatpEb1AiEAwomwtc5V2TZ6K8hMeNFxfAYNYuyyFkxgYaAQ2fYRCW0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj24KvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrf3g/5ABFVjok73KnUJcnu095y2ZVcCV7QHvb0DQNbLwQ5no35i2op\r\nWrveR9VaUgYk8qbc3Em7Ig6nz762HrYwhQm+sjArlWjhlsjbp6EfTMffV9Lx\r\nZc7n/Xkrm4ZIPuyslBKzegHvLtufq+WDJ+O1Jo/gO89r4S8iVTTamhKIitWZ\r\nXSFSPxseaMwLSQIIBUbet4XUXIrXYxvaIoXVlZhXj76+LaWjFsiPzO5bPCmG\r\n7FPKOFStxC/hegKpiBNLQkuHEx/CnqhauHS2KZ1OWxx4awtsh6gyGG/ENR2V\r\nokgBX/pkpUjg0YmpkZCaWHk3+6P/vKPMAHFYfQs2AnLPyFiXRk5JIySAPcOW\r\nP4TK2QqXaQRqbCDCvc5HNvT+lFXLLXkZAzh0xTUBx7ZCMTKh67iseibsFeid\r\napL9diNyvcgm6pR7ar+3bNPRQOuQ28cGCz5YFy4EyGVMK5T+/EFPKPQT2Hi0\r\nmnEwtq9dvkTHFEBIK110qmCbBiRDzCLAp7NwZfnV8Biio0vGd84lg3exvgq5\r\ntuIKQ0ozEKrH1HnNDZrfGgiLbg3h7rMU0ipAmuK6rv12yQwOSCMxVY7LOqAR\r\nKAfbMMBFE64zQbv0D6hVVWPOAu0WJAQ2GWkGuGs64bhVKqfRfhlrS909RT5h\r\nLvO7g38vU1nJc51OWr+2Uw5KHAcm+Y1/w1M=\r\n=1whp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"9741d20e4f4f6c6492ffc7b40012f7a1b23cbd24","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.7-beta.5134"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.7-beta.5134_1675330223424_0.7186536486257913","host":"s3://npm-registry-packages"}},"0.15.7-beta.5135":{"name":"piral-ssr-utils","version":"0.15.7-beta.5135","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.7-beta.5135","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"94fa95fe32b093d551da65e02cc9d0dcd74e9d01","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.7-beta.5135.tgz","fileCount":40,"integrity":"sha512-G34dXEETUwwOWfgFeG2eRxp9jIfIsKgaf58J2VQpT2CqOvPuHBbqBL1D26MsnOi9NcgTQZz6RWV4sh8R0JzypA==","signatures":[{"sig":"MEYCIQDqQxbBbducekjrR61A7cbZJlx++f8Zcqjqo1gMnBTuBgIhAPELe4tWQAltrWSAM7JeJYCa3sjUkbN0+i/uLAdz1rP9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj24M9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpewQ/9GO3yaYIdoUs8iCd0EOsXCQqwAM6hNYjRcy9ZTTWTH/IVEUhd\r\nn7p8sHbEognT0Ca2dEQ0wxmMRPQBz56X8isHHbSYAUmsrN5Bs4G2j21Fqmzl\r\no6HqxkbHhbJP1eZ/RmLfbveRacDxyaeUp26yFZD3NTLwQ6XT+K1MVY81j7dM\r\nkNtK8wGmD+k8fku87W7ol4QaQH+DG5Z3fqGQ26eMkm7UF9CC4HMfG9et7xri\r\nKXfSnH2pO6xH9bB8Sm819Tm3mHfLHPCeDhfoS1/bWMuAzIr9fsLQDr76nPH0\r\n9uxxigpYoSsxH3e/98mi3YGsSv+PIu8pFhaqS6jI74HEf7pzTQJulSMDnYRg\r\niNQTQd928hiWP3X60Nj2GRjJTjyAGnhkAawyzqGOn7T1ej3RB/xNz4lAJOrY\r\nCnmeczdVPdbWUKuF2/cLnTLEkSeFggr6esn3IMTw1TmXqpN74wOGboIcZSe+\r\n4koVvPjuHAog0rFfRACG7cxk2ugqByRnWIcxG3gwcixtkghaCd8OUINns7Nr\r\nKo+XJyJ+lpDhNZKhTzpfKB4dyj2ieiA8whBgilFXsBiqnMyw8rqquhXFunPt\r\nvEQDotLPsIkXlpSdqIxpet8GFcuI3Shxracis+n2xoRiSQ1bkwl4H9bu1q2V\r\no/x7wGalmj19kt1hvaI3ICeTvS1a5rvIw/o=\r\n=vrQC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"9741d20e4f4f6c6492ffc7b40012f7a1b23cbd24","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.7-beta.5135"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.7-beta.5135_1675330365039_0.665675708303916","host":"s3://npm-registry-packages"}},"0.15.7-beta.5146":{"name":"piral-ssr-utils","version":"0.15.7-beta.5146","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.7-beta.5146","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"178a5b8a8af81201f908a045de315840cfa274d2","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.7-beta.5146.tgz","fileCount":40,"integrity":"sha512-+TQoZBzrz+0wM11WUCdk/gRnETaiuxs4CuM0PfOLshT0ssJu1PYwdLN2IohAPL3EemIOcU6DNIeoyHwBrwJ2zQ==","signatures":[{"sig":"MEQCIADp56qluiMtUQ9mPo6gzB9Wan1FNLNuhIXP9Mie90BHAiAMm+BmAAZFI32R3ZW0x2EcXYD6zFIlRzRiTSgrgz0log==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3i0RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpi1xAAhZrPf5ndROc3G9rp+9M/EvrF56x/qpeQmdeu2Q0QKI4hcyYZ\r\nbuA5++zg7LOmJnHQfnmT5hHq23vMyTaohIgqFIv+lfMI2cL/ZTgHu5NxaEaU\r\nydukucA6XhXRsANsr0hYkbHrCH71KRw2Hcu4fprRjg9IdYjDjM+ROJMxsxhS\r\n4K1Jq2T0Uyn4FrHKAnKbsW4Ixbz1KgsculFC922fKdSmYUHjcmzuKgLctNds\r\nmQS0xL4fCKkIab438Go21wsvCy1ZAoK2BXcANd+AcSxfSsLXDf5fjjaRSsgz\r\nzS/dwOEyyiprSgEYBrtWL+8d4u9V2VJIGuI2t/3hf22dfZmpgATRhHDt5gRZ\r\nnmwcpHtKlQQi89EZUDiX0V0LdmT6DN7+k78GXTUMfFhVxW720WUm98/2CI5Y\r\noqqevD4bjKPVb8lg/uZbd7mAa89ElIhEQk4sfFB9tUBHr5MCo6NSmRkjXawq\r\nY19uuaAY6/YQ4I3BhEVGhotusdOzvAFf3BCUdCv0RfJ4+Pa211tSomYYRKPv\r\nOPPAeYRsWO4nNL8CFi74ZffD0bnkNb+I+9hgJafAHDbo2FcpcgV7CVgdd16d\r\nTwM/fIIl7I/VJ4cHoDcnFP5u0NbmTOOFQaoELJfnFtl5NzsHTQwrOjqUcrBe\r\nkZt5facLYX2a1GKe+/dfFOw4sUFJOwXHPgc=\r\n=oBdb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"991e7af022c233bc3662e4017a6b8ea1dbbcbc92","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.7-beta.5146"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.7-beta.5146_1675504913134_0.5833486000379677","host":"s3://npm-registry-packages"}},"0.15.7-beta.5147":{"name":"piral-ssr-utils","version":"0.15.7-beta.5147","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.7-beta.5147","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8a686dfa0d31afd761121a8fc07429f69d99f915","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.7-beta.5147.tgz","fileCount":40,"integrity":"sha512-XlAzUTu/eD6o6MGz2WYEoFxSUMZ8wXDaEFlVHneGN+qJUT4icG76EkG24rd2VlWqAZemcs9dTCpnq3teZ0+EeQ==","signatures":[{"sig":"MEYCIQDlHO0/zQVwJlhWhux4jbk1ZFquYLgS8jwnTtD6uRod0wIhAN2WimRsyzZ+REIMymyvn/u1t+BlvlkmJDblCpnzwvcW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4Av1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrLOQ//bOnDZft5ebmcyfQfJYmGPO6XLPoR8RTXHAwc88zNQcWkr4Mu\r\nlkvnC8VaQEcjiM9QhGAcA+51Wc/AlvjDUNvEtduVQgkyN92XsCdZ4WUOW52H\r\n8r/rRHH5RqjfEe6elHDQ8eICEmehlpB4z5DG5r7+KpVlM0uI42azfc63zsXZ\r\n8XMU/BcRcO5J2pOUphFF6fdxrPRty2oude/uRFBOneLSjEN4VC3fq4yz83ai\r\nccU67AWTFNLPMZBzrVLf2keTNC6OWe4vprZctngzkCmg5CeVPGIjQqSd7WXK\r\nPKDoXBjX6HaL4EogNh9FkrnwZNYVt4Ffo3J13sDEAbCLGERXfVeuEiseVw5W\r\nKG5voFYPPuXPXhweECihhCfEd1E+XXZK2Yjn6UHMXDMXMexD3CVBLB0IR5IM\r\nWRoT3SvhGYqnIAzHUKZEGzEr4dHxToJC3WpoA2+Fz9KGS61mikEQaJYOoGOK\r\nY0nXi07AKKdmRlFPBsy6YFkoWYoR3hcLq3FviXLVaXd+UiPFjXmAtGXpQnIv\r\nY2ojzgSc8gmOiTBU3xD3nmqsaQdZbxI5q49FLqFR//UtgDiIS7bYYNwKNGMt\r\nT7vRGNP4vnMmDNiUuQFaqjrPoqz6eaUQgA3eEEIwlFGmdAw43UEkAnsbeBff\r\n/auvb7OhwU+wrrK7juXTLXb97LLm/QSKe3c=\r\n=pg/f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"8833e0913487f5b11446b6dfdf5354e9154cbded","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.7-beta.5147"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.7-beta.5147_1675627509194_0.4411064714616868","host":"s3://npm-registry-packages"}},"0.15.7-beta.5155":{"name":"piral-ssr-utils","version":"0.15.7-beta.5155","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.7-beta.5155","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cad1afd775f62fc2df2393132a614604b15c116b","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.7-beta.5155.tgz","fileCount":40,"integrity":"sha512-jhCST47KfR/fw1fycAKwiX6FlPoEdkvFdgVbNYit7ni3HTJ73HTf9iT3EjOcybYvmEt324XPyMIzzDR3arKB5g==","signatures":[{"sig":"MEUCIQDTjWozPp6AJMogrqGuYg2PdVTISbUekqVfufROLSlXcgIgOMMOkbixTZWH0wjK1NVypO+2b/j6HCPXFynFH+uVyfg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5PeSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqN2Q//WcbEzwkKa13OhcnpsAoSpiIHOeAHCXtiBiui3Sh29pQ9gYzV\r\n0suP1pMYyTz7/RUTy+rMoGZs7GpFy1LyVl5PH5mLAFfMpraRzordZV5cBvcr\r\noCWJ1aL0vZTaYW/N/RMl2l4qc3LxpA8TypDMkgn4v2GZF9McugwasJuiQfEY\r\nMj1vGK2Tq5CntXjVKhNvZg1eMkZ7kpd9SHO7rHIxPXlkcrIQ98ragg8Oy1Vp\r\nUD7gu+Z/aREvPe1K4TGynHeuvT0X5Ox0+j5yEyYnf+GwF/ZE1DVJXzC2a0js\r\n0xCoN2XvHryzqc51al1TBzzxOtkoHMbBcDRQnAiSy4ksntY8+mEwzg5XJXC2\r\nixbA6sJXhzKB5JJIpjS374iLmUqH0kxseR2lu62uDW/nGTvrkPleYuybYvcc\r\nqEQFbGuh++rtNOHKXnDy88zZQdhQU2Qm4hGT3hk5HcGPuiPSmITySLUy3b0p\r\nZ/nAFjOOi1tPyrni/zpA6PbMsCGE/Vf9v6rW/vcccbmVJnUnv3vXILxxEKIT\r\nCxwTxK8I/u+uy0CwNhjavo31iD8cDnict6/dJKhCZ3C5RZOgATlPMfviBwcR\r\nFyyonKv1fEan4goWlb8s1WuXNyScKVOHQR2ko9jZf1N3wox7da4k0fXTS8Mr\r\nU9SaN930BZyVjQh/sdMZyod8zAZE6JdRrk4=\r\n=WeIP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"f4d7b20a348a2474a0b7c5bfbb265e544732865c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.7-beta.5155"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.7-beta.5155_1675949970383_0.9128569295993261","host":"s3://npm-registry-packages"}},"0.15.7":{"name":"piral-ssr-utils","version":"0.15.7","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.7","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"77d128b1ee1f48d2a7c548abaf2c9dc46b6881d8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.7.tgz","fileCount":40,"integrity":"sha512-eZsboNDRE2aiMEJd+l3uS/zGA+FakrnfIWolRo3oo8WItQfLU3soTHaWooGlR2N9AfB86UkneAe/h4OCu/wG1Q==","signatures":[{"sig":"MEUCIQCCR2csfQqzMUAdIHazZbdDmotoqe3gzqcNP7+iFPXuYQIgKHqUr9pqhcHTpcP4oWKPUzs13VNpQ8ZGXBr5yLE7/o0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5goLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpSRQ/5ADZTXfanUi/ipPHfogO/fUsS0DXZGPOfLUX7kh1xIjZJ3oCw\r\naFhH8NloschaPf/dCi4FR/Q8VgRE2QK/St0eB3NeNyN7Fy7XJOwDe9wPA03G\r\n+ABRips4WoaaAO7GBOOVdVGfzONcTX+QRD8DNKmziWif8EWytp8sqlWBZ9sD\r\nGUQa3omMyzuiWC8/+wWLCpGtX/jlW+4JSN3ZM/VfsbNUZ6eaHicM81AWU7Gt\r\neR5UYYEIBCWq6hraYHUggovlW8upyJmNjSpFDlJk1HmmtmSW2a7iScPifO/O\r\nhHFlXEe7kjKyLBsa5cYMxEDrX1wkC62L8U6y2uYnIxpypMYzU0r0t8lZY/yg\r\nocoP4JI+9QwTpPqMEpujMI32PQDRVyYuXVySnnqADi/wPtota+XvT6QOO7mU\r\n8MQYIr0/G1eXjupKswt00+9DJ/E2Mln9NWcJjh2AZgOCULrv8afjq8dVVJD7\r\nf02nSzR1k+L4GttqtLSXiwRBbgca2RdYtY/76GWSYlrjfPoIj+ZWTeVo+GqM\r\nhcUlReSiVLfVXnUWSsGtv+eQgHj+VeGhZ9uiThPXReIH+v5VbZgATBQPn1DX\r\nJhN+FpqX3sBEv1IBPhmDOWui4XHc+MMJXQ8WDh8Sf++rqF7SClBrGT/aXvha\r\n8uDBjTjhTVsiVbpfpZi8g0O/mFRWv0HhK6E=\r\n=/823\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"79157be0d737c770cff89b1c3a2b802f2b13194d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.7"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.7_1676020235719_0.3998799898013339","host":"s3://npm-registry-packages"}},"0.15.8-beta.5168":{"name":"piral-ssr-utils","version":"0.15.8-beta.5168","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.8-beta.5168","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e9e5d1d0dd4d8099fe3f92c3ed79dd9340a73958","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.8-beta.5168.tgz","fileCount":40,"integrity":"sha512-LbJ7yVBAJ7/1HlajWGnfkiPY+kpTAJN3B/91UZX1544/go4yO0U43QMCd5uCsyRcOpcQJUHGj1017krjAn6TJA==","signatures":[{"sig":"MEQCIGX1+iRgL3npYTfRcjCbv0fOWbuuaGofrosnEow+Xq+aAiA8NNNt0EX7epyjFBrNF/QINnHrP5dl5FG/zmIDxI/isw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5qd8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoMTQ//eHkJsqRMe1PblwO/eY7QuzQ+UKRWe5YKAf0aBVw2e1mtchS6\r\nitayr+zDEOQQSj8E0ufs5KSJ0y0HzC8TzCZdRoqb1Gw/mbkOwhnmZtr5C3+y\r\nMeOX09Gqko22nN05/AlSWBASAzY848g0462/L/pFzR1Bo8D/JvKuBMQ6bNSn\r\nyUhgth9WFvlr1jG6c64FeUawfGB2n24N5TI9mpOwFYxhnyLyeYYrLSHOxmR3\r\nApMXq26Mx5ibZHaa47Z7nIuyFx7ZMG7B6qLEmx2E8v90tD1Q6zfNv1JL6RQe\r\n6i03phQ0mpvPZrRGV3m9MSc0oKQqSSJiumHblKorOWgb1vFOCTXIy3R7/u9a\r\nWWLXUtzkkh163krDPuJx4Rvytm3MPga2zxmK9fbCqqc3tZGzO/5d+TEbEuau\r\nEZLFtXUtI2GhlI0ficDWvVi+iHIRWUNzoY6xOYljK9JZhMnEcbLK0MnoU8Qf\r\nJicvyWsMkbM0IYrNvjzejlMpRQe3FREYBg/c2RKiZ8LnlTtbDadEvFg9KUcO\r\nlMX2CtdUR7LzjYQhRj9zwarlPSNCMbL5mQynhVp+TNeBihBhUWCmhFQWL+Hq\r\nSdmQ8KPLGPT8KzxAp73rb2qDXRMngnYouxlysX/H4WwOmm53R+KnEa54j8xR\r\nse4E2j14gLbF8HA8FcnZUpvSDvD7LIeHQRg=\r\n=OJXr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"43b50df63d9d3f75b2c07911d8275786157ffabf","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5168"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.8-beta.5168_1676060540447_0.3755086844462805","host":"s3://npm-registry-packages"}},"0.15.8-beta.5218":{"name":"piral-ssr-utils","version":"0.15.8-beta.5218","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.8-beta.5218","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e0b3870c3d742c8983b843be785a43ca64bfb586","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.8-beta.5218.tgz","fileCount":40,"integrity":"sha512-cp7+ql8lY2WYSElNwoWqLeC0kwV/KI5txKcwklHeJoqo6RgPTGD1Sk+88KBvCXhPze+HogQ4rkQC55IWsgUztA==","signatures":[{"sig":"MEUCIQCe4OfVJ5XTL/jbhNSD/bNYHHteOI/CoyT0Yic5HIbWIAIgY0ITSDmUZJEw1otoLYcLGxNgBKZHrcfGGF80Own4b6k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/416ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmowZBAAlFe7lAg+7S97UzKwe5QCA2l4BPij9tN4C95O2eOoRC06okvj\r\nrTV1r22iK4CC1qyTNZfGSncEXOv4DnD3xk4zNICRh1FBS2+6SYbkwJYbimaT\r\nKDyDJ8npzfb12Wh3PRY99OgQUuDp06hGZOC2Pcfm5XEM9rIJbX8B8l90fE+0\r\ndQOG4vOkSnBIJg5/DN5vuvPDR2h/r4eIEZdBBisXN9kizxluBO6S7YGZ1V6p\r\n3tor1EOLxb7eYcF0IqheYoqfvqVIdRiF11+33DK7Zwxu1RNpxdBtKEiCUvo2\r\nqqx0lCotBmkhhDB73ZiFzvBOOki+GCKBZbxacZiAx1kEqQry0t5FKggbGJB+\r\nyrC8rslz94BK3OhnckjB+RzW+Jd98dNWLljAhPfgc6o6wwPZ27Kq55ZX2PeH\r\ntiT7lpNMAZKljAlXu5uKOEekKnThAGLhvSHa/zU3/LEa7rcixOadx0oJrfFD\r\nAn3sTUMbYJahztlLZTjuxLOT2CJ9c2mvAkI8pO2AFaqrbcXo3/F98lv7F7Xw\r\nuFxRx2WNeVenPf03tSzYyUuJmOzlLA/iK6QDU3uxrk821LHIODTvPtWIlISP\r\nQbJV2BNt/vPhbuVSk4W6974oP433vl9Hit6KA3kLx6MVzeYkK3RxFlsbdRNN\r\nh3Bp4h0Ta1Txc2XM/0Px/ium8sCAKNiU3WU=\r\n=73wC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"d4382a445c6188d31622fea15a6e0e092fcbad78","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5218"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.8-beta.5218_1677692282615_0.7850190860417845","host":"s3://npm-registry-packages"}},"0.15.8-beta.5219":{"name":"piral-ssr-utils","version":"0.15.8-beta.5219","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.8-beta.5219","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e8a09b6f5c6506ea691da5eb38c70573613b64b6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.8-beta.5219.tgz","fileCount":40,"integrity":"sha512-Je5kypOb1GziGwn+BC6pxc2zkSQQ+9/qhB6Xxkm8JhQDgs18N9wvkzmxLMHZc6yMXnvh7G26i4StN75It1wk4Q==","signatures":[{"sig":"MEQCIDKaUTqrb8/raCwMDlAVxjv8LgpecgncHyyJUHwf0qIHAiANM9EV1pRhdHqPw+qbTNaEq8fk8GgkXz8T7nKRdG2Ijw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/+TrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAxA//TPgzCriMJhfq5BXqns7t11FTPdwe56uLf9kdzzbDY0jRgYmt\r\nwOn2O3JH5tcVmP6Lz/Bt02kDMLBaCbljKzDXuIuT9NyFCQhyLhbt7C+rQto+\r\n+pCxqyFYd9MvTDu58AyLHl/W2QRnnhnKiwHh670eUS8LiSIzPuwz+R2LlYFV\r\nANPTtVlsy/KLLrzIu9nv9AqEU6Sdw1miSMmMYUWEiq/Hmq5TZn0d1c017WIf\r\nj3sUkAyqZRLgT9l4GOt3LE3dxVtWKIOpyCyquQtTd2YcNMydv4cl/RKqn1t2\r\nyzTCmS2kefmuYcUl0Wow/daWNWXrJmLwymKH2HnuzL/Yt6VJApi5Mg9rdy1f\r\n6ohXEsaZlpltIA8WVb2vjIiC0OlA4dJAQMa5vS6n0lckKRvVOBVUWCBRWRUa\r\nK+zjQC557kOCtIzwrjUeaNR6ceVt2DPB004wfjOj3RqT7ke0hejscieBhdjz\r\na4HGWDMl/9sGa0fPEkIRrxpmTjV0QVOotMDrkp4BC+MKpjWfadDeYUEZXScB\r\nLA3fvOptz8UGMT0wI7DMnpxG+tIBRwizPgt+u7QivXuQXBeV4Nn6tAA6R/fN\r\nGPhVJmcIhywhRRDb7lt9BL5+35M2LiRzHKSYnEFQq1dueZhNsp356Dy6l3ba\r\n3s24s81zqkHJEEDy27NQzYBpldjkLLYMRwo=\r\n=Fn0H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"11e6b6a60fe6082d6a01ec67713f3acf85e04b57","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5219"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.8-beta.5219_1677714667411_0.6739361959138128","host":"s3://npm-registry-packages"}},"0.15.8-beta.5224":{"name":"piral-ssr-utils","version":"0.15.8-beta.5224","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.8-beta.5224","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c84b6ae4278bc4c66a5d9198aad8975cfa1ffd9f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.8-beta.5224.tgz","fileCount":40,"integrity":"sha512-5PLTm/2x5dSvuT4rnv6Zwc77uGl4rc1OjBrc4jgHP8D2++xXJaVm3yN2Dma0RI2SVzK/VCCSAkb5LpawpTg+nA==","signatures":[{"sig":"MEUCIQCNOI8vKlRj8vYIV814aAg0turUVOK/JxJcdJWrJ4CveQIgAgXd0rvQFZScjMyWb6QxFrFwEjqLuYRCQ1SO7RSUVeI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAKYiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmompQ//doBI9rzu8881ZDVIWC2lV9uSpDsKGsxPao01UMPdSn12otIu\r\nFpxMHgsPVDIR471mSfVnyksxrn38DdFJkDNpLG7yWMjeQBSY+Yaey9VsSt5h\r\nI+LKPW6e12pmfo6R+MeTLaqUsbHAvfz/s+62uEu8B77D2sjWfr3aErnEE4BO\r\nQ8fco8isn4SXm0/JpWsAKTcDgWXpdoEneLrfxtOOLYKBFWarSIcsUlaj1/CT\r\nJRxItb+ax2FwpRX+8zIhjTFSrKHvDHgX7JNdMlQn7Aeg73wVC692dFdwM4od\r\nkpdyXGGnqoaNiCZykprqES9D5OiKM+g5MVwcsG5yBI9PNXFRgUmsBIfAQcSd\r\nIXGTqRbp8Vw7xogV7Q9bfqWDEJaNSxmmr1NpWHgoC3yNh2SRVvqSPTBZjwB/\r\nvXVMk2Xu4cLlV0QrE/UWpKZOYsU7xdJ/ysBfIn8b2QCj9ayGtsWazQAZ8XL6\r\nt4uOlvuNi92DWd67wIT5KartuLjFZ1upxkU1nIblSQEWphUbAsfNMCNqv6aH\r\n5jjgiMJycvNXZcqMTt+trAmIoCNylBZL3JAFBOUW5hYjzaIgCrWFM2KMwsjI\r\nYIHfyL06CJwN4z9SfPcoKBcOeoVi4psWJpd1HuRfkx8+lZDQBd1hVsF7GCJe\r\nvLV5zHGlrr1UNPyvFH4eDemyuVCmyuX9UY4=\r\n=2Lwg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"8bcc3476fd84ace954922e3ff11c394a5b9da7a4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5224"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.8-beta.5224_1677764129909_0.2943666872519701","host":"s3://npm-registry-packages"}},"0.15.8-beta.5229":{"name":"piral-ssr-utils","version":"0.15.8-beta.5229","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.8-beta.5229","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"07f603610ba6cf86e05353c294fbb0d465863224","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.8-beta.5229.tgz","fileCount":40,"integrity":"sha512-9VY+fryJQvh8aRGa1zdIwozOxAsGEgzTnN63W93KxPml9lUlBNBbw/OjfwSooOj8dJIEocMzgMxEPeU0EW+qIw==","signatures":[{"sig":"MEYCIQDOIXse90+cm5aPrbEafduut3CkVSMjcEOdpanVanzv3AIhAJYqSDNtIV8lZ3Gq5pdbwFswt2Mw9PjrO3RXRYuFhX/S","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAOUwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoebRAApM8n+NuxdhqELeLp36XLE2ac/Jm6N1AX2FlF6zN8Jte63Yxk\r\nZ0hWY2yqaGaThDCrJr5F6To5S8DRSQagl8ZJoz8Kwlz+DeMLBn7QDEEBhL95\r\nJIu2D7haOBndwWISmbhfxQApyo1xElOdG4vKXUfkYdnw/8nM+8qTiqYQb5aC\r\nSSyGd6Zusz7HtReL+aDxe0wBRBYC8UWNLy9nRmSN20IdZ+PD/l//Ey2f34Zx\r\nQS9hFU6xJ3BwwGxa2/McXiEw9CdqpYucsgHrxETuukXcB/S48487ZmqUvuO1\r\nixkLlBJAKJUx8LVhWeuDSYUV3T/tyVOwjy1QnFSgPX6WLqFnXhA4p1HcCzgD\r\nYixqqPMyV0kwe23uJ+ODLWvUesUCQF2l7AS0Np4E4UEVMj2oSXteqo7gntqH\r\np0LRUOx7BILwkjqkyUy+QVwVkDuWOup8ZpuzwHUm8kpwSC9ceItwqAGjoMA2\r\nFktJGewTJrU7dQVnPWBFPrALkrcjl00+Ve/5xpI12K0XioCincajwjsRvQ+6\r\nnnw3tUcDluzb+NKX2TCzkDYPKYlBG1vP4JmzSl9Pe3GIyLP2gBtNqPViO9QV\r\n9x953mLKnWEA0YxEy3qCVWCNL3YBNqF4FNBnDB7m3FqHkPLwRZcCJylRaFr6\r\ndwaNClkdTn/mtto40Zn+/XTkB7H1uouvJD0=\r\n=3aMc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"8149d15bf5ea66fb4af6f04b6da9242ebd4db1db","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5229"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.8-beta.5229_1677780271877_0.03787922505319319","host":"s3://npm-registry-packages"}},"0.15.8-beta.5238":{"name":"piral-ssr-utils","version":"0.15.8-beta.5238","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.8-beta.5238","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"40cd15a2169a092b1c7856672b31ca4d9c4f44af","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.8-beta.5238.tgz","fileCount":40,"integrity":"sha512-aujGMrU7MgJNP7FLdBm8H+7ZN5NTc99uPySHfobIxT6l/3GNFcijCGcC224XdzTptjCHC/ThVLLBOdoxs6uoWw==","signatures":[{"sig":"MEUCIQCrJCV7/l+OcRLAQem5FOCidKwdUKATWt/tIWv6P4kONQIgQ1D+hXxeHLclq6PGu4ncQX7BxM6sa85J6Sa9tBn1fQo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAbW7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrmsw/+MsiTyme9UIhC+vjDQX2/iIz/p0BOR4itlqHiOR2RRz7ZC+qn\r\nnB2X/ZdpSNuJq8tiajqz1lCaHsd/3SvXyH5p8GHYkB214tDXlwrRbcciZOlI\r\nY2c7YBAd5CdrdFJ3jNLjNM2T7NP8+uGc9H7GmQqRvD+JqWvZA5bfRdajooiZ\r\nbJZCIuAmFEC9GuzPVoFUc1jp8cmR8Xlydvz1z5RYfqgb0TmG4k28J/CvDZcG\r\nTY/HTJjbAGC7CJYL7vDs516285YRUYIdLDSJ6x7G09LHje2SrX4BOVwpJi5P\r\n2+48o0Pml2YkhlfWVQf26aMj1w9wexmg9uiz/Psf8yfl4fJaa+IhL6St9+vp\r\naMlmaRYpMPDVa9UD08edaXhXbkSnPemTtxuDIkB+PxX3oHPvplegemBZ3sFn\r\nhXiVwK+pTe5TYtSewXu1hqfzCbEE1PHoouGl7sRk76+4V13GEF2CzsobrRMC\r\nBpwQEmtu+xPVyjf+lvIDdI2B7HqXwG9kjKxvlbAFKG73BWcRFY1c0JBqCqb8\r\nwjMyTbnf7rS+YiXrJk8EdSnc7WvPnLyCZdYVCQR2I0jzkJOYKdqmzxpnZ2QJ\r\npDlcBBg4ChTw+S0gnlhh90Dp38ey4W09vqrGYISuu1tI9srMM/1m99F0lFxj\r\ndfk/InmoojXGPwWFFXMGR0YBSQNJZ7G+yU4=\r\n=PYmI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"98d5d39c29ab4a76247695b78c9e73b6086bd09b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5238"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.8-beta.5238_1677833659225_0.23929514537695917","host":"s3://npm-registry-packages"}},"0.15.8-beta.5261":{"name":"piral-ssr-utils","version":"0.15.8-beta.5261","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.8-beta.5261","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c19c870ec33ffd0faf5b1b9d43fc12e0668f90da","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.8-beta.5261.tgz","fileCount":40,"integrity":"sha512-HcVsbARbKXdlePjUK7pJZ+ZzAlD4qf8G+vNIeE2Yeite2oLzRL23PbLTr7PT5WMHNthr4OfHHq/b1u7FiuOJ5w==","signatures":[{"sig":"MEYCIQCsDKUmluMH2dTYFF7piYYABpgb57nCb4vOUqysjBXQDAIhAITVlv4+Phyln3Ek6HzbvnMvfxAxZYmo8AfDuy6pGak1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkBg/nACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqx0RAAg7MFXAn4BTPTYIK2x2dhHHIcP5fNDOf03AzCUbn8Zd9Rfrk1\r\nDROnulrT3+gjhTmHvaHexaPaqZjLIVYl1vn6qHfVDS/4cs27q5ihOu4pjx1/\r\nOxAkgN0RW5k8wJvBdSboOXMfXlUg3KNK7Vt41kytaNsF8AyImWkMoyGVH9SH\r\nMRyPCHVbEb3+1+VTQCv/RC5nCehA0JhbomQe8aWvLPmjsl6l7Mqc5aDyBfpn\r\n3V8kusakLllpl1fBO3FKgiqyfuXeM0pnyr9VFoNaUIad8ZGmcKknviBdbTmk\r\nDz88x3HJP+kYHl8OifGIdYdJdNnRVLvhNih5VviRGdeP9oEiuQ6YPMUF84S3\r\nBwGuE9gdWZV8FLvxaVqcvNYfE8B/KqWWnoxtPaLdTNxBlX+ersbXyI0yDWxw\r\ncrkXviUurFG9p32plJOwZiQ4fzOnLiHLq2gAxz7iJtppaIh6+xx3EN7q7Iy1\r\n+rYPejHP6JIdWTinTouPj6JOF/t23emAkR6uLVSNYiGiJiTp93bXQa02kht0\r\niKdL/LoV8XA2Nt5SGXXymxVu17gYEjefDUOf9fQdvmpXES4UhJpHQBsMD9NU\r\nUb8ZEOvJItYh1dC2dcs7+rtMFCuw+f1Ywavq1EMqm/dBlZ6Fi5XYBAdLv+4S\r\nWpA21dhr2BBNbBIxM/1h3jBMgvKDQ0JP55Y=\r\n=2nO/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"cd42da9486d7b22c942271dda8bac0d0625eb92c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5261"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.8-beta.5261_1678118886922_0.8784368479555109","host":"s3://npm-registry-packages"}},"0.15.8-beta.5269":{"name":"piral-ssr-utils","version":"0.15.8-beta.5269","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.8-beta.5269","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7657841497cb9d68e47cf3b63b90d8336acc4ee1","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.8-beta.5269.tgz","fileCount":40,"integrity":"sha512-+KeBtQnSQ/qUqEUJ/zwk0lbR+wDx9IvAzauxSWlKqeLVJumEDMWvDI+2Of1OM3k7rMc20amo3riqrqqyF0ZWOg==","signatures":[{"sig":"MEUCIQDEu5rNGGaPfh1SmqOqm+V0BGL8xkLALrn7jeidjl1KcQIgNqUG97FQbT11KWKGeV9jnNYCiwzLKmKZgzhCm9X/p+A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkBzHQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp58Q/+K8bIOoApXNeRA0NkvOIjoQxzlap/DgCTzUciFWpo8fsvm8kS\r\nQhkdWjkzcufY7+FFoEJgl7nRCOlvEw47CzsBO5oq6r0G7Y8ORYppolpH4ljS\r\nb1ZqGierkWisWMu76TtX4bhc6TI33JSJI3dL9MmEmv63Yp37fCuIiWd+vBuf\r\nuxiTiPX49FyhRNv20RHVd94io3Tx3Lji6z59dbJu2JZjIvh+coHWBAMeHvwa\r\nIaT4KMUmiiAnnup/nLeajEn44odibv4To6U7/GjgeECjbw0gxIUW58bkCUnB\r\nCo29Qbs/zUOhiIbedW7o9UsK0kQ8jPAvJlDYivYN+uzONFFNwS605zhW/Q6X\r\nLf3Jlw+6tNnxE32xGSvZzasO30fOcdrQUNZRpGaaRwa+oKWtcRmBbDIVHa/T\r\nxyEqc0qf0m5gAmoukQwDyTJ4im+kqQe4CrBcAagO/5MQKA/IT2fooVQI5YoK\r\ntb/oWvMLMCautEApXOUSDCRD1IhDK5JuJH5ObPWW3dbNAyF4HuLxKegGVHmm\r\nW7TGEk34ybLZwWYTz8FwuuunR7VHzFvOxxdp2mQuxaacwvJlUzgy9Nyu6ulZ\r\nqD9tSMwQ9IvzpMv1gK5a47DaaU7j2Y4HS0nn/jLDlsip2M+UvgNmc6w48knQ\r\nFHxx713aLOWYItL4W9hfxdRVzupVq/Dd/AA=\r\n=lUjY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"f372d7442c3aadc61ffd5951104f084744b2fd5f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5269"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.8-beta.5269_1678193103950_0.13007636874300688","host":"s3://npm-registry-packages"}},"0.15.8-beta.5276":{"name":"piral-ssr-utils","version":"0.15.8-beta.5276","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.8-beta.5276","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5702be175e85f0d13fec8e25b5f8a50dc0b38e90","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.8-beta.5276.tgz","fileCount":40,"integrity":"sha512-K+SvO9wkFO0U91M1noFoiLR+fsRj9MbHAINERV/9FimOSnNl5kvKIzTU6CLWVDXbPSRAxEsL2uFBTGaWv9tYCw==","signatures":[{"sig":"MEUCIQCsfA03VnkY1kfxsj0l0LL/lSKADVyJ3WbwQFFacOtQ1gIgLVaRcG5MoV1yptCpezUDkk3ha46E8XHl1l5d+T1zegM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkB7seACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqhUg//aUYVT/XYGlMWFpY//xMRJY4zVEpucTHC4L/WYO3VpfZ0wx1W\r\nMMI9w81aA+PEPXRX1y9+NoMTAMuY2acfs3eMKHm9nk3M4+h0LqDYSRKJre4J\r\nRu+Gc0Sp0XUabiz9+hk2RXkMIoWYmUgYaUo0byfZWC2a/gW8srgZPHQdeb8H\r\nkH7d9hCVVc7crXI6ZMn3DPql3V3pvptV6bXrBDOSivekJAJk0Pr8NAzq2XgQ\r\nR2JnjV7s0Hmh7XneLlXO+GirE5zdMNADsvIyQkA/Zm8WPJvkfjeabeWCb2qB\r\n6UfkB0pgeVmBLsQcQM5KZdmFhowXlX3/YRnlS3eVTgqeaK6jBCfsZv5j3eo0\r\nma8FeNc2MsizwAs1N1XoGUGetaCgf4gFCcyEdncSwfWGVSVu1Z2Tb1+hNLDG\r\n/fJtbrm1HLDblwSQ7FtNm7v1OaA+gY2ezW1SC94rZbCE4UkuyOlT6ofszYkf\r\ndh6frpD9qLHYdbuG1/WzaQJxBy7EZ6bEmzZKSj2hoWOteHu086gLhvnU4U5y\r\n9DiQtPQv6GK4PceovIFsSouXJmZnzywjV7dBX0tfwDp/qV6AP4nJb6kXKID6\r\npwiGiqTYLJ9+DUNYoiULw12mbQwomQy+wimZVaev39u1hj2OPCw8lzU30IFE\r\nw4k+QetyAqNTK9AEVpWq3IJbEwCM/gg3dOE=\r\n=WODI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"1718c338ffbe4be963c8e70c1265e4fa56d5a1e0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5276"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.8-beta.5276_1678228254741_0.5102362097864828","host":"s3://npm-registry-packages"}},"0.15.8-beta.5281":{"name":"piral-ssr-utils","version":"0.15.8-beta.5281","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.8-beta.5281","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"dcb4ccdb0b55d289983b92281efd50369821ef3c","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.8-beta.5281.tgz","fileCount":40,"integrity":"sha512-Mkgx9zxD3hDZ7bm/C/mtLRmKUKDGtDugo1gq9YYN38D18v1R8xEDvIDsrWomkRzHcV/1zYA7zNDp+K69vYlA7g==","signatures":[{"sig":"MEUCIANfOdOW+eMyY7FhNcnlnTprhk/DFQW4Anqfo33oFfVVAiEAmK69XHe4rpMUW/h4EQ2xwJkGGyZ9Bj6zNztqxNWCZeM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCEVAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofYg/+K1qabAnpkQ4iPS1eVlM/9ivmzr7+ERLyNPLDytP4PqtJ+wl7\r\nGU0029R+gcvqhJEqJGj5dnkz69hPd2/tO0tr3hUpMPI6Vueomo1mbM89iY54\r\nbT6QvtNZz1EfxCspzRPzUNG1NnANIVAyP6FYNsLiG50sbF0AQJNhgqpyTb7O\r\nnYhEIvi01ssxU9eqvg3W0q7p69d9xw7juABRDnQ44Q2Ct0GlU4WtWr/sIzlk\r\nolgOo4JayZ0gfyuSOrEPfhWaYJ7u47StLFY/k/DaKMn/WcqFjDWWYRW/27Xz\r\nV5X7b/VkZb/ZjavFoMwlbhd2yMBNIndCvKne7+P6i6yMhRrvYsFeEGcPY8wm\r\nAcjfXRTVoVeREN24TI7IhiQoHDy8R1yVKW5jiP0YQ322qotBB8ejqTSKGJPs\r\nRSdwQDsiQy+opf8xBmvVn0a9DrJbInxTDYWW8PSZQ9aBO2GX64tUNVohE3tK\r\nS4MKrkCwUSvpc3RXkyMLIbak32Ts+VAwXOj97D+weyR3umUhji+CNAu7Kr/S\r\ntbP5+vGiYNqKfYmXA9oY7ap1BljuvpVPnsLKYZwa11jlR0DSwPL4Kv5477pb\r\nkuhsuqBfdtexWZIVkwWBTf9iPRdiNYSnSbTybF7Gp6wVFupbQd3D7anyT9a3\r\nOopKbAq0Yar62hWeZArsat1VJdjgTNEj7YI=\r\n=IXAj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"2e9e94f7a6e4cab98bac439ac9faea95127a00c9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5281"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.8-beta.5281_1678263616705_0.9160426165300752","host":"s3://npm-registry-packages"}},"0.15.8-beta.5283":{"name":"piral-ssr-utils","version":"0.15.8-beta.5283","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.8-beta.5283","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"17b785e1d7d2770c3d660524f351a39310540475","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.8-beta.5283.tgz","fileCount":40,"integrity":"sha512-Cko91KwYquL2suqaEoRqxqwY7m+A3hN27Ao323uZiVQr4cyidaLIOZ69rJVQlTe+iNVJZiOrUdWShntbwdqF2g==","signatures":[{"sig":"MEUCIGfDgEvdX6ToKELeYHlgyMSdYrHNKrU5fF5q/tDtpJX2AiEA7Zj39dBwXCriqrkOXo8PI7Ls4UAnKxZfwHk+iFpjCjE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCEVGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpsIQ/+Og0nXz86Hs1tuUftUsPzY9VhFBa7o5wh6rIm8wVbO9rLHRkf\r\nh5W1Ms7voWJ6D6Jga7hnGEmh4zQ0+7G/v0xIE2jqhYtSfcA7fPZUYPfeYc5H\r\nvoSLZTW8PKi5OqLiUf7NJm3TbqJI5L4R91hNv+dIRveOuwe0d1g/ffhHK9X1\r\ncVx1rIqbB8BITAOP+PEoN6u8yN6eqTu9TmXQIgJ+o8MR9XjKKGRAAKxgjh/E\r\nlh/es1agkTzCkjrkGMeAjUWatZfhuSvX8LJTwIdwleZnGcQd7KPyUipUbBHl\r\nU237xZiPfPCxcQJG8VHiyMhRKKpSY/WVc8BWjV+VKnAAeTpCSPiNJDbz1ymD\r\nbc27C8u7qiMMHjyGMbqy8hLJEETTbbvohsmVVWLWW8ygdJ6xdy4ta9O/soNS\r\nGqhLa5QOO3Otkvg8NhQ1hSre2mKA5m4RDjsGf9YOvjeN6oV0zchwQCLhyahF\r\nS9BuM7QQVhdhOAukxzpu7zTCDwIBxAMWkJvbc9DP4l5RZgZsBiYgFeIVmXba\r\nSAbUG3W62BmTF0K3dL/PDUpnMSdaGMs/ODOxcsRyLqAkhTkxdqi5INHcU6hR\r\nzbWxwgBXuNAbx8nr31AWqK1L2wL80bCeEzwdLCewvLcZoVuL5WAtXMn4KNRc\r\ncQ8PZo5I9nqoSQ4ITRJwuLieUPKyH0TmcUA=\r\n=D7jt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"2e9e94f7a6e4cab98bac439ac9faea95127a00c9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5283"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.8-beta.5283_1678263622397_0.30376766186973403","host":"s3://npm-registry-packages"}},"0.15.8":{"name":"piral-ssr-utils","version":"0.15.8","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.8","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b748eab9e2b1ca0a06fb8c29593ac48ab076b592","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.8.tgz","fileCount":40,"integrity":"sha512-yR08r2UY1nou0/bIL0c05IzQNnRPckb24M3wsSW4LPI36BStnSjdtuHVIk57bC9+4kHRID9A8IS+nRxu1ucHFA==","signatures":[{"sig":"MEQCIFfvnwJ1MKkPobvjDKu5O7z8Wob3rRyNKpQ2dUH53c0UAiAglKy9zn4N0ppvfEzi8mLbSz6FnuNf+FKJRkb6ZBb+Xw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCFUcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6jw//ZocFkVc44/WD0v5Iq5qVyYdbzmzFKcnEBLtATaozWfdui6FS\r\n6oRp3X3bOE1S/o/z55uDCBGJP3iWNWyl14DoEmcygL2ywSPe9mOIFHJEp0Eq\r\nC0MkiufOW1ZSLabwGGUOLs1vFkWzGxv+f+w/HBwKR7f7Wp4N7sRMcoK0t2uD\r\nAbhxsLUWmlbKLbM/cCemicimdgiNuEhNliY0RCHQpKbLC+J/534vwIgAmG1m\r\n5NDsLrOYLxmcRmWr1DubP2bpvM8mVO5kZ4MSonXd2npzqusuyzrYQUsMK8Ii\r\nWdWwXhJkXRyBTjHsZF9qMAO9LS/5y72JazwX7kAPlhnrXXlQ1yMTvox2/6f3\r\nuB5fe5Vj7dLKwf2h/hwjfTb08vgRBg7iB0vpBF4d5RsQmZjpgW/jNqGwLNzO\r\nZgYR0d04npDZaG4joFHqZQsRjemfHpw7D8un0uMLEOW2bhlIcmxGKVZNwEqT\r\nkm6C5EFrQL7BYyGAzkvXUgK2+UgT3Hr/rwj3AzhHHs3xgQSnG3KD0PPRao56\r\nMQb7gMQvEOtPycARbT03yIJ2rBxLebGp2J/jIJC3HGtg7rpjlYMbQ7/qZgcs\r\nJnwCX5myfQJtmbrZ7nOPxcbaJFay6itO2eQ9ApByEVTNaJ+f0IlYU5UFH/J3\r\niYIwMs2gWGdsorlbA3dq+4MgQu91Gwi5PV4=\r\n=RYu3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"0d9486dedbf2a368be8c7debf9be8a8f89b8139f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.8"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.8_1678267676233_0.8719464162176913","host":"s3://npm-registry-packages"}},"0.15.8-beta.5316":{"name":"piral-ssr-utils","version":"0.15.8-beta.5316","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.8-beta.5316","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"39fa653fe80310c9c29c013f8ad0120623c236f6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.8-beta.5316.tgz","fileCount":40,"integrity":"sha512-ZLSTeveG/oqKzyG6zAJ1JK56zcRfl3nre+emAPlJvMMc/CaRoIaYv27TMYBHn23TYeiLNsaSCZZXMw7bMuGD+A==","signatures":[{"sig":"MEYCIQD0pTIUqjeaZKB4W2WbFIItnt/uAoIOhR9SUjYOU7vxgQIhAOcoVCqxMrlXQDApv7Lvrtk/Im2U2lj+hMrGdR6DxaeV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEYE3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoMrQ//aLZOVe7dEtq3cefzlpr6q+u9XpAv/RJ/ScOsQ9Y5qrvpqXRa\r\ntNQnJC3eMBpHXxpeUxctoTQMLQSK/hSaqYsNo1vw9bg8uF1C2ubKnmWAVAk6\r\nzJCowcSNEAMkpgbrwX0wP5v6bxGNonRvFWbHFLgLuYVlU+pBBqjPj8Wter69\r\n3ZTG7jHHMHhQ3XEcK0Zn4/iwd1cagK0cB6y9lxZPNjq/sjlN/gescF1QiOD8\r\nVSmLJW+io63zrjMWKIQtyeXulOxlULJl6zkfEU9pNmfiDHEYLKV1+CsB5kzL\r\nXon4xo4DHxwZ7CxyMY9y8EsXVxhPxIhEG70FvT5hcHLgTkk23oLVbg6CYuhx\r\nOzrUTctKdVTBefcsUQ/l73gmruAiuYqjzfafLqXN91hF1nPpyz7XL1U4dGrE\r\nbzzxrH3SpLQeDueGQ/lHanx3D7O2OVMc66C7d+c1YSGnhu6UxZslA892xeN+\r\nQEDmKZT+yEz6f1aHkELqBZWHYxtjdZOASHejF3Wo3qbexWszmHXmb+GMMsc1\r\nGfluCvWMOSx4bWogTNYgdkbXya58D4grL3IroU4/zLVxmFy68F98d7p8srf9\r\nrZPjwtxQHjzz2U/tV3Janym3X+n3FCthLkE6MRO+xvRkkFnk6BaI3pJUoBfF\r\nEMv65d64IBnfrG0HLDsopj8+y0YaqjZSCi8=\r\n=6nIV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"62cf3e403a817c02836c78d987d04d1b987ead3a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5316"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.8-beta.5316_1678868791105_0.9019702389367956","host":"s3://npm-registry-packages"}},"0.15.9-beta.5384":{"name":"piral-ssr-utils","version":"0.15.9-beta.5384","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.9-beta.5384","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"bd4923a846434845a72476e7704092a03f20632a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.9-beta.5384.tgz","fileCount":40,"integrity":"sha512-yMwBcUHXjCnPu2X9DFnOlx1BJmltO9se57hZA6ystXK3p4XKs+qAbsatsO0FVQe1666L3nAl2dpamei6WZ9mbA==","signatures":[{"sig":"MEUCICSxgndyrVtS1m5FW32ZHsWmHi3uphdnEITWHM6nzomUAiEAucwsglKBYc5x0ImMzEk5uGS9ZN9RT55/g8dFUFHAQ8U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJAG1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpfuBAAg30KUHALbKxNcPPo9C2jKCmAa0MMZ4mg++vAVjD8mqiD1eT1\r\nR4fJLVXj6ATtD4iHWwCu79UHgqVoc7a3Kh59UEp7vX3xXTrZhQAe0vlTWXPH\r\nwzBCjoqQn7jx017E3X0OvgELm5Fz57JYkQIdt22/LLBouiYj41Z+3NSAK3/Y\r\n9AV/vhMuAhhEy/usnHOICq2BFd6OrKvhLuTLaKvmfrgZDb84AXHBKcraDCJM\r\nirqN0lw1xjHkcz/q33q/WzXCh1hEYacgeOL02J0Ee4pBO0xfSaZyPEAkzwPc\r\ntu7Dm1zP/rzWhuHs3TOu9FElJCWkuNDU8X9apgo5VqXLe6oZJML85Ympzt+D\r\nYc2Nj2yYQkfMgGsYPE2c0x2jggCNyLm2BwW4H6MrgHetws5NSu0SE7JN0zQP\r\n/orCprNLaE4k6f/S2ZHjqJgSn7MRlCJuG9lJaQCViackPjHd06WNc5p3dMMw\r\nRU3xTz9yX98qS/q7N5eRTNa1KJEpcD6p19MqAAZLJ7eSdVZ54cMTejlfFnX2\r\nt3+vWYERlcyDvdr4gixt+MIBsafb+HEnzOr8Pe9SOvOCJuPBlUwjecQVMOJt\r\nP3YmY+SAhaDtrRS93ThyJINWIzJ6rtRcsRS7k6LVm5QOzstoPV+Idf6bRSTM\r\nGcfUj2okPXDOh+pDp+TpWE2tXzB5LrezcgQ=\r\n=WoDi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"e1fc7342dedc2c0b0f099823e15d9e5ac4c641d5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5384"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.9-beta.5384_1680081333348_0.1681788631195429","host":"s3://npm-registry-packages"}},"0.15.9-beta.5387":{"name":"piral-ssr-utils","version":"0.15.9-beta.5387","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.9-beta.5387","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"93fe100a25196930ef731811fe6e0e5707c44bb4","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.9-beta.5387.tgz","fileCount":40,"integrity":"sha512-9NuHqgONHWafRYJN1YqZvhK9Os/AUOzf/SVl+padCIv2ax1EI0IjzbSd1U518oLjvW9rcin1L3uT5usJKgWxPw==","signatures":[{"sig":"MEUCIQD/qxBb2aKWjqlKXO9q+hMYJWOxxaOyWUOU/5vkY054gAIgMQxmdlCGbivjLgpiygA2juaGHaewljJJi3W2r8b5GCU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJTjgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpfFg//ReMtizg/yj0vjMOJ5gxh1RAlboBky8s0Nd6niaVNYKX/auSF\r\n86YjnH1efz1qoQI8wor2YK7NYGvlMERrFugIo8DBBBXW69PL01Z64JZ6EO0S\r\nUzk6G/dAz+gjDjJBIZvtXCtKbWfG0g0rDa4Tc7KfFF+5eee+FF3ccp7EVPiT\r\niFm5R8kksqVNxb2pOkB5WUlv477eA7Rk+NZRajQcCCVgAfULprU9byXf0qSR\r\n8UJ8fBsJ5jf0ftaJ3/lD+TJJCWwOWLg0z1G61N74f3pDF40MPWaz3dgMz8ZX\r\nFzDRebDjnS7m3vBWx8LkDlwQY5E/3XMTOxRZUEFMc6BVnv40VGoYxTFlfD0s\r\nataoNnYN4raChJ88xThbb40VpLoBouBXsyNeZa04pCd7IjfVlCH1ajq/Hg+i\r\nXuTW9i9MNObowVDQMSDS5S1ymeJUvePsILIBGCQkkoBE5VO+nvdAiySifBFi\r\n/SFOzUKBxSCywg8vaWXb5O6XBv0l57TfrZgDgI1Gxtgd7InnjxffcM/pqFGr\r\nwFq9cndbvpEiHRswmfvdFRzDZy5ZMhc0jtlhYD4Wy0TkXeTjpuk2wvUfl4BL\r\nyxuJPW52zpS8KrrhNrSuCjXlpj/JzSf8aZ0SHKT0xNINQd6nZbejeXec1jtc\r\nDHO6Pz5/AHnHoVUHEfkmrt7OXqFsgQpSNHA=\r\n=raFs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"7e8a09cd29f25a8986169bad38e270b95be0059a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5387"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.9-beta.5387_1680160992577_0.9305109200651909","host":"s3://npm-registry-packages"}},"0.15.9-beta.5415":{"name":"piral-ssr-utils","version":"0.15.9-beta.5415","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.9-beta.5415","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2b02c3f9200bf6265d972a3bc626cb16ca738f68","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.9-beta.5415.tgz","fileCount":40,"integrity":"sha512-9NJTuMDinQ1R1WrEFbCzlGB0mEHiBmjNXb7zBJrEpTUHnf6lPkn65V44b1TYwF2ybpp9d0rzfI5l4h8/KMWxdg==","signatures":[{"sig":"MEQCIC+VRCZJnPRphJgORhjNtfJqn6fKhKl3bG4rC05jcSEZAiAmT4iAzfZFbdy1Z2+Fhxcyk/DVhdExX9XJVGo/QY5oNg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkMJruACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpLTw//dYu7qe3dyo9b2UhsAhxbsFJtda9i7UlKihplSZDNSDCljDLh\r\njcRphaG/Vq+2JrdJvGx5wnuj6xMmjwhewGUmXIOpOfBoSOll952SfbGeVyzJ\r\nWwn3ZRrKT0T1FTFo8UU2IxzoT5ESBfYHWp716DX+wPkicaF3wJKtWHCNyxgP\r\n9aMVWbHwxXn2G+g4clIvbjdOTuGeYdnG1cAm1WslmnrHi2PHedh7BiB4SC7B\r\ndL8CfWf2C4zy7xf1tX7LAuNAE2FuLQr8ltUMCDXTV/m7K0W/l8dU0uB2l3Nh\r\nShYusDbfSGopLQ2VdHnWJHZkIyORjidxFzHHcMvfgx9u+jX4voDpnTj+5DSH\r\nICYPvJ836JMWRtVWISzXtIwXz+5tl/Y3umh6upl14P3gjHS00VQ+9ga4oq7G\r\nuUghwApefc4s8NbNUbaifmdYhhNh0Hk9BUWdEBXL9TBw2lkVwEkRBnZOp1T4\r\nOuZv9Ph0R4qa11pMKc+PnTyTFvrwe9xfKKp9/Kii6ZXYs7ZjSkNbdvJhHR/F\r\nbiZ8V2ujyGoOW1E+v5sLIwdyn6FC71Xnl2im2DINP5j2mAS7OeluTONwF4mP\r\n6mHUeYJ8k08+o7aRWmi7jSwAzMip42RhG7/JepZ1Xjdmt4TGaXl/D+I3Ymi8\r\nfTWYHuIKzZzrsjJNRR0sQ8JtLN8gid/Rz6U=\r\n=+4Cg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"85149fa812581dc049a38da51944099330f332db","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5415"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.9-beta.5415_1680906990170_0.8109172348532339","host":"s3://npm-registry-packages"}},"0.15.9-beta.5417":{"name":"piral-ssr-utils","version":"0.15.9-beta.5417","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.9-beta.5417","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"96170c102a5323517f37caa0f59be17933f08b34","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.9-beta.5417.tgz","fileCount":40,"integrity":"sha512-jmZVvV9gnVa5mkrIyOw2ODklJja2/76Fmy21o8dpLrQp09zPcciqz9itticXx1Cl8yKlrRCWpY4qcw9VIQQ24w==","signatures":[{"sig":"MEQCIFf6tRub8PTacCbWBXmCtg8n6pRjUwKCYuBaO/j0PSwrAiBI6B81uNgGO1YlcaIdJ9iTrIGpz9GjWEOYsnD63fRRiA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkMVrpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrREA//XFA46aRuAPSDE8glCGl8JNrfLzwE3sGnUtYlX/63thkG4kDK\r\nFCHK9fZGVaWSUJlIXOcAymOK74+12lFEb4PBujVPaUigJXXyNg27H7A1QvDX\r\n/ChtKsdTFngBDr/6cysQEjXX+ntUOfVLlfAJhOHOMNgO7sgCajDR+z5aQW1B\r\nKyrY9G+XxS8ayQhAiiNajomJoP+xeI3Bvwza2JgY4PvCR4B2rbbTbewI2lnw\r\ncr5MktOE1uDniQNLIZpHSq1gwQHjJ/V35s8bBUsRqDqjgVZ08MautgREtXx1\r\nTmBdA/b4R1MRiRu3J3CvUeyhJiRevVFKTaorwMkTWTpHjLNn1SvuroCGXG25\r\nX0YSiBYsCGXo+MV0vq19ONJaJqXGeqgT+80fzCaSF1mxy3XFmDFVviEcEH4N\r\ntc7NYg4ZezWSmZkDWaNMWA96t9q+xC+EPtS7VkWOrSXYAe2UHBbyoBjXgJe1\r\nALkTvIzjxMtQaNkE1lTYEpQInjhCnO3pEucXNfJjnb5/LYAYJDh/rTQ3qbDL\r\nsn3F0V462Q7MbFzD2Szxm9hiCubbes2aUIDrRg+ChPcj2GSGXquxEUW1Rs1j\r\nAZiafCuVaoSL4fE+UifqzLSlLLa6vHPSUBxEw0IeIeKmSa36UDQZb+Llqpgh\r\nd39H2Kl0XRvDh3H6xC7ovlXs3UWV7k78PBM=\r\n=5dw3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"dde0a115d916010beb178e29abe04fbe116f63f1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5417"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.9-beta.5417_1680956136935_0.006281678222620712","host":"s3://npm-registry-packages"}},"0.15.9-beta.5420":{"name":"piral-ssr-utils","version":"0.15.9-beta.5420","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.9-beta.5420","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ee983b6c4a05966a3a6bfef8b91c9d0fad9c3cba","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.9-beta.5420.tgz","fileCount":40,"integrity":"sha512-Di11tSUJLzN8TsykV6cypmX1NGA/adjFnWcZJD3XiTE5ZrRYwLfuWrKQqdH5CJfDguG4olKOBIBwObfn5FI2+A==","signatures":[{"sig":"MEUCIAx3uxoe7liDF6hG4vXSsvXtnUW9nI5f5LTQfOX9nJSXAiEAy1kp0lkE4jHbwUbUi08EUtAALOL1K36RJWynmEWXs6o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkM9SfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqwlw//YU09WNdgVIpL3+JVIVJO/r6M7kp1rgvLL22XwctuxV8pAqzb\r\nUILtjFtMVITGJJ0voO6rDCm1ikKSv/A1deh4L30ZRwXoJpFVxbqu2lknt9J1\r\nigTs5halhDanZNxzoAw3HgLq42MZKodzlep+sA5h1Zady4pTXs11T9oxpDeD\r\nmZYNwS40cwWQP7b/H03Qdstbj2Tm1Z4vSIPF6RPe8vjbIxDAmQqDM7LzCqLw\r\ntvF8xIwIeokbsytOFJN22C3/LvomBcEOvJvL+M1/2QaIYldbDVfSFwGS2X9v\r\ne2xL0TvRUDYCNwWsEDWcGzVZsWos/tI/qCxqGiCsWlzQv1CnHajoLJt7So8W\r\nRt31o419tOldCO+k/Jf016em3F/44AUUtrL0xqyZZayExhAKgHqC4ccO8xUO\r\nhRIxy7PLsCzun9xnNU6eVdcSZmXWhFbTTPfxbWIg2rF8oLHlQjh3RqTmGxIL\r\nAdyCxWYGO8Z8B2K2EZBQZP2beaAlJljwthUY2tRQjTxAN34H3PKYrjoYtDq9\r\nLucNtKjXP8zHXbHFHef+YXERq5rtM27yoFdnr8b+BpVSpsiUndMGi01S4RgM\r\nBynwuTDkT13h6ZiEnIzxqVY4T4TeB6H1YwUn/Z8U9SoGYEloPHpSXDUyuU1A\r\nD90o6w+faDBjlxlfaOV2RUaDXqZZ7rBJBhQ=\r\n=Ol5R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"a4b6f7cb2d3285e0d486c7951ad6c3d6484b11f8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5420"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.9-beta.5420_1681118367726_0.6202022353645678","host":"s3://npm-registry-packages"}},"0.15.9-beta.5423":{"name":"piral-ssr-utils","version":"0.15.9-beta.5423","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.9-beta.5423","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cb884ecee1aa60addd04f5350f9661df182bdb5f","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.9-beta.5423.tgz","fileCount":40,"integrity":"sha512-jmXkHgK8hQwAzSNg2v1lqTppYhGjPfCTegHQHGpcSBbng4/9GO9ygGF7GwL5OkKnDoWNhJk4CTQ94nBIHKh7ww==","signatures":[{"sig":"MEUCIFNMBhOagvpoWBBHwIZucdX9Lu+KXJ0BV14BJ9OIGovTAiEArOLBs0JxVDSWh/LM+CbfygMMH19eOaJfrO33bNAa1wM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkM+9pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmouRw//UgqES6YAt3OHxtR9f4MDu4rKGhBbLhDuXsmyT3Ac2vkyOygC\r\nW/O0wGR95e2y1BdFMeMuiFbu67ObghGzaOn3JPo7OTtYS0BSwIjEjWUoiB+a\r\nQgTz8iQGl8yPagEwpG8I9YTDI7p9hUog/NR9Q5od44AWJUaZ8Ki7zP67ParP\r\neyhrFktaI7VRyj6KTp6dDkx2DX44xry0DCIjvxRZ4m4x48J4E5i4fyl6EBW3\r\nO+/nRWbN7DaW7Dn0vhZKlrwVKOl4muqBxxdavm0zF6s3274kq0Js5U30/JDh\r\nv0jH0hsVkCtZxDhBQeTYKdd7xAhatillLiyruLgCwt4ABd9Tg3rBKdYfBuhp\r\nzXmBo4G0IFJrGjUIOFIca3UTLPKiANhUjy9eClyRTtaL4sXxzyOJ0PPnnnCJ\r\nLM3YLiEk4KaiZGVAZYb0aML8MEzUpp4B2QsiNq6jAPb4QLnvTpQZq9D4o06S\r\nDZ1aXIfG2HXVU+TJGoLqwaN4TwAyMqWZh7+SxGd+El5ICi5PUZhvELW1fIGy\r\nQPN//ZoZgGX7RSX4QOL6A6XIF6FarnrUcqXYBduc4YKjC0kmhhLCGP8vN+cB\r\nDZSkUI+pV6m5neg2qJ84Rf0JvwlXisTqx88ywsClXBpYV9iDquFiaFoJtZqH\r\nMbRoYI6Q6e90xC06lzp6GJjaGz0IKuw5se8=\r\n=+rOd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"df7c927d3efbe8820ab9ee7969f5b1665a1bca40","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5423"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.9-beta.5423_1681125225004_0.36663788747017256","host":"s3://npm-registry-packages"}},"0.15.9-beta.5435":{"name":"piral-ssr-utils","version":"0.15.9-beta.5435","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.9-beta.5435","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f1598c22f4a73db29956c8365101cac8dc25c824","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.9-beta.5435.tgz","fileCount":40,"integrity":"sha512-+XlXdY6zHYd4RYbXEIeNF0slQaLdKcAqe4k5UjY4Wq1Qwu+i3rySDCVpXO0h1G7ScJatTKjg3j4TyCDinuFWLQ==","signatures":[{"sig":"MEYCIQD9Iw/oja8Ga7iZa1XUMB1jVMyO+uaTuRvXC7uR/FsFnAIhAPPBTJ077/201fAYJVNmCE3PRP/iPSsTTzz2O/dOUa2D","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNShKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpdqA//aoSVnpC2JS4pktqInbNJi2SEjcWsGZ5ew1d6Fj4siv2LPaPG\r\nTyHceV69y1wBZ1F0fGKBKPogzkyVDB9Mt4zAGxFNwLC2khTg787iZ+9uXZu2\r\ndpAa1XNP6E4toh7WaFl4cgXwiRDaswOsVtpjlA0TaDmld3xS2y6jMDQn5bP2\r\nk787D7D30ksKf7WLdduMPPA34CS4NTNliRk4A9Cv/K5zBxTMPVsLKtuWKZnv\r\nhTvYN6WL8Qw9erBdNXVa49mY5BW1Uqe++62j/KaS2SWFjBqr0pbkpJ5YSzHb\r\nTCYewJsse9HILdQ3JaO3rGjqelVm+/YgOzc0P/N8rzmdx3HFYzEeUmLSkGaZ\r\nZ8r+HAfpk3728/lDY209b9ATqeWGwpyDdADTVKeMoPrrt2VJi3snJsVkO6NE\r\nywruz6K/Cvuqw1/Pj/Pwx66oGX/oeXhsWPidVoc5xP2MHGBFgyYIleU2z5F1\r\nqfd0/amj1uS9XzBsNMxHcmPbLKmkTOCfPt/1BsWKfp3I/lNlWJisgkLPi6WQ\r\nHKt67/TTy31vZSUQ1BXy7eBwZeTVoB1dy9KHblBSCIc/McsBnBOxG1tTVkC9\r\nOVGhiL5W9kkKonHaHhqWyvyilvYGMZ7RyINOX9tmti4x6+IyMZqzXus6cz1R\r\nmZ2lH8fgwu8NNSXHGhVniicPPZNPTEUJxMk=\r\n=7SI9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"9a36cc1b229556a4a0fcd7075cc51bdfd6190fe2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5435"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.9-beta.5435_1681205322042_0.5821437469945563","host":"s3://npm-registry-packages"}},"0.15.9-beta.5437":{"name":"piral-ssr-utils","version":"0.15.9-beta.5437","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.9-beta.5437","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"200e76247d117790055ce23eed5807d83308f3e8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.9-beta.5437.tgz","fileCount":40,"integrity":"sha512-fYlZ+1kzIGcrKueooJZIkR9fS3FoEHmmeYD0bbE5IZrr1PySDB0gkXEFvgCDIgAwRpBOhM6yElE5j4W97aQTyA==","signatures":[{"sig":"MEQCIGROwfUuxg2Cj2WdjX12vnOoLUL6B1L5eKVlQDVtgrLGAiAmwxYjkENOjP2cTS5xYPfuU9u3L/GUiUjl/JdgNao9iQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNT2BACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqv1w/+N0ubEo9OrG2RJZVQLhIj90yOqssKtDQNGbU9/BpToSwjezwv\r\nQWvddr+HWuPKTYpLj/RT9ZsOf0/+57ZreiamUuyViWP3Vlk2edLycCVmB9q2\r\nhibYdGQ/8ZVSV8OMvs8xuF2zRZpNWRi5gEqp9s78E2cO26r8VXlG0vQj8N4i\r\nFLOwH3iGs+I5ODglR3y+132h5RJJ0qzpMbcGUqlueSRbabsqp/6JWXD0YL3v\r\nYKpqRqB7pHb+hLHzf5iqE4ag7G865bwPaJkSST46FJI1VgQ+pL2AAGpj/v6p\r\nK587IM/t/azyirF2eDvrsqva4WITcyi9aWWnPdu65q0zhN2HculPWiujA2t4\r\nWXNuDPFZwyERSpwljJuhgipIeEX5bO1D1ZAN7iIwjPYE2r5MNz/bp4uITk2U\r\nPrliiv+TNPGLzgrD+0gJi22GVSjb9z8mhWMmw/7ngZKNap+Agx2JSGLEsU7o\r\nhxOFaLK/D4ePliw28FXv2Oh9RwSJii3O+sEhNVcoQaxP3/r5v7x8NQTtCfqM\r\nWym4ZHrX4WngXGqjrGP/am/A2ezRxoO6WDm6uVe4E2L3TSxbB8N75VPomm+o\r\nFw5IJ4QRnhMRCSf05/llGkSpcV3iJ94AQlOBi3D/fvgg61TW4hxxxsc+2bfU\r\nFrofzt/SMrtn/ZU2v47E+YGbNAVA+zvEJKg=\r\n=yW3R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"f8f4a7e9d40f1867843e52379c9dc29ee737f409","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5437"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.9-beta.5437_1681210753267_0.9520813553347136","host":"s3://npm-registry-packages"}},"0.15.9":{"name":"piral-ssr-utils","version":"0.15.9","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.9","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"51d7fce1fa12c0000553be150c4d885da0dfb4f7","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.9.tgz","fileCount":40,"integrity":"sha512-Fo48a56RJdIyIlTQ9H9kc/ea+4T3T8NUbhkY032nJjSF1knDGsJvOv3WeohoTKbLfiXja6MUHOoRp//AH701pA==","signatures":[{"sig":"MEUCIQC50QOznULJcyYe1yCX6ctS+Vj1iwCb0dv1csjlKLL1LQIgCJRxI72kPCgzvUeYX0JOQ3Pl2296DvO0ef1DybCDZv4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNaavACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpTBQ//XIQl1+DFp6Op15C0gHGwlww9aJY/ru1nRWhhf0swiFbG8MFh\r\nCL5pWnldtYe+RbO9XnAu/LYmP+MHjMoXLWnFgy3eCrWEHymGxcArXcclb5tJ\r\n5daK1gdPZaqRN40GjjUHWkv7gxWcK8GZ2LAoLnSCZNcM2hZnz5G3ZUeWe/3c\r\nast8WE/vc8OBYw8XGcLF3dm3BM4ccdSJZ+9EAYG3rkOhWAStw403RVbL038s\r\nadra3wwmej5pGnXVdK/wJkOgee6QnUg3fVf/TFbpYiqgNG6TujFyi1n+wJxz\r\noG9TgNSevn9pn8neK7E4pbyI9zr3tNdt4tihipZot4B6vfyJreYxPoMKd0Tj\r\nSEbKjq4J1p8QQnRfw0MOuWDCRAmV4QGhjy0WC4gVoylTCCl3pXewm5RcEJCI\r\n8h0RPD2fSX8ATg9T1WcmiCIn+SabJv+gqLMMr3PZHhJ/rbDgf3+WMAFlBiIt\r\nB6KjzXxXRisPJcoOLuXCpB/MChRxv4xHlth3fquC+4+i/5+9T408c/gZNaER\r\npo/3de4LODuaV95V3EFw325vX1m7+CFcHajJ+wQdidrEpFK0oZv0/zxeXuPr\r\nmNJtbPt9GZUBhOwJ41lLoasDZfQDxGIPcgIejrbakZk1zuW8fLdFpkwsTDPR\r\nE7/vSxeFGbawcNbQvDwXT2psPpbz4Fv9yTI=\r\n=a2QI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"aa0d6dc1feda46ee7a459441d6bdee589f49a1ce","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.9"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.9_1681237679615_0.7964808410581159","host":"s3://npm-registry-packages"}},"0.15.10-beta.5447":{"name":"piral-ssr-utils","version":"0.15.10-beta.5447","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.10-beta.5447","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c597ee2927b978af8561a2557e7f0744dd084598","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.10-beta.5447.tgz","fileCount":40,"integrity":"sha512-8tNbMKh7P5+WXwq54OjpTFPo8wJStQh0oAS3Tjm7YGfggLm3E7JLvr9XgOzvzlgSVW3Vr9hUOCRDkqMwwgOXsA==","signatures":[{"sig":"MEUCIDoDjrd23rzk/5NK5ijoYFpV0cBKFL5Jka3TTkvUvhwhAiEAzsjRak8boh0EI9RLuA0FzlZYqsud0Z1dtCxOMWv5keQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOGMeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrjqA/6AmnPgmyYh3AUw82GbyRAZtNBFX8De2YJ9Ey5u+/9ZCqmD5iA\r\nlBeOHfq9yHz77QQ+NL0Fd7NS3QvtragaODzK+udM0l7cmz1wPT0kiNt9f6gC\r\nTSSL1UKDoZwq3OC+RbtopCuctITvUt6f1SFMcKiDXnIMA+b6+EiHPyxmrT6C\r\nMEsQZ34U7pQ7lpZbPXXA/OsD4ngcd4BRV3ZuOJBPsOfWKpwrW1lf4Gv8RC9K\r\nCFwm3ivdH4cuARKRe/yHIqmTSUF2R74AwRrQOFD56S6kgRbM2xyT1/idX9q+\r\nfP2lr6ndK+AP1HAUMhML8UeKHle+/rpsd5qw+UntEoUxwN8LMEcJq39OtC/c\r\n7FIxokCyCUfAmIK9GR/5Op9cD1FK2/pqgO7TlndqsFjzwXHeeIcd8WuF+hRR\r\n7nHHlV+VYzhhUE6sxUxEv/jgmTEZnyeVgS0LKLsgEXL5Irn4Ph3N5qxIcvV7\r\nffDtUznv489aABWFhRFJJ8q/zTa9yC8KKw5MwcHlW1HEJaQ91cMpOhZZt4tb\r\n6fvByQEqSKLO0mcVTXXFkjuIWCFMZ+4/AD1BMxVnAJYKqIsWZWzy3FeEUWW7\r\nqQprR1gCvxANPQHQW7SInnYrPEJquJqXhJ+4lo57Uybm9Cxt274onjtP1qSM\r\n0MYCphX1N421InVfHxBqZojSN+T9z43mqws=\r\n=u9AC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"29c46cc421457235e89b8ce4e577b092d615a66d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.10-beta.5447"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.10-beta.5447_1681416989698_0.6626300195541259","host":"s3://npm-registry-packages"}},"0.15.10-beta.5457":{"name":"piral-ssr-utils","version":"0.15.10-beta.5457","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.10-beta.5457","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a75b13e7a94d5fef3de0dad04e72c3cc86c7ae4a","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.10-beta.5457.tgz","fileCount":40,"integrity":"sha512-BzP0c1dScQ42hTUOkIopJ3C3UJi8C0sorMLRv8dOW6yxnRWzJayPfXnqQYWGk/G7tS6fBFQUFJ33f4/ClnFqHQ==","signatures":[{"sig":"MEQCIBoc10gu7HSLYG2KMjlWUloU9iiGGWIjfUZ7k/TJ+6ISAiBfsdPjr6oC3o6rxWU91TmMRnGdjdHZNrvPR3carrGpPA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPP1qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsiA/5AEETPITS3SrbIX4ADqxFy86K/S+n572PAUX3sFnPBMetGchY\r\nm+M0KyzW5C4GbtBRDoR8v5qFYWdtUVRUKW52EXBTlng9urX0N1873iXpVLnt\r\newYR44gz6UnFaVCDL3RzKginnyU9JFA8SFeTaD2Pd2gkuRqaBDbSvasZi5nk\r\nq+0TUqlUPbk/qCgxoNFgNn2WTr3f3kbh1I6faPRbLHu1q+T3uqVOuQ7QetaL\r\nj6J2bk5cNBqTRmdk5DDCNOAUlmOZyR1neGek002JMdbzdXNiF2vg0s6pu7zv\r\ndzO/AV7XGAX0wG0WDdyZesh48y5cWRmjC1Sj6zVHaqfnrsAWMtqx+uFNLFIZ\r\nxoW5sB2A5UBo5sdTg4Ce6hsbovDG3xXm2L8F7OFk2KY0btTFAnf1lcZmy9Bm\r\nKUXDvvXuNSt7mMWo3we7VeaXEuCKlbIeIsvaonmd4BrmHKoYAq7IB8szDPTR\r\ntAiaW2/qccwsUe6T3KmnpcusrU7YvrCvR7nSTF18PtIWx9mfDWspYUAr0hYd\r\nnJSe34YBMQvk8awVfyyoVupuKefq4pUtovKcsK3jSOPqyndUvw9z1iwAZTeS\r\n5Ss5AK3XsXA1dyDUDnaqxDXS0najfCj1G64K2mXAqcjA5h9HxAZXYCuf/wPt\r\nKNM0xIvLePzIAo6PIh10TEmvxABXMFr0nHQ=\r\n=hddi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"dd199d0645a2126ee2c5be59d725b4b752eac928","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.10-beta.5457"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.10-beta.5457_1681718634586_0.8662695092417041","host":"s3://npm-registry-packages"}},"0.15.10-beta.5462":{"name":"piral-ssr-utils","version":"0.15.10-beta.5462","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.10-beta.5462","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f385f874ad788b43e12d345ef28bc219e5957ada","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.10-beta.5462.tgz","fileCount":40,"integrity":"sha512-QLnl3M6a+yxV2mYwbCw7QDZqsHBZ22OcyM67Yiv2o6m6/ZNSIwe9gQqXu1CvWJmesLxFDS4wQz/NjiVdXD2yEg==","signatures":[{"sig":"MEUCIQCJ9diBDQovrGO3b7bO8P0v++fK7vyyhCHoVoMfksTuFgIgITgWEIlFndvWsin2CQQy1MwARyE6kzG9nG/ta7k1xZA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPltPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJoRAApPHVPy3QU1aTh0iYf00eKw7ZRtaZZctbLxu4D/R7RgImftKw\r\nhf+mhCFWT+SFDkgQLxJnNhgdRZ52OTEqpSY6M6Mz9IvqYEQYIyPLGVb/qbDO\r\n18zElTh2Y7szP9j2FsPLaaQKgoDTe8etAJ0rABmAozm2tYWCu5yTWf355CPP\r\njeQnj0gw4Cvud+ycehBWGVm38zFiHSCAwndSaQKL5PSo6m1R5kquIrn9thjy\r\nA8FfSw6hbWl/H0KZtSdXXAsSBNbIckomNUKPtEHB9JBApMQ8++NiUDDdUNTz\r\nwapDGbog9HsvyNR1N660NAqdps7kzTvR5mT701pYz2/7yNAuNuX9oZocuWok\r\nzwu5GqRUGaEw9HsATTDDlElCbiIoHT+4S3zwSCXI8lTLFkaBhgkFwuSImbbw\r\nvHdT+jHibuff28NgXvbymdBGqnZNeeEiAFXJW/ejs+xWDKwYftBzlZDHWJ92\r\nrOa8N+Hz4NGcFXy+J2PvtME6gyHX08q25XH61xU8Ex9bjvNQMNga6vYtbqi0\r\nMceOExi3wAwIF6Q/jmi6GScV+iFw6pPGf3AZHcTrWGWmvz9ld72Z2S6pbrbS\r\nBx9bLT49cSgvixXbJBGdCQPCCP/vQgLqwQ5m6mevpGp8nLxGKKFV3qikhovZ\r\nG0ZXubVvf8jnp+RjeRsgrwKbkx4XQ8GcjtI=\r\n=2PBT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"11acf184ca5d2a56c7f9674b12aed0773489ef88","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.10-beta.5462"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.10-beta.5462_1681808207428_0.6196370677313472","host":"s3://npm-registry-packages"}},"0.15.10-beta.5463":{"name":"piral-ssr-utils","version":"0.15.10-beta.5463","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.10-beta.5463","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"28b12f47c3224f5c49d6a36a3eed533dcd4bff3d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.10-beta.5463.tgz","fileCount":40,"integrity":"sha512-fSO9UBRR/6HclzTIFHculO+kQILtBT+CR/lh9vKAlfybCVysf7D5g2ELfRDUlzKL3YDjlvZG5yvvyTfWE0A2Bg==","signatures":[{"sig":"MEUCIGLRgA1yq7DsKFDhtW5otFBDXGDybaJqggEaELAfB/bpAiEAgo2SkybTtsYanb6hcXka7MqY/I0DIAmf3G6FwDfGdng=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPnNxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoxBhAAgrJ1R23IG/9PoweS1q6Jok8ZxJtxpsDGN3m0Xvf1T0LCruXH\r\nUJBFmLWUa+upAyCBXHu4e6RILUrFjFfF7th5uRxck1xR8NqUBGu1WO1V7AKh\r\nAlB/z//e83zcozYmLd4dY3POnspUii9AENFqDEO3y04cRquv+4/KFhU/Yg3C\r\ntphPhRwyek2JATR86ISusgWEzX3McHuj8MQgv1cdk0oG63kCTgcn0csuOhdG\r\nk20T3Ov+hyWGy5jV+oIBS0Et0PUey7RvZinPkIKpB2omK0ILYm4iN6CkjwZM\r\nqW9I3XHUHQSPVZs/Q9MA2ZfAqOt5Q2BjJnpyaCslOGGSoHaABlWSFKDbGJf+\r\nJVwJc7DH4DFbp74sW71z8gZxCKr3abdQb3K3q+TIGTS19SeFgCXlVk3W4lsW\r\nSEL7igNNnfTY6s2Wu1IO85aQ8dlEpnJLuQM6Lr6OJqvTTXPFaz2QHkAvD6SD\r\neLujgR/iqkbT1mNdHqqNcpAKY/kYDuz7xsuZBD0zMPnnilGbt2tIiUPA0YnN\r\nVIHvdO/egCMz+YkJMSu3InhLROZ8VZEUvhBBAkkznqjgnLOTX7mo2EiNLP5e\r\nGqV0NY6CGBxoK1aquKMyjQSwd8bDtHTIBnhm8f+bHqvvYaNIAqPjUp5WbFWD\r\n7cFtCgvAWlQdyxZQl5U1x8IwYwbdXX22Zy8=\r\n=YCto\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"49f28a0509531a5f15c763f1d66a4aeb7b8e823f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.10-beta.5463"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.10-beta.5463_1681814385494_0.44313107515204364","host":"s3://npm-registry-packages"}},"0.15.10-beta.5490":{"name":"piral-ssr-utils","version":"0.15.10-beta.5490","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.10-beta.5490","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"14f57980740afcd35b2afce419ac4c884a5d2b83","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.10-beta.5490.tgz","fileCount":40,"integrity":"sha512-yMCHlO83s+GsTGJNQFngs060Q3IpS7a760OS0VIqibu56n533qMvQJ6Ph3gbUy7daDrGeB2lEQRchrh84EEYRw==","signatures":[{"sig":"MEQCICvuEUwwGwr+NTTMPeGsPcZMLOs3aJJJtZsmRuO/LZFOAiBcej8t2UClKY01hD+oFcRIAPny2gT3OxBZmvSvYkN/Dg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkS6AFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFPRAAkalFZuWYPXQJk+TbQJuajSap9WHo6QNelaFsofWxg7PR09DR\r\nFb1uW4k0g+C2WS2glrf8kn4o2LQ2Xl5yIYve1498KykmqGxTmWQ0FAskDRxa\r\nek/xb1ZsBLBPV+nDBXKFxFsBaVf8ltkFrM/O1XH4lAt/YDsPEDdPU5nRqzdh\r\n9MfLgxbGe123Mi7ZHtoa52Q9OmnMchxwCuny1DsK47tKqMvwcHJNv+iNyIQ/\r\ntlp3RwzDIrJRnuwqWhAtKn+4WVW+S1L429O0JQdtFdVm3etlkcLZ653iOeQi\r\nzdNBkdoe/t8GoebeVAWKtbAnys/5vZn6w2+VTVH+91//5+FfL09gMYRWj4+N\r\ny172gBaZdrnaoK6XAdrCsh1l4XwDhcpewBl2eTCMpe9LXo3cKfwehGfP/ZTr\r\nj0TxouE6WAMVjPH1tX36tWh9Xu74EqkVSFPNu0L1VlGHcDQ71lIA18Xrj938\r\nMH4bKifTI3J1/V1klNP6JyFASR4GhAgdxaSO8dsza+lc8Bs768TEUvVJTkJ9\r\nhIkVriUpx8GoILT8UEY4OjkCYie4K9/nQPfutqhaWLrW5EaQjp673ExCQJ6j\r\nKK1IG3J4V0qGujXrDrGeW+3RSNI23lVqwdXA1a1CnAMQW2NehGMGZrXDeN/q\r\neVmF60oCNUwgMgJ5IfmkdvgWPFmQriFJU5k=\r\n=1/Nb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"c275a93204a80a1a8fbc40c266e9256982eedbc5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.10-beta.5490"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.10-beta.5490_1682677765635_0.43487765670140455","host":"s3://npm-registry-packages"}},"0.15.10-beta.5491":{"name":"piral-ssr-utils","version":"0.15.10-beta.5491","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.10-beta.5491","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"42b27a1bb71c523d1ff1db41b87480aef29eb4a8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.10-beta.5491.tgz","fileCount":40,"integrity":"sha512-u1yxlH9GzDcShJYMfWi28CVVN/3v1gFKRML43PfnTx+b7fBt8d2tv+h0X9uHzarFxDwU61rkOe0XcGu86MZiIg==","signatures":[{"sig":"MEQCIEKzytTItq7JEEMbag3uaoih17oydk4ihONj5YlKIogqAiBjl5AKtbjdxBZF0U4nLNEEySWZ4cL+A9UgNODM8qER0w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkS+SQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpvKQ/9EvlF6SM/TyiPAL0XHhBKACrxpTTG8lDDzM1HHinpyHf27N2t\r\n3F872ZBHT0ytmZyYhvDreTJOSn8yv17JXbKVPpOW51S3diylkeYcef7n5RIT\r\n2Ayi+oOv61QJVU66YmPHyM4oU8ff/+Lby5tGkhFVT0FoV/sZnTQebh6+y/Si\r\nJuKGAxlJxLpMunBrydp7V7lRGkgT5hI1mZ5QlyYizTf7Iumvcat2xCnQ+FDU\r\nf219SPhe+H040yV7lIQo6stGxts9wmHyaOjowqCHJA2B1mM8yGYqj16dLznj\r\noe6Tp2AMLugC/d8UcYqbKD9X2DJXZPWqqIbVatI6cekISTg62F40B6gnuvi8\r\nok5WzKKJibbD/P4K7r9rlw1caKoao/49+3l1FMQOuXE2wNxMf4uxW1GwGvtE\r\nby9T7nvYhF6DQoFwX5SwkkWnVS8DpQvnGp0nb3HxD0sf3gGXvALLZqbDQPym\r\nTM0wze2wj2IMbM5AUDaWchfXCoY0nLeTK/wSlkSIJN9foIsx14u6qFKlPgSb\r\nqJh4GdcfGMHHlxrTtXxbiO2iiv4CzFSUfR8QeFxY1ENtSrCY+s/ZVUADvCyq\r\nefzLbJl5NCI3lKTscYbuXIlpXMEzQV3KuwmRKNakplB0ZoTJwXyT+dKy0g0O\r\nxAO63VAUC7RC82t9wjQq17l33tOTjA8saPo=\r\n=eQz1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"3ee67d02efb34989f4642076e302e0813d28bcc1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.10-beta.5491"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.10-beta.5491_1682695312091_0.5565524634299999","host":"s3://npm-registry-packages"}},"0.15.10-beta.5496":{"name":"piral-ssr-utils","version":"0.15.10-beta.5496","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.10-beta.5496","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f68faf21e8baf548be3af33aaec86bd269aa4f90","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.10-beta.5496.tgz","fileCount":40,"integrity":"sha512-3L9i4vP6LY4/mVkv0Grj5hoU/q31ipuhSzDSz6e/0irpx9lntkZhF17DfGM6E4QFNmwVxtA3qO5lLbFtgrFF2g==","signatures":[{"sig":"MEUCIQDhj7PbEQkmbwfzxpUkgb4jtRI1n0sr4JoxukZwLvGxywIgcKGxecJz6+Sq8YyiHnW66lp3Cyho+sjHCEriJazl9KY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkU7mLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZTg//cJhAYA+e+mtNr+kLK90AQz6xe+JVeMCxERuTjgFRJeQZbT3b\r\nuO4WKQsrUqj8SieUShh2DwftrCqDy/0HYPji2TlXHszCTQhMMG/kL21bhp/t\r\nlPtVp3vXJjjzjW53BnDm3y9YX/kQhNk8mL3/53D5ZmGsvEwYPfAktG8phmQI\r\n5ENl+pHS+r5OfKiQaysiHQuk5c+yy3cyqgtZjEEruQUyfm9EWV1kxANZRk+C\r\nvwpbMYTYQ6ZC9i5zGI6djg7IgmtiKLWlMgbxbSa8VHRJ/h3fCoifKts8dHqY\r\np198/SktJFK1gM93q4MDGBDnNA05O4yQWkUckGjLfxwfJQbsQdpaLZngfCQQ\r\nmcYtySPiVtCDq+zqcb42Oii0qfnJO4V6vmtSRDl4nXGM/oMHinZ7EYJHko0Y\r\nLYPF9BTJHD6isCFVVHZR9JXk3Y8Fif1GfiVTwnRMFinqh0hUEu1E8xfPWsCw\r\nb3TLy02lfvWFvpCiIj8hlnGYoAGNMsnI63qgyU7esavCuQ19Xcg9wE9Xptmb\r\nBNb/pVgL2ynJsfXxMBS/ms6K7x1FS0vaiBrsv127Miub4405bbL336NM47/G\r\nf+sxGBtxtOToEUUjJyiXDpi6xOuyxsP+3KFcdS9sPHtcvslbvZvmNy6V7Tjx\r\n633ctZ2n8VsNq3bfMAZUeR1q7DAI/hd48u0=\r\n=uudB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"fa6436e21e3115c53329d622ae4c8bf88c62b6fb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.10-beta.5496"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.10-beta.5496_1683208586960_0.6751930762982326","host":"s3://npm-registry-packages"}},"0.15.10":{"name":"piral-ssr-utils","version":"0.15.10","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.10","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"34ce819198d09064cfc60a8d392c41269a664add","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.10.tgz","fileCount":40,"integrity":"sha512-NGNclHNZ/XrrYel9PzdlNcRlMS8BF7cqubl+5yGTFzI8xzS8Drn7I/LQx3gtQOB6aTJb3yA0/xkzKO5egMQLAA==","signatures":[{"sig":"MEQCIGKQwz2p+UTgNQ5rKWSSyBv6M+qlBtdcrgHy0Yj7Mk62AiATyO1kCtqjC1+cBrEYOBj6so0ON8lUg1gzCr5swPmZfQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42440},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"801cd5b1af1b26664f84294c86292e7b27e789b1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.10"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.10_1683541078989_0.9622932383188896","host":"s3://npm-registry-packages"}},"0.15.11-beta.5506":{"name":"piral-ssr-utils","version":"0.15.11-beta.5506","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.11-beta.5506","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9fa179d882a145df4a976271531fdc882833a621","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.11-beta.5506.tgz","fileCount":40,"integrity":"sha512-CQha+SUhB3YJB51oF6ZtF+zS6upa8pDNpTetua/2RLp4SnPFKGhsAC+cZKgrsa/PeWofbbSdbommtr5AzDn6EQ==","signatures":[{"sig":"MEUCIApD9DhhAQeZuxr79cDxk/8AlAfqiPDZaquDNNGUAOzXAiEAzPeZ3CTcKTj9S17Q6pUIpAZwvNhAIS37VRzLNAtkBBs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42459},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"1a604e1dc6d75849d65f91debd27b5c0518140e8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.11-beta.5506"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.11-beta.5506_1683811636538_0.42635671259765817","host":"s3://npm-registry-packages"}},"0.15.11":{"name":"piral-ssr-utils","version":"0.15.11","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.11","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"933127d466a5ebdb5327ae0a3fe88fb5587cb3e8","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.11.tgz","fileCount":40,"integrity":"sha512-ONtLFHFOxHrH6Y2pG90GvQs0yZacPfSG0YTVYowwz2+UxgKn23W/Hliz9xt507d41kzIncsDe8To5AVInbeZxQ==","signatures":[{"sig":"MEYCIQCqBZKRZ1izOakypVsHTLx8jLYJ3i26th2/SRcKFfxMLQIhANSDN2yReC4I0iwoJNs6KdG7qVyue1Py9lEN7iF3n84s","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42440},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"513cd05c0234dd02fdc95abb8f391e307f309fea","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.11"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.11_1684155577889_0.646809179809241","host":"s3://npm-registry-packages"}},"0.15.12-beta.5528":{"name":"piral-ssr-utils","version":"0.15.12-beta.5528","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.12-beta.5528","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"32d6fd50761414a0eec43ea8d4a8c5ae762563c7","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.12-beta.5528.tgz","fileCount":40,"integrity":"sha512-1unGWVhsMnZC3OGoMPYzCppxfubYaniVJBE4XiKCT8msW/xdGOwt6tmwln1gHSgcwRoC5V9BeYjJO8Nx0oo4Pw==","signatures":[{"sig":"MEYCIQCczzFIxIsZThzTGxb/UyeJtCXM5y4hfUdH+juvd2g7igIhAP0OW5PQBRYy7ynoiqoNgMugApIRw9KggGIIvvzQNdIj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42443},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"6d97a2baca7ae3e5fb19a754ba55d44b40ed137e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.12-beta.5528"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.12-beta.5528_1684281963452_0.5995562358788014","host":"s3://npm-registry-packages"}},"0.15.12-beta.5531":{"name":"piral-ssr-utils","version":"0.15.12-beta.5531","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.12-beta.5531","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b94fbf321ed39d692db1d061aaf67b3947a0e0bd","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.12-beta.5531.tgz","fileCount":40,"integrity":"sha512-z0+bz9z7eLAPGJC0tnZWFQewIHltVlLjGS5igC/Goa2cwsWLqy9m+LG77nVdCu3zuCK8+GqxZtPhYKknMvWXww==","signatures":[{"sig":"MEUCIFgC8yOaQdJgTu4jR3oLQU6+XjdRqoBgvooKl36arC3/AiEAgWUkX0jfSywdaT2rg9LjKHoEOzZ74MbW9kaT87tTUg8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42443},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"e305bf2bdfa60d6325a7db20f550b58dabdea245","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.12-beta.5531"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.12-beta.5531_1684342505927_0.29347239029658767","host":"s3://npm-registry-packages"}},"0.15.12-beta.5535":{"name":"piral-ssr-utils","version":"0.15.12-beta.5535","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.12-beta.5535","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d856afd8295ea6509bba36f2e8662912a06149d1","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.12-beta.5535.tgz","fileCount":40,"integrity":"sha512-XA9sNWnbyLiazMikmkNqzGoJdAghrMdWPWE/pJf8hGfQdSMNH4J0nOD4H4Lx7XQajSqYcyJamPEgC8uzQOYieg==","signatures":[{"sig":"MEUCIFVZ5sjfqPkpFGkwDASHvm9uYAIINlANoLwwqhi83o1YAiEA2HQTpCuvPvXtdH5o3zOgLRjIAsuVqhoQ9EJH2hYUyEs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42443},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"6decbca12cb26efb2b2b4fdec3d692eea1420cdb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.12-beta.5535"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.12-beta.5535_1684481078928_0.7988891540459333","host":"s3://npm-registry-packages"}},"0.15.12-beta.5538":{"name":"piral-ssr-utils","version":"0.15.12-beta.5538","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.12-beta.5538","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f5312f4735bffea823adc49b7b7b61640beebe02","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.12-beta.5538.tgz","fileCount":40,"integrity":"sha512-6JLRkLP1ykaZ6OiIkx9MvSbPiix1u7APD2cIBrjNVPHanWLbfBktlHM1Xfe/DK+5dd1tZB5lTrb7MCZPBi+cIg==","signatures":[{"sig":"MEQCIHXnYHixZ5jrVqmX52ACpmMBKm4wMt+N4eyIXDDYQgBfAiARSGQtsMz4V39yqW8WOcl/KmkMYSY/cBUDhFTqfCve8w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42443},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"edf6a2b34e37e7d280a949f0955105e07ac01542","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.12-beta.5538"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.12-beta.5538_1684498224605_0.6238881831091192","host":"s3://npm-registry-packages"}},"0.15.12-beta.5541":{"name":"piral-ssr-utils","version":"0.15.12-beta.5541","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.12-beta.5541","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1e02a3c08eb14a363c400c7a44c2ae7f17780ec6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.12-beta.5541.tgz","fileCount":40,"integrity":"sha512-3eVaETsC/GIOh+jTJQ2xz1Y1pQv81HBlr9PTe1LZEr2/NJZCVd7Bi29+E8iE7HebSyVo0DcrncSJR6PHrBtxcg==","signatures":[{"sig":"MEYCIQDfDXnLjmzC9o69qrp/8DkdQey68xTmzAYhtw+cov4/lwIhAM50RaN9fMqPMONdvrQgb6d8FSqwlydpAacY7G1zOuBG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42443},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"9006ea1da868b2647caf6c142af29f568ae76e4a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.12-beta.5541"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.12-beta.5541_1684513088195_0.40204064029003317","host":"s3://npm-registry-packages"}},"0.15.12":{"name":"piral-ssr-utils","version":"0.15.12","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.12","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a162bf40dc55359553d7ca3cc4ccd7d599db1480","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.12.tgz","fileCount":40,"integrity":"sha512-1SS63fAMC6lQF31AqI8q8iA+PXk/qv9cr9KheT5iufhhFJdL93hMSVBLw+zLz244OPtVItH/GjWj+McqiAwsrw==","signatures":[{"sig":"MEUCIQCw8xGtw85QW5arCrx7A3Y/anVsNSkTkP/P5upSFzVhrQIgFwK/66qfRzIBlP5Tu7A/Enee8R7In8Enm5bQFoYcrXM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42424},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"a0f06e81b67c81ebe4ff97ae593184fd1e0ba5a3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.12"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.12_1684538614419_0.5751969878770038","host":"s3://npm-registry-packages"}},"0.15.13-beta.5556":{"name":"piral-ssr-utils","version":"0.15.13-beta.5556","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.13-beta.5556","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3f93e78cfcbef32e4885a808797b72e430fd1b61","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.13-beta.5556.tgz","fileCount":40,"integrity":"sha512-uVtCKFiZW2NarYffdIyrF7mnbYUojopa/Xhf3TRPoCRx7NuxrpXANYtM50b0HHrBD6h+zCwUN8MwvCEZkQBBZg==","signatures":[{"sig":"MEQCIA3K0AyO4rCWcBa2e1nFgw8nJKIbSNxxWl5E+NyGu5oWAiB0mKMRgaQYhZTeIxvl/61tLPFfIRdxTZXv6+vpkTsBWQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42443},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"d18c25ab3b042b684687ecb0fec53c2b241c6fb6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.13-beta.5556"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.13-beta.5556_1684766185055_0.13148911418088738","host":"s3://npm-registry-packages"}},"0.15.13-beta.5560":{"name":"piral-ssr-utils","version":"0.15.13-beta.5560","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.13-beta.5560","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"787b771aba2baccadc90db16bbb0f644bffcd43d","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.13-beta.5560.tgz","fileCount":40,"integrity":"sha512-VMHdBfVMMxc9dQItDMVU9KnT7RRNPgTH2JbNIc/0r32PSUK2sDeksRZHsANVQHqVWdSZz6LhKQFz0Lp5g5Z0Hg==","signatures":[{"sig":"MEQCID8IIzsUkIK6Ib4WaSYM87hOGdvbNbjpt2SrO9j/rzW0AiAmSk5xsX7R17gt1vK1tRGKWEd3b455Y/XKVlGHlhdTZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42443},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"18136ebf42fac6b296b8afb7a5c90175ae14df24","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.13-beta.5560"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.13-beta.5560_1684931679142_0.31549495957465745","host":"s3://npm-registry-packages"}},"0.15.13-beta.5575":{"name":"piral-ssr-utils","version":"0.15.13-beta.5575","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.13-beta.5575","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"50744d667f27ae539c4f6312deee4ec3e5a8e474","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.13-beta.5575.tgz","fileCount":40,"integrity":"sha512-B4YCx5yQIdKo1/gQvTsrK1Vq4G+mkPmzEoq7UEJNg35PF8wojiwE3488x99k4vXSSZQNxhCpgiHz39yh4jKy4A==","signatures":[{"sig":"MEQCIGtD+o9BEp/5zMsmkQ5tKnZcuenhdRIzx7gMZBdrTvAPAiBdhfzWX30YYy9dPwjDXZozRFaipS7LTlf6+kebGUgydw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42443},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"44084de3fbae6c5b7891ce9cbe99740bf74139d9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.13-beta.5575"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.13-beta.5575_1685117276493_0.15682545702864026","host":"s3://npm-registry-packages"}},"0.15.13-beta.5583":{"name":"piral-ssr-utils","version":"0.15.13-beta.5583","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.13-beta.5583","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"66b376079c6df4aa90aae86d0662fbf73f3d1fc6","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.13-beta.5583.tgz","fileCount":40,"integrity":"sha512-0Dl6lFvXMb0RRfAlt1nYKKYP72Io9hIDrwy/ur/JXA6PQ8eRNw2VQSeya41taaGp9tMHNYjd90tq93gfYvhElg==","signatures":[{"sig":"MEUCIBgridv7oIbjNU1uSMNHRQCEXc0FH78Cdzm1Am6B/5TqAiEAouDIaV5NBLs9Ucqrd8VKMrfVqnLePVm5QREs9F9bZHM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42443},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"2628b867cc564352d75a019f1700a5acdd9587f3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.13-beta.5583"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.13-beta.5583_1685364992322_0.6580351458335234","host":"s3://npm-registry-packages"}},"0.15.13-beta.5591":{"name":"piral-ssr-utils","version":"0.15.13-beta.5591","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.13-beta.5591","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"37e47b1118f1291a27cc2d0971226860a8932ecc","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.13-beta.5591.tgz","fileCount":40,"integrity":"sha512-LKUQYJW+N9gzLJI4xcOoFmzSXIRB14ad9PJHAN4OsG5r8OwjthPsjtQeXSOzknDDbrhfHiGH5gNiVKxGrsYncA==","signatures":[{"sig":"MEUCIEx0LcW/dvEjdMbi5mWuNvobDOaMrGVsbLeeah3tDHhOAiEAhXz362Fxj90WqYmviPb6F0lbUrIEKjL0QTRuyaxRQVc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42443},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"784a1959701dc0f13b9b8aa0edda2c7ae7c7390b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.13-beta.5591"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.13-beta.5591_1685526443929_0.6656598567249412","host":"s3://npm-registry-packages"}},"0.15.13":{"name":"piral-ssr-utils","version":"0.15.13","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-ssr-utils@0.15.13","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"da5cc7b79f86d48d4829ef04c49a3de8ec34f267","tarball":"https://registry.npmjs.org/piral-ssr-utils/-/piral-ssr-utils-0.15.13.tgz","fileCount":40,"integrity":"sha512-YgC1xrzBesbShqrpOcoMXL1uPQYvOxxJlyzR/fwAsB7coV2nGKYh9QAF2x5bpeg7E1nTtopBjUhgSRBRjfyP4Q==","signatures":[{"sig":"MEQCIGPM7g418UGdys0xkNeMNImF+OSflSqyMEZ5Ju1jro9mAiBDi77ZjEQCIpAWuMjrhXU1sUBXyxD197azyJKfP8y5cA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42424},"main":"lib/index.js","module":"esm/index.js","browser":"./runtime.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./runtime":{"require":"./runtime.js"},"./package.json":"./package.json"},"gitHead":"1c7ef348ee00d0bfd2d8a5af20bb846d6d88f485","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-ssr-utils.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Utilities for server-side rendering of a Piral instance.","directories":{},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.13"},"peerDependencies":{"piral-core":"0.14.x || 0.15.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-ssr-utils_0.15.13_1685526450670_0.44808900930022233","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-11-26T14:33:12.085Z","modified":"2026-05-22T14:25:50.828Z","0.9.0-pre.755":"2019-11-26T14:33:12.203Z","0.9.0-pre.756":"2019-11-26T16:37:46.803Z","0.9.0-pre.757":"2019-11-28T10:57:30.348Z","0.9.0-pre.758":"2019-11-29T00:32:39.636Z","0.9.0-pre.759":"2019-11-29T14:09:57.342Z","0.9.0-pre.763":"2019-12-02T16:38:52.103Z","0.9.0-pre.765":"2019-12-03T10:50:03.148Z","0.9.0-pre.767":"2019-12-03T14:07:11.350Z","0.9.0-pre.770":"2019-12-03T15:02:46.311Z","0.9.0":"2019-12-03T16:05:31.067Z","0.9.1-pre.779":"2019-12-05T11:49:47.655Z","0.9.1-pre.781":"2019-12-06T12:34:24.392Z","0.9.1":"2019-12-06T13:36:03.794Z","0.9.2-pre.785":"2019-12-06T22:06:38.941Z","0.9.2-pre.787":"2019-12-07T00:20:51.195Z","0.9.2-pre.789":"2019-12-07T01:46:19.451Z","0.9.2-pre.790":"2019-12-07T12:30:26.518Z","0.9.2-pre.796":"2019-12-09T01:59:08.175Z","0.9.2-pre.799":"2019-12-10T00:01:12.624Z","0.9.2-pre.802":"2019-12-10T19:32:28.334Z","0.9.2-pre.804":"2019-12-11T00:21:07.389Z","0.9.2":"2019-12-11T06:59:47.742Z","0.9.3-pre.808":"2019-12-13T00:45:03.533Z","0.9.3-pre.811":"2019-12-16T13:46:04.001Z","0.9.3-pre.813":"2019-12-16T19:53:48.961Z","0.9.3-pre.814":"2019-12-16T23:36:54.873Z","0.9.3-pre.816":"2019-12-17T01:06:56.825Z","0.9.3-pre.818":"2019-12-17T14:58:48.927Z","0.9.3":"2019-12-17T16:49:26.922Z","0.10.0-pre.823":"2019-12-18T04:36:43.377Z","0.10.0-pre.827":"2019-12-20T10:43:35.566Z","0.10.0-pre.828":"2019-12-22T23:48:42.273Z","0.10.0-pre.829":"2019-12-26T00:11:56.010Z","0.10.0-pre.832":"2019-12-30T19:05:53.427Z","0.10.0-pre.833":"2020-01-03T06:11:37.151Z","0.10.0-pre.836":"2020-01-08T06:56:36.846Z","0.10.0-pre.837":"2020-01-09T01:00:45.010Z","0.10.0-pre.838":"2020-01-10T10:11:40.843Z","0.10.0-pre.839":"2020-01-13T00:29:19.717Z","0.10.0-pre.842":"2020-01-17T14:57:05.462Z","0.10.0-pre.843":"2020-01-18T10:48:45.495Z","0.9.4":"2020-01-20T16:16:23.182Z","0.10.0-pre.846":"2020-01-20T18:29:43.158Z","0.9.5":"2020-01-21T16:39:30.679Z","0.9.6":"2020-01-22T16:34:57.910Z","0.10.0-pre.853":"2020-01-23T00:27:31.556Z","0.10.0-pre.855":"2020-01-24T00:18:30.146Z","0.10.0-pre.856":"2020-01-24T13:29:35.830Z","0.9.7":"2020-01-25T23:03:47.534Z","0.10.0-pre.861":"2020-01-25T23:38:49.547Z","0.10.0-pre.865":"2020-01-27T16:38:29.935Z","0.9.8":"2020-01-27T22:30:21.794Z","0.10.0-pre.870":"2020-01-27T23:04:12.056Z","0.9.9":"2020-01-29T13:51:15.951Z","0.10.0-pre.877":"2020-01-30T16:24:21.571Z","0.10.0-pre.878":"2020-01-30T19:04:49.510Z","0.10.0-pre.879":"2020-01-30T23:20:51.983Z","0.10.0-pre.880":"2020-01-31T11:01:14.924Z","0.10.0-pre.881":"2020-01-31T16:18:15.518Z","0.10.0-pre.883":"2020-01-31T22:45:06.270Z","0.10.0-pre.885":"2020-02-01T13:22:26.865Z","0.10.0-pre.887":"2020-02-02T07:43:31.279Z","0.10.0":"2020-02-02T10:16:08.054Z","0.11.0-pre.891":"2020-02-03T00:35:39.841Z","0.10.1":"2020-02-04T01:25:01.298Z","0.11.0-pre.894":"2020-02-04T06:45:46.646Z","0.10.2":"2020-02-05T14:25:07.163Z","0.11.0-pre.897":"2020-02-05T22:26:07.187Z","0.11.0-pre.902":"2020-02-07T09:41:05.973Z","0.10.3":"2020-02-11T00:29:57.568Z","0.11.0-pre.937":"2020-02-11T01:05:13.080Z","0.10.4":"2020-02-11T23:03:02.081Z","0.11.0-pre.942":"2020-02-11T23:40:24.831Z","0.10.5":"2020-02-15T17:56:44.586Z","0.11.0-pre.945":"2020-02-15T21:54:33.681Z","0.11.0-pre.946":"2020-02-18T21:54:00.650Z","0.10.6":"2020-02-20T21:54:08.103Z","0.11.0-pre.956":"2020-02-20T22:27:56.425Z","0.10.7":"2020-02-21T08:57:10.526Z","0.11.0-pre.960":"2020-02-21T12:54:09.953Z","0.11.0-pre.963":"2020-02-23T09:35:49.697Z","0.10.8":"2020-02-25T15:55:08.044Z","0.11.0-pre.970":"2020-02-25T16:29:48.180Z","0.10.9":"2020-02-28T11:35:02.806Z","0.11.0-pre.973":"2020-02-28T16:03:43.912Z","0.11.0-pre.974":"2020-03-03T07:13:58.430Z","0.11.0-pre.975":"2020-03-04T00:02:30.506Z","0.11.0-pre.979":"2020-03-05T22:56:06.353Z","0.11.0-pre.985":"2020-03-09T13:22:22.935Z","0.11.0-pre.987":"2020-03-14T07:04:40.225Z","0.11.0-pre.988":"2020-03-18T21:28:40.097Z","0.11.0-pre.989":"2020-03-20T11:40:35.582Z","0.11.0-pre.992":"2020-03-21T18:48:50.468Z","0.11.0-pre.994":"2020-03-22T02:20:58.420Z","0.11.0-pre.995":"2020-03-22T23:16:14.181Z","0.11.0-pre.997":"2020-03-27T00:21:48.212Z","0.11.0-pre.998":"2020-03-29T01:54:03.438Z","0.11.0-pre.1007":"2020-03-29T23:49:28.216Z","0.11.0-pre.1009":"2020-03-30T23:57:17.028Z","0.11.0-pre.1030":"2020-03-31T15:19:55.754Z","0.11.0-pre.1034":"2020-03-31T18:55:53.849Z","0.11.0":"2020-04-01T06:08:14.088Z","0.11.1-pre.1039":"2020-04-01T09:07:54.916Z","0.11.1-pre.1050":"2020-04-06T06:41:05.315Z","0.11.1-pre.1053":"2020-04-08T11:39:34.818Z","0.11.1-pre.1055":"2020-04-08T18:55:50.280Z","0.11.1":"2020-04-08T20:18:31.989Z","0.11.2-pre.1081":"2020-04-11T22:14:51.110Z","0.11.2-pre.1094":"2020-04-16T13:31:59.620Z","0.11.2-pre.1095":"2020-04-18T23:38:32.531Z","0.11.2":"2020-04-19T08:13:13.531Z","0.11.3-pre.1099":"2020-04-20T23:01:00.199Z","0.11.3-pre.1117":"2020-04-22T10:00:09.941Z","0.11.3-pre.1120":"2020-04-23T23:36:23.599Z","0.11.3":"2020-04-24T08:33:07.754Z","0.11.4-pre.1124":"2020-04-24T22:31:31.952Z","0.11.4-pre.1127":"2020-04-29T04:46:42.295Z","0.11.4-pre.1128":"2020-04-29T12:37:17.203Z","0.11.4-pre.1130":"2020-04-30T13:27:28.176Z","0.11.4-pre.1131":"2020-04-30T14:22:07.417Z","0.11.4-pre.1133":"2020-05-02T22:00:59.526Z","0.11.4-pre.1134":"2020-05-04T22:04:39.259Z","0.11.4-pre.1138":"2020-05-05T16:08:51.277Z","0.11.4-pre.1139":"2020-05-05T17:20:31.304Z","0.11.4-pre.1148":"2020-05-06T11:30:22.584Z","0.11.4":"2020-05-06T13:12:05.268Z","0.11.5-pre.1155":"2020-05-07T09:54:04.965Z","0.11.5-pre.1167":"2020-05-09T23:34:47.581Z","0.11.5-pre.1168":"2020-05-10T08:18:26.854Z","0.11.5-pre.1169":"2020-05-12T12:40:03.865Z","0.11.5-pre.1176":"2020-05-13T16:05:50.483Z","0.11.5-pre.1196":"2020-05-15T15:54:40.689Z","0.11.5-pre.1201":"2020-05-18T19:51:53.821Z","0.11.5-pre.1203":"2020-05-19T07:03:52.955Z","0.11.5-pre.1204":"2020-05-19T19:26:00.203Z","0.11.5-pre.1233":"2020-05-21T15:30:14.185Z","0.11.5-pre.1237":"2020-05-22T19:35:49.903Z","0.11.5-pre.1242":"2020-05-23T12:30:54.407Z","0.11.5-pre.1243":"2020-05-23T21:49:56.698Z","0.11.5-pre.1244":"2020-05-23T23:43:49.538Z","0.11.5-pre.1248":"2020-05-24T16:37:30.858Z","0.11.5-pre.1250":"2020-05-24T18:15:44.697Z","0.11.5":"2020-05-24T19:49:14.994Z","0.11.6-pre.1254":"2020-05-24T22:25:17.684Z","0.11.6-pre.1256":"2020-05-25T22:08:30.590Z","0.11.6-pre.1258":"2020-05-26T21:49:21.750Z","0.11.6-pre.1262":"2020-05-27T13:19:31.567Z","0.11.6-pre.1316":"2020-05-28T23:07:15.351Z","0.11.6-pre.1320":"2020-05-29T16:33:30.008Z","0.11.6-pre.1322":"2020-05-29T20:46:18.193Z","0.11.6-pre.1324":"2020-06-02T06:35:18.006Z","0.11.6-pre.1357":"2020-06-02T14:36:17.187Z","0.11.6-pre.1361":"2020-06-02T15:24:54.290Z","0.11.6-pre.1371":"2020-06-03T07:27:31.657Z","0.11.6-pre.1372":"2020-06-03T07:47:28.007Z","0.11.6-pre.1377":"2020-06-03T13:18:33.467Z","0.11.6-pre.1380":"2020-06-04T06:54:49.080Z","0.11.6-pre.1391":"2020-06-05T23:11:09.372Z","0.11.6-pre.1393":"2020-06-06T01:10:35.994Z","0.11.6":"2020-06-06T14:50:42.618Z","0.11.7-pre.1403":"2020-06-07T13:34:12.403Z","0.11.7-pre.1404":"2020-06-07T16:24:07.224Z","0.11.7-pre.1406":"2020-06-07T21:46:50.288Z","0.11.7-pre.1415":"2020-06-10T07:10:07.470Z","0.11.7-pre.1416":"2020-06-10T08:52:31.892Z","0.11.7-pre.1417":"2020-06-10T09:28:40.787Z","0.11.7-pre.1420":"2020-06-10T12:17:07.075Z","0.11.7-pre.1421":"2020-06-10T15:48:15.267Z","0.11.7-pre.1423":"2020-06-12T07:18:45.630Z","0.11.7-pre.1424":"2020-06-14T21:28:57.599Z","0.11.7-pre.1425":"2020-06-15T12:26:53.522Z","0.11.7-pre.1426":"2020-06-15T23:26:34.964Z","0.11.7-pre.1427":"2020-06-16T10:11:26.765Z","0.11.7-pre.1428":"2020-06-16T14:36:41.072Z","0.11.7-pre.1429":"2020-06-16T20:39:52.434Z","0.11.7-pre.1430":"2020-06-17T23:55:16.157Z","0.11.7-pre.1431":"2020-06-18T06:45:34.430Z","0.11.7-pre.1433":"2020-06-19T02:54:02.336Z","0.11.7-pre.1435":"2020-06-20T23:10:13.812Z","0.11.7-pre.1437":"2020-06-21T00:40:03.680Z","0.11.7-pre.1439":"2020-06-21T14:56:27.344Z","0.11.7-pre.1441":"2020-06-22T04:59:28.938Z","0.11.7":"2020-06-22T06:41:27.717Z","0.11.8-pre.1446":"2020-06-22T13:44:27.944Z","0.11.8-pre.1447":"2020-06-24T08:53:07.267Z","0.11.8-pre.1521":"2020-06-26T07:49:20.673Z","0.11.8-pre.1522":"2020-06-27T23:01:06.384Z","0.11.8-pre.1548":"2020-06-29T22:48:55.823Z","0.11.8-pre.1560":"2020-06-30T14:37:15.503Z","0.11.8-pre.1583":"2020-07-01T08:42:04.926Z","0.11.8-pre.1591":"2020-07-01T14:22:24.416Z","0.11.8-pre.1595":"2020-07-01T17:28:37.899Z","0.11.8-pre.1596":"2020-07-01T23:33:04.159Z","0.11.8-pre.1607":"2020-07-03T13:16:35.531Z","0.11.8-pre.1610":"2020-07-03T15:12:33.350Z","0.11.8-pre.1611":"2020-07-05T16:26:51.216Z","0.11.8-pre.1616":"2020-07-06T14:19:08.222Z","0.11.8-pre.1618":"2020-07-07T02:24:00.194Z","0.11.8-pre.1620":"2020-07-07T14:29:08.582Z","0.11.8-pre.1622":"2020-07-08T08:29:27.476Z","0.11.8-pre.1627":"2020-07-08T14:44:32.026Z","0.11.8-pre.1633":"2020-07-09T06:10:33.676Z","0.11.8":"2020-07-09T14:34:22.191Z","1.0.0-pre.1638":"2020-07-09T20:31:15.826Z","1.0.0-pre.1648":"2020-07-13T09:02:29.431Z","1.0.0-pre.1657":"2020-07-14T08:28:25.378Z","1.0.0-pre.1666":"2020-07-15T10:00:49.158Z","1.0.0-pre.1671":"2020-07-15T14:43:50.248Z","1.0.0-pre.1672":"2020-07-15T18:06:43.876Z","1.0.0-pre.1676":"2020-07-16T06:19:08.615Z","1.0.0-pre.1679":"2020-07-16T10:02:19.193Z","1.0.0-pre.1682":"2020-07-16T15:48:02.758Z","1.0.0-pre.1684":"2020-07-16T22:28:15.386Z","1.0.0-pre.1690":"2020-07-20T08:34:09.513Z","1.0.0-pre.1692":"2020-07-24T09:25:18.633Z","1.0.0-pre.1694":"2020-07-25T09:38:28.081Z","1.0.0-pre.1699":"2020-07-28T22:44:55.764Z","1.0.0-pre.1703":"2020-07-30T14:58:45.782Z","1.0.0-pre.1708":"2020-07-31T08:20:28.274Z","1.0.0-pre.1721":"2020-08-03T09:08:16.824Z","1.0.0-pre.1730":"2020-08-06T15:18:32.986Z","1.0.0-pre.1731":"2020-08-09T10:29:25.397Z","1.0.0-pre.1732":"2020-08-10T21:31:36.263Z","1.0.0-pre.1741":"2020-08-21T22:19:59.833Z","1.0.0-pre.1742":"2020-08-25T21:59:04.887Z","1.0.0-pre.1746":"2020-09-01T10:11:52.994Z","0.12.0-pre.1747":"2020-09-04T21:56:50.394Z","0.12.0-pre.1748":"2020-09-07T22:48:23.095Z","0.12.0-pre.1750":"2020-09-08T10:11:21.116Z","0.12.0-pre.1754":"2020-09-08T19:27:56.208Z","0.12.0":"2020-09-09T08:52:38.440Z","1.0.0-pre.1758":"2020-09-09T14:27:17.863Z","0.12.1-pre.1768":"2020-09-16T14:42:01.804Z","0.12.1-pre.1770":"2020-09-16T15:39:23.603Z","0.12.1":"2020-09-17T08:14:16.601Z","1.0.0-pre.1775":"2020-09-17T09:08:29.162Z","1.0.0-pre.1779":"2020-09-21T12:09:34.108Z","0.12.2-pre.1793":"2020-09-26T00:24:57.419Z","0.12.2-pre.1794":"2020-09-26T12:42:46.031Z","0.12.2-pre.1795":"2020-09-26T20:20:20.625Z","0.12.2":"2020-09-28T04:17:41.234Z","1.0.0-pre.1801":"2020-09-28T08:23:22.245Z","0.12.3-pre.1815":"2020-10-05T12:38:06.003Z","0.12.3-pre.1816":"2020-10-06T00:56:56.372Z","0.12.3-pre.1817":"2020-10-06T23:00:55.989Z","0.12.3-pre.1818":"2020-10-08T10:44:55.679Z","0.12.3-pre.1820":"2020-10-09T15:03:27.447Z","0.12.3-pre.1826":"2020-10-09T23:27:53.863Z","0.12.3":"2020-10-10T00:03:46.937Z","0.12.4-pre.1830":"2020-10-13T08:33:53.589Z","0.12.4-pre.1836":"2020-10-20T09:07:02.922Z","0.12.4-pre.1846":"2020-10-21T20:43:03.750Z","0.12.4-pre.1854":"2020-10-23T13:58:59.604Z","0.12.4-pre.1861":"2020-10-27T22:52:08.327Z","0.12.4-pre.1862":"2020-10-28T13:16:32.110Z","0.12.4-pre.1863":"2020-10-28T16:17:30.424Z","0.12.4-pre.1867":"2020-10-30T07:10:35.267Z","0.12.4-pre.1874":"2020-11-11T00:26:27.278Z","0.12.4-pre.1875":"2020-11-11T16:29:41.820Z","0.12.4-pre.1884":"2020-11-16T17:27:06.645Z","0.12.4-pre.1886":"2020-11-17T12:52:51.677Z","0.12.4-pre.1888":"2020-11-20T00:13:36.238Z","0.12.4-pre.1890":"2020-11-20T11:36:39.851Z","0.12.4-pre.1895":"2020-11-21T02:08:40.245Z","0.12.4":"2020-11-24T11:13:37.507Z","1.0.0-pre.1899":"2020-11-24T13:31:38.667Z","1.0.0-pre.1904":"2020-11-26T13:19:23.409Z","1.0.0-pre.1958":"2020-12-08T15:21:03.782Z","1.0.0-pre.1959":"2020-12-08T15:42:08.087Z","1.0.0-pre.1960":"2020-12-08T23:52:32.423Z","1.0.0-pre.1979":"2020-12-09T23:50:14.724Z","1.0.0-pre.1989":"2020-12-10T15:15:45.052Z","1.0.0-pre.1994":"2020-12-11T08:40:12.357Z","1.0.0-pre.1998":"2020-12-11T12:20:35.062Z","1.0.0-pre.2002":"2020-12-11T15:50:15.187Z","1.0.0-pre.2023":"2020-12-12T19:24:00.497Z","1.0.0-pre.2024":"2020-12-13T01:06:01.078Z","1.0.0-pre.2025":"2020-12-13T02:15:38.011Z","1.0.0-pre.2026":"2020-12-13T02:54:13.922Z","1.0.0-pre.2027":"2020-12-13T11:39:30.997Z","1.0.0-pre.2028":"2020-12-13T12:48:47.086Z","1.0.0-pre.2031":"2020-12-14T14:38:26.787Z","1.0.0-pre.2033":"2020-12-15T14:52:29.675Z","1.0.0-pre.2034":"2020-12-15T16:04:32.676Z","1.0.0-pre.2036":"2020-12-16T02:07:51.911Z","1.0.0-pre.2073":"2020-12-25T13:46:55.807Z","1.0.0-pre.2075":"2021-01-05T19:30:10.869Z","1.0.0-pre.2076":"2021-01-05T19:56:15.391Z","1.0.0-pre.2077":"2021-01-05T20:05:20.942Z","1.0.0-pre.2078":"2021-01-05T21:53:51.556Z","1.0.0-pre.2079":"2021-01-05T22:35:33.598Z","1.0.0-pre.2082":"2021-01-07T01:08:23.265Z","1.0.0-pre.2084":"2021-01-10T21:26:49.980Z","1.0.0-pre.2085":"2021-01-10T22:49:43.399Z","1.0.0-pre.2086":"2021-01-12T22:08:32.626Z","1.0.0-pre.2087":"2021-01-13T10:37:42.216Z","1.0.0-pre.2091":"2021-01-15T13:00:53.025Z","1.0.0-pre.2093":"2021-01-19T22:43:03.125Z","1.0.0-pre.2094":"2021-01-20T14:46:44.286Z","1.0.0-pre.2096":"2021-01-21T14:17:55.008Z","1.0.0-pre.2098":"2021-01-26T09:47:26.501Z","1.0.0-pre.2104":"2021-02-02T14:32:31.123Z","1.0.0-pre.2107":"2021-02-06T21:34:42.512Z","1.0.0-pre.2108":"2021-02-07T01:29:42.906Z","1.0.0-pre.2112":"2021-02-10T21:31:52.948Z","1.0.0-pre.2117":"2021-02-11T13:46:09.104Z","1.0.0-pre.2137":"2021-02-23T14:48:54.286Z","1.0.0-pre.2196":"2021-03-09T09:09:46.660Z","1.0.0-pre.2217":"2021-03-15T10:12:13.863Z","0.13.0-pre.2244":"2021-03-18T17:28:47.060Z","0.13.0-pre.2253":"2021-03-20T00:43:45.392Z","0.13.0-pre.2254":"2021-03-20T13:51:38.337Z","0.13.0-pre.2284":"2021-03-23T16:38:30.301Z","0.13.0-pre.2290":"2021-03-23T20:42:06.085Z","0.13.0":"2021-03-24T10:21:35.356Z","1.0.0-pre.2296":"2021-03-24T13:47:50.563Z","0.13.1-pre.2307":"2021-03-25T17:21:20.540Z","0.13.1-pre.2312":"2021-03-26T14:39:34.196Z","0.13.1-pre.2323":"2021-03-30T14:17:52.191Z","0.13.1-pre.2326":"2021-03-31T11:01:36.161Z","0.13.1-pre.2329":"2021-04-11T23:47:46.679Z","0.13.1-pre.2330":"2021-04-12T13:03:49.939Z","0.13.1-pre.2336":"2021-04-13T15:18:32.891Z","0.13.1":"2021-04-13T16:27:15.907Z","0.13.2-pre.2341":"2021-04-13T22:43:22.340Z","0.13.2-pre.2352":"2021-04-15T15:39:53.827Z","0.13.2-pre.2364":"2021-04-16T20:26:18.894Z","0.13.2-pre.2383":"2021-04-20T13:21:56.881Z","0.13.2-pre.2387":"2021-04-22T22:57:06.542Z","0.13.2":"2021-04-27T16:18:54.324Z","0.13.3-pre.2417":"2021-05-04T09:36:40.917Z","0.13.3-pre.2419":"2021-05-04T11:03:31.521Z","0.13.3-pre.2433":"2021-05-05T21:45:17.997Z","0.13.3-pre.2435":"2021-05-06T20:52:28.977Z","0.13.3-pre.2437":"2021-05-09T01:03:29.055Z","0.13.3-pre.2442":"2021-05-09T20:32:47.759Z","0.13.3-pre.2460":"2021-05-19T13:37:13.647Z","0.13.3-pre.2477":"2021-05-25T14:47:28.361Z","0.13.3-pre.2480":"2021-05-28T07:31:49.702Z","0.13.3-pre.2585":"2021-06-15T15:35:01.711Z","0.13.3-pre.2783":"2021-06-27T15:10:39.782Z","0.13.3-pre.2928":"2021-07-20T00:03:53.843Z","0.13.3-pre.2931":"2021-07-21T09:28:49.230Z","0.13.3-pre.2936":"2021-07-26T14:08:00.655Z","0.13.3-pre.2937":"2021-07-28T12:37:59.410Z","0.13.3-pre.2940":"2021-07-28T21:21:31.575Z","0.13.3":"2021-07-28T22:07:40.539Z","0.14.0-pre.2948":"2021-07-31T23:47:04.083Z","0.14.0-unstable.2949":"2021-08-01T00:53:36.653Z","0.14.0-unstable.2952":"2021-08-02T14:08:27.013Z","0.13.4":"2021-08-02T21:11:23.532Z","0.14.0-pre.2954":"2021-08-02T23:11:20.956Z","0.14.0-pre.2955":"2021-08-03T14:50:19.013Z","0.14.0-pre.2958":"2021-08-04T00:34:05.652Z","0.14.0-pre.2964":"2021-08-06T12:47:09.890Z","0.14.0-pre.2970":"2021-08-09T00:20:59.359Z","0.14.0-pre.2975":"2021-08-17T21:37:41.387Z","0.13.5":"2021-08-17T21:38:20.845Z","0.13.6":"2021-08-27T10:36:06.727Z","0.14.0-pre.2983":"2021-08-27T13:39:55.154Z","0.14.0-pre.2998":"2021-08-30T20:47:22.042Z","0.14.0-pre.3018":"2021-09-01T09:21:30.195Z","0.13.7":"2021-09-01T11:50:03.998Z","0.14.0-unstable.3035":"2021-09-07T22:49:12.278Z","0.14.0-unstable.3037":"2021-09-08T16:46:53.901Z","0.14.0-unstable.3040":"2021-09-10T09:26:40.908Z","0.13.8":"2021-09-10T11:49:34.445Z","0.14.0-unstable.3058":"2021-09-13T12:45:19.826Z","0.14.0-unstable.3060":"2021-09-14T00:50:53.587Z","0.14.0-unstable.3062":"2021-09-15T07:54:26.332Z","0.14.0-unstable.3065":"2021-09-16T09:30:14.297Z","0.14.0-pre.3069":"2021-09-16T12:47:58.591Z","0.14.0-unstable.3068":"2021-09-16T12:48:13.276Z","0.14.0-unstable.3072":"2021-09-16T13:44:08.351Z","0.14.0-pre.3074":"2021-09-17T00:23:41.668Z","0.14.0-pre.3079":"2021-09-20T11:10:36.705Z","0.14.0-pre.3085":"2021-09-21T13:25:41.960Z","0.14.0-pre.3086":"2021-09-21T14:29:14.352Z","0.14.0-pre.3087":"2021-09-21T22:21:50.391Z","0.14.0-pre.3090":"2021-09-22T15:18:39.696Z","0.13.9":"2021-09-23T20:49:23.077Z","0.14.0-unstable.3096":"2021-10-05T00:15:26.689Z","0.14.0-pre.3097":"2021-10-05T20:43:41.187Z","0.14.0-pre.3098":"2021-10-06T00:38:36.265Z","0.14.0-pre.3099":"2021-10-07T11:31:47.800Z","0.14.0-unstable.3105":"2021-10-12T00:10:38.380Z","0.14.0-pre.3106":"2021-10-12T15:39:58.202Z","0.14.0-pre.3113":"2021-10-14T08:22:53.656Z","0.14.0-pre.3114":"2021-10-14T10:39:41.041Z","0.14.0-pre.3115":"2021-10-14T13:37:55.044Z","0.14.0-pre.3122":"2021-10-18T09:32:06.766Z","0.14.0-pre.3128":"2021-10-18T21:07:12.031Z","0.14.0-alpha.3152":"2021-10-21T13:12:36.210Z","0.14.0-alpha.3154":"2021-10-22T09:01:00.690Z","0.14.0-beta.3156":"2021-10-22T12:11:02.638Z","0.14.0-beta.3157":"2021-10-22T14:48:27.668Z","0.14.0-beta.3163":"2021-10-22T22:54:06.864Z","0.14.0-beta.3183":"2021-10-27T15:48:57.324Z","0.14.0-beta.3184":"2021-10-28T00:12:26.838Z","0.14.0-beta.3187":"2021-10-28T10:10:22.926Z","0.14.0-beta.3203":"2021-10-28T23:10:28.465Z","0.14.0-beta.3215":"2021-10-29T20:40:19.980Z","0.14.0-beta.3216":"2021-10-29T23:25:34.702Z","0.14.0-beta.3217":"2021-10-31T02:38:13.866Z","0.14.0-beta.3222":"2021-11-03T11:18:32.742Z","0.14.0-beta.3226":"2021-11-06T01:22:42.013Z","0.14.0-beta.3230":"2021-11-08T13:11:14.081Z","0.14.0":"2021-11-08T18:03:07.240Z","0.14.1-beta.3240":"2021-11-10T02:34:32.927Z","0.14.1-beta.3244":"2021-11-10T11:58:54.943Z","0.14.1-beta.3246":"2021-11-11T21:45:25.055Z","0.14.1-beta.3250":"2021-11-12T15:22:02.236Z","0.14.1-beta.3256":"2021-11-16T14:00:21.557Z","0.14.1-beta.3266":"2021-11-18T14:53:42.699Z","0.14.1":"2021-11-19T13:24:46.792Z","0.14.2-beta.3272":"2021-11-20T00:45:04.806Z","0.14.2":"2021-11-22T14:18:37.406Z","0.14.3-beta.3295":"2021-11-24T09:52:43.787Z","0.14.3-beta.3296":"2021-11-24T14:33:25.381Z","0.14.3-beta.3297":"2021-11-25T02:02:48.323Z","0.14.3-beta.3299":"2021-11-25T15:02:43.610Z","0.14.3-beta.3303":"2021-11-26T01:25:12.515Z","0.14.3":"2021-11-26T10:50:39.129Z","0.14.4-beta.3311":"2021-11-28T15:55:05.643Z","0.14.4-beta.3313":"2021-11-29T17:28:50.839Z","0.14.4":"2021-12-01T09:43:53.103Z","0.14.5-beta.3331":"2021-12-07T17:11:10.753Z","0.14.5-beta.3335":"2021-12-09T17:58:33.752Z","0.14.5-beta.3336":"2021-12-09T22:34:39.208Z","0.14.5-beta.3339":"2021-12-10T16:52:39.471Z","0.14.5-beta.3344":"2021-12-11T21:38:13.518Z","0.14.5-beta.3346":"2021-12-13T13:31:04.047Z","0.14.5-beta.3347":"2021-12-13T14:50:35.755Z","0.14.5":"2021-12-13T16:39:41.097Z","0.14.6-beta.3361":"2021-12-15T16:52:54.413Z","0.14.6-beta.3368":"2021-12-16T13:24:11.672Z","0.14.6-beta.3400":"2021-12-22T23:53:54.381Z","0.14.6-beta.3419":"2021-12-31T15:31:38.978Z","0.14.6-beta.3425":"2022-01-05T09:37:05.459Z","0.14.6":"2022-01-05T16:50:41.912Z","0.14.7-beta.3428":"2022-01-05T21:47:04.542Z","0.14.7-beta.3435":"2022-01-08T11:05:22.145Z","0.14.7-beta.3438":"2022-01-09T09:42:27.323Z","0.14.7-beta.3456":"2022-01-10T11:44:31.825Z","0.14.7-beta.3463":"2022-01-10T13:34:33.651Z","0.14.7-beta.3467":"2022-01-11T10:48:35.079Z","0.14.7-beta.3472":"2022-01-12T01:36:46.851Z","0.14.7":"2022-01-12T09:27:36.307Z","0.14.8-beta.3480":"2022-01-12T23:55:29.752Z","0.14.8-beta.3483":"2022-01-13T00:23:34.556Z","0.14.8-beta.3487":"2022-01-13T09:29:03.697Z","0.14.8-beta.3490":"2022-01-13T17:39:29.147Z","0.14.8-beta.3494":"2022-01-15T09:07:37.767Z","0.14.8-beta.3500":"2022-01-17T12:34:52.178Z","0.14.8-beta.3504":"2022-01-18T18:12:21.776Z","0.14.8-beta.3509":"2022-01-19T08:53:52.387Z","0.14.8-beta.3510":"2022-01-20T00:48:32.365Z","0.14.8-beta.3511":"2022-01-20T02:02:39.856Z","0.14.8-beta.3513":"2022-01-20T10:27:11.875Z","0.14.8-beta.3515":"2022-01-20T12:13:42.216Z","0.14.8":"2022-01-20T13:47:03.990Z","0.14.9-beta.3522":"2022-01-21T01:00:29.359Z","0.14.9-beta.3526":"2022-01-21T11:01:29.177Z","0.14.9":"2022-01-21T11:15:33.018Z","0.15.0-alpha.3537":"2022-01-21T21:45:17.711Z","0.15.0-alpha.3540":"2022-01-22T15:13:22.509Z","0.15.0-alpha.3548":"2022-01-25T19:33:13.377Z","0.15.0-alpha.3549":"2022-01-25T19:52:47.359Z","0.15.0-alpha.3555":"2022-01-27T01:48:55.869Z","0.15.0-alpha.3564":"2022-01-28T11:27:37.023Z","0.15.0-alpha.3589":"2022-02-02T18:04:08.921Z","0.15.0-alpha.3592":"2022-02-03T01:17:32.831Z","0.14.10-beta.3615":"2022-02-04T13:37:59.357Z","0.14.10-beta.3616":"2022-02-04T13:42:28.765Z","0.14.10-beta.3621":"2022-02-04T18:24:52.001Z","0.14.10":"2022-02-04T21:47:29.644Z","0.15.0-alpha.3640":"2022-02-09T23:25:23.328Z","0.14.10-beta.3659":"2022-02-13T10:46:39.178Z","0.14.10-beta.3661":"2022-02-13T11:00:54.436Z","0.15.0-alpha.3662":"2022-02-13T11:25:07.155Z","0.14.11-beta.3674":"2022-02-17T11:24:47.058Z","0.14.11-beta.3680":"2022-02-17T13:43:00.641Z","0.14.11-beta.3683":"2022-02-17T15:11:05.923Z","0.14.11-beta.3686":"2022-02-17T15:41:42.603Z","0.14.11":"2022-02-17T16:37:52.270Z","0.14.12-beta.3701":"2022-02-20T17:01:36.567Z","0.14.12-beta.3703":"2022-02-20T19:38:33.470Z","0.14.12-beta.3704":"2022-02-20T23:17:52.868Z","0.14.12":"2022-02-21T10:12:51.646Z","0.15.0-alpha.3711":"2022-02-21T21:31:24.139Z","0.15.0-alpha.3719":"2022-02-23T09:25:23.983Z","0.15.0-alpha.3724":"2022-02-23T16:01:51.148Z","0.14.13-beta.3733":"2022-02-26T15:37:19.385Z","0.14.13-beta.3734":"2022-02-26T23:10:24.183Z","0.14.13":"2022-02-27T10:16:40.606Z","0.15.0-alpha.3740":"2022-02-27T12:17:35.922Z","0.14.14-beta.3748":"2022-03-01T10:54:03.096Z","0.14.14-beta.3753":"2022-03-01T13:57:55.086Z","0.14.14-beta.3765":"2022-03-02T17:58:24.210Z","0.14.14-beta.3767":"2022-03-02T21:12:46.788Z","0.14.14":"2022-03-03T01:27:10.105Z","0.15.0-alpha.3784":"2022-03-03T22:12:39.740Z","0.14.15-beta.3790":"2022-03-04T13:51:24.349Z","0.14.15-beta.3791":"2022-03-04T16:06:35.028Z","0.14.15-beta.3795":"2022-03-04T18:16:59.710Z","0.14.15":"2022-03-05T09:09:07.208Z","0.15.0-alpha.3804":"2022-03-05T14:02:39.843Z","0.15.0-alpha.3809":"2022-03-06T09:55:53.967Z","0.15.0-alpha.3816":"2022-03-08T09:11:16.970Z","0.14.16-beta.3830":"2022-03-09T16:32:43.532Z","0.14.16-beta.3834":"2022-03-10T10:11:54.673Z","0.14.16-beta.3841":"2022-03-10T13:06:31.956Z","0.14.16-beta.3852":"2022-03-10T13:20:26.329Z","0.14.16-beta.3861":"2022-03-10T13:24:24.608Z","0.14.16-beta.3846":"2022-03-10T13:32:31.717Z","0.14.16-beta.3856":"2022-03-10T13:37:45.994Z","0.14.16-beta.3843":"2022-03-10T13:42:04.712Z","0.14.16-beta.3850":"2022-03-10T13:52:02.473Z","0.14.16-beta.3860":"2022-03-10T13:57:23.350Z","0.14.16-beta.3863":"2022-03-10T14:02:02.358Z","0.14.16-beta.3855":"2022-03-10T14:03:10.075Z","0.14.16":"2022-03-10T15:27:15.746Z","0.14.17-beta.3882":"2022-03-11T15:51:42.352Z","0.14.17":"2022-03-13T16:19:00.055Z","0.15.0-alpha.3905":"2022-03-14T01:38:49.236Z","0.14.18-beta.3923":"2022-03-15T00:51:40.940Z","0.14.18":"2022-03-15T08:51:29.991Z","0.14.19-beta.3927":"2022-03-15T17:55:18.632Z","0.15.0-alpha.3933":"2022-03-16T10:19:14.623Z","0.14.19-beta.3953":"2022-03-18T02:56:27.553Z","0.14.19-beta.3964":"2022-03-18T18:17:57.220Z","0.14.19-beta.3968":"2022-03-19T14:53:08.901Z","0.14.19-beta.3970":"2022-03-20T03:12:33.277Z","0.14.19":"2022-03-20T09:55:38.014Z","0.15.0-alpha.3975":"2022-03-21T07:29:44.551Z","0.14.20-beta.3989":"2022-03-24T03:55:32.548Z","0.15.0-alpha.4005":"2022-03-25T19:23:12.213Z","0.14.20-beta.4013":"2022-03-30T21:10:57.248Z","0.14.20-beta.4017":"2022-03-31T07:29:53.814Z","0.14.20":"2022-04-01T08:27:39.520Z","0.15.0-alpha.4027":"2022-04-02T15:21:10.179Z","0.15.0-alpha.4028":"2022-04-03T10:34:14.659Z","0.15.0-alpha.4029":"2022-04-04T00:49:54.213Z","0.15.0-alpha.4034":"2022-04-04T09:01:41.180Z","0.15.0-alpha.4036":"2022-04-05T15:04:44.704Z","0.15.0-alpha.4041":"2022-04-07T13:17:32.915Z","0.14.20-beta.4064":"2022-04-10T11:16:07.683Z","0.14.20-beta.4067":"2022-04-10T14:51:26.598Z","0.14.21-beta.4074":"2022-04-11T10:36:06.629Z","0.14.21-beta.4078":"2022-04-11T17:07:02.373Z","0.14.21":"2022-04-12T16:56:40.766Z","0.15.0-alpha.4098":"2022-04-13T15:21:49.631Z","0.14.22-beta.4103":"2022-04-18T21:39:51.290Z","0.14.22-beta.4113":"2022-04-25T13:01:39.721Z","0.14.22":"2022-04-25T16:13:29.876Z","0.15.0-alpha.4122":"2022-04-26T13:35:57.370Z","0.14.23-beta.4124":"2022-04-27T15:11:57.975Z","0.14.23-beta.4129":"2022-04-30T08:36:33.222Z","0.14.23-beta.4131":"2022-04-30T14:38:48.823Z","0.14.23":"2022-05-01T12:52:06.291Z","0.14.24-beta.4144":"2022-05-04T12:57:47.929Z","0.14.24-beta.4150":"2022-05-04T22:50:33.384Z","0.14.24-beta.4157":"2022-05-05T13:54:03.508Z","0.14.24-beta.4161":"2022-05-06T14:36:09.153Z","0.14.24-beta.4163":"2022-05-07T00:01:20.159Z","0.14.24-beta.4168":"2022-05-09T13:23:56.179Z","0.14.24-beta.4171":"2022-05-09T16:53:40.644Z","0.14.24-beta.4191":"2022-05-12T15:28:59.575Z","0.14.24-beta.4195":"2022-05-13T10:21:40.010Z","0.14.24":"2022-05-13T14:29:11.591Z","0.14.25-beta.4229":"2022-05-19T22:45:40.903Z","0.15.0-alpha.4231":"2022-05-19T22:53:33.897Z","0.14.25-beta.4238":"2022-05-20T14:13:47.988Z","0.14.25-beta.4245":"2022-05-21T23:04:13.897Z","0.14.25":"2022-05-22T23:35:25.961Z","0.15.0-alpha.4257":"2022-05-24T14:56:20.371Z","0.14.25-beta.4266":"2022-06-02T07:50:35.135Z","0.14.26-beta.4273":"2022-06-04T07:13:55.091Z","0.14.26-beta.4274":"2022-06-04T08:01:17.204Z","0.14.26":"2022-06-05T14:21:12.797Z","0.14.27-beta.4280":"2022-06-05T23:42:49.399Z","0.15.0-alpha.4284":"2022-06-06T09:52:42.982Z","0.14.27-beta.4285":"2022-06-06T12:07:23.336Z","0.14.27-beta.4290":"2022-06-06T22:21:21.018Z","0.14.27":"2022-06-07T00:20:04.346Z","0.15.0-alpha.4311":"2022-06-08T13:41:47.704Z","0.15.0-alpha.4314":"2022-06-09T15:00:46.776Z","0.15.0-alpha.4332":"2022-06-14T10:24:41.448Z","0.15.0-alpha.4345":"2022-06-20T23:23:26.883Z","0.15.0-alpha.4355":"2022-06-24T11:41:42.876Z","0.14.28-beta.4360":"2022-06-27T12:33:29.523Z","0.14.28-beta.4363":"2022-06-28T09:39:06.028Z","0.14.28-beta.4379":"2022-07-01T07:09:02.477Z","0.14.28":"2022-07-01T10:35:25.031Z","0.14.29":"2022-07-05T09:47:40.927Z","0.15.0-alpha.4396":"2022-07-05T23:05:51.168Z","0.15.0-alpha.4399":"2022-07-06T13:50:15.495Z","0.15.0-alpha.4409":"2022-07-07T17:10:59.193Z","0.15.0-beta.4411":"2022-07-09T12:24:51.325Z","0.15.0-beta.4465":"2022-07-21T08:17:17.863Z","0.15.0-beta.4466":"2022-07-21T17:21:07.862Z","0.15.0-beta.4472":"2022-07-25T23:18:09.593Z","0.15.0-beta.4512":"2022-07-29T23:11:04.262Z","0.15.0-beta.4544":"2022-08-05T09:16:23.808Z","0.15.0-beta.4549":"2022-08-06T15:56:34.958Z","0.15.0-beta.4560":"2022-08-08T10:07:26.873Z","0.15.0-beta.4574":"2022-08-11T13:58:22.275Z","0.15.0-beta.4579":"2022-08-16T21:30:57.416Z","0.15.0-beta.4607":"2022-08-25T13:14:00.071Z","0.14.30":"2022-08-26T08:14:36.207Z","0.15.0-beta.4630":"2022-08-29T23:58:15.771Z","0.15.0-beta.4633":"2022-08-30T19:26:42.995Z","0.14.31":"2022-09-07T23:57:20.069Z","0.15.0-beta.4670":"2022-09-20T22:34:53.799Z","0.15.0-beta.4672":"2022-09-21T22:43:41.522Z","0.14.32":"2022-09-21T23:11:30.858Z","0.15.0-beta.4696":"2022-09-29T15:34:01.982Z","0.15.0-beta.4699":"2022-10-01T23:50:05.007Z","0.15.0-beta.4708":"2022-10-02T21:48:22.910Z","0.15.0-beta.4715":"2022-10-03T19:01:05.155Z","0.15.0-beta.4725":"2022-10-04T18:58:17.474Z","0.15.0-beta.4739":"2022-10-09T09:54:03.296Z","0.15.0-beta.4751":"2022-10-15T14:15:56.774Z","0.15.0-beta.4756":"2022-10-19T23:51:31.117Z","0.15.0-beta.4790":"2022-10-25T15:07:15.360Z","0.15.0-beta.4791":"2022-10-25T20:43:19.059Z","0.15.0-beta.4798":"2022-11-01T21:18:36.912Z","0.15.0-beta.4801":"2022-11-03T14:03:47.378Z","0.15.0-beta.4803":"2022-11-05T02:15:35.516Z","0.15.0-beta.4808":"2022-11-09T11:52:00.084Z","0.15.0-beta.4812":"2022-11-13T01:16:15.582Z","0.15.0-beta.4813":"2022-11-14T00:50:02.319Z","0.15.0-beta.4815":"2022-11-14T10:57:30.215Z","0.15.0-beta.4816":"2022-11-14T20:51:17.011Z","0.15.0-beta.4820":"2022-11-15T22:37:37.402Z","0.15.0-beta.4828":"2022-11-16T16:46:10.454Z","0.15.0-beta.4830":"2022-11-16T17:57:01.430Z","0.15.0":"2022-11-17T00:45:55.826Z","0.15.1-beta.4903":"2022-11-23T23:36:41.957Z","0.15.1-beta.4906":"2022-11-24T14:28:12.156Z","0.15.1-beta.4908":"2022-11-24T23:46:02.125Z","0.15.1-beta.4910":"2022-11-24T23:58:22.195Z","0.15.1":"2022-11-25T11:44:32.895Z","0.15.2-beta.4915":"2022-11-27T08:03:26.321Z","0.15.2-beta.4921":"2022-11-28T00:43:08.191Z","0.15.2-beta.4923":"2022-11-28T16:26:50.639Z","0.15.2-beta.4932":"2022-11-30T01:57:07.097Z","0.15.2-beta.4938":"2022-12-02T12:44:26.591Z","0.15.2-beta.4941":"2022-12-03T14:46:53.987Z","0.15.2-beta.4943":"2022-12-04T23:25:40.377Z","0.15.2":"2022-12-05T01:12:41.976Z","0.15.3-beta.4955":"2022-12-09T17:22:57.686Z","0.15.3-beta.4970":"2022-12-13T11:18:50.320Z","0.15.3-beta.4975":"2022-12-13T17:13:37.052Z","0.15.3-beta.4989":"2022-12-16T00:39:16.045Z","0.15.3":"2022-12-16T16:26:17.792Z","0.15.4-beta.5008":"2022-12-19T16:09:25.674Z","0.15.4-beta.5013":"2022-12-21T12:09:01.361Z","0.15.4-beta.5015":"2022-12-21T14:36:44.780Z","0.15.4":"2022-12-21T15:56:12.317Z","0.15.5-beta.5022":"2022-12-22T20:18:47.518Z","0.15.5-beta.5054":"2023-01-16T10:08:51.325Z","0.15.5-beta.5073":"2023-01-20T00:09:25.139Z","0.15.5-beta.5087":"2023-01-23T08:13:46.885Z","0.15.5":"2023-01-23T09:08:59.396Z","0.15.6-beta.5100":"2023-01-27T00:55:43.560Z","0.15.6-beta.5103":"2023-01-27T09:08:55.720Z","0.15.6-beta.5105":"2023-01-27T13:09:23.491Z","0.15.6-beta.5106":"2023-01-27T20:03:42.825Z","0.15.6-beta.5109":"2023-01-28T20:48:08.131Z","0.15.6":"2023-01-30T14:21:31.140Z","0.15.7-beta.5126":"2023-02-01T09:36:30.268Z","0.15.7-beta.5134":"2023-02-02T09:30:23.568Z","0.15.7-beta.5135":"2023-02-02T09:32:45.200Z","0.15.7-beta.5146":"2023-02-04T10:01:53.316Z","0.15.7-beta.5147":"2023-02-05T20:05:09.514Z","0.15.7-beta.5155":"2023-02-09T13:39:30.582Z","0.15.7":"2023-02-10T09:10:35.885Z","0.15.8-beta.5168":"2023-02-10T20:22:20.631Z","0.15.8-beta.5218":"2023-03-01T17:38:02.831Z","0.15.8-beta.5219":"2023-03-01T23:51:07.633Z","0.15.8-beta.5224":"2023-03-02T13:35:30.043Z","0.15.8-beta.5229":"2023-03-02T18:04:31.980Z","0.15.8-beta.5238":"2023-03-03T08:54:19.413Z","0.15.8-beta.5261":"2023-03-06T16:08:07.097Z","0.15.8-beta.5269":"2023-03-07T12:45:04.132Z","0.15.8-beta.5276":"2023-03-07T22:30:54.915Z","0.15.8-beta.5281":"2023-03-08T08:20:16.876Z","0.15.8-beta.5283":"2023-03-08T08:20:22.636Z","0.15.8":"2023-03-08T09:27:56.380Z","0.15.8-beta.5316":"2023-03-15T08:26:31.318Z","0.15.9-beta.5384":"2023-03-29T09:15:33.496Z","0.15.9-beta.5387":"2023-03-30T07:23:12.758Z","0.15.9-beta.5415":"2023-04-07T22:36:30.428Z","0.15.9-beta.5417":"2023-04-08T12:15:37.225Z","0.15.9-beta.5420":"2023-04-10T09:19:27.948Z","0.15.9-beta.5423":"2023-04-10T11:13:45.191Z","0.15.9-beta.5435":"2023-04-11T09:28:42.219Z","0.15.9-beta.5437":"2023-04-11T10:59:13.397Z","0.15.9":"2023-04-11T18:27:59.801Z","0.15.10-beta.5447":"2023-04-13T20:16:30.013Z","0.15.10-beta.5457":"2023-04-17T08:03:54.793Z","0.15.10-beta.5462":"2023-04-18T08:56:47.599Z","0.15.10-beta.5463":"2023-04-18T10:39:45.657Z","0.15.10-beta.5490":"2023-04-28T10:29:25.807Z","0.15.10-beta.5491":"2023-04-28T15:21:52.263Z","0.15.10-beta.5496":"2023-05-04T13:56:27.259Z","0.15.10":"2023-05-08T10:17:59.172Z","0.15.11-beta.5506":"2023-05-11T13:27:16.754Z","0.15.11":"2023-05-15T12:59:38.068Z","0.15.12-beta.5528":"2023-05-17T00:06:03.654Z","0.15.12-beta.5531":"2023-05-17T16:55:06.099Z","0.15.12-beta.5535":"2023-05-19T07:24:39.166Z","0.15.12-beta.5538":"2023-05-19T12:10:24.801Z","0.15.12-beta.5541":"2023-05-19T16:18:08.408Z","0.15.12":"2023-05-19T23:23:34.586Z","0.15.13-beta.5556":"2023-05-22T14:36:25.248Z","0.15.13-beta.5560":"2023-05-24T12:34:39.321Z","0.15.13-beta.5575":"2023-05-26T16:07:56.718Z","0.15.13-beta.5583":"2023-05-29T12:56:32.494Z","0.15.13-beta.5591":"2023-05-31T09:47:24.122Z","0.15.13":"2023-05-31T09:47:30.832Z"},"bugs":{"url":"https://github.com/smapiot/piral/issues"},"author":{"name":"smapiot"},"license":"MIT","homepage":"https://piral.io","keywords":["piral","smapiot","portal","modules","server-side","server","utilities","rendering"],"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"description":"Utilities for server-side rendering of a Piral instance.","maintainers":[{"email":"mail@florian-rappl.de","name":"florianrappl"},{"email":"mail@manuelroemer.com","name":"manuel.roemer"},{"email":"lothar.schoettner@smapiot.com","name":"lschoett"}],"readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral SSR Utils](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-ssr-utils.svg?style=flat)](https://www.npmjs.com/package/piral-search) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a utility library that only has a peer dependency to `piral-core`.\n\nWhat `piral-ssr-utils` offers are utilities that can be used for easily implementing server-side rendering of a Piral instance.\n\n## Documentation\n\nThe utilities should be used as follows.\n\nOn the server use `renderFromServer`:\n\n```ts\nimport { renderFromServer } from 'piral-ssr-utils';\n\nasync function sendIndex(_: express.Request, res: express.Response) {\n  const content = await renderFromServer(<App />, {\n    getPilet(url) {\n      return readRemoteText(url);\n    },\n    getPiletsMetadata() {\n      return readRemoteJson(feedUrl);\n    },\n    fillTemplate(body, script) {\n      return `\n        <!doctype html>\n        <head><meta charset=\"utf-8\"><title>React SSR Sample</title></head>\n        <body>\n          <div id=\"app\">${body}</div>${script}\n          <script src=\"index.js\"></script>\n        </body>\n      `;\n    },\n  });\n  res.send(content);\n}\n```\n\n**Remark**: Use, e.g., the incoming request for retrieving custom pilet metadata responses (e.g., using feature flags). Otherwise, fully cache the response. Pilets can/should be cached in any case.\n\nThe provided snippet assumes that `readRemoteText` and `readRemoteJson` trigger an HTTP request with the method of your choice. While the former just returns the content of the response, the latter already parses the response body's JSON.\n\nThe given component `App` can be as simple as `<Piral />`, however, for a full alignment with the client-side a custom configuration should be used.\n\nIn any case (e.g., for the client hydration) use `configForServerRendering` when configuring your Piral instance:\n\n```ts\nimport { configForServerRendering } from 'piral-ssr-utils/runtime';\n\nconst instance = createInstance(configForServerRendering({\n  // ... put your normal configuration here\n}));\n```\n\nFor more information on using `piral-ssr-utils`, see [our sample repository](https://github.com/smapiot/sample-piral-ssr).\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","readmeFilename":"README.md"}