Skip to content

Instantly share code, notes, and snippets.

@wycats
Created December 20, 2023 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wycats/eecaa071b841fa461ab66ec12025924b to your computer and use it in GitHub Desktop.
Save wycats/eecaa071b841fa461ab66ec12025924b to your computer and use it in GitHub Desktop.

Ember's new GJS syntax is now supported by GitHub!

GJS

A boring component:

class ActionButton extends Component {
  <template>
    <button {{on "click" @onclick}}>
      {{yield}}
    </button>
  </template>
}

A component with some tracked state:

class Counter extends Component {
  @tracked accessor count = 0;
  
  increment = () => this.count++;

  <template>
    <p>count: {{this.count}}</p>
    <button {{on "click" this.increment}}>
      ++
    </button>
  </template>
}

GTS Status

We have ~200 files to go to get support for GTS files, but we're closing in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment