ember-codemods / ember-native-class-codemod

A codemod-cli project for converting Ember objects to es6 native classes
67 stars 38 forks source link

Convert to TypeScript #498

Closed gitKrystan closed 1 year ago

gitKrystan commented 1 year ago

This is a bit of a yak shave.

  1. This codemod currently does not support legacy decorators, but we have users stuck on Ember classic that use legacy decorators (specifically, decorators in object literals).
  2. The currently-used Flow parser does not support legacy decorators, necessitating a switch to the babel parser. I did a POC spike on switching to this parser, and while it does parse the legacy decorators, there is enough of a shift in the AST format that it causes many of the existing tests to fail. In my spike, I started fixing the code to make these tests pass, but without TypeScript + good AST types, I don't have 100% confidence I'm not breaking things, and working on it is a bit like this gif:

See also: https://github.com/gitKrystan/ember-native-class-codemod/pull/1, https://github.com/gitKrystan/ember-native-class-codemod/pull/2

gitKrystan commented 1 year ago

Approved by @wycats via Telegram