Live data from Hacker News

CommonJS is hurting JavaScript

deno.com

131–134 of 134 posts

Re: CommonJS is hurting JavaScript

#131
post #123

Earlier quoted context omitted.

Many authors don't care if 5 dudes use their stuff, or the rest of the world, specially when taking zero monetary value out of it.

I'm one of them, as I'm a prolific open source contributor and maintainer. To argue that some high-profile authors don't get any monetary value from their public work is to be simply naive and uninformed. The two I mentioned have made careers on that work and derive the majority of their income from it.

OK so anyone disagreeing via their clicks on the down button, please provide a rebuttal. Have yet to see one.

Re: CommonJS is hurting JavaScript

#132

I’ve managed several open source projects through their transition from CommonJS to ES modules and the least interesting part was the server-side of the equation. More often, the most exciting, and most excruciating aspect is wrangling TypeScript to emit browser friendly module paths. Anything short of relative paths everywhere won’t cut it, and TypeScript really doesn’t like to emit file extensions when TSX is invol…

Im about to make the transition for alasql. Any chance you can share a link to a repo you feel did this well?

Re: CommonJS is hurting JavaScript

#134
Trying to reuse same code as it is written on both server and client is a bad idea.

As a language, JavaScript may support loading from file system or web. But, one of its use cases must not be code reuse on both client and server.

If I am to write a project in this way, how would it look like?

Assume, I write some server code in a server project that I want to use in client as well. How would I access that code from client? I need to make it accessible over internet. But, that is in a project that has other code as well, some of I do not want to be accessed over internet. What do I do? I will write rules in my web server to only allow access to specific files. Here and beyond, this process becomes complex and will get only worse.

Post reply on HN