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

Unify GopherJS's syscall/js and GopherWasm #899

Closed
hajimehoshi opened this issue Mar 3, 2019 · 10 comments · Fixed by #908
Closed

Unify GopherJS's syscall/js and GopherWasm #899

hajimehoshi opened this issue Mar 3, 2019 · 10 comments · Fixed by #908
Assignees

Comments

@hajimehoshi
Copy link
Member

hajimehoshi commented Mar 3, 2019

@neelance suggested to unify GopherWasm and GopherJS by making GopherJS recognize syscall/js as a wrapper like GopherWasm. This would enable the users to replace

import "github.com/gopherjs/gopherwasm/js"

with

import "syscall/js"

while the programs still work both for GopherJS and Wasm. This simplifies things very much and encourages users to migrate from GopherJS to Wasm more smoothly than the current GopherWasm.

Any thoughts?

@hajimehoshi hajimehoshi self-assigned this Mar 3, 2019
@hajimehoshi
Copy link
Member Author

I'll get started soon.

@inliquid
Copy link

inliquid commented Apr 3, 2019

@hajimehoshi thanks for your great work for gopherjs, may I ask in this context what would you recommend if I'm actively using honnef.co/go/js/dom and honnef.co/go/js/xhr, while keeping in mind possible wasm move in future? Should I stick with these libs or is there any solution which better suits in the wasm space? Maybe some support is planned by honnef.co maintainers?

@hajimehoshi
Copy link
Member Author

Hi, I have no idea about these projects. Please ask the owners.

@inliquid
Copy link

inliquid commented Apr 4, 2019

Well it's not about these projects, but generally about your vision of moving towards wasm in the context of this particular adoption keeping in mind that many ppl still (and will) be using other libs as well. Ok your point is clear.

@johanbrandhorst
Copy link

@inliquid I don't wish to speak for @dominikh but in the past he has expressed his intent not to spend anymore time on adapting the existing libraries to webassembly. I think there are alternative efforts to have a syscall/js-based DOM interface such as https://github.com/dennwc/dom. Ideally for the DOM specifically we would generate Go bindings directly from the WebIDL spec like Rust does. @dennwc was doing some work in this area last year sure if that effort is still ongoing. Would you be interested in contributing to this?

@inliquid
Copy link

inliquid commented Apr 6, 2019

Hi @johanbrandhorst! Thank you for detailed comments, I will follow mentioned repo activity and try to contribute when possible.

hajimehoshi added a commit that referenced this issue Apr 30, 2019
This PR adds a new package `syscall/js`. Originally `syscall/js` is for WebAssembly, but in GopherJS
this package works as a wrapper of `github.com/gopherjs/gopherjs/js`. With this package,
developers can use `syscall/js` both for GopherJS and WebAssembly.

The implementation is basically same as `github.com/gohperjs/gopherwasm`.

Fixes #899
@johanbrandhorst
Copy link

Will we get another release with this?

@hajimehoshi
Copy link
Member Author

I guess GopherJS does not have a 'release' policy. Not sure though.

@dmitshur
Copy link
Member

dmitshur commented Apr 30, 2019

The release policy is we increment the version number by 1 whenever there's a notable or large change. It's just for convenience, so people can tell if their GopherJS version includes said notable/large change (and we can ask them in bug reports). It's also so we can blog/tweet about a new version being released. See issue #500 for background.

I think adding support for syscall/js warrants bumping the version, if you'd like to do that @hajimehoshi. It would become 1.12-2.

@hajimehoshi
Copy link
Member Author

Sure, let me update the version soon :-)

hajimehoshi added a commit that referenced this issue Apr 30, 2019
Introducing `syscall/js` (#899) is so significant that we update
the version.
hajimehoshi added a commit that referenced this issue Apr 30, 2019
Introducing `syscall/js` (#899) is so significant that we update
the version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants