Hi Defero,

there are two ways to solve your problem I guess:

1. At build time
If your "pages" are independent JS-Files after the build job, you are able to 
exclude classes.
Just define an environment key inside your config.json, e.g.

"environment" : {
  "pagetype" : " twoWidgets" // possible values: oneWidget, twoWidgets, 
allWidgets
}

Now this environment key will be provided to your application. You can now 
determine which classes should be used depending on that key, e.g.:

// inside your app class

if(qx.core.Environment.get("pagetype") == "oneWidget") {
  this.add(new A());
}

else if(qx.core.Environment.get("pagetype") == "twoWidgets") {
  this.add(new A());
  this.add(new B());
}

else if(qx.core.Environment.get("pagetype") == " allWidgets") {
  this.add(new A());
  this.add(new B());
  this.add(new C());
}


Now depending on value of "pagetype" the generator will remove all statements 
which are not necessary, e.g.:

In our example the value is "twoWidgets", so the generator will only leave 
following statements:
  this.add(new A());
  this.add(new B());

That means your generated code has excluded class C and all his dependencies.

See: 
http://manual.qooxdoo.org/devel/pages/tool/generator/generator_optimizations.html#variants


2. At run time

If you are just able to determine which classes you need in run time, use our 
part loading pattern. So you can define a set of classes and there dependencies 
into separate packages (js files). This code will be loaded asynchronous at 
that time you need it. 

See : http://manual.qooxdoo.org/devel/pages/development/parts_overview.html


By the way, sure you can out source your widgets to separate libraries, which 
are just another qx app and include them in to your main project, but the 
generator build handles their classes like the one inside the main project.

So my advice is to use libraries to be able to share your widgets with other 
projects and use one of above methods to decries your code size.

Gruß
Mustafa Sak

Applications & Integration

1&1 Internet AG
Ernst-Frey-Straße 10
DE-76135 Karlsruhe


-----Ursprüngliche Nachricht-----
Von: Defero [mailto:[email protected]] 
Gesendet: Donnerstag, 24. Oktober 2013 10:36
An: [email protected]
Betreff: [qooxdoo-devel] Build options

Hi again,

i'll just start with writing my problem.

At the moment i have one application with my "custom widgets" created inside. 
And since the project is set in such a way that only one or a few widget have 
to be used on one page, i'm wondering if it's possible to only give those files 
to the client and not everything.
Could this be solved with libraries?

Or an even better solution would be that i would have a qooxdoo library and 
load that to the client only once. Then all the my "widgets" just reference 
that library. Is this possible to create?

Hope you can help on this.

Enjoy,
Defero



--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Build-options-tp7584817.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register > 
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to