Skip to content

js: Consider adding Wasm support. #833

Open
@dmitshur

Description

@dmitshur

In https://github.com/hajimehoshi/gopherwasm, @hajimehoshi created an experimental wrapper that implements the syscall/js API using the github.com/gopherjs/gopherjs/js package in GopherJS, and using the syscall/js package itself in Wasm.

This gives me an idea for something that might be possible for the github.com/gopherjs/gopherjs/js package: to add an alternative implementation of the same API, but using the syscall/js package.

The GopherJS compiler would never use it, only the Go compiler would. It would help by making all packages that currently import github.com/gopherjs/gopherjs/js buildable for Wasm (with overhead, of course), until they can be updated to use syscall/js directly. This can be especially helpful for browser API bindings (e.g., see dominikh/go-js-dom#57).

At this point this is just an idea. It needs investigation to see if it'd be viable. I wanted to create the issue so we can track it.

@hajimehoshi Have you already thought about this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions