{"dist":{"shasum":"463e1cc0fb77cd9361646746b5c55336f0a42aa7","tarball":"https://registry.npmjs.org/solid-meta/-/solid-meta-0.24.0-beta.1.tgz","fileCount":6,"integrity":"sha512-0Ppo/AwflV86NZlhv1+vT3EgHN8xdmGrwG3+B7L7RP+LdzsVutk/w0uRpzoNh7Vd+NDgDt8jahGy0vcvzC/9IQ==","signatures":[{"sig":"MEYCIQChq65OgZq6w0O8DaV06TixCYE3IDg5GR9ox+pYQScSTwIhAPgn2yEB+/atHc3yscPafUB0rkoUlctymCXskvUvOsRd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13519,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFTceCRA9TVsSAnZWagAABT0P/A0Xk3jCZ2iasfDfehh1\nbFRBPq/R+MBobz5qAepPtAg4oM+guSVKPEvSoAjPn0CB3ZkSXSdCA5spHWN1\nEtfPXDs7LghgYMyM73Yf8Q7WDllowhQ5oMZ4TCCpEiIBjmmkkTj4UBwNGgWH\nlZMyjoTs+PwnvZs6q8fx8SfWAyPIKFhevp9WWGHDYc3faKWyJ/NZfhoGWUJV\nhqT7V3c5Z42TftejdGt0EPT6u0AfHh3Wtii/4iVlQn3663PNg8n9WOjfUGuj\nnOB/jRyr9nE5R3ZY4xLKVbJgybh6U+lXNs4DwPanCJMgYhQabBnANi8X7j1Y\nsEKBROBzWPoCKmrzgQFFdaoF44NaWTHynEGv9EsUpuqyfLkLolIvyBOL5afU\nij4Poq6t2UD8dSP8/bETk+pfRojuIeK9fI3eJ9fy0WbtnU8fcsGSDi93tsBL\nw7EhpmFMv/6WzHPCpeu9S7dg6Gn5FmMqCTsAl5J0+vpDK5uOg+p+YZqw3jUl\nNkrRPPXn0G0iYHdrgBYSc4R17Zdol+OsYF0hFq7wB0iIEZSUsp/o5Bsl6iJf\ntUAOb8fSOUDSh87rWtoIyJgExbqYhpUioxzTdCRrVQkiaQjTft0PT0j1Jvzw\nwpJ3kgB129QyvieXI+zPzXtiwY1t4VkmWf/zKVSfzEni78wJsx8RBdCtIB7t\nvJLE\r\n=bxGj\r\n-----END PGP SIGNATURE-----\r\n"},"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":"a6c563c7e3cb92671ea2d5b29a839e40cedb058a","license":"MIT","scripts":{"test":"jest && npm run test:types","build":"tsc && babel src/index.tsx --out-file dist/index.js","test:types":"tsc --project tsconfig.test.json"},"_npmUser":{"name":"ryansolid","email":"ryansolid@gmail.com"},"repository":{"url":"https://github.com/ryansolid/solid/blob/master/packages/solid-meta","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.15.1+x64 (linux)","description":"Solid wrapper for Styled JSX","directories":{},"maintainers":[{"name":"ryansolid","email":"ryansolid@gmail.com"}],"sideEffects":false,"_nodeVersion":"14.15.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"solid-js":"^0.24.0-beta.1"},"peerDependencies":{"solid-js":"^0.23.0"},"_npmOperationalInternal":{"tmp":"tmp/solid-meta_0.24.0-beta.1_1612003101857_0.2774694829191042","host":"s3://npm-registry-packages"},"_id":"solid-meta@0.24.0-beta.1","version":"0.24.0-beta.1"}