@inglorious/web 5.0.1 → 5.0.2
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/mount.js +2 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inglorious/web",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "A new web framework that leverages the power of the Inglorious Store combined with the performance and simplicity of lit-html.",
|
|
5
5
|
"author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@lit-labs/ssr-client": "^1.1.8",
|
|
53
53
|
"lit-html": "^3.3.1",
|
|
54
|
-
"@inglorious/
|
|
55
|
-
"@inglorious/
|
|
54
|
+
"@inglorious/store": "10.0.0",
|
|
55
|
+
"@inglorious/utils": "3.8.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"prettier": "^3.6.2",
|
package/src/mount.js
CHANGED
|
@@ -10,15 +10,13 @@ import { html, render } from "lit-html"
|
|
|
10
10
|
* @param {Store} store - The application state store.
|
|
11
11
|
* @param {(api: Api) => TemplateResult | null} renderFn - The root render function.
|
|
12
12
|
* @param {HTMLElement | DocumentFragment} element - The DOM element to mount the template to.
|
|
13
|
-
* @param {Object} [options] - Mount options.
|
|
14
|
-
* @param {boolean} [options.hydrate=true] - Whether to hydrate the existing DOM.
|
|
15
13
|
* @returns {() => void} An unsubscribe function
|
|
16
14
|
*/
|
|
17
|
-
export async function mount(store, renderFn, element
|
|
15
|
+
export async function mount(store, renderFn, element) {
|
|
18
16
|
const api = { ...store._api }
|
|
19
17
|
api.render = createRender(api)
|
|
20
18
|
|
|
21
|
-
const shouldHydrate =
|
|
19
|
+
const shouldHydrate = element.hasChildNodes()
|
|
22
20
|
|
|
23
21
|
// If we need to hydrate, load the heavy lifting only now
|
|
24
22
|
if (shouldHydrate) {
|