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 }}
This repository was archived by the owner on Sep 2, 2023. It is now read-only.
First of all sorry if this was discussed before - I haven't been an active modules team member for a while :]
How does everyone feel about warning on thenables being imported?
I raised this up after discussing this case with Kyle Simpson last year in the promise use cases session in the summit and then completely forgot about it. Basically something like:
// myModule.mjsconstthenable={then(onFulfilled,onRejected){// do something}}exportdefaultthenable;
Then on the other side if someone does import('./myModule.mjs') they will get (arguably) surprising results. It's probably not a common problem but a very annoying one when you do get it probably.
We can:
Ignore this, as this is technically working as intended.
Warn when this happens by default. (I've tried looking for places this is done intentionally and haven't found any).
Expose a Symbol that allows opting out of this behaviour and importing the module as an object.
Hey,
First of all sorry if this was discussed before - I haven't been an active modules team member for a while :]
How does everyone feel about warning on
thenables beingimported?I raised this up after discussing this case with Kyle Simpson last year in the promise use cases session in the summit and then completely forgot about it. Basically something like:
Then on the other side if someone does
import('./myModule.mjs')they will get (arguably) surprising results. It's probably not a common problem but a very annoying one when you do get it probably.We can:
Symbolthat allows opting out of this behaviour and importing the module as an object.imports athenable.