Open namuol opened 7 years ago
I haven't tried that, but have heard @thejameskyle and @kentcdodds saying good things about that. I'd be up for trying that out and learning what the differences are.
That would be interesting, however, "visible" generated code makes the developer's life easier in terms of understanding / debugging, and also allows IDEs to do very strong static code analysis.
I've actually just started on this work. It'll behave the same way as what's there now, just using babel-codemod
instead of jscodeshift
.
I hope we will still have the ability to see / use the generated files. Here is an interesting approach (on iOS): https://github.com/rentzsch/mogenerator Two files / classes by model are generated: one which you must leave as is because it's auto-generated, and another one which simply subclasses the first one so you can implement your own methods.
There will be no change to how the files are generated.
Since you've gone to the trouble of writing JSCodeShift transforms, have you considered using a babel transform instead? They're actually quite similar.
Using babel would make it easier to transparently tweak the underlying implementation without requiring a re-run of the codemods.
Just an idea -- very interesting project! 🙇