mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
15 lines
436 B
TypeScript
15 lines
436 B
TypeScript
import type { IslandMap } from "./server";
|
|
import { hydrate } from 'svelte';
|
|
|
|
declare var $islands: IslandMap;
|
|
Object.entries($islands).forEach(async([moduleId, islands]) => {
|
|
const mod = await import(moduleId);
|
|
for(const [islandId, exportId, props] of islands) {
|
|
const elem = document.getElementById(`I:${islandId}`)!;
|
|
hydrate(mod[exportId], {
|
|
target: elem,
|
|
props,
|
|
});
|
|
}
|
|
});
|