-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate integrating or replacing generators with Plop #653
Comments
😆 Did some sleuthing 🕵️♀️ First result that came up was Just for build tasks (still haven't figured out how to word my search queries to find out how it stands against Gulp), followed by the React components for Fluent UI. It's the design system for Microsoft 365/Office 365, and although it looks like it's mostly using Plop by proxy through Just, there seems to be plans to use Plop directly. </🕵️♀️> |
Thank you for the investigation! 🔍 After suffering through our existing generator code (don't know who built that originally...<cough, cough, nervous glance>) do you have any opinion about whether we should maybe swap out to something like plop (and contributing back any enhancements we might come up with)? |
Not a Microsoft tool, but it's used by Gatsby too! So far it looks like a "maybe yes" answer to your first bullet point, so I think it's worth investigating, at least to see if it becomes a definitive yes or a hell no 🙅♀️ and address your 2 other questions at the same time 😃 |
Exciting!
Looks like it could be!
If by no other way one can always use
From their own web page: So I guess so 😉 I think the first thing to figure out would be how to interface with or wrap Plop. I'm sure it can do what we need, I wonder how much extra we would get compared to lodash's templates... Especially from a testability standpoint using the embedded version (node-plop) would probably be easier. But then we're in very undocumented territory, or, as they put it themselves: "Thar be dragons." 😛 |
We would want the source for either JS or TS be the same template since we don't want to manage multiple templates. It would be great if that's supported, but if it isn't we could still generate |
I'm pretty sure there is no magic way to have it generate both kinds of files. It would probably have to look something like this (contrived example, because, aren't they always? 😆)
With
And for JS (
|
@Tobbe I think the approach that we're currently using, which is to generate the typescript template and then to convert it to a javascript file with babel + prettier works fairly effectively without having to use any branching logic. |
Doesn't look like there's an "undo" method (there's |
@kimadeline Thanks for researching this, I think your suggestion for adding a custom action is a super reasonable approach. I would like to write down a set of first steps; would you be interested in contributing this?
@cannikin Does that sound like a reasonable way of testing plop? |
Absolutely agree this is the best approach if possible. Would probably mean we'll have to go with https://github.com/plopjs/node-plop If that's not a route we want to go down, it's actually not too bad executing yarn commands with node. I've recently done it for when I set up cypress ci execution for a project of mine |
Can you elaborate, @peterp & @Tobbe ? |
@noire-munich It totally would be opt in only, not much will change, but I think for a testability / tooling development / exception handling standpoint that not explicitly having to us the CLI is a bit easier. |
@peterp Sounds like a good starting point, count me in! I'd be happy to give it a try after we're sure that's the way we want to go to test it, and/or your setup pass 😬 |
@kimadeline Woot! Thanks! It is OK for me to assign you to this issue in the meantime? - I should have the "generators" package setup by tomorrow, and then I'll improve the granularity of "step 2" that I outlined above. |
@Tobbe Thanks for your input and support on this issue 🙇♂️ |
@peterp Of course, sounds good! 😄 |
Yep sounds great to me! |
@jtoar we've used Hygen for years on pretty much every project we can. I've looked into Plop previously and the two tools are similar enough we didn't feel the need to switch. That said, there are some things Hygen offers that I prefer:
Overall though, I feel like it's mostly a syntax choice and they accomplish the same thing. Plop seems to have a bit more community awareness. |
Update: in conversation today with Peter P., he gave Plop a 👎 We are not specifically unhappy with the current Redwood generators. However, there are two topics that keep coming up:
Peter mentioned wanting to first explore improving the structure and/or refactor before looking into an existing library like Plop or Hygen. TBD |
There's an opportunity to refactor the generators (possibly into a separate package) during the RC. Since this issue was mainly about using an ecosystem library, and since that's been delayed till after we've refactored, I'll close this for now. |
https://plopjs.com/
yarn rw g
?/cc @kimadeline word on the street this is being used by some Microsoft tools! Do you have any inside scoop? 😃
The text was updated successfully, but these errors were encountered: