Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
snek
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
32 ms
·
301.
▲
by
snek
8y ago
I feel like tools like this, which are intended to be used by developers for their own personal use, will have trouble succeeding if they aren't oss. It would be nice if the documentation was available without having to download this,
302.
▲
by
snek
8y ago
The first half of this article made me think it was going to talk about how clever algorithms can change a 1 year problem into a 1ms problem, think outside the box, etc. Instead it took a nosedive into complaining about electron, which defi
303.
▲
by
snek
8y ago
then they can continue using them, and not use the real esm semantics? i don't think anything would change for them.
304.
▲
by
snek
8y ago
Even in the same project, you might have multiple people working. The specifics end up not mattering, because the goal here is to always be unambiguous by default. If you want to have your own setup in your project, you can use a loader res
305.
▲
by
snek
8y ago
Node disagrees. You can `require('./a')` without knowing if its `a.json` or `a.js` or `a.node`. All you need to know about `./a` is the interface it exposes.
306.
▲
by
snek
8y ago
>In other words, if you `import` a file with that line, it should crash. If you `require` the file, it will do nothing This is the situation we don't want to be in, where the consumer is choosing. The consumer doesn't know. Eve
307.
▲
by
snek
8y ago
>Why does import have to work with cjs? It doesn't in the browser. Why does require have to work esm? `import` doesn't have to work with cjs, but we want to do so because there is so much code in the ecosystem that is cjs. `r
308.
▲
by
snek
8y ago
I don't think its as much a matter of people caring or not as it is that node is implementing ecma262 esm, not babel esm or typescript esm, etc.
309.
▲
by
snek
8y ago
> why does Node need file extensions when Other languages don't? Node allows you to require things that aren't commonjs javascript. (json, native extensions, etc). > when Ryan dahl announced Deno, he mentioned [removing exte
310.
▲
by
snek
8y ago
> current discussions seem to suggest "Yes, this will go away" for "./services" being resolved to anything but an absolute location ending in "/services" to be clear, this is still heavily in conte
311.
▲
by
snek
8y ago
No you did not.
312.
▲
by
snek
8y ago
>I would argue those are mostly shims for a pre-moudule era and they should just be `required()` Modules are always strict, so loading something intended to be a module as commonjs could break the code within, which expects strict mode.
313.
▲
by
snek
8y ago
Except no? Only servers where stuff making requests expects the server to behave that way. The interesting thing about this is that every server in the world already works like this: they expect the person calling the server to know how the
314.
▲
by
snek
8y ago
This is a pretty good breakdown but to the author: i would like to see a better explanation of defaults. Node will ship with the defaults needed to perform tasks logically and unambiguously. This however doesn't mean that a user's
315.
▲
by
snek
8y ago
Browsers don't care what extension you serve something as, so it doesn't break the interop we want with browsers if you put your files as `.mjs`.
316.
▲
by
snek
8y ago
The issue is that transpilers didn't implement correct ESM (both ts and babel have opt in flags to enable more-correct-mode, but its still not 100%). they implemented the syntax but forgot about the actual semantics like dependency gra
317.
▲
by
snek
8y ago
It isn't required when importing something, its required for the filename. You can continue to do `import './thing'` where you have `thing.mjs`.
318.
▲
by
snek
8y ago
>There are already tons of browser libraries not using the .mjs extension. Browsers don't care what extension you serve something as, so we can't really directly match that in the default behaviour. What you can do is use a r
319.
▲
by
snek
8y ago
If you feel you can come up with a better solution for module syntax ambiguity please feel free. Over the last three years we (including hundreds of devs like you who come in guns blazing calling us all idiots) haven't been able to co
320.
▲
by
snek
8y ago
holy shit my life is a lie
321.
▲
by
snek
8y ago
Did it annoy anyone else that they say they say "10 years" instead of "a decade" and "half decade" instead of "5 years"
322.
▲
by
snek
8y ago
Apologies, i'm unable to find the article i read before, but googling "nicotine salts" should get you on the right path.
323.
▲
by
snek
8y ago
This does not surprise me at all.
324.
▲
by
snek
8y ago
I assume the societal goal is to help young people, whose brains aren't yet able to make sound decisions ( https://www.aacap.org/aacap/families_and_youth/facts_for_fam... ) and keep them from doing things which
325.
▲
by
snek
8y ago
That doesn't mean we're finished. Pretending this problem is solved will just result in it getting out of hand again.
326.
▲
by
snek
8y ago
I read an article the other day about how juul modifies the nicotine to make it less painful so they can put more in each pod. An interesting side effect of this is that people who don't smoke can start smoking easier because it's
327.
▲
by
snek
8y ago
I'm not saying it doesn't make sense, just that it ignores existing terminology of the language, which just leads to confusion down the road.
328.
▲
by
snek
8y ago
This article seems to be making up its own terminology and patterns. In JS, a getter is a function bound to a property that is called when that property is accessed. (mdn.io/getter) and a setter is a function bound to a property that i
329.
▲
by
snek
8y ago
If you don't want the solution to exist, why do you care what it ends up being? You won't use it. You have no horse in the race.
330.
▲
by
snek
8y ago
Any company on this list[1] can send a delegate to a TC39 meeting, and at most meetings there are generally around 45ish people, from lots and lots of different companies and perspectives. A particularly important member to point out is the
More ›