Bonito.jl icon indicating copy to clipboard operation
Bonito.jl copied to clipboard

[WIP] switch from deno to esbuild

Open SimonDanisch opened this issue 9 months ago • 0 comments

Motivation: deno has deprecated their bundler 🤷 We're currently pinning an old version which still has the bundler, but this will obviously lead to problems in the future.

First test looked like a simple switch and replace, but then i noticed that esbuild doesn't seem to support something like: import * as Pako from "https://cdn.esm.sh/v66/[email protected]/es2021/pako.js"; in the source files, which deno downloaded and inlined into the bundle, which seems like the ideal behavior from my perspective.

We can either:

  • deprecate using CDNs in source files. It would be a bit sad to see this go, since it's a quite convenient way to use external dependencies without any hassle, and makes it easy to upgrade to newer versions.
  • find a solution with esbuild somehow (already googled/llm'ed it a bit without much success).
  • search and replace all urls and download them as part of the bundling. Advantage: we'll need to scan all imports, which would be a nice information for needs_bundling, since right now we can only check if the main js file has changed on disc. Disadvantage : quite a bit of work to make it work reliably.

SimonDanisch avatar Feb 19 '25 13:02 SimonDanisch