Quantcast

Re: Using external libraries via a Qooxdoo library in your app

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using external libraries via a Qooxdoo library in your app

oetiker
Hi Sanne,

one aproach is to write a a tiny qooxdoo class and append the
actuall javascript file you want to include to the same file.

look at https://github.com/oetiker/QxD3 for inspiration.

cheers
tobi

Today Sanne Peters wrote:

> Hi,
>
> Is somehow possible to specify dependencies to thrid party javascript
> lbriaries for a class in a a qooxdoo library?
> I am looking for a clean solution, with which I can easily upgrade the third
> party libraries in my qooxdoo library.
>
> with kind regards,
>
> Sanne Peters
> *Interaction Design*
>
> Realtime Solutions B.V.
> Torenallee 20
> 5617 BC Eindhoven
>
> *Tel:* 040 4022 726 | *E-mail:* [hidden email]
> <mailto:[hidden email]> | *Website:*
> http://www.realtimesolutions.nl
>
>

--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
www.oetiker.ch [hidden email] +41 62 775 9902


------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using external libraries via a Qooxdoo library in your app

John Spackman-3
Hi Sanne

There is a generator config key “add-script” which can be used to inject dependencies into the build – I’ve not used it myself but you can find the docs here: http://manual.qooxdoo.org/current/pages/tool/generator/generator_config_ref.html

Regards
John

From: Sanne Peters <[hidden email]>
Reply-To: qooxdoo Development <[hidden email]>
Date: Wednesday, 11 November 2015 at 07:52
To: qooxdoo Development <[hidden email]>
Subject: Re: [qooxdoo-devel] Using external libraries via a Qooxdoo library in your app

Hi,

I actually considered your approach in https://github.com/oetiker/QxD3/blob/master/source/class/qxd3/Svg.js ,but that is the thing that I wanted to prevent, because I would like to easily upgrade the third party library with npm (package.json) or something along those lines.

kind regards,
On 10/11/15 14:10, Tobias Oetiker wrote:
Hi Sanne,

one aproach is to write a a tiny qooxdoo class and append the
actuall javascript file you want to include to the same file.

look at https://github.com/oetiker/QxD3 for inspiration.

cheers
tobi

Today Sanne Peters wrote:

Hi,

Is somehow possible to specify dependencies to thrid party javascript
lbriaries for a class in a a qooxdoo library?
I am looking for a clean solution, with which I can easily upgrade the third
party libraries in my qooxdoo library.

with kind regards,

Sanne Peters
*Interaction Design*

Realtime Solutions B.V.
Torenallee 20
5617 BC Eindhoven

*Tel:* 040 4022 726 | *E-mail:* [hidden email][hidden email] | *Website:*
http://www.realtimesolutions.nl

    

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

------------------------------------------------------------------------------

_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using external libraries via a Qooxdoo library in your app

Phyo Arkar
Here is what we did:

 "add-script": [{
               "uri": "resource/${APPLICATION}/js/markdown-it.js"
           }, {
               "uri": "resource/${APPLICATION}/js/moment.js"
           }, {
               "uri": "resource/${APPLICATION}/js/markdown-it-emoji.min.js"
...

If you want it to be easy to upgrade , do a bower install , link js files inside bower folder to there.

On Wed, Nov 11, 2015 at 3:41 PM, John Spackman <[hidden email]> wrote:
Hi Sanne

There is a generator config key “add-script” which can be used to inject dependencies into the build – I’ve not used it myself but you can find the docs here: http://manual.qooxdoo.org/current/pages/tool/generator/generator_config_ref.html

Regards
John

From: Sanne Peters <[hidden email]>
Reply-To: qooxdoo Development <[hidden email]>
Date: Wednesday, 11 November 2015 at 07:52
To: qooxdoo Development <[hidden email]>
Subject: Re: [qooxdoo-devel] Using external libraries via a Qooxdoo library in your app

Hi,

I actually considered your approach in https://github.com/oetiker/QxD3/blob/master/source/class/qxd3/Svg.js ,but that is the thing that I wanted to prevent, because I would like to easily upgrade the third party library with npm (package.json) or something along those lines.

kind regards,


Sanne Peters
Interaction Design

Realtime Solutions B.V.
Torenallee 20
5617 BC Eindhoven

Tel: 040 4022 726 | E-mail: [hidden email][hidden email] | Website: http://www.realtimesolutions.nl

On 10/11/15 14:10, Tobias Oetiker wrote:
Hi Sanne,

one aproach is to write a a tiny qooxdoo class and append the
actuall javascript file you want to include to the same file.

look at https://github.com/oetiker/QxD3 for inspiration.

cheers
tobi

Today Sanne Peters wrote:

Hi,

Is somehow possible to specify dependencies to thrid party javascript
lbriaries for a class in a a qooxdoo library?
I am looking for a clean solution, with which I can easily upgrade the third
party libraries in my qooxdoo library.

with kind regards,

Sanne Peters
*Interaction Design*

Realtime Solutions B.V.
Torenallee 20
5617 BC Eindhoven

*Tel:* 040 4022 726 | *E-mail:* [hidden email][hidden email] | *Website:*
http://www.realtimesolutions.nl

    

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

------------------------------------------------------------------------------

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



------------------------------------------------------------------------------

_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using external libraries via a Qooxdoo library in your app

Dietrich Streifert
In reply to this post by oetiker
Hi Sanne,

I'm using the following methodology (example code, stripped down from the production file, untested):

    https://gist.github.com/level420/ea03a94115087b3c7834

But I have to admit, that this is is not based on my idea/code. In hurry of daily work the original writer got lost, so I can't give the reference and kudos back to him. I'm sorry :-(

Back to the idea, which I'm using in the end to dynamically load highcharts (along with jquery) and ckeditor. It implements a lazy loading mechanism.

It assumes that the jquery and jquery-ui files are located in resource/myapp/jquery both in a minified and non minified version, which is identified by the .min.js vs the .js file extension. The non minified version is loaded if qx.debug is set which is by default true if you are running the source version of your app.

Scripts are loaded on first instantiation of the class. All subsequent instantiations "know" that the scripts are already loaded by checking the class attribute LOADED. After the script loading finished or the scripts are already loaded, the instance method __scriptLoadedHandler is called.

If you just want to load scripts and don't need a created dom element, you have to derive from qx.core.Object and instantiate by e.g. turning the class into a singleton and calling getInstance().

I hope this will give you an idea on how to solve your problem.

Regards
Dietrich


Am 11.11.2015 um 08:52 schrieb Sanne Peters:
Hi,

I actually considered your approach in https://github.com/oetiker/QxD3/blob/master/source/class/qxd3/Svg.js ,but that is the thing that I wanted to prevent, because I would like to easily upgrade the third party library with npm (package.json) or something along those lines.

kind regards,
On 10/11/15 14:10, Tobias Oetiker wrote:



------------------------------------------------------------------------------

_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using external libraries via a Qooxdoo library in your app

Dietrich Streifert
In reply to this post by oetiker
Yes we can! :-)

We have this in production now for two years without any problems so far.

Please note, that just having the @asset hint defined does not load anything. It just makes the qx.util.ResourceManager "aware" of the file paths and makes certain that those files are copied over to the resource folders of the build version.

Am 11.11.2015 um 11:21 schrieb Sanne Peters:
Hi Dietrich,

I was wondering if I could use the resource folder and load the file via the @asset compiler hint. Apparently you can. This might be a decent solution and discuss it with the rest of my team.
On 11/11/15 10:45, Dietrich Streifert wrote:



------------------------------------------------------------------------------

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