wasp icon indicating copy to clipboard operation
wasp copied to clipboard

Add support for code scaffolding?

Open Martinsos opened this issue 2 years ago • 2 comments

Many frameworks have possibility to quickly kick-start common pieces of code by them creating a bunch of starting code for you.

Is this something we want to do? We in general want to avoid boilerplate, so if we need to do scaffolding, question is, did we already fail? But in reality there will always be a bit of "boilerplate" so maybe a bit of scaffolding is ok.

I imagine it could be used to do stuff like:

  • add auth to the app
  • generate new query/action/entity
  • ...

It might be done via wasp CLI, where it creates new files or adds to existing files. But it could also work as editor extension that provides snippets.

Martinsos avatar May 25 '22 16:05 Martinsos

@realamirhe was interested in this as a potential feature! https://discord.com/channels/686873244791210014/808446354585550878/976782466482331728 .

Martinsos avatar May 25 '22 16:05 Martinsos

I think it is still a bit early to work on this, but once we recognize more repeating stuff and once we have more capacity for issue like this, it could be interesting to give it proper thought.

Martinsos avatar May 25 '22 16:05 Martinsos

+1 for scaffolding auth!

Martinsos avatar Oct 14 '22 15:10 Martinsos

Question here is: do we have scaffolding that adds stuff to Wasp app on demand? Or do we have questions when creating a new app, and based on that we generate app with specific stuff already in it? I guess we probably want both!

Martinsos avatar Feb 01 '23 10:02 Martinsos

We could also have full templates for new apps -> this overlaps heavily with the concept of asking questions at start though. Related issue capturing this here: https://github.com/wasp-lang/wasp/issues/984 .

Martinsos avatar Feb 01 '23 10:02 Martinsos

@Martinsos imho, asking questions is the domain of Large Language Models, as proved by ChatGPT.

I suggest that if you go that route (having questions when creating), it might become obsolete very fast. Although obviously I'm not inside your head seeing what type of prompting you are thinking of here! 😜

eg. Please write the code for a WASP starter app that includes the following features ... (or something like that).

At some point you will be able to gather WASP users input, feed it back into the LLM and improve future answers.

So IMHO I recommend you focus only on scaffolding that adds stuff, just like Rails does it. That keeps developers being able to continue to build quickly long after they've initially started.

Also, the LLM you later plug into will become aware of the scaffolding mechanism too.

rmcsharry avatar Feb 09 '23 10:02 rmcsharry

Interesting -> you think LLM can cover the initialization, so it makes more sense to focus on continuous scaffolding? That does make sense! Although initial scaffolding also might make sense for now, since it is just closer for user to use and also it generates many files while most LLMs are for now limited to a single file. That might change in the future, so let's see how this evolves!

Martinsos avatar Feb 09 '23 13:02 Martinsos

I also like the idea of continuous scaffolding, e.g. adding a new entity and then all the CRUD around it. Initial scaffolding could be helpful for a quick start which might be a quick win, but continuous one could prove to be valuable in the long-term imo.

matijaSos avatar Feb 09 '23 13:02 matijaSos

It is boring to write new files / code for Operations -> it would be cool if you could just define a new Operation in .wasp and then JS code gets generated for you.

Martinsos avatar Feb 13 '23 09:02 Martinsos

AI still could be interesting for scaffolding -> we could do the deterministic part of scaffolding ourselves, but then potentially have AI try to guess some implementation details while at it.

Martinsos avatar Apr 27 '23 12:04 Martinsos