PDA

View Full Version : [OPEN] Sencha Cmd should support sandboxed packages



thorben
12 Oct 2012, 5:04 AM
Is it possible to use Sencha Cmd with a sandboxed build of Ext JS (e.g. ext-all-sandbox-dev.js)? I'm using Sencha Cmd 3.0.0.190.

I think a config option like jsduck's
--ext-namespaces=Ext,Ext4 would help us here. I'm mainly interested in a build of our custom classes, so it would be ok to have ext-all-sandbox.js included.

Is something like this going to be implemented or will I need to migrate my app to Ext JS 4 before using Cmd?

dongryphon
12 Oct 2012, 11:09 PM
We have discussed sandbox mode and there are a couple or so directions it could go.

I am curious to know more specifically what you are wanting to achieve. I assume you have a mixture of v3 and v4 classes? Are you wanting to produce a subset of the frameworks? And wrap the v4 subset in a sandbox...

thorben
19 Oct 2012, 12:34 AM
Yes, we've got a mixture of Ext 3 and Ext 4 classes. We are continually migrating to Ext 4, so the number of Ext 3 classes will eventually approach 0 ;).

What we want to achieve is a custom build of only the Ext 4 part of the app. In the final build, there will be 3 or 4 JS files

Ext JS 3 Framework (ext-all.js)
All our custom Ext JS 3 classes (this is generated using the current build process)
Ext JS 4 Framework + Ext JS 4 custom classes (this should be the output of Sencha Cmd)
So Cmd wouldn't need to care about the Ext JS 3 classes and their proper inclusion, but only accept "Ext4" as the Ext JS 4 namespace.

I imagine this might just be a minor tweak to the tool, but maybe sandboxing is more complicated internally?

dongryphon
19 Oct 2012, 9:06 AM
Cmd wouldn't need to care about the Ext JS 3 classes and their proper inclusion, but only accept "Ext4" as the Ext JS 4 namespace.

I imagine this might just be a minor tweak to the tool, but maybe sandboxing is more complicated internally?

Yeah that is the harder part - partitioning code that says one thing ("Ext") but needs to be understood as another ("Ext4") so that references from other code using the other name ("Ext4") link up properly. Then we need to wrap the sandbox around the Ext 4 code during the build.

It is all doable, but won't make in this release (3.0.0). Knowing that there are folks using/needing this support is really helpful though to decide when to pull the trigger on it.

I'm going to open this as a ticket so we can both track it.

Thanks for taking the time to explain what you were needing.

dongryphon
19 Oct 2012, 9:09 AM
I have opened a ticket in our bug tracker.

superstructor
25 Jun 2013, 4:17 PM
Any update on this issue ? Is it possible with the latest Sencha Cmd 3.1.2.342 release ? This is vital functionality for being able to port a legacy ExtJS 3.x application to ExtJS 4.x and a Sencha Cmd based build.

medifirst
10 Jul 2013, 5:37 AM
Same problem : any update??

Nick A.
18 Sep 2013, 1:55 PM
To get around this I ended up taking the sliced images from a non-sandboxed version of our theme that I generate and incorporate those images as the images for the sandboxed theme. When generating the theme with the sandbox I just use

sencha package build
from within the theme package and use the built <theme-name>-all.css.

The main downfall of this is that we can't take advantage of minimizing the js or css sent to the page as we use ext-all-sandbox.js and <theme-name>-all.css.

adrianmirjan
28 Nov 2013, 4:22 AM
There are still issues with sandboxed mode in Sencha Cmd v4.0.1.45.
On sencha app refresh bootstrap.js still contains references to


Ext.Loader.addClassPathMappings
Ext.ClassManager.addNameAlternateMappings
Ext.ClassManager.addNameAliasMappings
Ext.setVersion


Loading the app gives the error


ReferenceError: Ext is not defined
Ext.Loader.addClassPathMappings({ bootstrap.js (line 7)


I'll try to mess around with refresh-impl.xml to fix it.
But I'd like this to be fixed properly.

adrianmirjan
2 Dec 2013, 8:45 AM
Looks like sandboxed mode works differently. In dev mode you are still using normal mode, but building for production environment adds magic around your source code. This (http://www.sencha.com/forum/showthread.php?150204-Is-it-possible-to-use-Sencha-SDK-and-Sandbox-mode&p=1014623&viewfull=1#post1014623) worked for me.