115 points · by matijash · 3y ago · 37 comments
Why another full-stack framework? And why a config language/DSL? We were still experiencing a lot of boilerplate (repetitive tasks) using other frameworks—things like duplicating data models across database/server/client, implementing CRUD API, setting up auth, and choosing and stitching together all parts of the stack.
There are two main reasons for the DSL approach - 1) short-term: simpler and cleaner DX via a declarative language that helps avoid boilerplate, and 2) longer-tem: laying foundation for the stack & architecture independent system.
Since Wasp analyses the app’s requirements in compile time, it can decide how to generate the target code (React & Node.js currently). In the future it could support other stacks such as e.g. Vue/Svelte on the client and Python/Go on the server, even allowing for mixing’n’matching. The same goes for the architecture (dedicated server, serverless, …).
Our big vision for Wasp is to become a stable, stack-agnostic language for describing (web) app requirements (like SQL for databases or Terraform for infra) that interops with the existing stack. Wasp-lang stands for “Web Application SPecification language”.
Besides the DSL, another valid approach would be to offer an SDK in e.g. JS or Python to build Wasp AST (like Terraform and Pulumi now both offer). We see it as another “frontend” for constructing the AST and might also introduce it in the future.
Under the hood, everything is compiled to a client (React) and server (Node.js/Prisma) apps and we generate static files and a Docker image you can use for deploying to your platform of choice.
Wasp had an Alpha launch 1.5 years ago (https://news.ycombinator.com/item?id=26091956). Now we are more stable and feature-full. We still expect things to change, so wouldn’t recommend using Wasp for heavy production or mission-critical systems just yet. But it has been used for hackathons, internal tools and even revenue-generating products (https://wasp-lang.dev/blog/2022/11/26/erlis-amicus-usecase).
The current release is our biggest since we launched (https://wasp-lang.dev/blog/2022/11/29/wasp-beta). Besides general stability and DX improvements, it brings support for TypeScript (https://wasp-lang.dev/blog/2022/11/29/typescript-feature-ann...), Tailwind (https://wasp-lang.dev/blog/2022/11/16/tailwind-feature-annou...), async jobs via pg-boss (https://wasp-lang.dev/blog/2022/06/15/jobs-feature-announcem...), full-stack authentication (now also with Google) (http://localhost:3000/blog/2022/11/15/auth-feature-announcem...), and by popular demand, Wasp LSP with VS Code integration (https://wasp-lang.dev/blog/2022/12/01/beta-ide-improvements).
Our next focus will be on making Wasp even easier to use (examples, starter templates, UI helpers), and we’ll look into tighter weaving of data models with the rest of the stack and expanding the DSL with more functionalities.
We’re around to answer questions and look forward to hearing everything and anything you have to say!
Verify/reset/etc is always what pushes me away from doing multi-user webapps. Its a headache every time due to needing to think about e-mail, and I'd love an all-in-one oauth2 provider with signup and etc thats super lightweight and just does everything through an API.
As for username & password - correct, we do not do any email verification and reset right now. We actually changed the name from email & password to username & password to reflect the fact that we don't have tight email integration yet in Wasp. However, that will be coming soon, and once we do have first-class email support we plan to enrich that login method to have email verification with password reset, perhaps magic links, etc.
So long story short, we are trying to move quickly to add more auth options but be deliberate in how we integrate everything to ensure they all play together nicely. Please do check us out if it seems interesting and drop into Discord to let us know how we can improve to fit your use cases. Thanks!
Then I can use anything I want, by way of the myriad of self hosted and commercial services providing OpenID based authentication service endpoints, Auth0, Keycloak, Okata, etc. The predominant mechanism for these sorts of “auth service” is OpenID Connect, because it really does immediately get you 80% of what you want from authentication out of the box with no additional work, saving heaps of time, provided you need these kinds of features and a built in framework username and password style auth system is inadequate and as long as the pain of running (or paying for) the separate service is acceptable.
And to tie this to their request, this would facilitate you offering an auth service by way of having the wasp DSL build infrastructure as code configurations for an open source auth service like keycloak, or even partner and white label an exiting vendor service as a premium service extra at $/month…
Login with Google leaves at least 85% of your company employed userbase by the wayside, so add Login with Microsoft.
Really, your auth should look something like this:
What's most interesting (to me at least, as someone that loves building and learning about new languages) is that Wasp is YC funded. Probably the first language project I have seen to be part of YC.
At the beginning of our fundraising VCs were often skeptical towards Wasp being a "new programming language", because who ever monetized (directly) Python or C++? Once we changed the narrative a bit and started referring to Terraform (DSL and a successful VC case) and emphasized that Wasp is a config language that interacts with the existing stack (so no big learning curve), we started having much better conversations.
Fundraising wasn't an easy journey for us (it took over 250 meetings) and we learned a lot about how to present and also think about Wasp. For more details, we documented our fundraise in details here: https://wasp-lang.dev/blog/2021/11/22/fundraising-learnings
I will need to play with this to make more informed opinion, but based on description and info on landing page, I love what you are doing.
One thing that crosses my mind, clearly not applicable in this case as you are far along, but making it more interesting to write these specs would go a long way on improving how people use this. Like, I would consider some kind of markdown or at least TOML... something with indentation as opposed to braces.
Anyhow, anything that would save me from writing boilerplate code is more then welcome.
It would be cool if there is a standard way and then people start making plugins and stuff. It would have to be open source as VCs spoil the thing.
We documented our adoption journey (through gh stars) here (https://wasp-lang.dev/blog/2022/09/29/journey-to-1000-gh-sta...), and we also marked the moment when we were accepted in YC (we actually applied 3 times in a row!).
For example I could describe my application with Wasp, write some code generator and generate my own code with it?
Would it make any sense to use it like this?
So yes, you could use just Analyzer to produce AppSpec, and then write your own generator that will based on that AppSpec generate your own code! AppSpec currently exists only as Haskell in-memory data structure, but it could be relatively easy serialized via JSON and then imported in some other language.
You can see more about this in this README, there is a nice diagram showing parts of compiler (Analyzer, AppSpec, Generator): https://github.com/wasp-lang/wasp/tree/main/waspc#readme .
The reason why we already ensured this split was because the plan is in the future to have multiple different Generators, and also to allow users to write either their whole Generators or plugins that modify AST (AppSpec). We haven't explored this further yet, and probably won't push much in this direction until we get to Wasp 1.0, but we certainly want to work on it more in the future!
It feels like the JS ecosystem is missing framework that helped define layers of an app much like Rails/Django
But I agree providing some best practices on the structure would be helpful - I personally prefer top-level grouping-by-feature (e.g. "billing/" and "reports/") over grouping-by-type (e.g. "controllers/", "components/"), but I know some folks prefer by-type, especially in the smaller projects.
We plan to add more starter projects and templates so that might be a good start. Is there anything specific you'd like to se enforced/suggested, based on how you like to structure your projects?
We thought about it a bit already and definitely not 100% of concepts from the domain of web apps would apply (e.g. routes maybe don't make sense in mobile apps), but there is still a lot that could be share. Maybe Wasp could also generate some SDK you could use from your native mobile code.
That's all long-term stuff so really hard to know, but we imagined we'd first focus on getting to 1.0 with React & Node, then add support for more client/server stacks (e.g. Vue and Python), and then go towards mobile and desktop.
> How is Wasp different from Next.js / Nuxt.js / Gatsby?
> TL;DR - These are frontend-first frameworks, with some limited backend capabilities.
> [...]
> Although some of them now offer an option to use serverless functions, you still have to bring your own database and you'll also need some kind of a server/backend if you'll need to run more complex operations.
That's a big understatement; Next is fully full stack. You get API endpoints and server-side rendering out of the box.
You can deploy the backend as serverless functions, yes, but you can also deploy it as a plain old Node app.
Does Wasp offer something on the backend that Next doesn't?
> you still have to bring your own database
Confused on this one - does Wasp abstract away the database? The docs show a database connection config and mention using Prisma as the ORM. It looks similar to what I'd do in Next.
Besides db coming out-of-the-box, the biggest difference of Wasp over Next.js is that data models (aka entities in Wasp) are more deeply integrated throughout the whole stack. That means you don't have to implement your typical CRUD API to deal with data. E.g. Once you define your entities (User, Post, ...) and queries/actions that operate on them (getUser, updatePost, ...), you can immediately invoke them from the client (Wasp generates RPC under the hood) without any extra work.
Since Wasp has understanding of your data models (we actually parse the psl, prisma schema language, used for data model definition) it can also provide more help such as automatic cache invalidation [1] (e.g. if you run an action that updates Task entity, Wasp will immediately know it needs to refresh all queries that depend on Task entity, unless you specified differently) and a native support for optimistic UI updates [2].
[1] https://wasp-lang.dev/docs/tutorials/todo-app/03-listing-tas...
[2] https://wasp-lang.dev/blog/2022/11/30/optimistic-update-feat...
I think the main question here is what experience we want to offer and which level of integration (e.g. with Wasp's entity models) we can achieve. Do you have any particular features of Supabase/Hasura that you'd like to use?
The cool part about Wasp is that it allows you to build full-stack apps with minimal effort, so that you can spend the majority of your time actually writing React and Prisma, and not configuring servers, routes, authentication, and the like. Just by defining your Entities and the necessary read & write operations in your Wasp file, Wasp is able to build a NodeJS server based on industry best-practices, create your Auth "plumbing", build your API, protect pages, etc.
You're free to define the logic as you see fit, without the grunt work of setting up services from scratch.
* full-stack auth - username/password or Google (more providers soon)
* routing + ability to protect your routes (only authenticated users)
* running async jobs (e.g. you need send an email, or generate a report), powered by pg-poss
* tight integration of data models throughout the stack - no need to implement CRUD API, automatic cache invalidation, native support for optimistic UI updates
- we will provide a managed hosting service, think Wasp Cloud, that will make it the best place to run your Wasp apps with easy deployments, simple 3rd party integrations, great observability, DX enhancements and flows vs rolling your own on AWS, etc.
- we provide some extra functionality that is more enterprise-focused and niche, but we charge for it (like more enterprise-focused forms of authentication, for example)
- we provide support and maintenance licenses for those who want someone to be there when they call :)
Thanks for your interest!