Open Martinsos opened 3 years ago
I thought we decided to remove nameless declarations from the new version? In https://github.com/wasp-lang/wasp/issues/109#issuecomment-846094357
route
was given a name so you can't refer to non-existent routes, and we decided dependencies
and auth
to be part of app
. It might be worth discussing this again though:
There are several things that don't make sense to have names: app
, dependencies
, auth
, server
, db
. The reason is that it's invalid to have more than one, and there's no need to refer to them in a .wasp
file. So it's worth considering how to design this to only allow one (nameless) instance of each of these.
The original idea for this implementation was to a have third statement type that's an unnamed decl (we didn't settle on a good name. inst
for instance or maybe sing
for singleton?). The type checking an evaluation would be identical to decl.
@craigmc08 makes sense I forgot about that!
That is a good analysis -> let's keep it at this for now and we can revisit this in the future, this is certainly not urgent right now.
I think it will make sense at some point to have these nameless declarations, but as you said for now we can either just make them part of the app
, and then we can figure it out as we go.
Some declarations, like
route
ordependencies
, don't need a name, there is no purpose in them being named.Therefore, we should allow them being nameless:
Right now, this is not supported!
What do we need to support it?