Build a GluJS app

46 views
Skip to first unread message

ben.q...@callmeqube.com

unread,
Aug 12, 2013, 1:07:35 AM8/12/13
to gl...@googlegroups.com
I apologize if this has been asked / answered elsewhere, but Google isn't helping me find the answer.

How would I go about building a GluJS app for release? And by building, I mean concatenating all the required .js files in dependency order and minifying the result.

I'm guessing Sencha Cmd is out of the question since it relies on static analysis...

Ryan Smith

unread,
Aug 12, 2013, 12:09:05 PM8/12/13
to gl...@googlegroups.com
Hey Ben,

I'm not sure that there has been a best practice established yet for this or not.  However, one way that I've been doing it is with Sencha Cmd and a jsb3 file.  I know... its the old (v2) way of compiling files with sencha cmd (I believe its also been deprecated, so with the latest version it might not even work) but for the time being it works just fine and produces the results that we need to get things done.  The nice thing about using glujs though, is that the "dependencies" aren't really required.  In all of the applications that I've written with glujs, the viewmodels are independent of each other, and if you do have some sub-viewmodels they aren't instantiated until run-time anyway (which is well before your Ext.onReady).  This makes the concatenation and compression really easy because you literally can just grab everything in your js folder, concatenate it into one file and run any compressor on it that you like (yui is the one I think Sencha uses but I could be off my rocker).

Hopefully that helps!

-Ryan



--
You received this message because you are subscribed to the Google Groups "GluJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glujs+un...@googlegroups.com.
To post to this group, send email to gl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glujs/3fdfa7e0-d299-407d-b132-a23b8860019b%40googlegroups.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

ben.q...@callmeqube.com

unread,
Aug 12, 2013, 6:44:48 PM8/12/13
to gl...@googlegroups.com
Thanks Ryan, great answer.

How do build the js3b? By hand or with the old Sencha SDK?

The end goal would be to build all our custom Ext components, overrides, extensions (etc.) and Glu MVVM classes into one file.

Ryan Smith

unread,
Aug 12, 2013, 6:55:05 PM8/12/13
to gl...@googlegroups.com
Hey Ben,

We were maintaining the jsb3 by hand, and that was pretty easy.  We started getting a few more people on the team, and it started becoming a common problem that it wasn't being updated appropriately, so someone built a quick application that just looks through the file structure and builds the jsb3 for each of the files that we have (since we don't have any dependencies in our app).  You could easily do something similar in order to handle your extjs components, overrides, etc.  If you wrote a jsb3 generator, you could tell it to look in folders in an order that you prefer as well.  So you could add files to the jsb3 in order of components, overrides, extensions, viewmodels, and finally views.  Not as nice as it could be, but it gets the job done and lets you get back to doing real work :).  Hopefully that helps!

-Ryan


murrayh...@gmail.com

unread,
Jun 28, 2015, 8:02:30 PM6/28/15
to gl...@googlegroups.com, ben.q...@callmeqube.com
I am wondering whether RequireJS might be useful in here somewhere. I've never used it but am already thinking about the hassle of maintaining all those script tags as I build my first GluJS app. Just thinking out loud, really.

murrayh...@gmail.com

unread,
Jul 3, 2015, 2:39:10 AM7/3/15
to gl...@googlegroups.com, ben.q...@callmeqube.com
This might help (even if belated):

https://groups.google.com/d/msg/glujs/XaprCIi0c4Y/j6lX0zMOqP4J

Cheers,
Murray
Reply all
Reply to author
Forward
0 new messages