Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove map and createStore from mount.ts #1650

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions packages/start/src/client/mount.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { JSX } from "solid-js";
import { createStore } from "solid-js/store";
import {
createComponent,
getHydrationKey,
Expand All @@ -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);
Expand All @@ -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");
Expand All @@ -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)
});
Expand Down
Loading