Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support native system access from wasm #2968

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Commits on Mar 5, 2023

  1. Support native system access from wasm

    This commit adds support for native system access for WASM. This is used
    through a new `wasmSystemAccess` option on the `esbuild.initialize`
    options bag. This options bag can contain either a specifier or
    namespace for a Node.js compatible `fs` and `process` module. During
    setup these are injected into `globalThis.fs` and `globalThis.process`,
    where Go's WASM runtime uses them to back the regular Go FS APIs.
    Finally, if this option is set, we set the `hasFS` option on
    `createChannel`, and everything just works :)
    
    Example for Deno:
    
    ```ts
    import * as esbuild from "./deno/wasm.js"
    
    await esbuild.initialize({ wasmSystemAccess: {
      fsSpecifier: "node:fs",
      processSpecifier: "node:process"
    } })
    
    await esbuild.build({
      format: "esm",
      entryPoints: ["./lib/deno/mod.ts"],
      target: "esnext",
      outfile: "./out.js"
    })
    ```
    lucacasonato committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    8b1578e View commit details
    Browse the repository at this point in the history
  2. update deno

    lucacasonato committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    f1ed573 View commit details
    Browse the repository at this point in the history

Commits on Mar 16, 2023

  1. deno canary

    lucacasonato committed Mar 16, 2023
    Configuration menu
    Copy the full SHA
    6f47ff2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    29691e9 View commit details
    Browse the repository at this point in the history
  3. no windows support

    lucacasonato committed Mar 16, 2023
    Configuration menu
    Copy the full SHA
    c41dc56 View commit details
    Browse the repository at this point in the history