DEV Community

Discussion on: Agrippa 1.3 is out 🎉🎉🎉

Collapse
 
nitzanhen profile image
Nitzan Hen

Well, if most of your projects are built using similar stacks and you have a few good snippets, snippets might work for you.
However, to cover the different tools, patterns and ways people write React components with you'd need tons of snippets!

Just as a simple example, say you have four different styling solutions you come across, two different declaration methods (as a const or as a function), two different export schemes (named vs. default export), as well as support for Typescript projects. All combinations of these four parameters exist in the wild, so to account for all of them you'd need 4*2*2*2 = 32 different snippets! And that's not a comprehensive list of options, even.

Sure, if you create more generic snippets you can get around with a smaller number of them, but then they become non-ideal - you need to "fix" every component generated with a snippet, so that it actually fits into the projects' stack.

Also, I disagree with your point about generation with snippets being quicker - in most projects that have Agrippa configured correctly, generating a component consists of typing three words into the command line - agrippa gen xxx. This command creates a directory for the component, 1-3 files according to the configuration (e.g. main component file, styles file and an index entrypoint) with the needed boilerplate, and optionally also opens them in your IDE. I'd argue that this is much quicker than creating all of these manually, and using a snippet for the component's declaration. And, as Agrippa grows, this difference will only get bigger.

Collapse
 
nitzanhen profile image
Nitzan Hen

As a final point, Agrippa takes some inspiration from Angular's CLI. Angular and React are two different beasts, and not everything that works for Angular would work for React - but the convenience and developer experience Angular's CLI bring to Angular developers is immense, and I think React devs could benefit from something similar as well.

Collapse
 
penguinshade profile image
Christian Burke

(Keep in mind I haven't used aggripa I've just read a bit) If you are working on various projects I guess one advantage to Aggripa Is that projects can have an aggripa config so you don't need to make your own snippet every time you work on a new codebase (if the project itself has a config).

I could see how it could be faster to generate in some cases for aggripa (when there are multiple files created). The only downside is you have to navigate in your terminal to the spot you want vs. doing a couple clicks in the UI and hit create file.

Thanks for the response and your input. 🙂

Thread Thread
 
nitzanhen profile image
Nitzan Hen

Cheers!

(p.s, as for navigation, both post-commands and baseDir & dest might help)