Live data from Hacker News

Next.js 12

nextjs.org

271–280 of 293 posts

Re: Next.js 12

#271

Earlier quoted context omitted.

At least it isn’t SWF…

Showing my age here, but IIRC, that was the file extension used by Flash files?

Correct. Flash “source” files (used by Macromedia Flash and then Adobe Flash) were binary .fla files that were impossible to manage with source-control. The .swf files (from the original name: Shockwave Flash) were the “compiled” output from Flash’s .fla source files. Flash’s dialect of JavaScript (ActionScript) from .fla files (and later .as files) were compiled to a compact bytecode format, along with compact binary representations of Flash’s own vector art files, animation paths, and optimised JPEG and PNG images (IIRC Flash supported alpha channels in JPEG long before official support was added to JFIF).

SWF is a very clever and optimised format - it’s amazing what they fit into the minuscule Flash runtime of yesteryear when it was only around 300KB in size IIRC. It’s a shame there *still* isn’t an approachable replacement tool for non-experts for making cartoon-style animations and groundbreaking interactive games in HTML+JS yet (e.g. Fault-Line: http://www.nitrome.com/games/faultline/ )

Re: Next.js 12

#272
post #216

Earlier quoted context omitted.

I never said it supports AST transformations directly. I just said they were trivial to do with esbuild. Our build times remain at 0.5s with pretty extensive source transformers in JavaScript plugins in esbuild. This is down from 5-8 minutes using rollup.

I'd need a lot more context to understand what you mean by "trivial" and "extensive", respectfully

It is trivial to write extensions for esbuild. We've written extensive plugins to perform ast transformations that all run, collectively, in under 0.5 seconds.

Make a plugin, add acorn and escodegen. It isn't difficult.

I don't see what is difficult to understand.

Re: Next.js 12

#273
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.

I'm building a custom server (which hopefully now can be replaced with middleware?) which I build with tsc: $ tsc --strict --esModuleInterop --moduleResolution node --jsx react --outdir build server.ts node_modules/next/dist/server/config-shared.d.ts:1:15 - error TS2724: '"next/dist/compiled/webpack/webpack"' has no exported member named 'webpack5'. Did you mean 'webpack'? 1 import type { webpack5 } from 'next/dist/c…

Webpack is no longer a dependency of Next.js - this was the big announcement about the compiler. You will have to opt out of the new SWC compiler (if this is an option atm)

Re: Next.js 12

#274
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…

We are finding that Next.js + Nest.JS to be a really strong combo so far.

Sounds interesting! Do you have any templates, resources, or just tips to share?

Re: Next.js 12

#275
post #82
post #64

Earlier quoted context omitted.

Maybe something like https://encore.dev ? Looks like a similar mindset.

This certainly is akin to what I had in mind, and looks really great. A couple of thoughts: 1) Ideally the framework is polyglot (Go seems sensible though) 2) I wish they had queues/events that were wired up to functions 3) Not sure if using autoscaling k8s services under the hood as opposed to serverless functions is the right choice 4) A bit too opinionated on DB/Auth (maybe I don't want to use Postgres) 5) With al…

Thanks for the feedback! (I'm the founder of Encore)

Your thoughts are very much in line with where we're going. We're working on natively supporting queues, pubsub, object storage, etc. Our roadmap is available at https://encore.dev/roadmap which should give you an idea.

We definitely intend on supporting more storage options. We already do provide end-to-end integration testing out of the box that integrates with Go's built-in testing support.

The authentication should be pretty flexible; was there something you were thinking of that makes it too opinionated or inflexible?

Thanks!

Re: Next.js 12

#276
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 being adopted in ts-node as well: https://github.com/TypeStrong/ts-node/blob/main/website/docs...

Re: Next.js 12

#278
post #160

Earlier quoted context omitted.

How many extent build-systems are there now for JS/TS? It's getting insane.

Realistically? Just Babel, SWC, ESBuild, and TypeScript's own compiler. I'm not really aware of anything else with serious momentum, or isn't simply built upon one of these projects, SWC itself if I recall correctly was built to address speed problems with Babel The other speed bottleneck I've found is postcss, which SWC is also trying to address with their own new CSS parser, which is the CSS parser they extended in…

Rome might join the list, but it's too early to tell

Re: Next.js 12

#279
post #273

Earlier quoted context omitted.

I'm building a custom server (which hopefully now can be replaced with middleware?) which I build with tsc: $ tsc --strict --esModuleInterop --moduleResolution node --jsx react --outdir build server.ts node_modules/next/dist/server/config-shared.d.ts:1:15 - error TS2724: '"next/dist/compiled/webpack/webpack"' has no exported member named 'webpack5'. Did you mean 'webpack'? 1 import type { webpack5 } from 'next/dist/c…

Webpack is no longer a dependency of Next.js - this was the big announcement about the compiler. You will have to opt out of the new SWC compiler (if this is an option atm)

That doesn't seem correct. Next _does_ still use Webpack - it's what does the actual bundling:

> Underlying webpack improvements: We've made numerous improvements to webpack, including optimizing Fast Refresh and making on-demand entries more reliable.

> After making webpack 5 the default in Next.js 11, we've now officially removed webpack 4. We've worked closely with the community to ensure a smooth transition to webpack 5.

SWC is the equivalent of Babel for transpiling JS, not Webpack for bundling.

Re: Next.js 12

#280

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…

That kind of undisciplined rot is unfortunately widely accepted in the Javascript community.
Post reply on HN