mystor / meteor-routecore

Client and server side rendering/routing powered by React
84 stars 6 forks source link

Modularizing code #22

Closed trusktr closed 9 years ago

trusktr commented 9 years ago

How would we split app.jsx into separate files (i.e. import React classes that are exported from other files)?

mystor commented 9 years ago

If you make the classes global, they will be visible in other files. This is pretty standard meteor global variable stuff.

Meteor doesnt really have an in app module system.

trusktr commented 9 years ago

For sure. I'd like to modularize if possible, like one does with CommonJS modules of ES6 modules. Can Meteor Packages be used in the same way? For a large application, can we separate React classes into separate "packages"? Would it be practical?

mystor commented 9 years ago

Routecore doesn't do anything special to help with modularizing your meteor projects. If you want to do that, look into other mechanisms which meteor can help you with.

On Tue, Mar 31, 2015 at 5:35 PM, Joseph Orbegoso Pea < notifications@github.com> wrote:

For sure. I'd like to modularize if possible, like one does with CommonJS modules of ES6 modules. Can Meteor Packages be used in the same way? For a large application, can we separate React classes into separate "packages"? Would it be practical?

— Reply to this email directly or view it on GitHub https://github.com/mystor/meteor-routecore/issues/22#issuecomment-88257226 .

trusktr commented 9 years ago

Do the load order rules found at http://docs.meteor.com/#/full/fileloadorder apply in the same way to the .jsx files?

mystor commented 9 years ago

Yup On Mar 31, 2015 7:55 PM, "Joseph Orbegoso Pea" notifications@github.com wrote:

Do the load order rules found at http://docs.meteor.com/#/full/fileloadorder apply in the same way to the .jsx files?

— Reply to this email directly or view it on GitHub https://github.com/mystor/meteor-routecore/issues/22#issuecomment-88288081 .

trusktr commented 9 years ago

Sweet. So I'll just follow the standard practices of Meteor packaging. I'm basically thinking of using this guideline: http://tech.exponential.io/meteor/building-large-modular-apps-meteor/, except with jsx files instead of js files.