We're building an app that has public part and main one for internal use. They share quite complex form and some utility components and data models.
I create a workspace, within that workspace I create two applications: frontend and backend. Then I create a common folder with sources and add this folder into the /.sencha/workspace/sencha.cfg:
My directory structure looks like this:
In frontend and backend I have diffferent namespaces (CJF, CJ and in the common components I have separate namespace: CJ. So I add a class CJ.component.Logger and put it into common/src/component/Logger.js
And then I modify app.js of the frontent app so it looks as follows:
It works just fine. And if I make a production build, it finds and includes my logger so I can use it.
The only problem is that above approach works if document root is /, not /frontend, otherwise path for CJ - ../common/src will be above the document root and thus inaccessible for the Ext.Loader during the development phase.
Any ideas? What is the correct approach of handling significant logic in the shared components? What about shared models, stores, do they work fine?