vazco / universe-modules

Use ES6 / ES2015 modules in Meteor with SystemJS
https://atmospherejs.com/universe/modules
MIT License
52 stars 7 forks source link

Alternative File Extensions #3

Closed AdamBrodzinski closed 9 years ago

AdamBrodzinski commented 9 years ago

Have you considered adding the .es6.js extension so that people currently using babel can switch over without changing all of their file extensions? I suppose this would have to be opt in with a config to not break existing babel projects. Just a thought!

MacRusher commented 9 years ago

I can do it, but you're sure that this is a good idea?

All .es6.js file are loaded automatically by Meteor and .import.js files need to be loaded explicit.
Changing name isn't enough to make this work.

IMHO it is better to do it manually and this way mark files that are ready for loading as a module, and actually are exporting something.

Once files are module-ready you can always use rename command or write simple bash script to rename all file.

Does this answer satisfy you?

AdamBrodzinski commented 9 years ago

Ah good point. I guess my initial reaction was that the filename becomes really long in my file tree. I think having them be explicitly loaded for now is prob. best.

MacRusher commented 9 years ago

Yeah names can get quite long sometimes, but this is just lesser evil.

We experimented with .mod.js, .i.jsx etc. but in the end readability is more important so we stick to .import.js.

Closing for now.

PS. How react-meteor-tutorial.com is going? I can't wait your screencasts :)