Skip to content

Commit

Permalink
Revert "fix: worker url"
Browse files Browse the repository at this point in the history
This reverts commit eed566d.
  • Loading branch information
TheNoim committed May 30, 2024
1 parent 447de65 commit ebf6e80
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 0 additions & 2 deletions reactive_home/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,5 @@ console.log(file.imports['reactive-home'])

PKG_VERSION=$(echo "$PKG_VERSION_SCRIPT" | deno run -)

cd /config/reactive-home

echo "Load runtime..."
echo "import '$PKG_VERSION/runtime'" | deno run --import-map=/config/reactive-home/import_map.json --allow-env --allow-net --allow-run --allow-sys --allow-read - --root /config/reactive-home --pkg "$PKG_VERSION"
23 changes: 14 additions & 9 deletions src/runtime/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@ for await (const path of walk(flags.root)) {

const loadWorker = async () => {
while (true) {
const scriptUrl = toFileUrl(join(Deno.cwd(), path.path));
console.info("Load script", path.path, scriptUrl.href);

const worker = new Worker(scriptUrl, {
type: "module",
deno: {
permissions: "inherit",
},
});
console.info("Load script", path.path);

const worker = new Worker(
new URL(
join(Deno.cwd(), path.path),
toFileUrl(join(Deno.cwd(), flags.root!))
).href,
{
type: "module",
deno: {
permissions: "inherit",
},
}
);

await new Promise((resolve) => {
worker.onerror = (error) => {
Expand Down

0 comments on commit ebf6e80

Please sign in to comment.