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
This would be incredibly helpful for supporting intellisense for JavaScript projects in VS Code; export * as foo from './foo'; seems pretty widely used
Reacted by Jonathan Stanton, Slava Lubenets, v1rtl, ExE Boss and nexsodev
At first I thought this (the ECMAScript proposal) was a bad idea because the preponderance of existing export forms is a source of confusion for newcomers. However, I've come around to the idea that the asymmetry between the import and export forms is actually a source of confusion in itself so adding this would be beneficial.
Is there any chance of this being added sometime soon? I've been using this feature in my codebase with the stage-1 babel preset, and was hoping to start using typescript to get gradually get some static typechecking, but typescript throws a bunch of errors every time it comes across export x from './y';
Namespaces are not really the way to go any more, babel doesn't support them, they probably aren't tree-shakeable etc. But I was hoping that the export * as ns syntax could be used as a replacement, like this:
exporttypeFoobar=import('./Foobar').Foobar// Or:// export type { Foobar } from './Foobar'export*asFoobarfrom'./Foobar'
This seems to pass the nightly compiler, but the compiler only knows that Foobar is re-exported as a type, not a value. It would be great if the compiler could merge them into a combined value & type like with namespaces.
Activity
[-]Support porposed ES7 `export form` forms[/-][+]Support proposed ES7 `export form` forms[/+][-]Support proposed ES7 `export form` forms[/-][+]Support proposed ES7 `export from` forms[/+]vilicvane commentedon Sep 16, 2015
👍
[-]Support proposed ES7 `export from` forms[/-][+]Support proposed ES.Next `export from` forms[/+][-]Support proposed ES.Next `export from` forms[/-][+]Support proposed ES `export from` forms[/+]nevir commentedon Jul 25, 2016
This would be incredibly helpful for supporting intellisense for JavaScript projects in VS Code;
export * as foo from './foo';seems pretty widely usedaluanhaddad commentedon Nov 21, 2016
At first I thought this (the ECMAScript proposal) was a bad idea because the preponderance of existing export forms is a source of confusion for newcomers. However, I've come around to the idea that the asymmetry between the import and export forms is actually a source of confusion in itself so adding this would be beneficial.
jetpacmonkey commentedon May 1, 2017
Is there any chance of this being added sometime soon? I've been using this feature in my codebase with the
stage-1babel preset, and was hoping to start using typescript to get gradually get some static typechecking, but typescript throws a bunch of errors every time it comes acrossexport x from './y';mikew commentedon May 10, 2017
Our team's projects usually has a
commonfile for developers to import common things from, without having to worry about where they come from:Without
export from, thiscommonfile will double in size and have needless duplication and some lines that can be confusing to newcomers.mikew commentedon May 10, 2017
Even more strange that
export { connect } from 'react-redux'works.23 remaining items
[-]Support proposed ES `export from` forms[/-][+]Support proposed ES `export * as ns from` form[/+]DanielRosenwasser commentedon Oct 28, 2019
Changed the title since there is currently no export default version of this.
Jessidhia commentedon Oct 29, 2019
It's still mis-titled because it's no longer "proposed"; it is already in the spec 😉
[-]Support proposed ES `export * as ns from` form[/-][+]Support ES `export * as ns from` form[/+]ExE-Boss commentedon Nov 8, 2019
I’ve now opened #35010 for the
export default fromform.DanielRosenwasser commentedon Dec 21, 2019
Thanks Wenlu Wang (@Kingwl)!
katis commentedon Jan 22, 2020
Previously I liked using TS namespaces and declaration merging for creating FP-style modules, without needing the
MyModule.Tconvention:Namespaces are not really the way to go any more, babel doesn't support them, they probably aren't tree-shakeable etc. But I was hoping that the
export * as nssyntax could be used as a replacement, like this:This seems to pass the nightly compiler, but the compiler only knows that Foobar is re-exported as a type, not a value. It would be great if the compiler could merge them into a combined value & type like with namespaces.
rbuckton commentedon Feb 13, 2020
Joni Katajamäki (@katis): I filed #36792 with the content of your comment above.
I'm closing this issue as it was fixed in #34903.