vatts 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/renderer.js +8 -9
  2. package/package.json +1 -1
package/dist/renderer.js CHANGED
@@ -161,15 +161,14 @@ function getJavaScriptUrls(req) {
161
161
  }
162
162
  }
163
163
  function ServerRoot({ lang, title, metaTagsHtml, initialDataScript, hotReloadScript, dataScript, children }) {
164
- return ((0, jsx_runtime_1.jsxs)("html", { lang: lang, children: [(0, jsx_runtime_1.jsxs)("head", { children: [(0, jsx_runtime_1.jsx)("meta", { charSet: "utf-8" }), (0, jsx_runtime_1.jsx)("title", { children: title }), initialDataScript && ((0, jsx_runtime_1.jsx)("script", { dangerouslySetInnerHTML: { __html: initialDataScript } })), metaTagsHtml && ((0, jsx_runtime_1.jsx)("script", { dangerouslySetInnerHTML: {
165
- __html: `
166
- (() => {
167
- const tpl = document.createElement('template');
168
- tpl.innerHTML = ${JSON.stringify(metaTagsHtml)};
169
- document.head.append(...tpl.content.childNodes);
170
- })();
171
- `
172
- } }))] }), (0, jsx_runtime_1.jsxs)("body", { children: [dataScript, (0, jsx_runtime_1.jsx)("div", { id: "root", children: children }), hotReloadScript && (0, jsx_runtime_1.jsx)("span", { dangerouslySetInnerHTML: { __html: hotReloadScript } })] })] }));
164
+ // Concatena tudo que vai no head em uma única string
165
+ const headContent = `
166
+ <meta charset="utf-8" />
167
+ <title>${title}</title>
168
+ ${initialDataScript ? `<script>${initialDataScript}</script>` : ''}
169
+ ${metaTagsHtml || ''}
170
+ `;
171
+ return ((0, jsx_runtime_1.jsxs)("html", { lang: lang, children: [(0, jsx_runtime_1.jsx)("head", { dangerouslySetInnerHTML: { __html: headContent } }), (0, jsx_runtime_1.jsxs)("body", { children: [dataScript, (0, jsx_runtime_1.jsx)("div", { id: "root", children: children }), hotReloadScript && ((0, jsx_runtime_1.jsx)("div", { style: { display: 'none' }, dangerouslySetInnerHTML: { __html: hotReloadScript } }))] })] }));
173
172
  }
174
173
  async function renderAsStream({ req, res, route, params, allRoutes }) {
175
174
  const { generateMetadata } = route;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vatts",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Vatts.js is a high-level framework for building web applications with ease and speed. It provides a robust set of tools and features to streamline development and enhance productivity.",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "itsmuzin",