The diff is being forced to "do it right by default", rather then being forced to think about + needing lint rules to check you did right
-
-
Replying to @mweststrate @robpalmer2 and
I don't think you're counting all the costs correctly. In a non-default world, the module has to come up with a name.
2 replies 0 retweets 0 likes -
Replying to @wycats @mweststrate and
I also don't think this hazard is what you're implying. I've written huge JS module codebases for years and the first thing I do...
1 reply 0 retweets 0 likes -
Replying to @wycats @mweststrate and
...when I want to know what a name is is to ask vscode to jump to the import. Named or default doesn't make that much difference ...
2 replies 0 retweets 1 like -
Replying to @wycats @robpalmer2 and
No I didn't want to imply the difference is huge ;-). Just don't see any value in consumer provided names, except when there are collisions
1 reply 0 retweets 0 likes -
Replying to @mweststrate @robpalmer2 and
I think consumers should probably use the same name as the module as a general rule, but don't think it's that important that they're unique
1 reply 0 retweets 1 like -
Replying to @wycats @mweststrate and
Module names should be globally unique, names inside of them are always 100% resolvable locally so I don't see the big deal.
1 reply 0 retweets 1 like -
Replying to @wycats @mweststrate and
I think you're undercounting programming styles where nearly all modules have a default export and nothing else.
2 replies 0 retweets 1 like -
Replying to @wycats @robpalmer2 and
That might be true. I'm on huge TS stuff, where most modules also expose at least some interfaces around the main export
2 replies 0 retweets 0 likes -
Replying to @mweststrate @robpalmer2 and
I've written nearly 100% TS modules for at least 2 years. I think when there is one JS export + interfaces default export is more valuable
1 reply 0 retweets 1 like
I usually use default export as a way to indicate that the file you're importing from is really about one JS value indicated by its name.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.