Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Move away from default export aka unnamed module.exports #5437

Open
frank-dspeed opened this issue Nov 27, 2019 · 0 comments
Open

Comments

@frank-dspeed
Copy link
Contributor

I Would love to see that CanJS (every single module) does named exports in addition to the default unnamed export for a better migration path forward es2020

Why

  • Module is a namespace. Default export often leads to function/component per file dogma and makes code less maintainable.
  • Interop with commonjs is broken in many cases. Ways to fight them are known.
  • Show me any good language with default exports. It's historical javascriptism.
const myStuff = "I am a string that represents a function or something"
module.exports = myStuff
const myStuff = "I am a string that represents a function or something"
exports.myStuff = myStuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant