Skip to content

ES6 class support #349

@matthewmueller

Description

@matthewmueller

Hey @dop251, thanks for all your hard work on Goja. I'm especially grateful for the recent Promise API support.

Goja is really close to being ready to natively run what ESBuild outputs to ES6 via esbuild --target=es2015 <entry...>.

One thing that's missing is class support:

class A extends B {
  constructor() {
     super()
  }
}

I was actually surprised to see that class support came in ES6, but I had a look at the ES6 support table and it looks like it's there.

For my use-case, I'm trying to render Svelte code on the server-side, but the compiler generates classes:

var SvelteElement
if (typeof HTMLElement === "function") {
  SvelteElement = class extends HTMLElement {
    constructor() {
      super()
      this.attachShadow({ mode: "open" })
    }
    // ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions