forked from gleam-lang/gleam
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wasm): support loading precompiled dependencies in
/lib
This adds support to utilize the `/lib` path in a similar way to the `gleam-cli` compiler. It's currently the responsiblity of the caller to populate the files with `write_file_bytes` for this to be useful. ## TODO Because the `PackageConfig` is hard-coded and has no dependencies declared, importing anything from `/lib` will produce a "Transitive dependency imported" warning. ## Motivation While tinkering with the idea from gleam-lang/playground#9 Found that the current playground includes `gleam_stdlib` by pretending they're submodules in `src/gleam/io.gleam` for instance. This approach no longer works when you're trying to use more dependencies than 1. Mainly the `import .. from` JS statements will break as they're precompiled as *siblings* rather than clobbered into a single package with submodules.
- Loading branch information
Showing
3 changed files
with
47 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters