Skip to content
Closed
Prev Previous commit
document builtin default export
  • Loading branch information
devsnek committed Nov 4, 2017
commit c4a6c27a604961d0431eb02d76356fb414365a57
3 changes: 2 additions & 1 deletion doc/api/esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ as named exports.
In both cases, this should be thought of like a "snapshot" of the exports at
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a snapshot of the values, or just a snapshot of the names?

The latter is necessary, but the former may not be.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought just saying exports was ok since its both the names and the values

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right - I’m saying that there’s no need for the values to be snapshotted; just the names.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically it isn't a snapshot, it's just a useful term to describe how it becomes static when assigned in reflection with es imports.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s pretty important to be precise here :-) i think “a snapshot of the names of the exports”, and indicating that if the values are updated, the resulting imports will update as well (a requirement for APM-like use cases, i understand)

the time of importing; asynchronously modifying `module.exports` will not
affect the values of the exports. Builtin libraries are provided with named
exports as if they were using `@@esModuleInterop`.
exports as if they were using `@@esModuleInterop`, as well as the
`module.exports` of the builtin provided as the `default` export.


```js
Expand Down