saloe 0.0.4 → 0.0.6

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/README.md CHANGED
@@ -12,7 +12,7 @@ It works seamlessly with `Cloudflare Workers` and `Service Workers`, and can als
12
12
 
13
13
  - [`saloe/html`](./src/html.js) - Stream HTML templates and render temporary templates while waiting for asynchronous functions to finish processing the final template.
14
14
 
15
- - [`saloe/actions`](./src/actions.js) - Add reactivity to HTML nodes with 0kb of initial JavaScript.
15
+ - [`saloe/listener`](./src/listener.js) - Add reactivity to HTML nodes with 0kb of initial JavaScript.
16
16
 
17
17
  ## Coming Soon
18
18
 
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "demo-listener",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "server.js",
6
+ "scripts": {
7
+ "watch:dev": "ENV=dev vite build --watch",
8
+ "watch:qa": "ENV=qa vite build --watch",
9
+ "watch:prod": "ENV=prod vite build --watch",
10
+ "build:dev": "ENV=dev vite build",
11
+ "build:qa": "ENV=qa vite build",
12
+ "build:prod": "ENV=prod vite build",
13
+ "local:dev": "wrangler dev --env=dev",
14
+ "local:qa": "wrangler dev --env=qa",
15
+ "local:prod": "wrangler dev --env=prod",
16
+ "deploy:dev": "npm run build:dev && wrangler deploy --env=dev",
17
+ "deploy:qa": "npm run build:qa && wrangler deploy --env=qa",
18
+ "deploy:prod": "npm run build:prod && wrangler deploy --env=prod",
19
+ "build-worker:dev": "wrangler deploy --dry-run --outdir=dist-worker"
20
+ },
21
+ "keywords": [],
22
+ "author": "",
23
+ "license": "ISC",
24
+ "devDependencies": {
25
+ "@cloudflare/kv-asset-handler": "^0.3.4",
26
+ "saloe": "^0.0.4",
27
+ "vite": "^5.4.3"
28
+ }
29
+ }
@@ -0,0 +1,5 @@
1
+ const input = ({ e, srcElement }) => {
2
+ console.log('--- value =', srcElement?.value)
3
+ }
4
+
5
+ export { input }
@@ -0,0 +1,5 @@
1
+ const load = ({ e, srcElement }) => {
2
+ console.log('--- load')
3
+ }
4
+
5
+ export { load }
@@ -0,0 +1,6 @@
1
+ const submit = ({ e, srcElement }) => {
2
+ e.preventDefault()
3
+ console.log('--- submit 2')
4
+ }
5
+
6
+ export { submit }
@@ -0,0 +1,94 @@
1
+ import { findPatternFromUrl, getRedirectResponse, getForbiddenResponse, getRoute, getNotFoundResponse, getServerOnlyResponse } from 'saloe/router'
2
+ import { getStaticResponse } from 'saloe/cloudflare-worker'
3
+ import { addRoute } from 'saloe/router'
4
+ import { html, stream } from 'saloe/html'
5
+ import { LISTENER_SCRIPT } from 'saloe/actions'
6
+ import { listener, getScriptListener } from 'saloe/listener'
7
+
8
+ import manifestJSON from '__STATIC_CONTENT_MANIFEST'
9
+
10
+
11
+ const isRedirectableCallback = ({ pathname }) => {
12
+ return pathname !== '/' && pathname.endsWith('/')
13
+ }
14
+
15
+ const isForbiddenCallback = ({ request }) => {
16
+ const forbiddenURLs = []
17
+ return forbiddenURLs.find((pathname) => request?.url?.endsWith(pathname))
18
+ }
19
+
20
+ const isServerOnlyCallback = ({ request }) => {
21
+ const serverOnlyURLs = []
22
+ return serverOnlyURLs?.find((pathname) => request?.url?.endsWith(pathname))
23
+ }
24
+
25
+
26
+ (() => {
27
+ addRoute({
28
+ pathname: '/',
29
+ route: ({ request, env }) => {
30
+ return stream({
31
+ head: () => html`
32
+ <meta charset="UTF-8">
33
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
34
+ <title>Cloudflare Worker Server</title>
35
+ `,
36
+ body: () => html`
37
+
38
+ <form
39
+ on-submit="submit"
40
+ >
41
+ <h1
42
+ on-load="load"
43
+ >
44
+ Hello world!
45
+ </h1>
46
+ <input
47
+ type="text"
48
+ on-input="input"
49
+ />
50
+ <button type="submit">Submit!</button>
51
+ </form>
52
+ `,
53
+ scripts: () => html`
54
+ ${getScriptListener()}
55
+ <script>
56
+ console.log('Hello world!')
57
+ </script>
58
+ `,
59
+ env,
60
+ })
61
+ }
62
+ })
63
+
64
+ })()
65
+
66
+ const handleFetch = async ({ request, env, ctx }) => {
67
+ const url = new URL(request.url)
68
+ const { origin, pathname } = url
69
+
70
+ const pattern = findPatternFromUrl({ url })
71
+
72
+ const redirectResult = getRedirectResponse({ origin, pathname, isRedirectableCallback })
73
+ if (redirectResult?.response) return redirectResult.response
74
+
75
+ const forbiddenResult = getForbiddenResponse({ origin, request, isForbiddenCallback })
76
+ if (forbiddenResult?.response) return forbiddenResult.response
77
+
78
+ const serverOnlyResult = getServerOnlyResponse({ origin, request, isServerOnlyCallback })
79
+ if (serverOnlyResult?.response) return serverOnlyResult.response
80
+
81
+ const route = getRoute({ pathname: pattern?.pathname })
82
+ const routeResult = route ? await route({ request, pattern, env }) : null
83
+ if (routeResult?.response) return routeResult.response
84
+
85
+ const staticResult = await getStaticResponse({ request, waitUntil: ctx.waitUntil.bind(ctx), manifestJSON, env })
86
+ if (staticResult?.response) return staticResult?.response
87
+
88
+ const notFoundResult = await getNotFoundResponse({ request })
89
+ return notFoundResult?.response
90
+ }
91
+
92
+ export default {
93
+ fetch: (request, env, ctx) => handleFetch({ request, env, ctx })
94
+ }
@@ -0,0 +1,25 @@
1
+ import { defineConfig } from 'vite'
2
+
3
+
4
+ export default defineConfig({
5
+ define: {
6
+ __ENV__: `'${process.env.ENV}'`,
7
+ __BUILD_TIME__: `'${new Date().toISOString()}'`,
8
+ __APP_NAME__: `'demo-server'`,
9
+ },
10
+ plugins: [],
11
+ build: {
12
+ outDir: './dist',
13
+ manifest: true,
14
+ emptyOutDir: true,
15
+ minify: false,
16
+ rollupOptions: {
17
+ input: {},
18
+ output: {
19
+ entryFileNames: `[name].js`,
20
+ chunkFileNames: `[name].js`,
21
+ assetFileNames: `[name].[ext]`,
22
+ },
23
+ },
24
+ },
25
+ })
@@ -0,0 +1,35 @@
1
+ name = "demo-actions"
2
+ main = "server.js"
3
+ compatibility_date = "2022-11-01"
4
+ compatibility_flags = ["transformstream_enable_standard_constructor", "streams_enable_constructors"]
5
+ minify = false
6
+ #node_compat = true
7
+
8
+ [site]
9
+ bucket = "./public"
10
+
11
+ [env]
12
+
13
+ [env.prod]
14
+ experimental-local = true
15
+
16
+ [env.prod.vars]
17
+ IS_CLOUDFLARE_WORKER = true
18
+ ENV = "prod"
19
+ APP_NAME = "demo-actions"
20
+
21
+ [env.qa]
22
+ experimental-local = true
23
+
24
+ [env.qa.vars]
25
+ IS_CLOUDFLARE_WORKER = true
26
+ ENV = "qa"
27
+ APP_NAME = "demo-actions"
28
+
29
+ [env.dev]
30
+ experimental-local = true
31
+
32
+ [env.dev.vars]
33
+ IS_CLOUDFLARE_WORKER = true
34
+ ENV = "dev"
35
+ APP_NAME = "demo-actions"
@@ -37,13 +37,13 @@ const listener = () => {
37
37
  const fetchListeners = async ({ srcElement, event, e }) => {
38
38
  var _a;
39
39
  if (!(srcElement == null ? void 0 : srcElement.getAttribute)) return;
40
- const scriptNames = srcElement == null ? void 0 : srcElement.getAttribute("on-" + event);
40
+ const scriptNames = srcElement == null ? void 0 : srcElement.getAttribute(`on-${event}`);
41
41
  if (!scriptNames) return;
42
42
  if (scriptNames && EVENTS_PREVENT_DEFAULT_MANDATORY.includes(event)) e.preventDefault();
43
43
  const scripts = await Promise.all(
44
44
  (_a = scriptNames == null ? void 0 : scriptNames.split(",")) == null ? void 0 : _a.map((scriptName) => {
45
45
  var _a2;
46
- const scriptToImport = "/" + (scriptName == null ? void 0 : scriptName.trim()) + ".js";
46
+ const scriptToImport = `/${scriptName == null ? void 0 : scriptName.trim()}.js`;
47
47
  return (_a2 = import(scriptToImport)) == null ? void 0 : _a2.catch((err) => {
48
48
  });
49
49
  })
@@ -92,18 +92,18 @@ const listener = () => {
92
92
  };
93
93
  script.onerror = () => {
94
94
  console.error("script failed to load");
95
- reject(new Error("Failed to load script with src " + script.src));
95
+ reject(new Error(`Failed to load script with src ${script.src}`));
96
96
  };
97
97
  (_b = document == null ? void 0 : document.body) == null ? void 0 : _b.insertAdjacentElement("beforeend", script);
98
98
  });
99
99
  };
100
100
  const fireLoadListener = () => {
101
101
  const event = "load";
102
- const srcElements = document == null ? void 0 : document.querySelectorAll("[on-" + event + "]");
102
+ const srcElements = document == null ? void 0 : document.querySelectorAll(`[on-${event}]`);
103
103
  srcElements == null ? void 0 : srcElements.forEach(async (srcElement) => {
104
104
  const listeners = await fetchListeners({ srcElement, event, e: null });
105
105
  executeListeners({ e: null, srcElement, listeners });
106
- srcElement == null ? void 0 : srcElement.removeAttribute("on-" + event);
106
+ srcElement == null ? void 0 : srcElement.removeAttribute(`on-${event}`);
107
107
  });
108
108
  };
109
109
  const fireObserverListeners = () => {
@@ -118,8 +118,8 @@ const listener = () => {
118
118
  }, /* @__PURE__ */ new Map())) == null ? void 0 : _a.keys()];
119
119
  uniqueScriptNames == null ? void 0 : uniqueScriptNames.forEach(async (scriptName) => {
120
120
  var _a2;
121
- const observedSrcElements = document.querySelectorAll('[on-observe*="' + scriptName + '"]');
122
- const script = await ((_a2 = import("/" + (scriptName == null ? void 0 : scriptName.trim()) + ".js")) == null ? void 0 : _a2.catch((err) => {
121
+ const observedSrcElements = document.querySelectorAll(`[on-observe*="${scriptName}"]`);
122
+ const script = await ((_a2 = import(`/${scriptName == null ? void 0 : scriptName.trim()}.js`)) == null ? void 0 : _a2.catch((err) => {
123
123
  }));
124
124
  const listener2 = getListenerFromScript({ script, event: "observe" });
125
125
  if (!listener2) return;
@@ -138,29 +138,29 @@ const listener = () => {
138
138
  };
139
139
  const getSrcElement = ({ srcElement, event }) => {
140
140
  if (!(srcElement == null ? void 0 : srcElement.hasAttribute)) return srcElement;
141
- const attribute = "on-" + event;
141
+ const attribute = `on-${event}`;
142
142
  const hasScriptName = srcElement == null ? void 0 : srcElement.hasAttribute(attribute);
143
143
  if (hasScriptName) return srcElement;
144
- const query = ":is(a, button, li)[" + attribute + "]";
144
+ const query = `:is(a, button, li)[${attribute}]`;
145
145
  const closestButton = srcElement == null ? void 0 : srcElement.closest(query);
146
146
  if (closestButton) return closestButton;
147
147
  return srcElement;
148
148
  };
149
149
  const fireListeners = () => {
150
150
  EVENTS_FIRE_DOCUMENT_BODY_LISTENERS == null ? void 0 : EVENTS_FIRE_DOCUMENT_BODY_LISTENERS.forEach((event) => {
151
- document.body["on" + event] = async (e) => {
151
+ document.body[`on${event}`] = async (e) => {
152
152
  await addScripts();
153
153
  fireLoadListener();
154
154
  fireObserverListeners();
155
155
  };
156
156
  });
157
157
  EVENTS == null ? void 0 : EVENTS.forEach((event) => {
158
- document.body["on" + event] = async (e) => {
158
+ document.body[`on${event}`] = async (e) => {
159
159
  const srcElement = getSrcElement({ srcElement: e == null ? void 0 : e.srcElement, event });
160
160
  const listeners = await fetchListeners({ srcElement, event, e });
161
161
  executeListeners({ e, srcElement, listeners });
162
162
  addListener({ srcElement, event, listeners });
163
- if (srcElement == null ? void 0 : srcElement.removeAttribute) srcElement.removeAttribute("on-" + event);
163
+ if (srcElement == null ? void 0 : srcElement.removeAttribute) srcElement.removeAttribute(`on-${event}`);
164
164
  };
165
165
  });
166
166
  };
@@ -35,13 +35,13 @@ const listener = () => {
35
35
  const fetchListeners = async ({ srcElement, event, e }) => {
36
36
  var _a;
37
37
  if (!(srcElement == null ? void 0 : srcElement.getAttribute)) return;
38
- const scriptNames = srcElement == null ? void 0 : srcElement.getAttribute("on-" + event);
38
+ const scriptNames = srcElement == null ? void 0 : srcElement.getAttribute(`on-${event}`);
39
39
  if (!scriptNames) return;
40
40
  if (scriptNames && EVENTS_PREVENT_DEFAULT_MANDATORY.includes(event)) e.preventDefault();
41
41
  const scripts = await Promise.all(
42
42
  (_a = scriptNames == null ? void 0 : scriptNames.split(",")) == null ? void 0 : _a.map((scriptName) => {
43
43
  var _a2;
44
- const scriptToImport = "/" + (scriptName == null ? void 0 : scriptName.trim()) + ".js";
44
+ const scriptToImport = `/${scriptName == null ? void 0 : scriptName.trim()}.js`;
45
45
  return (_a2 = import(scriptToImport)) == null ? void 0 : _a2.catch((err) => {
46
46
  });
47
47
  })
@@ -90,18 +90,18 @@ const listener = () => {
90
90
  };
91
91
  script.onerror = () => {
92
92
  console.error("script failed to load");
93
- reject(new Error("Failed to load script with src " + script.src));
93
+ reject(new Error(`Failed to load script with src ${script.src}`));
94
94
  };
95
95
  (_b = document == null ? void 0 : document.body) == null ? void 0 : _b.insertAdjacentElement("beforeend", script);
96
96
  });
97
97
  };
98
98
  const fireLoadListener = () => {
99
99
  const event = "load";
100
- const srcElements = document == null ? void 0 : document.querySelectorAll("[on-" + event + "]");
100
+ const srcElements = document == null ? void 0 : document.querySelectorAll(`[on-${event}]`);
101
101
  srcElements == null ? void 0 : srcElements.forEach(async (srcElement) => {
102
102
  const listeners = await fetchListeners({ srcElement, event, e: null });
103
103
  executeListeners({ e: null, srcElement, listeners });
104
- srcElement == null ? void 0 : srcElement.removeAttribute("on-" + event);
104
+ srcElement == null ? void 0 : srcElement.removeAttribute(`on-${event}`);
105
105
  });
106
106
  };
107
107
  const fireObserverListeners = () => {
@@ -116,8 +116,8 @@ const listener = () => {
116
116
  }, /* @__PURE__ */ new Map())) == null ? void 0 : _a.keys()];
117
117
  uniqueScriptNames == null ? void 0 : uniqueScriptNames.forEach(async (scriptName) => {
118
118
  var _a2;
119
- const observedSrcElements = document.querySelectorAll('[on-observe*="' + scriptName + '"]');
120
- const script = await ((_a2 = import("/" + (scriptName == null ? void 0 : scriptName.trim()) + ".js")) == null ? void 0 : _a2.catch((err) => {
119
+ const observedSrcElements = document.querySelectorAll(`[on-observe*="${scriptName}"]`);
120
+ const script = await ((_a2 = import(`/${scriptName == null ? void 0 : scriptName.trim()}.js`)) == null ? void 0 : _a2.catch((err) => {
121
121
  }));
122
122
  const listener2 = getListenerFromScript({ script, event: "observe" });
123
123
  if (!listener2) return;
@@ -136,29 +136,29 @@ const listener = () => {
136
136
  };
137
137
  const getSrcElement = ({ srcElement, event }) => {
138
138
  if (!(srcElement == null ? void 0 : srcElement.hasAttribute)) return srcElement;
139
- const attribute = "on-" + event;
139
+ const attribute = `on-${event}`;
140
140
  const hasScriptName = srcElement == null ? void 0 : srcElement.hasAttribute(attribute);
141
141
  if (hasScriptName) return srcElement;
142
- const query = ":is(a, button, li)[" + attribute + "]";
142
+ const query = `:is(a, button, li)[${attribute}]`;
143
143
  const closestButton = srcElement == null ? void 0 : srcElement.closest(query);
144
144
  if (closestButton) return closestButton;
145
145
  return srcElement;
146
146
  };
147
147
  const fireListeners = () => {
148
148
  EVENTS_FIRE_DOCUMENT_BODY_LISTENERS == null ? void 0 : EVENTS_FIRE_DOCUMENT_BODY_LISTENERS.forEach((event) => {
149
- document.body["on" + event] = async (e) => {
149
+ document.body[`on${event}`] = async (e) => {
150
150
  await addScripts();
151
151
  fireLoadListener();
152
152
  fireObserverListeners();
153
153
  };
154
154
  });
155
155
  EVENTS == null ? void 0 : EVENTS.forEach((event) => {
156
- document.body["on" + event] = async (e) => {
156
+ document.body[`on${event}`] = async (e) => {
157
157
  const srcElement = getSrcElement({ srcElement: e == null ? void 0 : e.srcElement, event });
158
158
  const listeners = await fetchListeners({ srcElement, event, e });
159
159
  executeListeners({ e, srcElement, listeners });
160
160
  addListener({ srcElement, event, listeners });
161
- if (srcElement == null ? void 0 : srcElement.removeAttribute) srcElement.removeAttribute("on-" + event);
161
+ if (srcElement == null ? void 0 : srcElement.removeAttribute) srcElement.removeAttribute(`on-${event}`);
162
162
  };
163
163
  });
164
164
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saloe",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Tools for making web development easy and efficient",
5
5
  "scripts": {
6
6
  "build": "vite build",
package/src/listener.js CHANGED
@@ -40,14 +40,14 @@ const listener = () => {
40
40
  const fetchListeners = async ({ srcElement, event, e }) => {
41
41
  if (!srcElement?.getAttribute) return
42
42
 
43
- const scriptNames = srcElement?.getAttribute('on-' + event)
43
+ const scriptNames = srcElement?.getAttribute(`on-${event}`)
44
44
  if (!scriptNames) return
45
45
 
46
46
  if (scriptNames && EVENTS_PREVENT_DEFAULT_MANDATORY.includes(event)) e.preventDefault()
47
47
 
48
48
  const scripts = await Promise.all(
49
49
  scriptNames?.split(',')?.map((scriptName) => {
50
- const scriptToImport = '/' + scriptName?.trim() + '.js'
50
+ const scriptToImport = `/${scriptName?.trim()}.js`
51
51
  return import(scriptToImport)?.catch((err) => { })
52
52
  })
53
53
  )
@@ -105,7 +105,7 @@ const listener = () => {
105
105
 
106
106
  script.onerror = () => {
107
107
  console.error('script failed to load')
108
- reject(new Error('Failed to load script with src ' + script.src))
108
+ reject(new Error(`Failed to load script with src ${script.src}`))
109
109
  }
110
110
 
111
111
  document?.body?.insertAdjacentElement('beforeend', script)
@@ -115,20 +115,20 @@ const listener = () => {
115
115
  // load
116
116
  const fireLoadListener = () => {
117
117
  const event = 'load'
118
- const srcElements = document?.querySelectorAll('[on-' + event + ']')
118
+ const srcElements = document?.querySelectorAll(`[on-${event}]`)
119
119
 
120
120
  srcElements?.forEach(async (srcElement) => {
121
121
  const listeners = await fetchListeners({ srcElement, event, e: null })
122
122
  executeListeners({ e: null, srcElement, listeners })
123
123
 
124
- srcElement?.removeAttribute('on-' + event)
124
+ srcElement?.removeAttribute(`on-${event}`)
125
125
  })
126
126
  }
127
127
 
128
128
  // invalid
129
129
  const fireInvalidListener = () => {
130
130
  const event = 'invalid'
131
- const srcElements = document?.querySelectorAll('[on-' + event + ']')
131
+ const srcElements = document?.querySelectorAll(`[on-${event}]`)
132
132
 
133
133
  srcElements?.forEach(async (srcElement) => {
134
134
  const listeners = await fetchListeners({ srcElement, event, e: null })
@@ -139,7 +139,7 @@ const listener = () => {
139
139
  // blur
140
140
  const fireBlurListener = () => {
141
141
  const event = 'blur'
142
- const srcElements = document?.querySelectorAll('[on-' + event + ']')
142
+ const srcElements = document?.querySelectorAll(`[on-${event}]`)
143
143
 
144
144
  srcElements?.forEach(async (srcElement) => {
145
145
  const listeners = await fetchListeners({ srcElement, event, e: null })
@@ -150,7 +150,7 @@ const listener = () => {
150
150
  // focus
151
151
  const fireFocusListener = () => {
152
152
  const event = 'focus'
153
- const srcElements = document?.querySelectorAll('[on-' + event + ']')
153
+ const srcElements = document?.querySelectorAll(`[on-${event}]`)
154
154
 
155
155
  srcElements?.forEach(async (srcElement) => {
156
156
  const listeners = await fetchListeners({ srcElement, event, e: null })
@@ -173,9 +173,9 @@ const listener = () => {
173
173
  }, new Map())?.keys()]
174
174
 
175
175
  uniqueScriptNames?.forEach(async (scriptName) => {
176
- const observedSrcElements = document.querySelectorAll('[on-observe*="' + scriptName + '"]')
176
+ const observedSrcElements = document.querySelectorAll(`[on-observe*="${scriptName}"]`)
177
177
 
178
- const script = await import('/' + scriptName?.trim() + '.js')?.catch((err) => { })
178
+ const script = await import(`/${scriptName?.trim()}.js`)?.catch((err) => { })
179
179
  const listener = getListenerFromScript({ script, event: 'observe' })
180
180
  if (!listener) return
181
181
 
@@ -197,11 +197,11 @@ const listener = () => {
197
197
 
198
198
  const getSrcElement = ({ srcElement, event }) => {
199
199
  if (!srcElement?.hasAttribute) return srcElement
200
- const attribute = 'on-' + event
200
+ const attribute = `on-${event}`
201
201
  const hasScriptName = srcElement?.hasAttribute(attribute)
202
202
  if (hasScriptName) return srcElement
203
203
 
204
- const query = ':is(a, button, li)[' + attribute + ']'
204
+ const query = `:is(a, button, li)[${attribute}]`
205
205
  const closestButton = srcElement?.closest(query)
206
206
  if (closestButton) return closestButton
207
207
 
@@ -210,7 +210,7 @@ const listener = () => {
210
210
 
211
211
  const fireListeners = () => {
212
212
  EVENTS_FIRE_DOCUMENT_BODY_LISTENERS?.forEach((event) => {
213
- document.body['on' + event] = async (e) => {
213
+ document.body[`on${event}`] = async (e) => {
214
214
  await addScripts()
215
215
 
216
216
  fireLoadListener()
@@ -219,14 +219,14 @@ const listener = () => {
219
219
  })
220
220
 
221
221
  EVENTS?.forEach((event) => {
222
- document.body['on' + event] = async (e) => {
222
+ document.body[`on${event}`] = async (e) => {
223
223
  const srcElement = getSrcElement({ srcElement: e?.srcElement, event })
224
224
  const listeners = await fetchListeners({ srcElement, event, e })
225
225
 
226
226
  executeListeners({ e, srcElement, listeners })
227
227
  addListener({ srcElement, event, listeners })
228
228
 
229
- if (srcElement?.removeAttribute) srcElement.removeAttribute('on-' + event)
229
+ if (srcElement?.removeAttribute) srcElement.removeAttribute(`on-${event}`)
230
230
  }
231
231
  })
232
232
  }
package/vite.config.js CHANGED
@@ -7,7 +7,6 @@ export default defineConfig({
7
7
  minify: false,
8
8
  lib: {
9
9
  entry: {
10
- actions: resolve(__dirname, 'src/actions.js'),
11
10
  'cloudflare-kv': resolve(__dirname, 'src/cloudflare-kv.js'),
12
11
  'cloudflare-worker': resolve(__dirname, 'src/cloudflare-worker.js'),
13
12
  cookie: resolve(__dirname, 'src/cookie.js'),