You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Name overload term/type module re-export as namespaceΒ #51109
Activity
MartinJohns commentedon Oct 8, 2022
I believe this to be a duplicate of #48764 (comment).
jasonkuhrt commentedon Oct 8, 2022
Thanks Martin Johns (@MartinJohns). That issue was about the
typeimport while mine is a suggestion that it should work like namespaces.That issue was/is closed with the counter-example of importing a class.
What I'm saying here wouldn't be closed because of that counter example.
I'm merely saying it works with
namespaceand ought to work with native ESM modules now that we have them.cruhl commentedon Oct 25, 2022
I have been trying to get something like this working for literal years now.
It would dramatically help write better functional/Rust-module-style code.
cruhl commentedon Oct 25, 2022
Jason Kuhrt (@jasonkuhrt) check out this related issue/discussion:
#39865
cruhl commentedon Oct 25, 2022
Another relevant discussion...
#48764 (comment)
cruhl commentedon Oct 25, 2022
Good overview of the resulting friction this would alleviate here:
#48764 (comment)
cruhl commentedon Oct 25, 2022
Here's a good example of the awkwardness this causes for users of Giulio Canti (@gcanti)'s fp-ts...
gcanti/fp-ts#1633
cruhl commentedon Oct 25, 2022
Here is my dream syntax...
import * as User, type { User } from "./User";cruhl commentedon Oct 25, 2022
gcanti/fp-ts#1415

cruhl commentedon Oct 25, 2022
This problem won't be going away anytime soon, so I would expect it to continually pop up so long as issues keep getting closed...
cruhl commentedon Oct 25, 2022
Oddly, this halfway works, but fails to see
export * as Point from "./Point";correctly...'Point' only refers to a type, but is being used as a value here.ts(2693)cruhl commentedon Oct 25, 2022
So this actually works...



cruhl commentedon Oct 27, 2022
So this actually works...