Sascha Herrmann
unread,Aug 14, 2012, 8:04:11 AM8/14/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jsclas...@googlegroups.com
Hi!
I am wondering what the best practice is regarding JS.require().
Our JSF application consists of various modules, that are imported into a "main" application. Most modules have their own JS classes or use some common framework JS classes. The modules are packaged into separate libraries.
I am trying to set up the Javascript classes in a way that allows us to autoload the files (as shown in the Songkick example, we learned a lot from that btw).
Where do I put my JS.require() statements?
List all in my applications at a central point? That would mean that every application needs to know and needs to specify what the modules require, which kind of breaks the encapsulation of the modules.
Or do I put the require statements into the class files, like import statements in Java, and every class file JS.requires the things that the class needs? Does it hurt to require the same class multiple times?
Thanks,
Sascha