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

make all exports explicit by making them named exports #551

Closed
1 of 5 tasks
thescientist13 opened this issue Apr 11, 2021 · 1 comment · Fixed by #707 or #815
Closed
1 of 5 tasks

make all exports explicit by making them named exports #551

thescientist13 opened this issue Apr 11, 2021 · 1 comment · Fixed by #707 or #815
Assignees
Labels
alpha.0 CLI documentation Greenwood specific docs enhancement Improve something existing (e.g. no docs, new APIs, etc) Plugins Greenwood Plugins v0.20.0
Milestone

Comments

@thescientist13
Copy link
Member

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

In the context of named vs un-named or default exports, I think we should standardize on a consistent method, which I woudldfavor as named exports.

Some examples, at least in CommonJS where it is most prevalent right now

Unnamed

const name = 'owen';

module.exports = name;

// usage
const anything = require('./name');

Named

const name = 'owen';

module.exports = {
  name
} 

// usage
const { name } = require('./name');

Details

The main case for named being is that everything is consistent everywhere. With un-named, how a user imports a plugin could vary from project to project since the name is left up to the user to decided. For find / replace and refactoring, this could be a real pain, say as part of an upgrade or migration.

Plus it will keep documentation consistent as well.

@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) documentation Greenwood specific docs Plugins Greenwood Plugins CLI labels Apr 11, 2021
@thescientist13 thescientist13 added this to the 1.0 milestone Apr 11, 2021
@thescientist13 thescientist13 linked a pull request Aug 31, 2021 that will close this issue
17 tasks
@thescientist13 thescientist13 linked a pull request Dec 4, 2021 that will close this issue
20 tasks
@thescientist13 thescientist13 self-assigned this Dec 8, 2021
@thescientist13 thescientist13 moved this from TODO to IN REVIEW in 7 - SSR and External Data Sources Dec 8, 2021
@thescientist13
Copy link
Member Author

this was handled as part of #707 , so will be available in the next minor release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha.0 CLI documentation Greenwood specific docs enhancement Improve something existing (e.g. no docs, new APIs, etc) Plugins Greenwood Plugins v0.20.0
Projects
No open projects
1 participant