PDA

View Full Version : Where to start?



BillHubbard
27 Oct 2011, 9:31 AM
Is the JS Builder tool documented anywhere? All I've been able to find so far is a couple of readme files. It would be nice to have some examples, a getting started guide, and just some basic information about how the tool works. I must be overlooking something....

kurt2305
28 Oct 2011, 9:01 AM
The same question with you

bas_tzx
31 Oct 2011, 12:52 AM
Check these:
http://docs.sencha.com/ext-js/4-0/#!/guide/getting_started (http://docs.sencha.com/ext-js/4-0/#%21/guide/getting_started)
http://www.sencha.com/forum/showthread.php?142768-Using-the-SDK-tools

BillHubbard
31 Oct 2011, 9:07 AM
Thanks for the reply, but that's basically where I started. There's a lot of assumptions in those sources, and not enough foundational information to glean an understanding.
The Getting Started guide alludes to the SDK Tools download (beta), which is described as a compressed file that needs to be extracted under htdocs/extjs under the Apache folders, but what I got was a Windows installer for version 1.2.3 that doesn't appear to generate any index.html file that can be found at http://localhost/extjs/index.html like the docs indicate.
Furthermore, after installing the tools, I try to make sense of the command shown in the guide:


sencha create jsb -a index.html -p app.jsb3But this doesn't fit with my environment, as there is no static index.html file to refer to. I am working with a complex system that embeds ExtJS apps within various pages, and the apps are all built using the MVC architecture. I tried to run the command on a standalone sample app that I built, and I just get errors, like:

undefined:0 ReferenceError: Can't find variable: jQuery
undefined:0 ReferenceError: Can't find variable: Ext
undefined:0 ReferenceError: Can't find variable: Sjs
[ERROR] Ext is not defined, please verify that the library is loaded properly on the application's page
undefined:0 ReferenceError: Can't find variable: Ext

There just isn't enough information available for me to determine what it's doing, what it's expecting, how to use it within my environment, and how I can manipulate it to work within my environment. And I need to figure it out real soon here, as we're approaching a December product release.

P.S. It would be good to have a reference app to run the tools against so I could at least get a look at the resulting output (JSB3 files?) to give me a point of reference to understand what this tool does.

Bucs
5 Nov 2011, 10:12 AM
Wow, been away from ExtJS for a while and although all the changes look great, it's obvious that Sencha still suffers from a huge lack of appropriate documentation. If you are going to build an mammoth ext-all.js core file (over a meg now), knowing most newbie devs are just going to drop that file into their project and start developing, and then just "expect" they are going to find there way around the sparse documentation on JSBuilder to build the appropriately sized file for their project, you are sorely mistaken. Result...huge, fat-arse programs that won't hold a candle to your competitors in terms of speed and delivery times.

Why is it so hard for Sencha to put together a comprehensive doc on using JSBuilder in Mac and Windows? Why do you insist on having everyone scour the web for the slightest of hints in order to use this product? It's really hard to believe the shortsightedness exhibited by Sencha on this topic...

evant
5 Nov 2011, 4:06 PM
Not really sure what you mean, the builder, along with a tutorial/explanation is in the getting started guide:

http://docs.sencha.com/ext-js/4-0/#!/guide/getting_started

bclinton
6 Nov 2011, 11:53 AM
Not really sure what you mean, the builder, along with a tutorial/explanation is in the getting started guide:

http://docs.sencha.com/ext-js/4-0/#!/guide/getting_started (http://docs.sencha.com/ext-js/4-0/#%21/guide/getting_started)

For the sake of making things easier to find, it might make sense to move the Deployment section from the Getting Started guide to its own section. I think many people reading the Getting Started guide get to the deployment section and think "I'll worry about that later." Then, when it's actually time to deploy their app, the Getting Started guide has receded far in the rear view mirror. It just doesn't seem logical to have a a passage that is basically about "Finishing up" in the "Getting Started" section of the docs.

BillHubbard
9 Nov 2011, 10:55 PM
Pretend that someone encountering this tool for the first time knows nothing about it. I think you guys are so close to the trees, you can't see the forest. The information in the getting started guide isn't even enough to get me started. There is zero visibility into this tool, and every attempt I have made to use it has failed with errors, with no reference info anywhere as to why, what to look for, how to troubleshoot it, etc., etc. and etc. It's very frustrating. I've opened a support ticket and have gotten no more input than I have received here.

The getting started guide shows little more than a couple of commands...that do who-knows-what. There is no reference example that comes with the tool, I'm completely in the dark about what a "JSB" file is and what it contains or what its purpose is, and I can't understand why this is treated like a black box.

This is as far as I have ever been able to get:

D:\temp\sencha>sencha create jsb -a http://localhost/Saba/Web/Social -p app.jsb3
[ERROR] Ext is not defined, please verify that the library is loaded properly on the application's page undefined:0 ReferenceError: Can't find variable: Ext

Dead end. Where do I go from here?

bclinton
9 Nov 2011, 11:38 PM
I'm completely in the dark about what a "JSB" file is and what it contains or what its purpose is, and I can't understand why this is treated like a black box.

Have you seen this thread? http://www.sencha.com/forum/showthread.php?131540-SenchaSDKTools-sencha-create-jsb-command&p=641450&viewfull=1#post641450

The 11th post (top of the second page) has an example of what a JSB file looks like. It's basically just a list of files that gets used by the "sencha create" command when it combines and compacts your .js files into one file and obfuscates your code. In that example, his file array is empty. It should be an array of file objects that looks something like this:



"files": [
{
"path": "app/model/",
"name": "Product.js"
},
{
"path": "app/store/",
"name": "Products.js"
},
{
"path": "app/view/product/",
"name": "Products.js"
},
{
"path": "app/controller/",
"name": "Products.js"
}
]


Theoretically you could just make this file by hand, especially if your project is small. Then you could move on to the next step and maybe you will be able to get the "sencha create" command working.



This is as far as I have ever been able to get:

D:\temp\sencha>sencha create jsb -a http://localhost/Saba/Web/Social -p app.jsb3
[ERROR] Ext is not defined, please verify that the library is loaded properly on the application's page undefined:0 ReferenceError: Can't find variable: Ext

Dead end. Where do I go from here?


Well, it obviously seems like some kind of path problem or script src include syntax issue. There are a few people who've had the same issue in the thread I linked and perhaps one of their solutions will work for you. On Windows servers, authentication seems to be a common culprit. If you continue to have trouble with it, perhaps you should post the HTML source of your http://localhost/Saba/Web/Social page.

BillHubbard
10 Nov 2011, 1:48 PM
Thanks, that was very helpful.
As an experiment, I created a jsb3 file by hand and was able to generate a script file. But the deployment version is not getting compressed or obfuscated, even though I specified "compress": true in the JSON.
Is there any documentation that describes all the features and options that can be specified in a JSB3 file? It took some experimentation to determine what the relative paths were relative to, and I'm not clear on what goes under "resources".

It seems the problem in my environment is authentication. At least that's the problem at the front door. And I have no way around that, so the sencha create command is going to be of no use to me - I'm going to have to figure out some other way to generate and manage JSB3 files. As for figuring out what script files to create and what sources go into them, I'm probably on my own there, considering the complexity of our application. It seems Sencha is centered around a single SPI concept. It's a whole different ball game entirely when you're dynamically embedding ExtJS apps within a very large application...

BillHubbard
10 Nov 2011, 5:20 PM
Apparently, this JS Builder tool gives no indication when it fails, other than to produce bad output.

It is not compressing or obfuscating my scripts, and I wind up with the following in my directory:
11/10/2011 04:54 PM 733,798 sjs-all-debug.js
11/10/2011 04:54 PM 733,665 sjs-all.js
11/10/2011 04:54 PM 733,665 sjs-all.js-temp-707842769255.8569

deane turner
12 Nov 2011, 3:09 PM
Hello Bill,

I just posted a link to a resource that may help you.

http://www.sencha.com/forum/showthread.php?154818-Using-JSBuilder-3-Here-may-be-some-helpful-information-for-those-starting-out.

deane turner
13 Nov 2011, 4:08 AM
http://deaneturner.com/blog/2011/11/12/using-jsbuilder3/

headkit
23 Jan 2012, 5:28 AM
Thanks, that was very helpful.
As an experiment, I created a jsb3 file by hand and was able to generate a script file. But the deployment version is not getting compressed or obfuscated, even though I specified "compress": true in the JSON.


same here:


...
* Compress and obfuscate appName.js...
rsync: -: unknown option
rsync error: syntax or usage error (code 1) at main.c(1455) [client=3.0.9]
java.io.FileNotFoundException: /Users/NAME/PATH/TO/APP/www/nameOfBuildJSFile.js-temp-882015127581.6014 (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at java.io.FileInputStream.<init>(FileInputStream.java:79)
at com.yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:20)

stewardsencha
5 Feb 2012, 2:17 PM
sencha create jsb -a http://chat.stewardsencha.com/index.php -p chat.jsb3



2012-02-05 14:07:58.545 phantomjs[15311:903] Error loading /Users/stewardsencha/Library/Internet Plug-Ins/WebEx.plugin/Contents/MacOS/WebEx: dlopen(/Users/stewardsencha/Library/Internet Plug-Ins/WebEx.plugin/Contents/MacOS/WebEx, 262): no suitable image found. Did find:
/Users/stewardsencha/Library/Internet Plug-Ins/WebEx.plugin/Contents/MacOS/WebEx: mach-o, but wrong architecture
2012-02-05 14:07:58.595 phantomjs[15311:903] Error loading /Library/Internet Plug-Ins/Silverlight.plugin/Contents/MacOS/agcore: dlopen(/Library/Internet Plug-Ins/Silverlight.plugin/Contents/MacOS/agcore, 262): no suitable image found. Did find:
/Library/Internet Plug-Ins/Silverlight.plugin/Contents/MacOS/agcore: mach-o, but wrong architecture
2012-02-05 14:07:58.630 phantomjs[15311:903] Error loading /Library/Internet Plug-Ins/QuickTime Plugin.plugin/Contents/MacOS/QuickTime Plugin: dlopen(/Library/Internet Plug-Ins/QuickTime Plugin.plugin/Contents/MacOS/QuickTime Plugin, 265): no suitable image found. Did find:
/Library/Internet Plug-Ins/QuickTime Plugin.plugin/Contents/MacOS/QuickTime Plugin: no matching architecture in universal wrapper
plugin,NP_Initialize start
plugin,NP_Initialize end
plugin,NP_GetEntryPoints start
Private_Initialize
plugin,NP_GetEntryPoints end
2012-02-05 14:07:58.956 phantomjs[15311:903] Error loading /Library/Internet Plug-Ins/iPhotoPhotocast.plugin/Contents/MacOS/iPhotoPhotocast: dlopen(/Library/Internet Plug-Ins/iPhotoPhotocast.plugin/Contents/MacOS/iPhotoPhotocast, 262): no suitable image found. Did find:
/Library/Internet Plug-Ins/iPhotoPhotocast.plugin/Contents/MacOS/iPhotoPhotocast: no matching architecture in universal wrapper


The "app" is barely more than "Hello World".

No idea if my machine has gone sour or Sencha is serving up more mystery.

Anyone know what "phantom.js" is? Are these messages for real?

headkit
6 Feb 2012, 12:58 AM
compiled and installed newest rsync, then rebooted - all good now!

trevorcox
25 Sep 2012, 8:04 PM
I've spent hours trying to get this to work on my own project ("ReferenceError: Can't find variable: Ext"), so I thought I would start with the Jog With Friends example, since it has a jsb3. But when I run:

sencha create jsb -a index.html -p tc.jsb3 -v

it just hangs. (Freshly downloaded 2.0.1.1 sencha touch.

It also hangs on Windows 7. And if I do -a file:///..., it loops printing "Can't find variable: Ext"

ingo.hefti
25 Sep 2012, 10:26 PM
'Tools' is now called 'CMD' and although still in beta, seems to be much better then its predecessor. Description and download links here: http://blog.sencha.com/blog/all-new-sencha-cmd/

trevorcox
26 Sep 2012, 10:45 AM
Thanks! It looks like Sencha Cmd v3.0.0.141 is close to working on Sencha Touch. When I run

sencha compile -debug -classpath=ftapp/app.js,ftapp,sdk/src page -in=index.html -out=built.html

It processes quite a bit before terminating with:

Processing class inheritance graph
[ERROR] Failed to resolve dependency Ext.scroll.scroller.CssPosition for file Ext.scroll.scroller.Infinite
[ERROR] Error executing page compilation Unknown definition for dependency : Ext.scroll.scroller.CssPosition

The latest version of Touch does not have CssPosition, but it is referenced.

dongryphon
26 Sep 2012, 11:48 PM
For building Sencha Touch apps with Sencha Cmd V3, you will need Sencha Touch 2.1 Beta 3. To build the app, you should use "sencha app build" from the application folder. Using the compiler directly for Sencha Touch applications can be done, but it is not really the simple way ;)