Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Turn struct and methods in es6 class / extends #813

Copy link
Copy link
Open
@didrocks

Description

@didrocks
Issue body actions

I didn't find any bug report on that, so sorry if that already been answered ;)

I read that gopherjs is mostly trying to follow es5 for compatibility (#320). It makes sense. However, wanting to create new bindings for the upcoming Polymer 3 with lit-html support (https://github.com/Polymer/lit-html), there are two main things with those technologies to create webcomponents in go:

  • es6 class support. The base element library is a class extending lit-element -(https://github.com/PolymerLabs/lit-element). Of course a go generator could generate those from structs and methods, but I using gopherjs for this would be nicer and avoid as well calling back to the transpiled code later on when hooking in more complex method. As you can see, this library (using lit-html) is using static methods, extending from another element. Do you think anything like this would be doable with gopherjs?
  • returning tagged template literal (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals). As those literals (html) are parsed by javascript, returning them raw or wrapped would be needed as they can have interpolation and nesting.

So, I'm seeking up for advices for how achieving that, and which road sounds the sanest to you (gopherjs, generator + trying to generate source maps, or … ?). Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.