7 ms·
Ooh, some competition for Next.js? Vercel is doing a really good job with Next, but it's good to see some competition. Of course, that means there's now 65,535
by solardev 4y ago
Ooh, some competition for Next.js?
Vercel is doing a really good job with Next, but it's good to see some competition. Of course, that means there's now 65,535 + 1 more way of serving a web page using Javascript (sigh).
Rehydration is a really big deal. Sounds dorky but it dramatically speeds up load times and such by serving flat HTML and injecting JS afterward, like the old days, except you can write code like it's not the old days.
- steve_adams_86 4y agoHave you seen Remix yet? It’s pretty compelling in terms of competition for Next.JS. It makes different trade offs and isn’t strictly better by every metric, but overall I’m very happy with it for the two use cases I’ve tried it with. It’s a very low overhead framework once the simple conventions click. I’d still like to check this out, then redwood and a couple others too. I’m not huge on these frameworks in general, but they tend to have some excellent ideas and smart people behind them, so plenty to learn by experimenting with them.
- solardev 4y agoI've heard really good things about Remix, especially the nested routes. But I think Next is trying to copy that in Layouts? https://nextjs.org/blog/layouts-rfc https://nextjs.org/blog/layouts-rfc I use Next not just for the routing and composition and hydration, but for all the other quality-of-life improvements (image resizing, buildchain configs, hot reload), especially when it's paired with Vercel (per-push sandbox builds, stale-while-revalidate, seamless CDN, access to serverless, etc.) I'm really excited to see how Remix and other Next competitors evolve, but for now, I think it's still the most "full" stack of the React frameworks? Is that correct?
- ttty 4y agoImage resizing can’t be done statically. That’s a big issue if you want to serve things from cdn property.
- steve_adams_86 4y agoThat’s correct about Layouts, and I agree, if you want something with all the quality of life tooling ready to go, Next seems to be the way to go. It isn’t too hard to get the same/similar tooling outside of the vercel ecosystem, but it does take know how and a bit of extra time. It isn’t obviously worth it unless vercel isn’t meeting your needs in my opinion/experience. I mostly play around with other frameworks in order to learn, but for any client where a frontend framework made sense I’d almost certainly choose Next. Edit: people also get bent out of shape about perfect hydration and shaving milliseconds here and there, but like you mention, Next offers such a comprehensive solution in a situation where routing and hydration are only a part of the big picture. Next gets you really far without any effort up front, which is crazy. I really like it!
- likortera 4y agoIt's funny to me to see how many people say Next is copying something about remix when the entire remix thing is a copy of Next. Heck, I've heard in a podcadt they're even working on a hosting platform copying vercel.
- solardev 4y agoAll of tech is just people borrowing from each other. It's a good thing! I wish IP patents weren't a thing.
- steve_adams_86 4y agoFor sure, Vercel was working on nested routes before Remix was a thing, as far as I know. A lot of people suggested it was lifted from Remix. It’s not a new idea at all and people have been asking for it for years. Arguably there is nothing all that novel in either framework. We are constantly reiterating and rebuilding wheels, doing it a little better each time. I’m glad to see the Remix take in things gaining steam though. It’s quite a bit less cognitive overhead than Next without any magical trade offs. Nothing ground breaking, but definitely better at things I care about. Like most things, a blend of solutions would be ideal
- solardev 4y agoEventually React is just going to become Angular3, lol
- jonny_eh 4y ago> that means there's now 65,535 + 1 more way of serving a web page using Javascript (sigh). You only need one (or none). I personally recommend Next.js for just about anything.
- onion2k 4y agoNext is lovely to work with but it has a flaw. It loses client state between pages if you use getServerSideProps. For any app that needs to load some up to date data on every page if the user is hitting it for the first time, but doesn't need to load it if the client already has it, Next doesn't have a solution. You end up using a persist gateway pattern which is a massive amount of work that you shouldn't really need the client to do. The problem is that that's pretty much every web app. Every time I've used Next I've end up abandoning SSR and building a plain clientside rendered app.
- srigi 4y agoCan you elaborate a little more, or navigate to some GH issue, where this is discussed, please?
- cercatrova 4y agoAlso, next/image only works with a CDN, ie Vercel, it doesn't work with static site generation. It's been an open issue for years and I honestly now feel like Vercel doesn't fix the problem on purpose, to push more people to using their service rather than simply exporting to a static host which are plentiful.
- solardev 4y agoYou can set next/image to work with Cloudinary or Imgix or a custom provider. It gets the job done that way, but yeah, the experience isn't as smooth as with Vercel. Same with incremental static regeneration and some other features... Next is obviously built not just by, but also for, Vercel. Vendor lock-in already is a small issue and may become a bigger one if they keep going down that route.
- 4y ago
- jasfi 4y agoThe htmx library is a good way to do that: https://htmx.org https://htmx.org
- c03 4y agoHTMX is revolutionary in it's bang-for-buck simplicity
- deleted 4y ago[deleted]
- 1337shadow 4y agoUnpoly.js also good
- eyelidlessness 4y ago> Rehydration is a really big deal. Sounds dorky but it dramatically speeds up load times and such by serving flat HTML and injecting JS afterward, like the old days, except you can write code like it's not the old days. Hydration is actually a compromise, and not a great one for UX. It’s in fact been said to be “pure overhead”, which I think is an overstatement but only slightly. What you’re describing in the abstract is spot on though. Serializing server state to HTML and sprinkling in interactivity to pick up where it left off is exactly where we should be headed. And yes it is like the old days, and yes all of HN will rapidly say so. The big difference now is the convergence of code written for both server and client, and compilers which help strip down and optimize what happens in the client. Hydration in the current sense is re-running most of what the server already did, to recreate the runtime state it already had. That may be perceptively faster in terms of metrics like first paint, but it’s a huge barrier for time to interactive. All the more so when most content is static and has to load twice—fast first as HTML, then slower and redundantly as JS. The best way to solve this is to not serve or hydrate anything at all unless you need to. The “islands” approach is a very good, but coarse, way to solve this: isolate components which are actually interactive, treat the rest as static. A more granular approach—termed resumability by Qwik and as I understand it the forthcoming version of Marko—works by treating the server-generated HTML as the initial state. The code executed from there is much more isolated than a full component.
- LeanderK 4y agoif the code is the same on the server, one could serialise the state and transfer it with the html, right?
- ash 4y agoYou still have transfer the JS.
- alrlroipsp 4y agoITT, it was finally proven that JS is not code.
- inglor 4y agocheck out Qwik (by Misko Hevery the author of Angular) which does (much) smarter hydration than Next (or this Fresh thing)
- stoicjumbotron 4y agoYeah, I too have been meaning to try it out. I guess the "barrier" for me is the ecosystem surrounding it.
- sdevonoes 4y ago> except you can write code like it's not the old days. I imagine you mean that writing (frontend) code now a days is better than how it was in the old days. Well, at least from my perspective that's not the case. "Modern" frontend code requires: - a package manager (npm) - node (or deno or whatever) - transpilers (or is it plugins?) - TS - 10K+ dependencies And to be honest, what is all that good for? To being able to "hydrate" some server-side rendered template? Not good enough reason.
- 5e92cb50239222b 4y agoWe've been able to replace a couple of client applications that previously used WPF with a React frontend (and a small native application that uses WebSockets to create a bridge between the browser and a particular piece of local hardware). Updates are now easy-breezy (update the server and you don't have to touch clients at all). There is a place for SPAs. I just don't think your typical grocery store website should use something like that.
- solardev 4y agoWhat SHOULD grocery store websites use, then? I feel like they're some of the most complex websites around (if they do any ecommerce/online pickups at all)... between product reviews, indexing, filtering, sorting, checkouts, SMS/push notifications, geolocation, real-time inventory, etc. It's not the sort of site that says "easily built in plain HTML" to me.
- madeofpalk 4y agoIf you think it's bad then why do you use it? Browsers still support just HTML. You can shove a just a script tag down in the page. Eventually, you'll have enough devs working on this you'll start to run into issues with how you coordinate your work. Your site becomes large enough the code gets more complicated and needs organising to work on it without slowing you down. You'll start to reinvent the above tools to solve these problems. Frontend/JS tooling isn't perfect, but don't pretend like other languages/systems (can) have a complex pipeline of build tooling.
- chrisweekly 4y agohttps://Remix.run https://Remix.run is the real competition for (/successor to) Next.js. It can target a Deno runtime so I guess it's competition for "Fresh", too.
- dmix 4y agoThat’s one of the best designed sales pitches I’ve seen for a web framework, you could use this approach to sell any idea. Just scrolling list of small blocks of text with small/interactive screencasts/animations that communicate the idea via succinct bullet points. Much more fluid than the usual approach of paragraphs or breaking the page up into large blocks/sections. It’s closer to older HTML where you just have text and a scrollbar.
- solardev 4y agoOpinion only: I found their front page difficult to skim. It took me several scrolls-to-end-and-back to even realize they were trying to explain concepts on that page, not just showing screenshots. Normally I just page-down quickly to get to the features list or comparison table, but doing so here bypasses most of the explanatory animations. I kept wondering, "where's the section that tells you what this does and how it compares to other frameworks". Then I kept looking for a Features page on their top or bottom nav, but didn't find one. Maybe it's just years of bad habits trained by seeing too many bad marketing sites, where the typical signal to noise ratio is really bad. I guess even when I see a good sales pitch, I don't recognize it as such anymore and try to skip through it... sigh. Sorry, Remix.
- dmix 4y agoI viewed it on mobile which I found much nicer than desktop FWIW
- jjdeveloper 4y agoI think Astro is more likely the successor to Next.js and probably not remix. I think Next will steal the best parts of Remix but Astro was built with simpler foundations and has integrations for deno with Netlify edge functions among others and unlike Remix is not tied to React but you can choose your framework.
- WuxiFingerHold 4y agoDepends on your SPA framework: https://hackernews-csr.ryansolid.workers.dev/ https://hackernews-csr.ryansolid.workers.dev/ No need for rehydration, I'd say. Combine this with code splitting for large apps.
- mikojan 4y agoMaybe besides the point but this is falling back behind modern HTML[0] in that it is reintroducing flashes of blank pages. It's not a nice experience. Remix (and, most likely, Fresh as well) prevents this. [0]: https://developer.chrome.com/blog/paint-holding/ https://developer.chrome.com/blog/paint-holding/