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

How to export a module variable in CoffeeScript #328

Merged
merged 2 commits into from Apr 1, 2016

Conversation

Projects
None yet
5 participants
@fknipp
Contributor

fknipp commented Apr 1, 2016

Maybe there might be better places in the guide to put this information, but it should be written somewhere.

@stubailo

This comment has been minimized.

Contributor

stubailo commented Apr 1, 2016

@fknipp can you add an entry to the changelog? https://github.com/meteor/guide#changelog

@fknipp

This comment has been minimized.

Contributor

fknipp commented Apr 1, 2016

You're welcome :)

@stubailo

This comment has been minimized.

Contributor

stubailo commented Apr 1, 2016

Thanks!

@stubailo stubailo merged commit 6d1f09c into meteor:master Apr 1, 2016

2 checks passed

CLA Author has signed the Meteor CLA.
Details
ci/circleci Your tests passed on CircleCI!
Details

@fknipp fknipp deleted the fknipp:patch-3 branch Apr 1, 2016

@GeoffreyBooth

This comment has been minimized.

GeoffreyBooth commented Apr 4, 2017

I just stumbled across this. This section is just wrong. The syntax is not different in CoffeeScript; CoffeeScript supports the import and export keywords, nearly identically to ES2015. What this PR is referring to is CommonJS module.exports, though it’s confusing CommonJS’ global exports object with the export keyword in CoffeeScript/ES2015.

This was written up here: https://docs.meteor.com/packages/modules.html#CoffeeScript. Clearly that’s hard to find, so perhaps we can replace this section with a link to that one?

@abernix

This comment has been minimized.

Member

abernix commented Apr 4, 2017

@GeoffreyBooth That sounds fine to me. Can you do a PR or shall I?

lorensr added a commit that referenced this pull request Apr 5, 2017

@lorensr

This comment has been minimized.

Collaborator

lorensr commented Apr 5, 2017

Thanks Geoffrey, fixed in abedc3b

@GeoffreyBooth

This comment has been minimized.

GeoffreyBooth commented Apr 5, 2017

@lorensr Thanks for tackling this, I haven’t had time just yet. In that commit it looks like the exports.Lists = ListsCollection 'lists' example is still there, after the link you added. I would think that this should become export Lists = new ListsCollection 'lists' or similar, i.e. using the export keyword (and ES2015 modules) rather than exports (and CommonJS). Even for CoffeeScript I think we should be encouraging the import and export keywords, and ES2015 modules, over CommonJS. Backticks aren’t required anymore.

@lorensr

This comment has been minimized.

Collaborator

lorensr commented Apr 5, 2017

Oops thanks, fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment