@primate/svelte 0.3.0 → 0.3.2

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/package.json +1 -1
  2. package/src/module.js +1 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primate/svelte",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "bugs": "https://github.com/primatejs/svelte/issues",
5
5
  "repository": "https://github.com/primatejs/svelte",
6
6
  "description": "Primate Svelte handler",
package/src/module.js CHANGED
@@ -14,10 +14,9 @@ const handler = path => (component, props = {}, {status = 200} = {}) =>
14
14
  const {html: body} = (await import(`${path.join(`${component}${js}`)}`))
15
15
  .default.render(props);
16
16
 
17
- const stringifiedProps = JSON.stringify(props);
18
17
  // create an entry point
19
18
  const entry = `import ${component} from "./${component}.svelte.js";
20
- const props = JSON.parse('${stringifiedProps}');
19
+ const props = JSON.parse(${JSON.stringify(JSON.stringify(props))});
21
20
  new ${component}({
22
21
  target: document.body,
23
22
  hydrate: true,
@@ -77,7 +76,6 @@ export default directory => async () => {
77
76
  .replaceAll(svelte, js)
78
77
  .replace("/svelte/internal", "/svelte/internal.js");
79
78
  await env.publish({src: `${component.name}.js`, code: compiled, type});
80
- await File.write(`${component.path}.client.js`, compiled);
81
79
  }));
82
80
  return next(env);
83
81
  },