Closed olliephillips closed 5 years ago
@olliephillips - interesting.. are you suggesting that we generate a commented out stub for interface APIs like Pushable
on all generated types?
I had a thought a while back that we could decorate the ponzu gen c
call with options like +push +hide
etc to add this stub... but decided it was really not much work to just write that code. But I'll leave this open to get feedback from others..
cc/ @ponzu-cms/team - any thoughts?
@nilslice Yes, the function signatures are fairly simple but there are a quite a few interfaces that one might want to use. My thought was a single flag that would scaffold all of them. There's no bloat, since as commented, they're stripped at build. Just my thoughts. Hope others can jump in with their opinion.
Adding a single flag to generate the commented out implementation stubs is something I feel much more comfortable with.. let's see what others think, but since it would be entirely opt-in, I don't have any problem with this at first thought. As for implementation, we'd just need to have some way to keep track of all the implementations, and/or use some tooling i.e https://github.com/josharian/impl
Closing this issue. No activity. Please reopen if need to.
It would be a time saver to uncomment interface method implementations in generated code rather than have to find the code snippet and copy paste it? Though I'm sure some users can key it from memory, that's not me :)
Maybe
ponzu generate
could also add these methods but wrap them in comments? To use, just uncomment and extend a method if required.A flag to populate or not on
ponzu generate
would also provide the user with a choice?