solidjs / solid-start

SolidStart, the Solid app framework
https://start.solidjs.com
MIT License
5.06k stars 377 forks source link

Support mounting the same application multiple times #388

Open IgorMinar opened 1 year ago

IgorMinar commented 1 year ago

Solid-start apps currently boostrap through a side-effect of importing entry-client.HASH.js with script tag in the HTML:

<script type="module" async="" src="/assets/entry-client.e2045c51.js"></script>

This script module is a result of bundling the following code:

import { mount, StartClient } from "solid-start/entry-client";

mount(() => <StartClient />, document);

This setup means that we can only bootstrap the application once (because script type=module will ever evaluate the top level expressions and statements only once per document).

This breaks the cases where we'd like to bootstrap the same solid-start app multiple times within the same document.

We discussed this with @ryansolid and agreed to explore the following to support these use-cases:

IgorMinar commented 1 year ago

Just a note that this fix also depends on https://github.com/solidjs/solid/issues/1325 which just got fixed in the Solid repo.

brenelz commented 2 months ago

I wonder if this is still valid with all the changes Solid Start has gone through with using Nitro and Vinxi now