I didn’t follow all of this thread, so apologies if the following is off. But one thing that I often wish we had is a syntax that allows me to import a package and assign a different local name to it in one go. So essentially a shortcut for import Foo; const bar = Foo
.
Typescript has something similar (import * as bar from "Foo"
) and Python of course has the alias syntax (import Foo as bar
). I find both of these extremely useful.
I think it would allow us to a) keep the long and descriptive package names we seem to tend towards (I like that!) and b) generally use using
less, but still have relatively concise code.
And yes, obviously one can use the syntax I showed above, but I think it would be nice if there was official syntax for this.