News for hackers. Stuff that matters.
Re:JDK 9 modules voted down by EC by nailer on Tuesday May 09, 2017 @01:07PM (#14301830)
I have little idea about cars (Java), but in carpet land (JS): we had the largest module ecosystem ever and it was pretty much ignored by TC39 in favor of a new solution, which has technical benefits (it's async), but there's no migration path from the current standard to the new anointed 'standard'. Sometimes technical committees just refuse to pave cowpaths. Look at the amount of lines it takes to do an XHR in the 'fetch' API vs superagent in, say, 2012.
Re:JDK 9 modules voted down by EC by wyuenho on Tuesday May 09, 2017 @01:13PM (#14301900)
I'm very interested in what "largest module ecosystem" you were referring to and what you mean by "the amount of lines it takes to do an XHR in the 'fetch' API vs superagent in, say, 2012."

AFAIK, there was a time when the "module ecosystems" were essentially split between requirejs (AMD) on the front and CJS in the back.

Fetch is also not XHR, and has different security defaults and trade-offs.

Re:JDK 9 modules voted down by EC by nailer on Tuesday May 09, 2017 @05:11PM (#14303843)
CommonJS (via npm) is used on more front-end code than TC39 modules are to this day.

I should say 'HTTP request' rather than XHR but the point still stands: having different objectives doesn't make it OK to ignore mime types, have people manually encode JSON, have people manually encode query strings, and all the other things we already have now in fetch. Which nobody will use (unless they want to cancel requests) because we already have better solutions with less needless boilerplate.

Re:JDK 9 modules voted down by EC by wyuenho on Wednesday May 10, 2017 @08:49PM (#14313085)
TC39 had been talking about JS modules for about decade, before CJS even existed. CJS is unsuitable on the frond end because it's synchronous and does not enable static analysis. CJS being more popular on the front end is a very recent phenomenon, it really started to take off when React took off. AngularJS had its own module system and everything jQuery were essentially AMD first.

I also don't know what you are talking what we already have in fetch. It you are arguing WHATWG should have just adopted superagent, I disagree. The major difference between fetch and XHR is the ability to stream content. Fetch only needs to be better than XHR. Superagent uses XHR internally, and it's extremely difficult to have XHR support streaming without turning its API to an even bigger mess. Encoding JSON yourself is a one-liner in JS. Encoding query string is also easy, there's a whole new URL object to help you now. If not, it's just a tiny function away. It's not hard to wrap fetch at all.

Re:JDK 9 modules voted down by EC by nailer on Thursday May 11, 2017 @09:09AM (#14315698)
> TC39 had been talking about JS modules for about decade, before CJS even existed.

Yep, which explains the ignorance. None of the other modules systems are a hundred thousandth the size of npm, so don't matter.

> I also don't know what you are talking what we already have in fetch.

Literally POST some JSON to a resource with a query and compare the code using superagent to the fetch API.

> Encoding JSON yourself is a one-liner in JS. Encoding query string is also easy.

That is irrelevant. Defaults should be sane.

Re:JDK 9 modules voted down by EC by pcwalton on Tuesday May 09, 2017 @01:31PM (#14302111)
The Node module system was not "ignored". The folks I know on TC39 talked about it constantly. "export default" was added specifically for compatibility with Node.

They just didn't adopt it wholesale.

Re:JDK 9 modules voted down by EC by chickenfries on Tuesday May 09, 2017 @01:12PM (#14301891)
What do you mean by cars and carpet?
Re:JDK 9 modules voted down by EC by bdcravens on Tuesday May 09, 2017 @01:25PM (#14302034)
Also drawing distinction between Java and JavaScript naming, as they really aren't related aside from those first few letters.
Re:JDK 9 modules voted down by EC by akoumis on Tuesday May 09, 2017 @01:20PM (#14301976)
The poster is emphasizing that their knowledge stems from a completely different industry but similar circumstances might provide useful insights into the issue.