saloe 0.0.6 → 0.0.7

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.
@@ -23,7 +23,7 @@
23
23
  "license": "ISC",
24
24
  "devDependencies": {
25
25
  "@cloudflare/kv-asset-handler": "^0.3.4",
26
- "saloe": "^0.0.4",
26
+ "saloe": "^0.0.6",
27
27
  "vite": "^5.4.3"
28
28
  }
29
- }
29
+ }
@@ -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 { LISTENER_SCRIPT } from 'saloe/actions'
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
 
@@ -23,7 +23,7 @@
23
23
  "license": "ISC",
24
24
  "devDependencies": {
25
25
  "@cloudflare/kv-asset-handler": "^0.3.4",
26
- "saloe": "^0.0.3",
26
+ "saloe": "^0.0.6",
27
27
  "vite": "^5.4.3"
28
28
  }
29
- }
29
+ }
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 getPage = async () => {
47
- const headers = {
48
- "Content-Type": "text/html;charset=utf-8",
49
- "Transfer-Encoding": "chunked"
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: { getPage }
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 getPage = async () => {
45
- const headers = {
46
- "Content-Type": "text/html;charset=utf-8",
47
- "Transfer-Encoding": "chunked"
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: { getPage }
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,6 +1,6 @@
1
1
  {
2
2
  "name": "saloe",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Tools for making web development easy and efficient",
5
5
  "scripts": {
6
6
  "build": "vite build",
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 getPage = async () => {
48
- const headers = {
49
- 'Content-Type': 'text/html;charset=utf-8',
50
- 'Transfer-Encoding': 'chunked',
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: { getPage }
75
+ route,
77
76
  })
78
77
 
79
78
  return html`