266 karma · joined September 12, 2019
The visualization here is amazing in its own right as well, can I ask what part of the codebase renders it and handled the force-directed part?
I’m sure it’s hallucinated a few times, but I’m at such an early level that it’s typically fine. I learn either way in a way that’s set me way ahead of where I’d have been without it
I can at least tell that Next.js is winning on growth. More new startups are building with it according to the job boards I’m seeing, esp. compared to Remix and even the other contenders (Vue, Svelte)—-at least in the States.
Kent’s point about Vercel platform lock-in is pretty eye-opening, though. Not able to easily deploy Next.js outside of Vercel? And, it’s a platform ran by a startup? It’s also not profitable?
Um…
Not the worst if you value other things!
This is because of a much deeper issue: static analysis is highly complex with the near-free-for-all that is CommonJS require & module.exports syntax. ES Modules is stricter and much easier to statically deal with.
At a high level, why? You can throw just about anything in an exports.module statement, and the syntax to "require" it also has a lot of leeway. You can actually see the code for this in the Node codebase--module resolution is handled in javascript @ /lib/internal/modules/cjs/loader.js vs /lib/internal/modules/esm (heads up, both approaches are a Lot to grok)
Understand that with the CJS approach, you can dynamically export modules at runtime under whatever name you wish, with whatever value you want, which may even include dynamic require statements themselves. Nightmare for static analysis.
It makes a lot more sense if you try it for yourself. Build a module resolution algorithm including: determining all the imports, all the files those imports are from, mixing with 3rd party and local imports, and building that chain recursively.
You can do it, but the edge cases surrounding CommonJS make it super difficult. I'd go so far as to say it's basically impossible to get 100% success in all the desired scenarios without directly invoking the code.
I can buy cheap courses off Udemy, I can read books on my own time (not tons of it these days), or I can pay someone super effing knowledgable to teach me. This guy's super knowledgeable, I stand by my downvoted post
Thanks for the gut check.
What on earth.