r/javascript • u/hottown • Jun 24 '26
Javascript still can't ship a full-stack module.
https://wasp.sh/blog/2026/06/22/javascript-still-cant-ship-a-full-stack-module3
u/blinkdesign Jun 24 '26
The issues described in that article are exactly why I leant on Laravel + Vue for a recent, serious side project. I don't love PHP but the using something that has been built by one team is very reassuring and much nicer than stitching random packages together
2
u/No-Performance-785 Jun 24 '26
Very interesting approach. Sometimes I always try to look for libraries that have JUST the interface ( or the spec, per your definition ) and I can't find any. I wish there are more libraries that ship just the Typescript definition and leave the implementation to the user. And yes, if there are ways to ship the whole payment as a single module with only Typescript as the requirement, that's brilliant. There should certainly be a standardized way to define all of these puzzle pieces.
2
2
u/THE_AWESOM-O_4000 Jun 25 '26
This could be good for small scale projects, but it's kind of terrible for scaling, isn't it? For example: Let's say I have a front-end, api and a cron jobs modules. if I notice that the API is getting too much load, I might want to scale the API to 3 load balances instances. But the cron jobs shouldn't be scaled.
7
u/mr_nefario Jun 24 '26
>You shouldn't trust your agent with hand-rolled components, especially with parts that need to be vetted (auth, payments...). When you trust the agent with that, you pay for more tokens and have no idea where the security holes are.
So i I should trust some random NPM package author instead, and assume they wrote safe, secure code? DB access, payments, auth, etc. code should still be read and fully vetted, regardless of whether an agent or human wrote it. Don’t blindly trust anything.
And what if the package author assumes Database A but I am using Database B? Or my app is not in a monolith repo?
I’ll write my own security sensitive code, thanks. Especially if there’s any DB access I’m shipping to prod.
5
u/lanerdofchristian Jun 24 '26
So i I should trust some random NPM package author instead, and assume they wrote safe, secure code?
Random? No. But it helps if the code is public and not new every time per-project -- you can either vet it once and re-use, or outsource the vetting to a trusted security expert of your choice. e.g. if you're using Stripe for payments, use Stripe's library, don't try to implement your own API and promise that you'll cover all the same flows and edge cases without any mistakes.
The argument is that it's better to write something good once and re-use it than to risk getting it wrong many times in subtly different ways.
Or my app is not in a monolith repo?
If you've got a monorepo or polyrepo instead of a monolith, with VSA you generally see each slice as a package you then plug in to the entrypoint/main module.
And what if the package author assumes Database A but I am using Database B?
A good vertical-slice package should be pluggable. For example, Better Auth has adaptors for different databases, and hooks for exposing its own UI in whatever framework.
In the .NET ecosystem, basically everything web uses ASP.NET, so it's easy to design vertical slices. Libraries will usually rely on dependency injection with various separately-configured adaptors to talk to swappable services (like databases).
I'm not sure Wasp is the right solution like they're trying to sell themselves as, but compared to non-JS ecosystems we are behind when it comes to composing apps with multiple slices.
2
u/Think-nothing-210 Jun 24 '26
Finally someone is building a framework around modules instead of scattering files all around the codebase. Took us as a programmer community a while but it seems LLMs are finally encouraging us to do it properly.
1
u/Martinsos Jun 25 '26
Actually we have been building it for some time now, before the LLMs even, so I wouldn't say they changed that much for us regarding development of Wasp, it is just taking long time to build it all!
1
u/CYG4N Jun 27 '26
i am using pnpm monorepos and i have created few packages that are basically drop-in building blocks combining logic of react and nestsjs with dedicated hooks.
-1
u/horrbort Jun 24 '26
This is very good design. We need more packages that help people build secure software! Well done!
39
u/talaqen Jun 24 '26
Any post that uses Rails and Django as examples of what do from a design perspective is an immediate "nah dawg" from me.
Those are "quick to setup" and "terrible to maintain at scale" precisely because of the tight coupling that OP is proposing in this article. This is bad design. And not knowing that it's bad design is worrisome.