News for hackers. Stuff that matters.
Re:Node v8.5.0 by coldtea on Wednesday September 13, 2017 @08:01AM (#15237421)
>I don't like the `.mjs` extension, but I understand the need for it, and I'm just glad that modules are finally here.

I read that a lot. Why do people don't like the new extensions?

Seems like the most elegant and programmatically more performant and less hassle free, solution to the issue.

Everything else looks like a terrible kludge.

Re:Node v8.5.0 by batmansmk on Wednesday September 13, 2017 @11:04AM (#15238916)
"Import" was already decided to help the parser performing static analysis versus "require". Now "mjs" is introduced to make detecting if we are in front of a commonjs or module "faster". I'm sure the people who decided this are very bright, but the main goal was how to be nice with v8, and not how to be easy for developers.

Changing from js to ts is an inconvenience sufficiently big enough to adopt flowtype instead.

Re:Node v8.5.0 by _pmf_ on Wednesday September 13, 2017 @08:16AM (#15237517)
> I read that a lot. Why do people don't like the new extensions?

Probably because you'll end up with .mts, .mjsx, .mts, .mtsx.

Re:Node v8.5.0 by coldtea on Wednesday September 13, 2017 @08:21AM (#15237556)
So? If they are different types, it makes sense to have different extensions (e.g. if mts implies typescript module).
Re:Node v8.5.0 by josteink on Wednesday September 13, 2017 @09:27AM (#15238007)
> mts implies typescript module

Or mpeg transport stream:

https://en.m.wikipedia.org/wiki/MPEG_transport_stream

Re:Node v8.5.0 by coldtea on Wednesday September 13, 2017 @02:09PM (#15240939)
Well, they can coordinate that like we coordinate mime types.

I've chanced upon the "same extension for the same thing" as a problem maybe 2-3 times in 30+ years.

Re:Node v8.5.0 by kdkdkdk333ke on Wednesday September 13, 2017 @09:43AM (#15238130)
They usually use .ts extension, or .tsv, .tsa according to the wiki article you just linked.

.mts is unheard of.

Re:Node v8.5.0 by josteink on Wednesday September 13, 2017 @10:00AM (#15238294)
Ive seen it in the wild. May not be that common though.
Re:Node v8.5.0 by CptMauli on Wednesday September 13, 2017 @10:07AM (#15238363)
my camera (Lumix GH2) produces MTS files
Re:Node v8.5.0 by bradstewart on Wednesday September 13, 2017 @10:30AM (#15238606)
I like that better than having to open a file and read its source to figure out what type of module it exports...