@primate/svelte 0.4.2 → 0.5.0

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 +3 -3
  2. package/src/module.js +3 -4
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@primate/svelte",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "bugs": "https://github.com/primatejs/svelte/issues",
5
5
  "repository": "https://github.com/primatejs/svelte",
6
6
  "description": "Primate Svelte module",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "runtime-compat": "^0.14.1",
9
+ "runtime-compat": "^0.15.0",
10
10
  "svelte": "^3.58.0"
11
11
  },
12
12
  "devDependencies": {
13
13
  "maximin": "^0.1.2"
14
14
  },
15
15
  "peerDependencies": {
16
- "primate": "0.14"
16
+ "primate": "0.15"
17
17
  },
18
18
  "type": "module",
19
19
  "exports": "./exports.js"
package/src/module.js CHANGED
@@ -10,14 +10,13 @@ const type = "module";
10
10
 
11
11
  const handler = path => (component, props = {}, {status = 200} = {}) =>
12
12
  async (env, headers) => {
13
- const {js} = endings;
14
- const {html: body} = (await import(`${path.join(`${component}${js}`)}`))
13
+ const {html: body} = (await import(`${path.join(`${component}.js`)}`))
15
14
  .default.render(props);
16
15
 
17
16
  // create an entry point
18
- const entry = `import ${component} from "./${component}.svelte.js";
17
+ const entry = `import Component from "./${component}.js";
19
18
  const props = JSON.parse(${JSON.stringify(JSON.stringify(props))});
20
- new ${component}({
19
+ new Component({
21
20
  target: document.body,
22
21
  hydrate: true,
23
22
  props,