From 680940daddae7ae4ece2c8bb51fad343ff9c5456 Mon Sep 17 00:00:00 2001 From: Damian Tarnawski Date: Tue, 8 Oct 2024 20:04:59 +0200 Subject: [PATCH] Remove map and createStore from mount.ts --- packages/start/src/client/mount.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/start/src/client/mount.ts b/packages/start/src/client/mount.ts index ac22d2196..b88ea93b6 100644 --- a/packages/start/src/client/mount.ts +++ b/packages/start/src/client/mount.ts @@ -1,5 +1,4 @@ import type { JSX } from "solid-js"; -import { createStore } from "solid-js/store"; import { createComponent, getHydrationKey, @@ -14,7 +13,6 @@ import { */ export function mount(fn: () => JSX.Element, el: MountableElement) { if (import.meta.env.START_ISLANDS) { - const map = new WeakMap(); async function mountIsland(el: HTMLElement) { if (el.dataset.css) { let css = JSON.parse(el.dataset.css); @@ -39,7 +37,7 @@ export function mount(fn: () => JSX.Element, el: MountableElement) { let hk = el.dataset.hk; // _$DEBUG("hydrating island", el.dataset.island, hk.slice(0, hk.length - 1) + `1-`, el); - let props = createStore({ + let props = { ...JSON.parse(el.dataset.props!), get children() { const p = el.getElementsByTagName("solid-children"); @@ -49,11 +47,9 @@ export function mount(fn: () => JSX.Element, el: MountableElement) { }); return; } - }); - - map.set(el, props); + }; - hydrate(() => createComponent(Component, props[0]), el, { + hydrate(() => createComponent(Component, props), el, { renderId: hk.slice(0, hk.length - 1) + `${1 + Number(el.dataset.offset)}-`, owner: lookupOwner(el) });