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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Building the same app using various web frameworks

161 点作者 7d7n8 个月前

16 条评论

apitman8 个月前
Creating an app is one thing. What I want to know is what&#x27;s the update experience like 3 years later when I haven&#x27;t touched the code in forever and I&#x27;m getting a flood of dependabot notifications about critical vulnerabilities.<p>I&#x27;ll just have vanilla thanks.
评论 #41509997 未加载
评论 #41508165 未加载
评论 #41508191 未加载
评论 #41510959 未加载
评论 #41509534 未加载
评论 #41508477 未加载
评论 #41510296 未加载
评论 #41509173 未加载
评论 #41508777 未加载
mlboss8 个月前
I started learning FastHTML but somebody on reddit mentioned htpy. In my opinion htpy+fastapi is awesome combo. I like the way htpy handles declaring html components.<p><a href="http:&#x2F;&#x2F;htpy.dev" rel="nofollow">http:&#x2F;&#x2F;htpy.dev</a>
评论 #41508080 未加载
评论 #41508038 未加载
评论 #41508099 未加载
评论 #41507853 未加载
fareesh8 个月前
Building simple CRUD apps are often a single code-generation command in Phoenix&#x2F;Rails&#x2F;Laravel, and adding common features like Auth, Queues, Emails, File Uploads, etc. are similar.<p>The downside is that this is a stateful monolithic approach that requires a server running 24x7 and can break without some effort to cache and reduce the load on the database. They are also often memory-hungry frameworks.<p>The tradeoff for productivity is worth it in my view, for the vast majority of cases where it&#x27;s just a small team of 1-3 developers.
评论 #41507872 未加载
评论 #41507858 未加载
评论 #41507837 未加载
评论 #41508269 未加载
评论 #41508147 未加载
webprofusion8 个月前
Now do the same using Blazor Server (C#). For convenience use <a href="https:&#x2F;&#x2F;www.fluentui-blazor.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.fluentui-blazor.net&#x2F;</a> or <a href="https:&#x2F;&#x2F;mudblazor.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mudblazor.com&#x2F;</a> for your UI components.<p>It has it&#x27;s compromises but it&#x27;s great for just building stuff, with UI updates streamed to the client, no JS (or as much as you want), no extra API building just for the sake of your SPA. Note that I&#x27;m not talking about Blazor WASM.<p>If you&#x27;re interested in working as a developer for corporations outside of the SF bubble (e.g. the other 80% that use Windows instead of macOS) it&#x27;s worth checking out, especially for internal corporate stuff.
评论 #41508678 未加载
评论 #41508630 未加载
评论 #41510467 未加载
nikcub8 个月前
&gt; As an anecdote, I had an easier time using Cursor + Claude to build the app in FastAPI and Next.js, and a harder time with FastHTML and SvelteKit. Since FastHTML is barely a couple weeks old (at the time of writing), its code and docs likely hasn’t made its way into the training data of most LLMs yet, explaining their limited proficiency with FastHTML.<p>In cursor settings, click features and then add the documentation URL for each framework or library you are using so they can be indexed.<p>It would be best if you did this regardless of how well trained a model is on certain code - it helps immensely.<p>FastHTML has markdown formatted docs which can be used by Claude, just add .md to the end of the URL:<p><a href="https:&#x2F;&#x2F;docs.fastht.ml&#x2F;ref&#x2F;handlers.html.md" rel="nofollow">https:&#x2F;&#x2F;docs.fastht.ml&#x2F;ref&#x2F;handlers.html.md</a><p>You can find markdown docs for most libraries on GiHub, where you can have Cursor index.<p>I suspect that with the increased use of LLM-aware code editors, single-page markdown-formatted documentation will become more common (even better would be if Cursor hosted an external vector db with up-to-date docs and tutorials for all the most popular libraries and frameworks).
评论 #41508227 未加载
jakelazaroff8 个月前
Just a tip, one way to cut down on the Next.js and SvelteKit code would be to use the “actions” feature they both provide rather than manually creating API routes.<p>- <a href="https:&#x2F;&#x2F;nextjs.org&#x2F;docs&#x2F;app&#x2F;building-your-application&#x2F;data-fetching&#x2F;server-actions-and-mutations" rel="nofollow">https:&#x2F;&#x2F;nextjs.org&#x2F;docs&#x2F;app&#x2F;building-your-application&#x2F;data-f...</a><p>- <a href="https:&#x2F;&#x2F;kit.svelte.dev&#x2F;docs&#x2F;form-actions" rel="nofollow">https:&#x2F;&#x2F;kit.svelte.dev&#x2F;docs&#x2F;form-actions</a>
评论 #41508154 未加载
评论 #41517910 未加载
ledgerdev8 个月前
Good points on code assistants effecting language&#x2F;framework usage. Myself I&#x27;ve found that copilot will happily suggest usages that were deprecated 10 years ago and waste a couple hours of time.
评论 #41507654 未加载
评论 #41507587 未加载
评论 #41507646 未加载
daft_pink8 个月前
I’m really interested in using FastHTML, but it feels like it’s baking and not actually production ready.<p>For example, the sample projects store passwords in plaintext if they even allow login, which most don’t.<p>I really wish there was a way to use the FastHTML fast tags in FastAPI, so that I could use their cool HTML generator, but have robust and reliable deployment and auth, and possibly migrate to FastHTML once it’s a more mature product.
评论 #41508371 未加载
评论 #41508744 未加载
评论 #41507886 未加载
shahzaibmushtaq8 个月前
First of all, this app is very limited to differentiate which stack is better and faster.<p>Second, it should consist of completely different programming languages like C#, Ruby, PHP, JavaScript, Python, Go etc. Hopefully I will do it one day.<p>Last, what&#x27;s the end result?
avyfain8 个月前
&gt; Given React and Next’s wider use and longer history, it’s likely most LLMs are trained on more React and Next code than Svelte code. Ditto for FastHTML. This could lead to coding assistants being more effective when working with and suggesting code for established frameworks such as FastAPI, React, and Next.js.<p>Yes, but also more stale code from old versions which use patterns that the community has for various reasons moved on from. I ran into a lot of trouble with deprecated patterns while teaching myself react last year with assistants on the side. React 17 and prior version patterns kept coming up all the time.
tomcam8 个月前
Love seeing this. Reminds me of the years of interest techempower provided with their scrupulous and thoughtfully evolving web framework benchmarks <a href="https:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;#hw=ph&amp;test=fortune&amp;section=intro" rel="nofollow">https:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;#hw=ph&amp;test=fortune&amp;s...</a>
nnx8 个月前
Would be interesting to compare Remix.run in the mix? Feels like an interesting in-between NextJS and SvelteKit.
评论 #41508259 未加载
评论 #41508117 未加载
oDot8 个月前
IMO the biggest hurdle in frameworks like Svelte or Next isn&#x27;t the framework -- it&#x27;s the language.<p>This type of app is a prime use case for something like LiveView or a Go framework. Just today I had the most marvelous experience using Tailscale&#x27;s ACP, where I&#x27;ve changed the ACL and it instantly saved it. It was so fast I had to make sure it&#x27;s not optimistic UI, and sure enough, 78ms round trip for the request.<p>Even if it was a FE-heavy app using SQLite in the browser, I wouldn&#x27;t have used JavaScript. After months of Gleam, I am spoiled.<p>The days of JavaScript-because-we-have-to are thankfully over. JS is now only for when the flexibility is required.
评论 #41508233 未加载
nsonha8 个月前
nothing can beat the simplicity of Nextjs using the old page router. Try it, all you need for a starting point is a package.json (react, react-dom and next as dependencies), and a pages directory with a single index.tsx, no need to even install typescript or manually create tsconfig.json. And you can do multi pages or single page app or static generation. All other options can only either do web server or static generator, not both.
评论 #41511100 未加载
saaaaaam8 个月前
I didn’t expect to see Dundee United in a Hacker News post!
jiggawatts8 个月前
The <i>first</i> thing that jumped out at me was this:<p><pre><code> csv_data = [&quot;,&quot;.join(map(str, tbl.columns_dict))] csv_data += [&quot;,&quot;.join(map(str, row.values())) for row in tbl()] </code></pre> Sigh. He&#x27;s not &quot;building the app&quot;. This code is <i>wrong</i>. It&#x27;s not escaping the CSV properly, so embedded commas and similar control characters will result in gibberish output.<p>I&#x27;m just so fed up with this JS+HTML SPA framework demos where everybody thinks that stringly-typed programming is the only way to do things, where instead of using a <i>proper</i> library that actually encodes&#x2F;decodes file formats properly there&#x27;s this kind of quick &amp; dirty script snippet that is basically broken under all but ideal conditions. (&quot;It worked, once, on my computer, with toy data. Job done!&quot;)<p>I get it, this exercise is about comparing the essentials of different frameworks. But that comparison ought to include <i>things that matter</i>, such as correct handling of Accept-Language, safe escaping of data, sorting on <i>date</i> columns, virtualising lists too big to handle in one go, etc... That&#x27;s what actually matters, that&#x27;s what takes actual time when getting something to production. Not the folder structure or file naming conventions.<p>The author mentions &quot;How will coding assistants influence builders?&quot; but ChatGPT can spot this kind of error, and more: <a href="https:&#x2F;&#x2F;chatgpt.com&#x2F;share&#x2F;793e6353-817f-4765-ab33-f3131906378c" rel="nofollow">https:&#x2F;&#x2F;chatgpt.com&#x2F;share&#x2F;793e6353-817f-4765-ab33-f313190637...</a>
评论 #41507894 未加载
评论 #41508772 未加载