config.json for a custom skeleton

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

config.json for a custom skeleton

benco
Hi,

I'm having some problems dealing with a custom config.json.

I plan to use qx.core.Environment outside of a qooxdoo app and I was planning to create a custom Bootstrap that extend this class by removing the "qx.*" keys (except the mandatory ones qx.debug) just to have a really small final "build" file.

What I've done at the moment is simply create an alias Env=qx.core.Environment in a file that must be included with the build. It works but I'd like to figure out how to use the Boostrap declaration and how it works exactly. When I try to extend qx.core.Environment, the result is Env equals to a new qx Class but I've no direct access. How can I instanciate it directly ?

I tried to understand how the generation of qxWeb works and how to declare classes and bootstrap to make something similar but I'm not sure what to do exactly.

Could you help me please ?

Thanks in advance,

Benoît.
Reply | Threaded
Open this post in threaded view
|

Re: config.json for a custom skeleton

Thomas Herchenroeder

On 08/29/2013 10:28 AM, benco wrote:
> Hi,
>
> I'm having some problems dealing with a custom config.json.
>
> I plan to use qx.core.Environment outside of a qooxdoo app and I was
> planning to create a custom Bootstrap that extend this class by removing the
> "qx.*" keys (except the mandatory ones qx.debug) just to have a really small
> final "build" file.

It's unclear to me what you exactly want to achieve. Do you want a build
that includes the qx.core.Environment functionality? Use qx-oo.js
("qx.Server").

It's not possible to extend a static class so that won't work. But if
your concern is size, q.c.E is actually small, and the few, the
_checksMap would be superfluous, but the few pre-defined keys
"qx.allowUrlSettings", ... really don't add much.

What is your goal, size? functionality?

>
> What I've done at the moment is simply create an alias
> Env=qx.core.Environment in a file that must be included with the build. It
> works but I'd like to figure out how to use the Boostrap declaration and how
> it works exactly.
It's basically the same as qx.Class.define, with a few features stripped
(e.g. no interfaces or mixins).

Even if you wrote your own q.c.E replacement, you would need to change
all references to it in the framework.

>   When I try to extend qx.core.Environment, the result is
> Env equals to a new qx Class but I've no direct access. How can I
> instanciate it directly ?

I'm not getting it. q.c.E is a static class, so you can't instantiate
it. If you extend it the derived class will inherit nothing from it.

>
> I tried to understand how the generation of qxWeb works and how to declare
> classes and bootstrap to make something similar but I'm not sure what to do
> exactly.

qxWeb is just a special app build. If you look into
component/standalone/website/module.js you find job definitions together
with class patterns that should go into each build. You just take
classes (either qx.Class.define'd or qx.Boostrap.define'd, it doesn't
matter) in a compile job's "include" and let the Generator figure out
the dependencies and the ordering.

Does that help?
T.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: config.json for a custom skeleton

benco
Hi Thomas,

Thanks for your reply. I recognize the description of my problem is not very clear.

thron7-2 wrote
Use qx-oo.js ("qx.Server").
Actually I already achieved to package qx.core.Environment in the past but I was using the old (and now removed) "bom" skeleton (the final size was about 30Kb). As it doesn't exist anymore, I tried using the "native" one.

thron7-2 wrote
It's not possible to extend a static class so that won't work.
I am aware of that but I didn't know if a Bootstrap was mandatory or not... considering q = qxWeb uses it but should be qualified as a static one too in practice. Anyway, when I define a Bootstrap (and include it in the "job section" of my config.json), it is not instantiated what look logical but when I declare a new object of this class, it throws an error. And I don't understand how qxWeb can be autoinstantiated...

thron7-2 wrote
What is your goal, size? functionality?
Size and minimal functionality limited to q.c.E.

Best Regards,

Benoît.
Reply | Threaded
Open this post in threaded view
|

Re: config.json for a custom skeleton

Thomas Herchenroeder

On 08/30/2013 09:45 AM, benco wrote:

> Hi Thomas,
>
> Thanks for your reply. I recognize the description of my problem is not very
> clear.
>
>
> thron7-2 wrote
>> Use qx-oo.js ("qx.Server").
> Actually I already achieved to package qx.core.Environment in the past but I
> was using the old (and now removed) "bom" skeleton (the final size was about
> 30Kb). As it doesn't exist anymore, I tried using the "native" one.

Mh, so what exactly is keeping you from using qx.Server?

(The old 'bom' skeleton was also just another build, a bunch of classes
stuffed together in a .js file. Other skeletons don't support this as
they are about build apps, not just a single .js file).


>
>
> thron7-2 wrote
>> It's not possible to extend a static class so that won't work.
> I am aware of that but I didn't know if a Bootstrap was mandatory or not...

