Live data from Hacker News

Build your own web framework

vercel.com

81–90 of 155 posts

Re: Build your own web framework

#81

What a sad state “modern” web dev is in. I’m glad that I’m living in a much faster and simpler world, but I fear, for end users and developers alike, that it is an ever shrinking one. I really can’t understand the appeal of what, to my eyes, amount to endless layers of needless complexity. I wish articles such as this one were more common: https://alexcabal.com/posts/standard-ebooks-and-classic-web-... This is the we…

With modern hardware it is very easy to serve millions of daily users from a single machine with simple software.

No one bothers because everyone loves their fast-as-a-snail framework in their favorite slow scripting language and they need massive infrastructure to scale it to serve less than 1k concurrent users.

Programmers have no one to blame but themselves.

Re: Build your own web framework

#82
post #5

This is a nice overview of modern front-end development but I'm constantly disappointed with what 'web framework' means in node-land. None of these things are strictly necessary when building a web app but authz/authn, user management, databases, server-side logic vs client-side logic, are pretty much always needed. When I see the phrase 'web framework' these are the things I am interested in seeing and they all seem…

I am still holding my breath for a Node framework that does everything Django does for me.

Honestly, we are most of the way there but for three holdouts; 0 config auth, easily extensible admin, and migrations.

User stuff isn't so bad with bcrypt but I'd really like to be able to type `framework create superuser` and `framework create user` instead of fiddling with user access and re-imaging user groups and permissions for the hundredth time.

Admin stuff always seems to be something relegated to a separate tool. No, please, please, please include it in the framework.

Most frameworks have you choose your own ORM (which is fine if they consistently use the same one in documentation), but for some reason Node ORMS always treat migrations as an afterthought or second class citizen (if they even consider it). Changing table structures in development to add a new column? Half of them just say, sorry, we're going to have to blow that away. The rest have either manual migrations or partially automated migrations written in the SQL dialect you happen to be using during development. My favorite of the lot I've seen so far is Prisma and even they have recently indicated they don't want to support transactions in migrations because they don't want to give you a "false sense of security" (well yeah, how about a real sense of security?). To be fair, even in python land Django is really the only one to have ever gotten migrations 100% right.

Re: Build your own web framework

#83
post #57
post #2

I'm struggling with the idea that React is a primitive used to build a Web Framework.

It's because almost no one uses React the way it was created, but ultimately depends on what you mean by Web Framework. I don't think react includes enough to be a web framework. It's a library to make components for web pages. Notably, Facebook's chat window. Later, one people decides that it's a good idea to have one giant component mounted at `body` or `div` directly underneath the body that would hold everything…

I think the problem is that react is larger than several frameworks but provide 1/10 of the functionality.

If react were preact it would feel smaller and people who care about performance would embed it without thinking too much

Re: Build your own web framework

#85
post #73

This is too funny. I predicted that when I entered this post the first comment would be HN people bemoaning complexity. And indeed it was. The commenter's proposed solution was WASM. Wasm doesn't solve the issues in this post. What does this post talk about: - serving content from the edge (wasm doesn't do anything there) - asset optimization (wasm doesn't help) - pre-rendering complex pages to static HTML+css (wasm…

That's HN. 8 years ago it would have been how Ethereum will make this all redundant

So you probably ought to listen to some degree? 8 years ago investing in ethereum was a very good idea and it definitely shook up the world to some extent.

Of course people exaggerate but it's important to see the trends and get an understanding of what people are feeling as a whole.

In this case, for all their complaining, people are kind of right. The web is becoming unnecessarily complex for the kinds of applications most of us interact with and there are solutions coming out there that address these pains: see HTMLx or phoenix liveview.

Re: Build your own web framework

#86

What a sad state “modern” web dev is in. I’m glad that I’m living in a much faster and simpler world, but I fear, for end users and developers alike, that it is an ever shrinking one. I really can’t understand the appeal of what, to my eyes, amount to endless layers of needless complexity. I wish articles such as this one were more common: https://alexcabal.com/posts/standard-ebooks-and-classic-web-... This is the we…

> I wish articles such as this one were more common:

> https://alexcabal.com/posts/standard-ebooks-and-classic-web-...

> This is the web I want and love.

Worth noting that according to their article, Standard EBooks does not use javascript on their page. This might work for them, and it might work for you, but in many cases users want SPAs and interactivity (Google Maps, Google Docs, etc)

Re: Build your own web framework

#87

Earlier quoted context omitted.

Classic asp also supports JavaScript, it is old and wide spread in the bowels of legacy sites. I thought of node as a victory for async more than anything else.

> I thought of node as a victory for async more than anything else. In terms of server-side development? Async is rather useless on the server side. Can't generate a web page or JSON blob with the results of a database query until you actually get those results from the database. I can see the application for something like websockets but I presume most Node sites aren't using those. I figured its success was due to…

> In terms of server-side development? Async is rather useless on the server side. Can't generate a web page or JSON blob with the results of a database query until you actually get those results from the database.

This is precisely why async (well, cooperative concurrency generally) is useful, whether on a server or otherwise. Blocking for things you can’t do yet is a waste of idle resources. There are plenty of other concurrency models which are also useful, but yielding/suspending when idle is almost always better than not. And the cases where it’s not generally have other problems.

Re: Build your own web framework

#88
post #69

Do we ever think we'll collapse all of the complexity layers for programming on the web? Coming from other languages, I'm finding that the agreed-upon web standards make development super hard (we have to collectively build these towers of babel on top of them, since we can't fix the underlying stuff) I guess WASM maybe is one possible solution here

on the note of babel, I don't usually do front end stuff but the other day I wanted to transpile one single javascript file to support older browsers, one time and then never again. I tried for like an hour and I could not figure out how to do it, without setting up like a whole environment/pipeline for it. My expectation going into it was "surely there's some sort of command that just lets you do input file -> outpu…

Babel transpiles js to browsers which are older than me. You should give it a try.

Re: Build your own web framework

#90

Earlier quoted context omitted.

Classic asp also supports JavaScript, it is old and wide spread in the bowels of legacy sites. I thought of node as a victory for async more than anything else.

> I thought of node as a victory for async more than anything else. In terms of server-side development? Async is rather useless on the server side. Can't generate a web page or JSON blob with the results of a database query until you actually get those results from the database. I can see the application for something like websockets but I presume most Node sites aren't using those. I figured its success was due to…

> Async is rather useless on the server side [...] its success was due to [...] a generation of front-end-centric developers [who] didn't realize [...] that better options already existed

You'd be wrong, again. According to Ryan Dahl, creator of Node.js [1]:

> I think the combination of Chris Neukirchen’s rack plus how Nginx structured its web server with non-blocking IO led me to start thinking about how those two things could be combined. [...] So, when V8 came out, I started poking around with it, and it looked fascinating [...] and suddenly, I clicked that: oh! Javascript is single-threaded, and everybody is already doing non-blocking. [...] I think JavaScript plus asynchronous IO plus some HTTP server stuff would be a cool thing. And I was so excited about that idea that I just worked on it non-stop for the next four years.

[1]: https://mappingthejourney.com/single-post/2017/08/31/episode...

Post reply on HN