@primate/svelte 0.11.2 → 0.13.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.
- package/package.json +3 -3
- package/src/module.js +4 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primate/svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Primate Svelte module",
|
|
5
5
|
"homepage": "https://primatejs.com/modules/svelte",
|
|
6
6
|
"bugs": "https://github.com/primatejs/primate/issues",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"directory": "packages/svelte"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"runtime-compat": "^0.
|
|
20
|
-
"svelte": "^3.59.
|
|
19
|
+
"runtime-compat": "^0.21.0",
|
|
20
|
+
"svelte": "^3.59.2"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"primate": "0.20"
|
package/src/module.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import crypto from "runtime-compat/crypto";
|
|
2
2
|
import {Path} from "runtime-compat/fs";
|
|
3
3
|
import * as compiler from "svelte/compiler";
|
|
4
|
-
import {tryreturn} from "runtime-compat/
|
|
4
|
+
import {tryreturn} from "runtime-compat/async";
|
|
5
5
|
import errors from "./errors.js";
|
|
6
6
|
|
|
7
7
|
const endings = {
|
|
@@ -46,7 +46,6 @@ const handler = ({path}) => (name, props = {}, {status = 200, page} = {}) =>
|
|
|
46
46
|
if (as_layout) {
|
|
47
47
|
return make(name, props);
|
|
48
48
|
}
|
|
49
|
-
const headers = app.headers();
|
|
50
49
|
const components = (await Promise.all(layouts.map(layout =>
|
|
51
50
|
layout(app, {as_layout: true})
|
|
52
51
|
)))
|
|
@@ -76,10 +75,9 @@ const handler = ({path}) => (name, props = {}, {status = 200, page} = {}) =>
|
|
|
76
75
|
});
|
|
77
76
|
`;
|
|
78
77
|
|
|
79
|
-
|
|
80
|
-
//
|
|
81
|
-
headers
|
|
82
|
-
.replace("script-src 'self' ", `script-src 'self' '${integrity}' `);
|
|
78
|
+
await app.publish({code, type, inline: true});
|
|
79
|
+
// needs to be called before app.render
|
|
80
|
+
const headers = app.headers();
|
|
83
81
|
|
|
84
82
|
// -> spread into new Response()
|
|
85
83
|
return [await app.render({body: html, page}), {
|