Skip to content
RWOverdijk edited this page Jul 29, 2012 · 1 revision

Why multiple applications?

Well, requireJS (from here on RJS) did an awesome job supplying a modular structure. However, when working with ZF2 you're already in a modular structure. This means we're bound together with other modules if we want to share RJS modules. Every ZF2 module's RJS module should have the possibility to get executed. Imagine having a RJS module that doesn't get executed because the main application doesn't know about it. That would take away a lot of flexibility.

How?

I kept in mind that every module should share the same config map when it comes to loading RJS modules. This means that one way or another, we'll still need a main application to provide all modules with this information.

SxRequireJs sets up a main application, which essentially sets all "module bootstraps" as a dependency, waits for them to load, and then executes them. This will be your module's entry point, and should have its own dependencies.

Clone this wiki locally