{"dist":{"shasum":"5aeb55ce72675333bdba2b7accf8c6ac5125df05","tarball":"https://registry.npmjs.org/solid-meta/-/solid-meta-1.0.0-rc.0.tgz","fileCount":6,"integrity":"sha512-0SeNXlZqoVXNmOPIxvcbaXjHAVxP/DCsWY3h1moVVUMJcK0YF5ozQDVdLg2F7CIYCQZX2znol/vg0rvy41cf5Q==","signatures":[{"sig":"MEYCIQDdIsvlh3xMHQZkrzrypMaCGaD5dMKiajyeSq+Rz1ZikQIhANvKkwzRSEDQMX4DUY2Lkw1TSwP4Q3tO6c05V6gXQ/St","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgimDwCRA9TVsSAnZWagAAAtgP/2yr5nWdFh2O4CyAXsez\nwsJR8Hlh+33rTniGi3V35XUScQswdH5IscK5ELWGnhcrE6iJm7EfXyuiM9od\neT0c3uC/N2l5SPFGtRhYMsri8Y8jf5i1aLC7xzRt20SfVLtE7BbYBGSvc3cb\nFk/6txjaB+6NUjcYINkje0KuVp24uVX9NpzXl5qdoHOW4cRoN30q6R2WnAfB\nVNjrj2yeaEjYpzBuRsA0Ra1SWkaZuMfePnnYF0liUkyLUy5NTdOb6eZTrjze\n+P2V8dTBBbFAYGpQK9HyeV4IynBQ3x4VrCqiDSPI/wv2tetoD13Ip4m+K4EQ\nG40iB0NZvQoq+CQ1GhNtd2vGcdiag3Aut0cgA2mN5gUBp7S/e0u441zMAWKf\nmpmJaPLOl2KjgpbdAW6FWS9seAT/7oyoOTeymXhT4yXdFh3vJkJZXSMsxLn1\nLzIWBi3uYD2tXmJmZeFNm+QquPf+1QkEEBPDHDRCoLi+aTUWD3iET4XTWjp7\nZXHIt4DlUxQvUC26x9H8/aBQ9mZ+zktaR6lwW8nUeQ4O/jO8SLcIl89a5/Kg\niJSa7BdIkJxnoAvrIJV3i1ekFDWT20BOWBuzVCz0miyBB6WYuKZnn64+bN1H\nZmH1jNxVmThKCMuZbZBoIP495dKB6OtWGhl4n192mNLHaLuhDbEFAVHcMUfY\nmaw1\r\n=0PxG\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"preset":"solid-jest/preset/browser"},"main":"dist/index.js","name":"solid-meta","type":"module","types":"dist/index.d.ts","author":{"name":"Ryan Carniato"},"readme":"# solid-meta [![npm Version](https://img.shields.io/npm/v/solid-meta.svg?style=flat-square)](https://www.npmjs.org/package/solid-meta)\n\nAsynchronous SSR-ready Document Head management for Solid based on [React Head](https://github.com/tizmagik/react-head)\n\n## Motivation\n\nThis module allows you to define `document.head` tags anywhere in your component hierarchy. The motivations are similar to [react-helmet](https://github.com/nfl/react-helmet) in that you may only have the information for certain tags contextually deep in your component hiearchy. There are no dependencies and it should work fine with asynchronous rendering.\n\n## Installation\n\n```sh\nnpm i solid-meta\n```\n\n## How it works\n\n1.  You wrap your App with `<MetaProvider />`\n1.  From the server, you pass `tags[]` array to `<MetaProvider />`\n1.  Then call `renderTags(tags)` and include in the `<head />` block of your server template\n1.  To insert head tags within your app, just render one of `<Title />`, `<Meta />`, `<Style />`, `<Link />`, and `<Base />` components as often as needed.\n\nOn the server, the tags are collected in the `tags[]` array, and then on the client the server-generated tags are removed in favor of the client-rendered tags so that SPAs still work as expected (e.g. in cases where subsequent page loads need to change the head tags).\n\n### Server setup\n\nWrap your app with `<MetaProvider />` on the server, using a `tags[]` array to pass down as part of your server-rendered payload. When rendered, the component mutates this array to contain the tags.\n\n```js\nimport { renderToString } from 'solid-js/web';\nimport { MetaProvider, renderTags } from 'solid-meta';\nimport App from './App';\n\n// ... within the context of a request ...\n\nconst tags = []; // mutated during render so you can include in server-rendered template later\nconst app = renderToString(\n  <MetaProvider tags={tags}>\n    <App />\n  </MetaProvider>\n);\n\nres.send(`\n  <!doctype html>\n    <head>\n      ${renderTags(tags)}\n    </head>\n    <body>\n      <div id=\"root\">${app}</div>\n    </body>\n  </html>\n`);\n```\n\n### Client setup\n\nThere is nothing special required on the client, just render one of head tag components whenever you want to inject a tag in the `<head />`.\n\n```js\nimport { MetaProvider, Title, Link, Meta } from 'solid-meta';\n\nconst App = () => (\n  <MetaProvider>\n    <div class=\"Home\">\n      <Title>Title of page</Title>\n      <Link rel=\"canonical\" href=\"http://solidjs.com/\" />\n      <Meta name=\"example\" content=\"whatever\" />\n      // ...\n    </div>\n  </MetaProvider>\n);\n```","exports":{".":{"solid":"./dist/index.jsx","default":"./dist/index.js"}},"gitHead":"a2409a441a855c3c7244d2cdad47d0bb6a5e5db8","license":"MIT","scripts":{"test":"jest && npm run test:types","build":"tsc && babel src/index.tsx --out-file dist/index.js","clean":"rimraf dist/","prebuild":"npm run clean","test:types":"tsc --project tsconfig.test.json"},"_npmUser":{"name":"ryansolid","email":"ryansolid@gmail.com"},"repository":{"url":"https://github.com/solidui/solid/blob/main/packages/solid-meta","type":"git"},"_npmVersion":"lerna/3.22.1/node@v15.11.0+arm64 (darwin)","description":"Write meta tags to the document head","directories":{},"maintainers":[{"name":"ryansolid","email":"ryansolid@gmail.com"}],"sideEffects":false,"_nodeVersion":"15.11.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"solid-js":"^1.0.0-rc.0","babel-preset-solid":"^1.0.0-rc.0"},"peerDependencies":{"solid-js":">= 0.26.0"},"_npmOperationalInternal":{"tmp":"tmp/solid-meta_1.0.0-rc.0_1619681520392_0.4426795754393267","host":"s3://npm-registry-packages"},"_id":"solid-meta@1.0.0-rc.0","version":"1.0.0-rc.0"}