saloe 0.0.6 → 0.0.8
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.
|
@@ -2,8 +2,7 @@ import { findPatternFromUrl, getRedirectResponse, getForbiddenResponse, getRoute
|
|
|
2
2
|
import { getStaticResponse } from 'saloe/cloudflare-worker'
|
|
3
3
|
import { addRoute } from 'saloe/router'
|
|
4
4
|
import { html, stream } from 'saloe/html'
|
|
5
|
-
import {
|
|
6
|
-
import { listener, getScriptListener } from 'saloe/listener'
|
|
5
|
+
import { getScriptListener } from 'saloe/listener'
|
|
7
6
|
|
|
8
7
|
import manifestJSON from '__STATIC_CONTENT_MANIFEST'
|
|
9
8
|
|
package/dist/html.cjs.js
CHANGED
|
@@ -43,11 +43,10 @@ const awaitHtml = async ({ pending, success, error }) => {
|
|
|
43
43
|
const id = Math.floor(Math.random() * 1e9);
|
|
44
44
|
const pendingId = `pending_${id}`;
|
|
45
45
|
const pendingRoutePathname = `/~/components/${pendingId}`;
|
|
46
|
-
const
|
|
47
|
-
const headers =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
46
|
+
const route = async () => {
|
|
47
|
+
const headers = new Headers();
|
|
48
|
+
headers.append("Content-Type", "text/html;charset=UTF-8");
|
|
49
|
+
headers.append("Transfer-Encoding", "chunked");
|
|
51
50
|
const streamResult = worker.stream({
|
|
52
51
|
callbacks: [
|
|
53
52
|
async () => html`
|
|
@@ -64,7 +63,7 @@ const awaitHtml = async ({ pending, success, error }) => {
|
|
|
64
63
|
};
|
|
65
64
|
router.addRoute({
|
|
66
65
|
pathname: pendingRoutePathname,
|
|
67
|
-
route
|
|
66
|
+
route
|
|
68
67
|
});
|
|
69
68
|
return html(_a || (_a = __template(["\n ", '\n <script\n data-script-to-load="await-html_script-', `"
|
|
70
69
|
type="text/script-to-load"
|
package/dist/html.es.js
CHANGED
|
@@ -41,11 +41,10 @@ const awaitHtml = async ({ pending, success, error }) => {
|
|
|
41
41
|
const id = Math.floor(Math.random() * 1e9);
|
|
42
42
|
const pendingId = `pending_${id}`;
|
|
43
43
|
const pendingRoutePathname = `/~/components/${pendingId}`;
|
|
44
|
-
const
|
|
45
|
-
const headers =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
44
|
+
const route = async () => {
|
|
45
|
+
const headers = new Headers();
|
|
46
|
+
headers.append("Content-Type", "text/html;charset=UTF-8");
|
|
47
|
+
headers.append("Transfer-Encoding", "chunked");
|
|
49
48
|
const streamResult = stream$1({
|
|
50
49
|
callbacks: [
|
|
51
50
|
async () => html`
|
|
@@ -62,7 +61,7 @@ const awaitHtml = async ({ pending, success, error }) => {
|
|
|
62
61
|
};
|
|
63
62
|
addRoute({
|
|
64
63
|
pathname: pendingRoutePathname,
|
|
65
|
-
route
|
|
64
|
+
route
|
|
66
65
|
});
|
|
67
66
|
return html(_a || (_a = __template(["\n ", '\n <script\n data-script-to-load="await-html_script-', `"
|
|
68
67
|
type="text/script-to-load"
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "saloe",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Tools for making web development easy and efficient",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vite build",
|
|
7
|
-
"
|
|
7
|
+
"deploy": "npm run build && npm publish --access public --loglevel verbose"
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
package/src/html.js
CHANGED
|
@@ -44,11 +44,10 @@ const awaitHtml = async ({ pending, success, error }) => {
|
|
|
44
44
|
const pendingId = `pending_${id}`
|
|
45
45
|
const pendingRoutePathname = `/~/components/${pendingId}`
|
|
46
46
|
|
|
47
|
-
const
|
|
48
|
-
const headers =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
47
|
+
const route = async () => {
|
|
48
|
+
const headers = new Headers()
|
|
49
|
+
headers.append('Content-Type', 'text/html;charset=UTF-8')
|
|
50
|
+
headers.append('Transfer-Encoding', 'chunked')
|
|
52
51
|
|
|
53
52
|
const streamResult = streamAsWorker({
|
|
54
53
|
callbacks: [
|
|
@@ -73,7 +72,7 @@ const awaitHtml = async ({ pending, success, error }) => {
|
|
|
73
72
|
|
|
74
73
|
addRoute({
|
|
75
74
|
pathname: pendingRoutePathname,
|
|
76
|
-
route
|
|
75
|
+
route,
|
|
77
76
|
})
|
|
78
77
|
|
|
79
78
|
return html`
|