I'm not sure I understand what you mean with "Bootstrap". Do you mean
the class qx.Boostrap specifically, or just any class defined with
'qx.Boostrap.define'?

> considering q = qxWeb uses it but should be qualified as a static one too in
> practice. Anyway, when I define a Bootstrap (and include it in the "job
> section" of my config.json), it is not instantiated what look logical but
> when I declare a new object of this class, it throws an error.

But you are aware that static classes *are not to be instantiated*,
right?! That's the whole point of static classes. They are simply
containers for methods that you call directly on the class, not on any
instance.

>   And I don't
> understand how qxWeb can be autoinstantiated...

But it isn't. qxWeb is just a container for static methods, full stop.
Or do you mean the collections that are returned by those methods?


>
>
> thron7-2 wrote
>> What is your goal, size? functionality?
> Size and minimal functionality limited to q.c.E.

qx.Server is your friend. If you are desperate you can even sqeeze it
further, e.g. by turning off custom events and data binding.

T.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: config.json for a custom skeleton

benco
thron7-2 wrote
Mh, so what exactly is keeping you from using qx.Server?
Ok, I'll give a try to the Server one.

thron7-2 wrote
I'm not sure I understand what you mean with "Bootstrap". Do you mean
the class qx.Boostrap specifically, or just any class defined with
'qx.Boostrap.define'?
thron7-2 wrote
But you are aware that static classes *are not to be instantiated*,
right?! That's the whole point of static classes. They are simply
containers for methods that you call directly on the class, not on any
instance.
Actually I though "defining" (so calling indeed qx.Bootstrap.define) was mandatory to have access to the main object of my build (<a href="http:// https://github.com/qooxdoo/qooxdoo/blob/fe5157092a44290c3fb84d40198cb6f5ffe5f18b/framework/source/class/q.js">like in the code of "q")  

thron7-2 wrote
But it isn't. qxWeb is just a container for static methods, full stop.
Or do you mean the collections that are returned by those methods?
I didn't understand until I saw the "defer" declaration in qxWeb. Indeed, q extends qxWeb that extends qx.type.BaseArray that isn't a static class. So, even though qxWeb contains its own static methods, I though there should be a "new qxWeb()" declared somewhere. But finally thanks to the defer declaration, q points to the statics of qxWeb and so it can be then qualified as a simple container. The question is then why there is a qx.Bootstrap.define('q' ...) what brings me back to my second comment.
Reply | Threaded
Open this post in threaded view
|

Re: config.json for a custom skeleton

Daniel Wagner
Administrator
Hi,

the define methods (qx.Class, qx.Bootstrap, qx.Mixin, etc) are the hooks
that allow the generator to recognize a dependency object. That's the
why there is a separate 'q' class, otherwise qxWeb could just create the
global q alias in its defer block.

Regards,
Daniel

On 30.08.2013 14:28, benco wrote:

> thron7-2 wrote
>> Mh, so what exactly is keeping you from using qx.Server?
>
> Ok, I'll give a try to the Server one.
>
>
> thron7-2 wrote
>> I'm not sure I understand what you mean with "Bootstrap". Do you mean
>> the class qx.Boostrap specifically, or just any class defined with
>> 'qx.Boostrap.define'?
>
>
> thron7-2 wrote
>> But you are aware that static classes *are not to be instantiated*,
>> right?! That's the whole point of static classes. They are simply
>> containers for methods that you call directly on the class, not on any
>> instance.
>
> Actually I though "defining" (so calling indeed qx.Bootstrap.define) was
> mandatory to have access to the main object of my build ( like in the code
> of "q" <http://
> https://github.com/qooxdoo/qooxdoo/blob/fe5157092a44290c3fb84d40198cb6f5ffe5f18b/framework/source/class/q.js>
> )
>
>
> thron7-2 wrote
>> But it isn't. qxWeb is just a container for static methods, full stop.
>> Or do you mean the collections that are returned by those methods?
>
> I didn't understand until I saw the "defer" declaration in qxWeb. Indeed, q
> extends qxWeb that extends qx.type.BaseArray that isn't a static class. So,
> even though qxWeb contains its own static methods, I though there should be
> a "new qxWeb()" declared somewhere. But finally thanks to the defer
> declaration, q points to the statics of qxWeb and so it can be then
> qualified as a simple container. The question is then why there is a
> qx.Bootstrap.define('q' ...) what brings me back to my second comment.
>
>
>
> --
> View this message in context: http://qooxdoo.678.n2.nabble.com/config-json-for-a-custom-skeleton-tp7584497p7584513.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: config.json for a custom skeleton

benco
Daniel Wagner wrote
the define methods (qx.Class, qx.Bootstrap, qx.Mixin, etc) are the hooks
that allow the generator to recognize a dependency object.
Aaaah Ok, I get it now :-)

Thanks for your help !