Skip to content

GopherJS Playground 2.0 #1158

@nevkontakte

Description

@nevkontakte

The GopherJS playground has been doing its job very well, but I think it may be time to give it an overhaul. Here is a list of improvements I would like to make (in no particular order):

  • Migrate to a modern frontend framework. Currently we are using some ancient version of AngularJS is no longer supported. In my experiments, vecty mostly works with GopherJS even though it no longer supports it officially. vugu or go-app might be another interesting option.
  • Make it possible to show generated JavaScript code for the main package. This is something our users have requested in the feedback survey, and I also wished for it on multiple occasions.
  • Implement "advanced" codepen-style mode, which allows the user to provide HTML and CSS, and have results executed in an iframe sandbox.
  • Use play.golang.org 1 instead of https://snippets.gopherjs.org to save snippets. I believe the latter is still being maintained by @dmitshur, and potentially he wouldn't have to keep doing it indefinitely. But what is even more appealing to me is that it would make the two playgrounds more interoperable: you would be able to open the same snippet with the same ID in either gopherjs or the official playground and compare behavior.
  • Use better code editor, which supports automatic indentation and maybe even syntax highlighting.

I think this would be a great contribution for someone new to the project, since it doesn't require getting far in the weeds of the compiler, but does give an opportunity to touch the internals a little bit.

Footnotes

  1. Snippets can be saved by POST'ing its text to https://play.golang.org/share, which will return snippet ID. Given the ID, the snippet can be read by GET'ing https://play.golang.org/p/${id}.go. Both endpooints allow cross-origin requests, so they would work find on our playgound.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsHelpCommunity contributions are welcome for this feature!enhancement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions