TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

What to expect from your framework

119 点作者 hejsna超过 2 年前

13 条评论

darkhorse13超过 2 年前
This is really great, and I&#x27;m really happy people are finally waking up to this. I&#x27;ve stuck with Django through all of this and never looked back. Nowadays with stuff like HTMX, things have never been better!<p>Could we do this for CSS-in-JS next please? With React 18 making a strong push for compiled CSS, we have libraries now that let you write CSS (compiled) using Typescript. This is also absolutely crazy to me because we COULD BE JUST WRITING CSS instead (especially with variable support).
评论 #34857852 未加载
评论 #34858157 未加载
评论 #34857313 未加载
mattgreenrocks超过 2 年前
Rails is probably the best framework still. But it still feels too low-level. I don’t want to care about the mountains of Web gunk there are: JSON serialization, HTTP methods, cookies, etc. Lack of static typing really hurts the maintenance story, too.<p>I really just want to write business logic, wire that up to endpoints in a nice DSL, and move on.<p>Most web frameworks seem to be obsessed with the web platform to the point they feel more like glorified macros, leaking its web gunk everywhere.
评论 #34857530 未加载
评论 #34857527 未加载
评论 #34857751 未加载
评论 #34857520 未加载
评论 #34859129 未加载
arrowsmith超过 2 年前
This article is great, and it reminds me of a rant I&#x27;ve been wanting to make for a long time: why the hell does <i>everyone</i> these days insist on building every web app as an SPA?<p>I started my career in Rails. I&#x27;m sick of Rails these days as I&#x27;ve worked with it for long enough to become intimately familiar with its flaws; these days I&#x27;d pick Phoenix over Rails any day of the week. But still, I&#x27;d rather spend a million years with Rails than five minutes with most of the React SPA monstrosities I&#x27;ve had to work with recently.<p>I get it: if you want to build a super-complicated, dynamic front-end, there&#x27;s only so much you can do with the classic Rails-style approach (server-side rendering of HTML templates with some vanilla Javascript, or perhaps jQuery, sprinkled on top). Once you get past a certain level of complexity I can understand the argument for having totally separate &quot;frontend&quot; and &quot;backend&quot; applications where the frontend is built with something like React and the latter renders nothing more than a JSON API.<p>But why, why, <i>why</i> has the entire industry seemingly decided that the latter, complex approach is the default, perhaps even the <i>only</i>, way to build a web application? The last four companies I&#x27;ve worked for all used the &quot;separate FE&#x2F;BE&quot; approach for every app, and at all four companies it was a terrible, unnecessary choice that added exponential amounts of complexity and slowed development to a crawl for no discernible benefit. Time and time again I&#x27;d get frustrated because the most simple, basic features would take ridiculously long to finish, be a nightmare to test, and be full of infuriating little subtleties and footguns that made the implementation fragile as an eggshell. Even something as simple as adding a &lt;form&gt; would take ten times longer than I knew it would have taken me in Phoenix or Rails.<p>And yet when I try to explain that I don&#x27;t think we need the &quot;separate FE&#x2F;BE&quot; approach for the task at hand, people look at me like I&#x27;ve suggested we don&#x27;t need electricity. It&#x27;s all they&#x27;ve ever known and they can&#x27;t imagine there might be a better way, or at least one that isn&#x27;t so agonisingly, pointlessly complex. What&#x27;s happened to the industry? Why has web development become like this?
评论 #34857776 未加载
评论 #34857919 未加载
评论 #34857638 未加载
评论 #34861920 未加载
评论 #34858375 未加载
评论 #34858054 未加载
评论 #34858277 未加载
评论 #34858297 未加载
评论 #34873602 未加载
评论 #34857582 未加载
ChrisMarshallNY超过 2 年前
I enjoyed that read! Johan is a great writer.<p>I&#x27;ve written frameworks, libraries, SDKs, APIs, and drivers.<p>Most are not frameworks. Frameworks are a <i>lot</i> of work to write and maintain.<p>The most painful part of writing a framework, is the &quot;rubber meets the road&quot; part, where I suddenly realize that all that TLC I put into developing Guiding Principles, Mental Models, Basic Philosophies, etc. <i>ad nauseam</i>, were for shit, because no one is using my marvelous tool, the way I expect[0], and no one is oohing and ahhing over my masterful implementation. That ends up as a huge smorgasbord, serving a <i>lot</i> of Crow, Egg On Face, and Humble Pie.<p>[0] <a href="https:&#x2F;&#x2F;www.theonion.com&#x2F;bantu-tribesman-uses-ibm-global-uplink-network-modem-to-1819563905" rel="nofollow">https:&#x2F;&#x2F;www.theonion.com&#x2F;bantu-tribesman-uses-ibm-global-upl...</a>
howaboutnope超过 2 年前
A really, really good podcast I listened to recently:<p><a href="https:&#x2F;&#x2F;changelog.com&#x2F;news&#x2F;web-developments-lost-decade-LWao" rel="nofollow">https:&#x2F;&#x2F;changelog.com&#x2F;news&#x2F;web-developments-lost-decade-LWao</a><p>&gt; <i>Amal sits down for a one-on-one with Alex Russell, Microsoft Partner on the Edge team, and former Web Standards Tech Lead for Chrome, whose recent post, The Market for Lemons, stirred up a BIG conversation in the web development community.</i><p>&gt; <i>Have we really lost a decade in potential progress? What happened? Where do we go from here?</i>
nickjj超过 2 年前
I like using `rails middleware` as an example because it&#x27;s true, tons of things in that list are important.<p>A good example of this is: Rack::MethodOverride<p>Try making your non-JS server rendered view functions and HTML form submissions handle PUT, PATCH and DELETE. Depending on which lightweight alternative to Rails you&#x27;re using this can become very tricky and you end up spending an entire day of Googling and maybe finding a questionable solution instead of having that available without thinking about it.
评论 #34859116 未加载
johnteller超过 2 年前
I was interviewed for a job a few days back and I was told that these heavy JavaScript libraries are the future of the web. I&#x27;m still confused.<p>Either my country is just behind or what you read on hackernews is not reflective of the real world.
评论 #34858253 未加载
评论 #34858013 未加载
评论 #34858071 未加载
imetatroll超过 2 年前
And good old Johan wrote many an app, rode off into the sunset victorious and left the job of maintaining his third party soup to some poor soul.
评论 #34857377 未加载
评论 #34858219 未加载
KrugerDunnings超过 2 年前
I dislike frameworks for the same reason most of their proponents like frameworks, you can not expect to out-compete all the smart people working together on a common goal. Frameworks are bad at cultivating off-colour ideas, they tend to have a well curated API but are often stuck with a singular architecture. Sometimes the solution is to be found in some lateral dimension. One such example is PostREST, it does away with 80% of API boilerplate by inferring the API from the database schema using functional programming magic. You sort of have to become a Postgresql wizard to get everything out of it, but I feel that this knowledge is somehow more valuable than yet another backend framework.
评论 #34857506 未加载
revskill超过 2 年前
&quot;Concatenates text and fires it off to the browser in a straightforward and predictable way.&quot;<p>What ? It&#x27;s in 2023, you don&#x27;t want to concanate text ?
评论 #34858063 未加载
评论 #34857498 未加载
eximius超过 2 年前
Yeesh, I just want some web components, okay?<p>(But not Web Components, those... Those are not good.)
评论 #34858767 未加载
KronisLV超过 2 年前
&gt; So half of this blog post has actually been sitting on my drive for a couple of months because I’ve had a good long sad about the distressingly low bar we’ve set for something to bill itself as a Framework. I suppose this is partly because we’ve never really agreed about what constitutes one, and spoiler alert I don’t have a proper working definition either. But let’s get this out of the way first: React is not a framework.<p>I never got why people care about the difference between a library and framework and try to categorize these offerings, especially when we don&#x27;t even have meaningful definitions. The way I&#x27;ve seen it, you&#x27;re usually going to have one front end &quot;base thing&quot; and build everything around it - be it Vue, or React, or Angular, or Svelte, or jQuery, or Next.js, or Nuxt, or JSF, or Vaadin, or Laravel&#x27;s Blade templates, or the Rails equivalent etc.<p>In some cases, it will try to provide everything out of the box, in other cases you&#x27;re going to integrate a bunch of other stuff to do what you want, but you&#x27;re rarely (at least in my experience) going to have something like React combined with Vue, or Vue with Svelte in the same site, which is sometimes touted as one of the advantages of libraries. I think I can recall one micro frontend project in my past like that. Furthermore, I&#x27;ve seen very few cases where integrated libraries are ever swapped out for something else once there&#x27;s lots of code written against them, so they get coupled with the rest of the codebase regardless (unless you&#x27;re really good at establishing boundaries&#x2F;abstractions), so that&#x27;s another supposed advantage that doesn&#x27;t always pan out. And even when you use most of the frameworks out there, you still need to think about UI components and such, of which there are many libraries to integrate with your framework, so you still need additional bits introduced.<p>It&#x27;s almost like saying &quot;Next.js acts 75% like a framework, whereas React only provides 25% of what you&#x27;d need for a full batteries included experience and therefore will mostly be treated as a library on its own.&quot; Silly way of framing it, I&#x27;ll admit, but the end result will most likely be the same - one big repo of front end code (possibly a sub-folder), regardless of how many packages it&#x27;s made up of. Just pick a group of solutions that fit your architecture of choice: Laravel, Rails and Django front end offerings are all good for SSR, whereas for SPAs just pick things depending on how much of an integrated experience you want, anything from Nuxt to barebones Vue, with libraries imported based on needs.<p>Personally, I like the benefits of SSR (how integrated development can feel, easy to reason about), but I dislike the coupling and how you eventually will need to upgrade &quot;the entire thing&quot;, which might be a big rewrite (e.g. moving from Spring to Spring Boot, or upgrading Rails&#x2F;Laravel projects across major versions). I like the ability to throw away and replace SPAs if the need presents itself (AngularJS, anyone?) and the clear decoupling thanks to the API (running the old and new thing side by side is nice for dev). Oh, also SPAs lend themselves nicely for build parallelization, but have the downside of two deployment units (e.g. separate front end and back end containers&#x2F;packages). Solutions that give you most of what you&#x27;ll need are great, but only for as long as you don&#x27;t have to fight against them due to needing to do something different.
评论 #34858116 未加载
butz超过 2 年前
So, is Angular a framework then?