Live data from Hacker News

Next.js 10

nextjs.org

61–70 of 206 posts

Re: Next.js 10

#61
post #45

I have mixed emotions on this framework. If you're doing a simple project, Next is the best around. Also great for marketing pages, etc. But if you have a more sophisticated app, with an API, page routes that need to toggle based on cookies, etc, then you have to integrate something like Express. I've done this several times with Next, and it just doesn't pay off. I've also tried to use it at work, but it changes rap…

Next.js has been very good for not introducing breaking changes in my experience (especially for the JavaScript ecosystem). The changes are more along the lines of lots of new and useful things (e.g. image optimisation) as opposed to problematic maintenance issues.

I agree cookies can be a bit awkward with Next but I've always found a way around.

Re: Next.js 10

#62
Am I the only developer that feels that React ... and perhaps the whole web paradigm ... is about the worst way to think about and develop client GUIs?

After using Google's new Flutter framework (which is built to develop cross platform apps: iOS, Android, Web, embedded) I felt like I had my eyes open. The structure seems so much more logical and easy to navigate.

The Web (and React) paradigm of putting some code in HTML, some in CSS, and then some in JS, just seems like a step backwards to me after using Flutter where everything is just code. Designers build in Adobe XD or Figma, and then they hit export, and it dumps out FLutter code that a developer can directly read and incorporate into her project. There isn't a bewildering array of different things all being processed by different other things ... dumping out yet more things. Its just code to binary ... that's it.

And that's another thing ... I like the code to binary direct link. React Native's JS logic + bridge to native always seemed like such an inefficient shim. And seeing the framerate of widgets in Flutter its pretty clear we have been leaving some performance on the table for the convenience of making everything in Javascript.

Having said that, I'm sure Flutter on the web is as bulky as any other JS framework, as there it has to run on JS/HTML/CSS like everyone else.

Re: Next.js 10

#63
post #35

I tried nextjs because I thought it would be a good way to learn React but I found it really confusing. Is it really better to master React first then try nextjs?

I think create-react-app is much more beginner friendly. Fewer concepts to learn. Rolling your own or using script tags to begin with is also an option (see this course for an example: https://egghead.io/courses/the-beginner-s-guide-to-react)

Re: Next.js 10

#64
post #35

I tried nextjs because I thought it would be a good way to learn React but I found it really confusing. Is it really better to master React first then try nextjs?

This is the resource I used (as someone who's been doing web development for ~20 years) to get a a basic understanding of React. It, plus some side projects, was enough to get me up to speed: https://daveceddia.com/pure-react/

I'm sure there are others that are free; but, this is what worked for me.

Re: Next.js 10

#65
post #40

> Nowadays users browse the web using their phones, tablets, and laptops, yet images are still as a one size fits all. For example: sites load a 2000 by 2000 pixel image, but phones are only displaying it as 100 by 100 pixels. That's what srcset & were invented for. > Furthermore, 30% of images on web pages are outside of the initial viewport, meaning the browser loads images that a user does not see until they scrol…

>That's what srcset & were invented for.

I don't know Next.js but I just spot checked a comparison to see if srcset is an exact subtitute.

- If I'm reading CanIUse chart correctly, it says IE11 isn't compatible.[1]

- syntax of srcset requires manual and verbose specification of different source images. E.g. from MDN[2]:

  
- Next.js example[3] is simpler and shorter:

  import Image from 'next/image'
  
The Next.js post also says that tag also provides the following dynamic feature: When using the next/image component, images are automatically lazy-loaded, meaning they're only rendered when the user is close to seeing the image. This prevents loading that 30% of images outside of the initial viewport.

Like I said, I'm not an expert. The Next.js Image function doesn't look like useless redundancy with plain HTML5.

[1] https://caniuse.com/?search=srcset

[2] https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimed...

[3] https://nextjs.org/blog/next-10#nextjs-image-component

Re: Next.js 10

#66
post #33

As someone who only really built websites using jQuery / custom vanilla js and good ole CSS2, this stuff feels completely alien to me

Same. I mean I understand how it works but I ask myself what's the point every time. I've looked into react and I hate how it works and I hate how every 2 months people are begging for some new optimization because its slow and sucks. Then version 5000 is released and fixes that slowdown, but every react site I've ever used is still buggy and slow as hell.

> but every react site I've ever used is still buggy and slow as hell

This is just as asinine as saying "every Ruby on Rails site I've ever used is still buggy and slow as hell".

No, every terribly coded site youve used is slow as hell.

Re: Next.js 10

#67

I can't believe NextJS still doesn't have named routes, resorting to hacks like next-routes or next-named-routes to have a semblance of sanity managing links throughout larger apps. Also, doing things like /@[username] is still a huge hack, unsupported.

[deleted]

Re: Next.js 10

#68
post #18

Earlier quoted context omitted.

And... Sapper is dead btw. Rich said it recently in a video. The Svelte team is working on the next big thing combining Svelte with Snowpack. The project is called SvelteKit. https://www.youtube.com/watch?v=qSfdtmcZ4d0

I think retiring Sapper was the right decision. I have a feeling Rollup will meet a similar end too. They both seemed like fine pieces of software. They just don't seem offer separate much their counterparts nowadays that warrants continued feature development.

Rollup isn't going anywhere! When you poke behind the scenes of newer build tools, like Snowpack and Vite and the custom compiler that powers Remix Run, you'll find Rollup doing a lot of the heavy lifting. And it's the preferred choice of most libraries. There's a reason for that :)

Re: Next.js 10

#69

I can't believe NextJS still doesn't have named routes, resorting to hacks like next-routes or next-named-routes to have a semblance of sanity managing links throughout larger apps. Also, doing things like /@[username] is still a huge hack, unsupported.

It looks like both of those packages are used for creating dynamic routes with named parameters. Nextjs supports this already. Is that what you meant by "named routes", or is that something different? https://nextjs.org/docs/routing/dynamic-routes

Re: Next.js 10

#70
post #65
post #40

> Nowadays users browse the web using their phones, tablets, and laptops, yet images are still as a one size fits all. For example: sites load a 2000 by 2000 pixel image, but phones are only displaying it as 100 by 100 pixels. That's what srcset & were invented for. > Furthermore, 30% of images on web pages are outside of the initial viewport, meaning the browser loads images that a user does not see until they scrol…

>That's what srcset & were invented for. I don't know Next.js but I just spot checked a comparison to see if srcset is an exact subtitute. - If I'm reading CanIUse chart correctly, it says IE11 isn't compatible.[1] - syntax of srcset requires manual and verbose specification of different source images. E.g. from MDN[2]: - Next.js example[3] is simpler and shorter: import Image from 'next/image' The Next.js post also…

Yeah, I mean, screw IE11 users. An unsupported srcset just means that they will not benefit from this enhancement but they will just download a standard size. This is perfectly fine.

As for the syntax, yes, it’s better to always have some generator to create it. WordPress has been doing it for years with a plain `the_image($id)` call.

Post reply on HN