Live data from Hacker News

Next.js 12

nextjs.org

91–100 of 293 posts

Re: Next.js 12

#91
post #10

The big innovation here seems to be https://swc.rs/ If it works as advertised this is going to be great for a ton of JS/TS projects. Particularly having a 20x typescript compiler boost when running large test suites would be great. Maintaining 5-8 different babel related projects in packages.json is also annoying and often buggy. Looking forward to see where else this gets adopted and it's stability.

It’s already used in Deno

Re: Next.js 12

#93

The install footprint from npm is 302 packages weighing in at 504mb. It includes a lot of superfluous debris, with packages containing single functions like "is-string" and multiple polyfills for functions like object.assign. That's a very large attack surface considering the poor security practices in the npm ecosystem[0] and the growing frequency of attacks on transitive dependencies[1]. [0]: https://www.bleepingco…

I wonder why they don't replace these simple packages like `is-string` with Lodash, which has all these functions and more. Bundle size isn't a problem: they're ES modules, so you can do something like `lodash/isString` and import only what you need. Seems like that would cut down on a lot of dependencies. I'm curious why the ecosystem hasn't adopted this or a similar approach.

They're probably dependencies of dependencies. You depend on some very useful package and somewhere down the line it depends on something written to be platform agnostic in 2012 when lodash wasn't modular and JavaScript wasn't as mature. The ecoystem hasn't adopted a better approach because it would require every individual package developer to understand the problem, get on board, then update and test everything they've written.

Re: Next.js 12

#94
post #77

The install footprint from npm is 302 packages weighing in at 504mb. It includes a lot of superfluous debris, with packages containing single functions like "is-string" and multiple polyfills for functions like object.assign. That's a very large attack surface considering the poor security practices in the npm ecosystem[0] and the growing frequency of attacks on transitive dependencies[1]. [0]: https://www.bleepingco…

A huge bet we're placing on our Rust compiler is that we'll control the supply chain much more tightly. The core infrastructure of the project will ship as an architecture-optimized binary (for local dev) or WebAssembly (for browser dev). In the process, we're being careful and empathetic about the incremental upgrade paths and ecosystem compatibility, so we're shipping a number of packages that'll completely disappe…

How do you review a WebAssembly binary? Are builds reproducible? I just found this about Rust: https://github.com/rust-lang/rust/labels/A-reproducibility

It would be nice to be able to run them on multiple CIs and compare the SHAs.

Re: Next.js 12

#95

>Compilation using Rust is 17x faster than Babel and enabled by default using Next.js 12, replacing transforming JavaScript and TypeScript files. I've never, ever felt constrained by Babel performance. Even in massive 100k+ LOC codebases. I have , however, been burned over and over again by introducing native binaries into the build process. We specifically moved off of node-sass to using PostCSS for this very reason…

I haven’t used SWC extensively, but with ESBuild (written in Go) this has been a non-issue for me. I’ve experienced the pain of native bindings in other projects though, it largely depends on how resilient the native bindings are to different Node/V8 APIs across versions.

Re: Next.js 12

#96
post #48

If Next.js + Vercel is the leader of the production-ready frontend-as-a-service space, why hasn't a similar leader emerged in the backend-as-a-service space? I would love a clean Vercel-like abstraction on top of standard cloud primitives (functions, queues, events, workflows, etc.) with everything wired up nicely and focused on developer experience. It just seems like AWS is so configuration heavy that it is ripe fo…

Most of the modern frontend hosting services also push for a backend as a service. Whether it be a DBaaS, like Fauna https://www.fauna.com, or Headless CMS, like Cosmic https://www.cosmicjs.com as it gives you the auto-scaling capabilities without the infrastructure time and headache (Disclaimer: I'm CEO at Cosmic)

Re: Next.js 12

#97

The install footprint from npm is 302 packages weighing in at 504mb. It includes a lot of superfluous debris, with packages containing single functions like "is-string" and multiple polyfills for functions like object.assign. That's a very large attack surface considering the poor security practices in the npm ecosystem[0] and the growing frequency of attacks on transitive dependencies[1]. [0]: https://www.bleepingco…

Keeping in mind that these are generally build-time/server-side dependencies, not client-side dependencies, so size-on-disk isn't a very relevant metric

That seems beside OP's point.

They are speaking of the potential bugs and security vulnerabilities all that code might/probably has, given track records.

Re: Next.js 12

#98
post #48

If Next.js + Vercel is the leader of the production-ready frontend-as-a-service space, why hasn't a similar leader emerged in the backend-as-a-service space? I would love a clean Vercel-like abstraction on top of standard cloud primitives (functions, queues, events, workflows, etc.) with everything wired up nicely and focused on developer experience. It just seems like AWS is so configuration heavy that it is ripe fo…

I would suggest render.com and fly.io if you’re looking for something that has a similar deployment experience to Vercel.

Re: Next.js 12

#99

The install footprint from npm is 302 packages weighing in at 504mb. It includes a lot of superfluous debris, with packages containing single functions like "is-string" and multiple polyfills for functions like object.assign. That's a very large attack surface considering the poor security practices in the npm ecosystem[0] and the growing frequency of attacks on transitive dependencies[1]. [0]: https://www.bleepingco…

[deleted]

Re: Next.js 12

#100
post #2

Hey everyone, Lee from Vercel here! Happy to answer any questions about Next.js 12. Personally, I'm extremely excited for the new Rust compiler.

Does Next 12 allow for getStaticProps() in _app.js?

It does not, but with React Server Components, you can achieve the same result.

https://nextjs.org/docs/advanced-features/react-18

Post reply on HN