1
votes

I have an extjs 4.2 application which was built by hand coding controllers, views, stores and models. I was looking for a step by step approach to migrate to sencha cmd and could not find one.
The reasons for moving to sencha cmd are packaging benefits (1 app.js to load instead of 100s of js files), obfuscating/ minimizing code for production, theming, ease of migration to newer extjs versions.
Please let me know what steps you took to migrate to sencha cmd? I am planning to do this (actually tried it and did not succeed):

  1. Start fresh and create a new sencha app using cmd keeping the same Ext.application.name as the hand coded one
  2. Copy all models, views, controllers, stores over to sencha cmd app
  3. Add those models, views, controllers in app/Application.js
  4. Run sencha app watch and it should work

A little guidance or a pointer to how you migrated a non sencha cmd app to a sencha cmd app will help.

Thanks

1
you must have gotten some exceptions during cmd build??Yellen
I got some exceptions regarding variable names. For e.g. var long = 1.0; had to be changed to var longitude = 1.0; But after cleaning all those up, the sencha app build production works fine and generates a app.js in the build folder...but I get runtime exceptions when I try it out. Current one is regarding an extensible calendar UX which I am working on. But my question was regarding an approach.. is this the way to do it?Vick L
This link: enovision.net/sencha-cmd-how-setup-ext-js-neptune-theme still works for Ext JS 5. It's a step by step approach on creating an Ext JS app with Sencha Cmd. If you want to have more applications in a single workspace, you shoud use the workspace as mentioned in the answer below.Johan Van de Merwe
@VickL Was my answer useful? If any success, maybe I can help you with it..Vladyslav Sheruda
In a way yes.. but I also wanted a real practical example by someone who has gone through this kind of task.Vick L

1 Answers

2
votes

First of all you need to download Sencha ExtJS and Sencha CMD. After that you need to install Sencha CMD.

Generation ExtJS Build:

  • run terminal;

    sencha -sdk /path/to/extjs-5.x.x generate workspace my-workspace

    cd my-workspace

    sencha -sdk ext generate app NameApp name-app

    cd name-app

    sencha app build

Also, if you want to migrate exists application, you can perform the steps listed above, copy your application in workspace and run sencha app build -c production for example