How to use Packages feature in 0.8 Build?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use Packages feature in 0.8 Build?

MShillinger

Can someone post an example of how to use the "packages" feature in the 0.8
build framework.  I have read the online docs but cannot seem to get it to
work.

My config.json contains a "packages" top level key

"packages" :
{
        "parts"    :
        {
                "qooxdoo" : [ "qx.*" ],
                "my_utils" : [ "my.utils.*" ],
                "my_dialogs"    : [ "my.dialogs.*" ],
                "my_app" : [ "my.ui.*", "my.io.*" ]
        },

       
        "init"     : "my_app",
        "collapse" : [ "my_app", "my_utils" ]
}

I would expect this to generate 3 different js files in either the "source"
version or the "build" version.  I cannot seem to figure out what I am
missing.

Any help would be appreciated.

Thanks
Mike Shillinger


--
View this message in context: http://www.nabble.com/How-to-use-Packages--feature-in-0.8-Build--tp21939291p21939291.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to use Packages feature in 0.8 Build?

Thomas Herchenroeder
Hi!

> My config.json contains a "packages" top level key

This won't work; a packages key has to be in the context of a job, so you
need something like this in your config:

"jobs" : {  // this is top-level
   ...
   "myJob": {
      "packages" : { ...

Usually your "myJob" would also contain the "compile-dist" key, in order
to create a build version of your app. (Sorry, that wasn't all too
obvious, and I have updated the docs).

>
> "packages" :
> {
> "parts"    :
> {
> "qooxdoo" : [ "qx.*" ],

You woudn't want to define a "qooxdoo" part. Stick with your application
classes (as you did with the other parts), and let qooxdoo do its job.
Specifying a "qooxdoo" part as you did might break the dependency checking
and auto-packaging the generator does.

> "my_utils" : [ "my.utils.*" ],
> "my_dialogs"    : [ "my.dialogs.*" ],
> "my_app" : [ "my.ui.*", "my.io.*" ]
> },
>
>
> "init"     : "my_app",
> "collapse" : [ "my_app", "my_utils" ]
> }

Other than that, it looks fine.

>
> I would expect this to generate 3 different js files in either the
> "source"
> version or the "build" version.

Nope. qooxdoo will figure out how many physical files to create from your
parts definition. Also, I'm not sure it makes much sense in the source
version, but you can try anyway.

Thomas


>  I cannot seem to figure out what I am
> missing.
>
> Any help would be appreciated.
>
> Thanks
> Mike Shillinger
>
>
> --
> View this message in context:
> http://www.nabble.com/How-to-use-Packages--feature-in-0.8-Build--tp21939291p21939291.html
> Sent from the qooxdoo-devel mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with
> Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code
> to
> build responsive, highly engaging applications that combine the power of
> local
> resources and data with the reach of the web. Download the Adobe AIR SDK
> and
> Ajax docs to start building applications
> today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>



------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to use Packages feature in 0.8 Build?

MShillinger
In reply to this post by MShillinger



mshillin wrote:

>
> Can someone post an example of how to use the "packages" feature in the
> 0.8 build framework.  I have read the online docs but cannot seem to get
> it to work.
>
> My config.json contains a "packages" top level key
>
> "packages" :
> {
> "parts"    :
> {
> "qooxdoo" : [ "qx.*" ],
> "my_utils" : [ "my.utils.*" ],
> "my_dialogs"    : [ "my.dialogs.*" ],
> "my_app" : [ "my.ui.*", "my.io.*" ]
> },
>
>
> "init"     : "my_app",
> "collapse" : [ "my_app", "my_utils" ]
> }
>
> I would expect this to generate 3 different js files in either the
> "source" version or the "build" version.  I cannot seem to figure out what
> I am missing.
>
> Any help would be appreciated.
>
> Thanks
> Mike Shillinger
>
>
>


Nevermind - figured it out.

"packages" needs to be a child of the "source" job and the "build" job (as
the documentation says...)

Anyway - for others having the same problem the "build" job in your
config.json would look like the following:

"build" :
{
        "extend" : ["common", "appconf::build"],
        "packages" :
        {
                "parts"    :
                {
                        "qooxdoo" : [ "qx.*" ],
                        "my_utils" : [ "my.utils.*" ],
                        "my_dialogs"    : [ "my.dialogs.*" ],
                        "my_app" : [ "my.ui.*", "my.io.*" ]
                },

       
                "init"     : "my_app",
                "collapse" : [ "my_app", "my_utils" ]
        }
}



--
View this message in context: http://www.nabble.com/How-to-use-Packages--feature-in-0.8-Build--tp21939291p21957498.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to use Packages feature in 0.8 Build?

Sebastian Werner
In reply to this post by MShillinger

Am 10.02.2009 um 19:31 schrieb mshillin:

>
> Can someone post an example of how to use the "packages" feature in  
> the 0.8
> build framework.  I have read the online docs but cannot seem to get  
> it to
> work.
>
> My config.json contains a "packages" top level key
>
> "packages" :
> {
> "parts"    :
> {
> "qooxdoo" : [ "qx.*" ],
> "my_utils" : [ "my.utils.*" ],
> "my_dialogs"    : [ "my.dialogs.*" ],
> "my_app" : [ "my.ui.*", "my.io.*" ]
> },

This basically look like you do not have a configuration for the  
packages support. There seems to be a misunderstanding of the idea of  
what packages can do for you. These are not thought to build library  
like packages which may be used by different apps. The ideal use case  
is to automatically split an application into separate packages which  
are loaded on-demand during the application runtime.

A example would be something like an outlook clone where you initially  
load the email view together with the basic application structure  
(tree, toolbars) and only when the user jumps to the calendar  
automatically load this part afterwards etc.

A configuration here would look like this:

"core" : "my.Application",
"mail" : "my.email.View",
"calendar" : "my.calendar.View"

etc.

Hope this explains this a bit.

When you want to built library like packages an include statement with  
explicit "=" classs lists would be more ideal. Not sure if there exist  
documentation around this topic though.

Cheers,
Sebastian


>
>
>
> "init"     : "my_app",
> "collapse" : [ "my_app", "my_utils" ]
> }
>
> I would expect this to generate 3 different js files in either the  
> "source"
> version or the "build" version.  I cannot seem to figure out what I am
> missing.
>
> Any help would be appreciated.
>
> Thanks
> Mike Shillinger
>
>
> --
> View this message in context: http://www.nabble.com/How-to-use-Packages--feature-in-0.8-Build--tp21939291p21939291.html
> Sent from the qooxdoo-devel mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with  
> Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills  
> and code to
> build responsive, highly engaging applications that combine the  
> power of local
> resources and data with the reach of the web. Download the Adobe AIR  
> SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to use Packages feature in 0.8 Build?

MShillinger



Sebastian Werner wrote:

>
>
>
> This basically look like you do not have a configuration for the  
> packages support. There seems to be a misunderstanding of the idea of  
> what packages can do for you. These are not thought to build library  
> like packages which may be used by different apps. The ideal use case  
> is to automatically split an application into separate packages which  
> are loaded on-demand during the application runtime.
>
> A example would be something like an outlook clone where you initially  
> load the email view together with the basic application structure  
> (tree, toolbars) and only when the user jumps to the calendar  
> automatically load this part afterwards etc.
>
> A configuration here would look like this:
>
> "core" : "my.Application",
> "mail" : "my.email.View",
> "calendar" : "my.calendar.View"
>
>

Actually, what I am trying to accomplish is to build the app so that my code
is delivered to the browser in "source" format and qooxdoo library code is
delivered in "build" format.  Doing this has several advantages while
developing

1. Makes debugging so much easier (ex. 800 fewer files in the Firebug script
tab)
2. Makes the app load faster than an all "source" version.
3. shortens the "edit-build-run" cycle since I don't really "build" anything

I thought the "packages" feature could do this for me - but looks like I am
mistaken. Still trying to get comfortable with the new tool chain.

Perhaps the tool chain could include this type of build as a standard job. I
think many developers would appreciate the benefits.


Sebastian Werner wrote:
>
> When you want to built library like packages an include statement with  
> explicit "=" classs lists would be more ideal. Not sure if there exist  
> documentation around this topic though.
>

That sound like what I need.  I looked through the docs but didn't see
anything.


The new "window.qxloader =" scheme is very different from how 0.7.x loaded
the JS files.

I wonder if I could hack the window.qxloader.uris after a "source" build of
my app - like the following - (where qx-0.js is the entire Qooxdoo library)

window.qxloader =
{
        parts : {"myapp":[1],"qooxdoo":[0]},
        uris : [
                ["../script/qx-0.js"],
       
["../script/class/my/ui/View.js",../script/class/my/ui/Control.js",<REST_OF_MY_CLASSES>"]
                ],
        boot : "qooxdoo",
        ...
}

Do you think that will work?

Thanks
Mike Shillinger


--
View this message in context: http://www.nabble.com/How-to-use-Packages--feature-in-0.8-Build--tp21939291p21975679.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to use Packages feature in 0.8 Build?

Andreas Ecker
Hi Mike!

> Actually, what I am trying to accomplish is to build the app so that my code
> is delivered to the browser in "source" format and qooxdoo library code is
> delivered in "build" format.  Doing this has several advantages while
> developing
>
> 1. Makes debugging so much easier (ex. 800 fewer files in the Firebug script
> tab)
> 2. Makes the app load faster than an all "source" version.
> 3. shortens the "edit-build-run" cycle since I don't really "build" anything
>
> I thought the "packages" feature could do this for me - but looks like I am
> mistaken. Still trying to get comfortable with the new tool chain.
>
> Perhaps the tool chain could include this type of build as a standard job. I
> think many developers would appreciate the benefits.

A while ago we talked about the same idea: during regular application
development to use a qooxdoo library file ("build") while keeping all
individual custom classes ("source"). This would help keeping browser
reloads fast. Need to see if we missed to file a ticket for such a
behavior, which I think could become even the default behavior for
qooxdoo app development (i.e. the "source" generation). Thomas is sick
and not at work, but I'll talk with him about this feature soon.

> > When you want to built library like packages an include statement with  
> > explicit "=" classs lists would be more ideal. Not sure if there exist  
> > documentation around this topic though.
> >
>
> That sound like what I need.  I looked through the docs but didn't see
> anything.

It should all be in the generator docs, see
http://qooxdoo.org/documentation/0.8#tooling

> The new "window.qxloader =" scheme is very different from how 0.7.x loaded
> the JS files.
>
> I wonder if I could hack the window.qxloader.uris after a "source" build of
> my app - like the following - (where qx-0.js is the entire Qooxdoo library)
>
> window.qxloader =
> {
> parts : {"myapp":[1],"qooxdoo":[0]},
> uris : [
> ["../script/qx-0.js"],
>
> ["../script/class/my/ui/View.js",../script/class/my/ui/Control.js",<REST_OF_MY_CLASSES>"]
> ],
> boot : "qooxdoo",
> ...
> }
>
> Do you think that will work?

Do not bother to mess with the loader script! It's going to change,
since the loading of a qooxdoo app is to be improved to the level of 0.7
(i.e. a single JS file, not two) and beyond (e.g. providing useful
"domready" event, etc.).

Bye,

Andreas
 




------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to use Packages feature in 0.8 Build?

Sebastian Werner
Andreas Ecker schrieb:

> Hi Mike!
>
>> Actually, what I am trying to accomplish is to build the app so that my code
>> is delivered to the browser in "source" format and qooxdoo library code is
>> delivered in "build" format.  Doing this has several advantages while
>> developing
>>
>> 1. Makes debugging so much easier (ex. 800 fewer files in the Firebug script
>> tab)
>> 2. Makes the app load faster than an all "source" version.
>> 3. shortens the "edit-build-run" cycle since I don't really "build" anything
>>
>> I thought the "packages" feature could do this for me - but looks like I am
>> mistaken. Still trying to get comfortable with the new tool chain.
>>
>> Perhaps the tool chain could include this type of build as a standard job. I
>> think many developers would appreciate the benefits.
>
> A while ago we talked about the same idea: during regular application
> development to use a qooxdoo library file ("build") while keeping all
> individual custom classes ("source"). This would help keeping browser
> reloads fast. Need to see if we missed to file a ticket for such a
> behavior, which I think could become even the default behavior for
> qooxdoo app development (i.e. the "source" generation). Thomas is sick
> and not at work, but I'll talk with him about this feature soon.
>
>>> When you want to built library like packages an include statement with  
>>> explicit "=" classs lists would be more ideal. Not sure if there exist  
>>> documentation around this topic though.
>>>
>> That sound like what I need.  I looked through the docs but didn't see
>> anything.
>
> It should all be in the generator docs, see
> http://qooxdoo.org/documentation/0.8#tooling
>
>> The new "window.qxloader =" scheme is very different from how 0.7.x loaded
>> the JS files.
>>
>> I wonder if I could hack the window.qxloader.uris after a "source" build of
>> my app - like the following - (where qx-0.js is the entire Qooxdoo library)
>>
>> window.qxloader =
>> {
>> parts : {"myapp":[1],"qooxdoo":[0]},
>> uris : [
>> ["../script/qx-0.js"],
>>
>> ["../script/class/my/ui/View.js",../script/class/my/ui/Control.js",<REST_OF_MY_CLASSES>"]
>> ],
>> boot : "qooxdoo",
>> ...
>> }
>>
>> Do you think that will work?
>
> Do not bother to mess with the loader script! It's going to change,
> since the loading of a qooxdoo app is to be improved to the level of 0.7
> (i.e. a single JS file, not two) and beyond (e.g. providing useful
> "domready" event, etc.).

+1 for this. This is really needed for all low-level needs. Even more
important than these pre-build core feature talked above.

Sebastian

>
> Bye,
>
> Andreas
>  
>
>
>
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code to
> build responsive, highly engaging applications that combine the power of local
> resources and data with the reach of the web. Download the Adobe AIR SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to use Packages feature in 0.8 Build?

MShillinger
In reply to this post by Andreas Ecker



Andreas Ecker-2 wrote:

>
> Hi Mike!
>
>
> A while ago we talked about the same idea: during regular application
> development to use a qooxdoo library file ("build") while keeping all
> individual custom classes ("source"). This would help keeping browser
> reloads fast. Need to see if we missed to file a ticket for such a
> behavior, which I think could become even the default behavior for
> qooxdoo app development (i.e. the "source" generation). Thomas is sick
> and not at work, but I'll talk with him about this feature soon.
>
>
> Do not bother to mess with the loader script! It's going to change,
> since the loading of a qooxdoo app is to be improved to the level of 0.7
> (i.e. a single JS file, not two) and beyond (e.g. providing useful
> "domready" event, etc.).
>
> Bye,
>
> Andreas
>
>

Andreas,

Thanks for the quick reply.

Could you take a guess at the time frame?

If the time frame is several weeks it might be worth it to hack the loader
so we can move forward.  If it's a few days to a week on your end - I can
probably find other things to do.

I don't mind working off the SVN branch for now.

Also, I have some additional thoughts on the "loader", should I post to the
news group or contact you/Thomas off line?


Thanks again,

Mike

--
View this message in context: http://www.nabble.com/How-to-use-Packages--feature-in-0.8-Build--tp21939291p21977120.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to use Packages feature in 0.8 Build?

Andreas Ecker
Howdy!

> Thanks for the quick reply.
>
> Could you take a guess at the time frame?
>
> If the time frame is several weeks it might be worth it to hack the loader
> so we can move forward.  If it's a few days to a week on your end - I can
> probably find other things to do.

Consolidating the loading phase is a major topic of the 0.8.2 release
(due in early March). We're a bit late here, but we'll address it asap
once the relevant people are able to focus on it.

> I don't mind working off the SVN branch for now.
>
> Also, I have some additional thoughts on the "loader", should I post to the
> news group or contact you/Thomas off line?

Please see the several bugs that exist, e.g. the following one and its
depending/blocking bugs:
http://bugzilla.qooxdoo.org/show_bug.cgi?id=1177

Feel free to add your input to the bugs and/or send it to the mailing
list to enable everyone interested to collaborate.

Thanks,

Andreas



------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel