-
Notifications
You must be signed in to change notification settings - Fork 14
Is any default
export binding included in the exported namespace object?
#2
Comments
@guybedford has been pushing for considering |
This is a natural asymmetry that will continue to be confusing especially when these proposals land. I still think excluding |
I really can't overstate how bad this is. It inhibits the creation of eg automatic |
Just to clarify, this was something that was added into ES6 without a unified consensus behind the reasoning. In previous (unfortunately private) email discussions Allen has even mentioned that this would be something that could be changed, but that his concern to this use case is based on the principles discussed at https://www.mail-archive.com/[email protected]/msg03762.html, and he thinks it is a refactoring hazard, although I do not agree with this argument. |
@guybedford if you make a formal proposal, I can help to push this forward! |
Thanks @caridy I will get to this. |
I definitely think Also does anyone else find the I guess this proposal would do the same thing in that case e.g. // example.js
export * as someMod from "./ambiguousMod.js"
// other.js
import { someMod } from "./example.js"
someMod.ambigiousName // undefined Personally I'd much rather see ambiguous entries create a module namespace with a getter for the ambiguous names that simply throws an error on trying to use it, but I suspect that's probably not going to happen. |
Since this is creating a namespace object we'll follow this existing mechanism to do so. |
Reference: http://www.ecma-international.org/ecma-262/6.0/#sec-getexportednames
export * from '...'
does not re-export thedefault
binding from the referenced module.It's unclear to me whether this proposal would export only the bindings that
GetExportedNames
returns, which is to say, everything but thedefault
export.So: is any
default
export included in the exported namespace exotic object?(thanks! 😄 also ref: import-js/eslint-plugin-import#328)
The text was updated successfully, but these errors were encountered: