-
Notifications
You must be signed in to change notification settings - Fork 307
Atmosphere packages exports and npm deps #401
Comments
If you want your package to support < 1.3 you need to use
I'm honestly not sure. It's not clear yet what the consensus is going to be in the wider JavaScript world as ES2015 support is pretty new everywhere. We've gone with named exports as it's what you get by accident if you write the old
It doesn't, you're right. We should change this.
Yes, although I can see how it would make sense to put it at a lower level (e.g. using it for peer deps in test mode). |
Thanks, worth noting in guide? |
I guess, I'm not quite sure how--there's not any guide-style documentation anywhere about how to do this (it would be great to link to the 1.2 guide but it didn't have a writing packages section), and I wouldn't want to devote a lot of space to something I wouldn't really encourage people to do.. |
Probably worth noting in the docs under package.js? |
http://docs.meteor.com/#/full/modules Also, should it be explained there rather than here how to import using CommonJS, if you haven't switched your app to ecmascript? Similar to: |
@tmeasday should we keep Should it instead be explicitly named as a named export? |
The issue I raised was more to do with how the documentation read. |
I think there's no reason not to name default exports as it makes it a lot clearer, even if it doesn't actually do anything (unless you access the export later down in the exporting file). |
We should possibly make some changes to the docs; let's hold off on this (just about to launch a new docs site). |
http://guide.meteor.com/writing-packages.html#exporting
What if you want your package to support apps < 1.3? Can you also
api.export('myName')
inpackage.js
?Is it best practice to use named exports, or should we explain defaults as well?
http://guide.meteor.com/writing-packages.html#npm-dependencies
Does this mean only on the server? Can't use npm modules on the client inside a package?
Does
Npm.depends
always go on top level, or can you do egThe text was updated successfully, but these errors were encountered: