PDA

View Full Version : Different builds for different clients



gary.bake
28 May 2015, 4:30 AM
We currently have a number of clients using our ExtJS 4 based application.

We would like to inc/exclude various pieces of code/components depending upon which client the build is for.

Is this possible with ExtJS?
Has anybody else approached this before?

f.baron
28 May 2015, 10:09 AM
This is only an idea, I've never tried this approach and I don't know if it works: you could define your modules (subsets of js and css) as packages (with the package.json) and then configure them in you app.json, something like this:


"builds": {
"build1": {
"packages": {
"module1",
"module2",
...
},

},
"build2": {
"packages": {
"module1",
"module3",
...
},

}
}

gary.bake
1 Jul 2015, 7:21 AM
In case anybody else may find this useful or has pointers to improve this.

Our current solution is to comment out things in application.js and then use feature detection in the app. This commenting out is done by the build process.

i.e. client 1 has all of the app apart from the calendar module
We run Build -t client1
This takes a copy of the application
In application.js it comments out App.model.Calendar, App.store.Calendar, App.view.Calendar...
Sencha app build is ran on the copy.
The client is supplied the package that no longer includes any of the Calendar module code.
In the app we use the following to show/hide menu items

if (App.store.Calendar) {...show calendar menu item}