3 Nov 2011 11:12 AM #1
Code reuse across Web (Ext JS) and Mobile (Touch) applications?
I asked this question a couple of times at SenchaCon 2011 and didn't get a definitive answer, but the general vibe appears to be that the answer is "No." I want to ask the community to see if anyone else has experience with this and can help answer the question definitively:
If I want to write a web app using Ext JS and a mobile app using Sencha Touch, can I write from a single code base? To what extent can I share code between the applications I write in each?
Is the ability to do this an active part of the Sencha plan? If so, when will it be delivered?
One would think that model management code and possibly controller code could be shared across Touch and ExtJS apps.
thanks for your thoughts
4 Nov 2011 5:46 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
This has been asked a lot...
The answer is yes and no. Yes, models, stores, controllers, and some views can technically be shared between Ext JS 4 and ST 2 but no you wouldn't want to (models and stores you can).Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
11 Nov 2011 11:03 AM #3
Thanks for teh response but it was a wee bit ambiguous.
So models and stores "more or less" yes
Controllers and Views "more or less" no
Any idea of the Sencha plans related to this?
18 Jul 2013 12:01 PM #4
So, it's been almost 2 years since this question was asked, any updates? If there is a way to share any amount of code between the browser version of an app and the mobile version, it would be a great help.
18 Jul 2013 12:45 PM #5
I was really excited with the blog post a couple weeks ago announcing "One of the big themes for Sencha is more convergence between Touch and Ext JS". I've been waiting for this for a long time. Today's blog post confirms that Ext Js will now have some amount of support for tablets, but doesn't confirm that the code bases between the two frameworks are necessarily any closer together.
The main thing I'm looking to do is share stores and models between desktop and mobile apps. Controllers would be great as well. View sharing would be nice for the cases where the desktop and mobile show essentially the same markup, albeit with a scroll bar and inertial scrolling respectively.
Will any of these types of code sharing be possible with the forthcoming versions of the two frameworks?
18 Jul 2013 12:56 PM #6
Or perhaps I'm asking the wrong question. Maybe I should be asking if Ext Js will have enough of the Sencha Touch functionality to port over an existing mobile app that runs on tablets, assuming that the intent is to build an app that adapts the UI to the device? That is, will Ext Js basically have all or most of the ST functionality and UI components, plus the Ext Js desktop components?
22 Jul 2013 1:18 PM #7
I hope it has more than 'some' support for tablets, given the direction that computer design is headed...sencha needs to be ahead of the curve here. Can you define, 'some'?
25 Jul 2013 10:23 PM #8
I attended the conference and this is what I understand.
ExtJS will be getting the touch event code base from the Touch framework i.e. that particular code base will be shared so all touch events will be available to ExtJS.
This means your ExtJS application should run "ok" on a tablet.
You have to remember that ExtJS caters for legacy browsers that aren't HTML5 compliant (IE 9 and below) so it cannot take real advantage of some of the awesome CSS3 features that make Touch perform so well on mobile and Tablet e.g. flexbox, transitions, translate2D 3D etc....
If you have a Touch application I wouldn't be ditching it for an ExtJS implementation thinking it will run better on a tablet, it wont - Touch is the preferred framework for required high performance delivery to a tablet.
Sencha are starting to port across to Touch some of the richer ExtJS components and have started with the Touch grid.
Sencha also indicated they would start merging core aspects of the frameworks so the code base is more consistent. The extent of this is fluid but they did list of some key areas.
Most of which you can see when they make the conference videos publicly available.
Or Mitchell maybe able to list some of them off.