You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Hugo Ferreira <hf...@gmail.com> on 2022/02/02 02:26:37 UTC

Jquery

Hi,

I want to build a wrapper for a js library that requires JQuery.
How to add JQuery to Royale App before loading the external library ?

I already tried everything (loading dinamically on the wrapper) and also
try to put directly on the html template and I didn't be able to put JQuery
and this library working together.

Re: Jquery

Posted by Hugo Ferreira <hf...@gmail.com>.
I'm using ANT to build Apache Royale SDK.

I'm using VS Code to develop and build my projects (using the ActionScript
& MXML plugin of course).

Harbs <ha...@gmail.com> escreveu no dia quarta, 2/02/2022 à(s) 11:06:

> You need this in your external-library-path:
>
> ../js/libs/jquery.swc
>
> > On Feb 2, 2022, at 1:03 PM, Harbs <ha...@gmail.com> wrote:
> >
> > I’d be wary of *any* JQuery components, but you can definitely use them.
> >
> > What are you using to build your app? Maven?
> >
> >> On Feb 2, 2022, at 1:01 PM, Hugo Ferreira <hf...@gmail.com>
> wrote:
> >>
> >> I don't want to use the set of jQuery components.
> >> What I want is to add the jQuery.js library to use a externs lib toastr
> (
> >> https://github.com/CodeSeven/toastr) that requires jQuery.
> >> The $ is not a function is exactly the missing of jQuery.js library.
> >> I tried to add the library but I was not able to do until now.
> >>
> >> Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
> >> à(s) 10:45:
> >>
> >>> There’s an example in
> >>>
> >>> …\royale-asjs\examples\royale\RoyaleStore_jquery
> >>>
> >>> I just ran in and saw a runtime error [1], but maybe you can figure it
> out.
> >>>
> >>> [1] TypeError: $(...).button is not a function
> >>>
> >>> From: Harbs<ma...@gmail.com>
> >>> Sent: Wednesday, February 2, 2022 12:36 PM
> >>> To: Apache Royale Development<ma...@royale.apache.org>
> >>> Subject: Re: Jquery
> >>>
> >>> You just need to include the JQuery externs SWC and you can use JQuery
> >>> like you would in a normal web app.
> >>>
> >>> Check out manualtests/RoyaleTest_jquery.
> >>>
> >>> Just FYI: Beware or JQuery components. We found that JQuery components
> had
> >>> a very bad performance impact on our app. We had two JQuery components
> >>> which were responsible for most of the lag in our app. Getting rid of
> them
> >>> had an incredible effect on performance.
> >>>
> >>>> On Feb 2, 2022, at 11:52 AM, Hugo Ferreira <hf...@gmail.com>
> >>> wrote:
> >>>>
> >>>> I don't know what I should look at. I see a set of few components in a
> >>>> folder, a binary jquery a config file but I don't see any sample how
> to
> >>> use
> >>>> jquery in Royale or a custom jquery.
> >>>>
> >>>> Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta,
> 2/02/2022
> >>>> à(s) 07:47:
> >>>>
> >>>>> Have you looked at the jquery lib on royale-asjs ?
> >>>>>
> >>>>>
> >>>>> From: Hugo Ferreira<ma...@gmail.com>
> >>>>> Sent: Wednesday, February 2, 2022 4:26 AM
> >>>>> To: Apache Royale Development<ma...@royale.apache.org>
> >>>>> Subject: Jquery
> >>>>>
> >>>>> Hi,
> >>>>>
> >>>>> I want to build a wrapper for a js library that requires JQuery.
> >>>>> How to add JQuery to Royale App before loading the external library ?
> >>>>>
> >>>>> I already tried everything (loading dinamically on the wrapper) and
> also
> >>>>> try to put directly on the html template and I didn't be able to put
> >>> JQuery
> >>>>> and this library working together.
> >>>>>
> >>>>>
> >>>
> >>>
> >
>
>

Re: Jquery

Posted by Harbs <ha...@gmail.com>.
You need this in your external-library-path:

../js/libs/jquery.swc

> On Feb 2, 2022, at 1:03 PM, Harbs <ha...@gmail.com> wrote:
> 
> I’d be wary of *any* JQuery components, but you can definitely use them.
> 
> What are you using to build your app? Maven?
> 
>> On Feb 2, 2022, at 1:01 PM, Hugo Ferreira <hf...@gmail.com> wrote:
>> 
>> I don't want to use the set of jQuery components.
>> What I want is to add the jQuery.js library to use a externs lib toastr (
>> https://github.com/CodeSeven/toastr) that requires jQuery.
>> The $ is not a function is exactly the missing of jQuery.js library.
>> I tried to add the library but I was not able to do until now.
>> 
>> Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
>> à(s) 10:45:
>> 
>>> There’s an example in
>>> 
>>> …\royale-asjs\examples\royale\RoyaleStore_jquery
>>> 
>>> I just ran in and saw a runtime error [1], but maybe you can figure it out.
>>> 
>>> [1] TypeError: $(...).button is not a function
>>> 
>>> From: Harbs<ma...@gmail.com>
>>> Sent: Wednesday, February 2, 2022 12:36 PM
>>> To: Apache Royale Development<ma...@royale.apache.org>
>>> Subject: Re: Jquery
>>> 
>>> You just need to include the JQuery externs SWC and you can use JQuery
>>> like you would in a normal web app.
>>> 
>>> Check out manualtests/RoyaleTest_jquery.
>>> 
>>> Just FYI: Beware or JQuery components. We found that JQuery components had
>>> a very bad performance impact on our app. We had two JQuery components
>>> which were responsible for most of the lag in our app. Getting rid of them
>>> had an incredible effect on performance.
>>> 
>>>> On Feb 2, 2022, at 11:52 AM, Hugo Ferreira <hf...@gmail.com>
>>> wrote:
>>>> 
>>>> I don't know what I should look at. I see a set of few components in a
>>>> folder, a binary jquery a config file but I don't see any sample how to
>>> use
>>>> jquery in Royale or a custom jquery.
>>>> 
>>>> Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
>>>> à(s) 07:47:
>>>> 
>>>>> Have you looked at the jquery lib on royale-asjs ?
>>>>> 
>>>>> 
>>>>> From: Hugo Ferreira<ma...@gmail.com>
>>>>> Sent: Wednesday, February 2, 2022 4:26 AM
>>>>> To: Apache Royale Development<ma...@royale.apache.org>
>>>>> Subject: Jquery
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> I want to build a wrapper for a js library that requires JQuery.
>>>>> How to add JQuery to Royale App before loading the external library ?
>>>>> 
>>>>> I already tried everything (loading dinamically on the wrapper) and also
>>>>> try to put directly on the html template and I didn't be able to put
>>> JQuery
>>>>> and this library working together.
>>>>> 
>>>>> 
>>> 
>>> 
> 


Re: Jquery

Posted by Harbs <ha...@gmail.com>.
I’d be wary of *any* JQuery components, but you can definitely use them.

What are you using to build your app? Maven?

> On Feb 2, 2022, at 1:01 PM, Hugo Ferreira <hf...@gmail.com> wrote:
> 
> I don't want to use the set of jQuery components.
> What I want is to add the jQuery.js library to use a externs lib toastr (
> https://github.com/CodeSeven/toastr) that requires jQuery.
> The $ is not a function is exactly the missing of jQuery.js library.
> I tried to add the library but I was not able to do until now.
> 
> Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
> à(s) 10:45:
> 
>> There’s an example in
>> 
>> …\royale-asjs\examples\royale\RoyaleStore_jquery
>> 
>> I just ran in and saw a runtime error [1], but maybe you can figure it out.
>> 
>> [1] TypeError: $(...).button is not a function
>> 
>> From: Harbs<ma...@gmail.com>
>> Sent: Wednesday, February 2, 2022 12:36 PM
>> To: Apache Royale Development<ma...@royale.apache.org>
>> Subject: Re: Jquery
>> 
>> You just need to include the JQuery externs SWC and you can use JQuery
>> like you would in a normal web app.
>> 
>> Check out manualtests/RoyaleTest_jquery.
>> 
>> Just FYI: Beware or JQuery components. We found that JQuery components had
>> a very bad performance impact on our app. We had two JQuery components
>> which were responsible for most of the lag in our app. Getting rid of them
>> had an incredible effect on performance.
>> 
>>> On Feb 2, 2022, at 11:52 AM, Hugo Ferreira <hf...@gmail.com>
>> wrote:
>>> 
>>> I don't know what I should look at. I see a set of few components in a
>>> folder, a binary jquery a config file but I don't see any sample how to
>> use
>>> jquery in Royale or a custom jquery.
>>> 
>>> Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
>>> à(s) 07:47:
>>> 
>>>> Have you looked at the jquery lib on royale-asjs ?
>>>> 
>>>> 
>>>> From: Hugo Ferreira<ma...@gmail.com>
>>>> Sent: Wednesday, February 2, 2022 4:26 AM
>>>> To: Apache Royale Development<ma...@royale.apache.org>
>>>> Subject: Jquery
>>>> 
>>>> Hi,
>>>> 
>>>> I want to build a wrapper for a js library that requires JQuery.
>>>> How to add JQuery to Royale App before loading the external library ?
>>>> 
>>>> I already tried everything (loading dinamically on the wrapper) and also
>>>> try to put directly on the html template and I didn't be able to put
>> JQuery
>>>> and this library working together.
>>>> 
>>>> 
>> 
>> 


Re: Jquery

Posted by Hugo Ferreira <hf...@gmail.com>.
I found the source of the jQuery issue.

The library toastr that I have download yesterday was not correct.
I have now the correct version and is working.

1. I reference jQuery on the html template instead of the wrapper to avoid
loading jQuery multiple times (if I need latter on another library).
2. I load the toastr library on the wrapper as usual and it's working now.

Sorry for the trouble.

Anyway, there's something that is now on back of my mind, about what Hards
said.

I understand that jQuery will not the best approach for components and I
will avoid them as much as I can, however on this cas it's a toast that
have built-in features that I appreciate a lot.
Since it's a toast that run on demand as a parellel process and not
something that is loaded of the div like a button, I believe that there is
not problems about performance.


Harbs <ha...@gmail.com> escreveu no dia quarta, 2/02/2022 à(s) 11:59:

> You can reference the extern libs directly, but I’m lazy and I usually
> just copy the ones I need to a typedefs folder and I include the following:
>
>         "js-external-library-path": [
>             "typedefs"
>         ],
>
>
> So, in the case of jquery, I’d just copy the swc from
> [framework]/js/libs/jquery.swc to the typedefs folder.
>
> You can also use the ${royalelb} token mentioned here
> https://github.com/BowlerHatLLC/vscode-as3mxml/wiki/asconfig.json#external-library-path
>
> If you go that way, you’d need something like:
>
> "js-external-library-path": [
>      "${royalelib}/..//js/libs/jquery.swc"
> ],
>
> But, like I said, I find copying the necessary ones as needed is simpler.
>
> In the case of JQuery, make sure you include the jquery js in your html
> template, so it’s available at runtime.
>
> HTH,
> Harbs
>
> > On Feb 2, 2022, at 1:11 PM, Hugo Ferreira <hf...@gmail.com>
> wrote:
> >
> > Perhaps what Harbs said:
> >
> > "You need this in your external-library-path:
> >
> > ../js/libs/jquery.swc"
> >
> > Is the solution and will inject the jQuery.js dependency.
> >
> > Where I set this on a VS Code type project ?
> >
> > Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
> > à(s) 11:09:
> >
> >> If you debug you’ll see $ is a function, but not $(…).button. So I think
> >> the lib is there.
> >>
> >> From: Hugo Ferreira<ma...@gmail.com>
> >> Sent: Wednesday, February 2, 2022 1:00 PM
> >> To: Apache Royale Development<ma...@royale.apache.org>
> >> Subject: Re: Jquery
> >>
> >> I don't want to use the set of jQuery components.
> >> What I want is to add the jQuery.js library to use a externs lib toastr
> (
> >> https://github.com/CodeSeven/toastr) that requires jQuery.
> >> The $ is not a function is exactly the missing of jQuery.js library.
> >> I tried to add the library but I was not able to do until now.
> >>
> >> Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
> >> à(s) 10:45:
> >>
> >>> There’s an example in
> >>>
> >>> …\royale-asjs\examples\royale\RoyaleStore_jquery
> >>>
> >>> I just ran in and saw a runtime error [1], but maybe you can figure it
> >> out.
> >>>
> >>> [1] TypeError: $(...).button is not a function
> >>>
> >>> From: Harbs<ma...@gmail.com>
> >>> Sent: Wednesday, February 2, 2022 12:36 PM
> >>> To: Apache Royale Development<ma...@royale.apache.org>
> >>> Subject: Re: Jquery
> >>>
> >>> You just need to include the JQuery externs SWC and you can use JQuery
> >>> like you would in a normal web app.
> >>>
> >>> Check out manualtests/RoyaleTest_jquery.
> >>>
> >>> Just FYI: Beware or JQuery components. We found that JQuery components
> >> had
> >>> a very bad performance impact on our app. We had two JQuery components
> >>> which were responsible for most of the lag in our app. Getting rid of
> >> them
> >>> had an incredible effect on performance.
> >>>
> >>>> On Feb 2, 2022, at 11:52 AM, Hugo Ferreira <hf...@gmail.com>
> >>> wrote:
> >>>>
> >>>> I don't know what I should look at. I see a set of few components in a
> >>>> folder, a binary jquery a config file but I don't see any sample how
> to
> >>> use
> >>>> jquery in Royale or a custom jquery.
> >>>>
> >>>> Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta,
> >> 2/02/2022
> >>>> à(s) 07:47:
> >>>>
> >>>>> Have you looked at the jquery lib on royale-asjs ?
> >>>>>
> >>>>>
> >>>>> From: Hugo Ferreira<ma...@gmail.com>
> >>>>> Sent: Wednesday, February 2, 2022 4:26 AM
> >>>>> To: Apache Royale Development<ma...@royale.apache.org>
> >>>>> Subject: Jquery
> >>>>>
> >>>>> Hi,
> >>>>>
> >>>>> I want to build a wrapper for a js library that requires JQuery.
> >>>>> How to add JQuery to Royale App before loading the external library ?
> >>>>>
> >>>>> I already tried everything (loading dinamically on the wrapper) and
> >> also
> >>>>> try to put directly on the html template and I didn't be able to put
> >>> JQuery
> >>>>> and this library working together.
> >>>>>
> >>>>>
> >>>
> >>>
> >>
> >>
>
>

Re: Jquery

Posted by Harbs <ha...@gmail.com>.
You can reference the extern libs directly, but I’m lazy and I usually just copy the ones I need to a typedefs folder and I include the following:

        "js-external-library-path": [
            "typedefs"
        ],


So, in the case of jquery, I’d just copy the swc from [framework]/js/libs/jquery.swc to the typedefs folder.

You can also use the ${royalelb} token mentioned here https://github.com/BowlerHatLLC/vscode-as3mxml/wiki/asconfig.json#external-library-path

If you go that way, you’d need something like:

"js-external-library-path": [
     "${royalelib}/..//js/libs/jquery.swc"
],

But, like I said, I find copying the necessary ones as needed is simpler.

In the case of JQuery, make sure you include the jquery js in your html template, so it’s available at runtime.

HTH,
Harbs

> On Feb 2, 2022, at 1:11 PM, Hugo Ferreira <hf...@gmail.com> wrote:
> 
> Perhaps what Harbs said:
> 
> "You need this in your external-library-path:
> 
> ../js/libs/jquery.swc"
> 
> Is the solution and will inject the jQuery.js dependency.
> 
> Where I set this on a VS Code type project ?
> 
> Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
> à(s) 11:09:
> 
>> If you debug you’ll see $ is a function, but not $(…).button. So I think
>> the lib is there.
>> 
>> From: Hugo Ferreira<ma...@gmail.com>
>> Sent: Wednesday, February 2, 2022 1:00 PM
>> To: Apache Royale Development<ma...@royale.apache.org>
>> Subject: Re: Jquery
>> 
>> I don't want to use the set of jQuery components.
>> What I want is to add the jQuery.js library to use a externs lib toastr (
>> https://github.com/CodeSeven/toastr) that requires jQuery.
>> The $ is not a function is exactly the missing of jQuery.js library.
>> I tried to add the library but I was not able to do until now.
>> 
>> Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
>> à(s) 10:45:
>> 
>>> There’s an example in
>>> 
>>> …\royale-asjs\examples\royale\RoyaleStore_jquery
>>> 
>>> I just ran in and saw a runtime error [1], but maybe you can figure it
>> out.
>>> 
>>> [1] TypeError: $(...).button is not a function
>>> 
>>> From: Harbs<ma...@gmail.com>
>>> Sent: Wednesday, February 2, 2022 12:36 PM
>>> To: Apache Royale Development<ma...@royale.apache.org>
>>> Subject: Re: Jquery
>>> 
>>> You just need to include the JQuery externs SWC and you can use JQuery
>>> like you would in a normal web app.
>>> 
>>> Check out manualtests/RoyaleTest_jquery.
>>> 
>>> Just FYI: Beware or JQuery components. We found that JQuery components
>> had
>>> a very bad performance impact on our app. We had two JQuery components
>>> which were responsible for most of the lag in our app. Getting rid of
>> them
>>> had an incredible effect on performance.
>>> 
>>>> On Feb 2, 2022, at 11:52 AM, Hugo Ferreira <hf...@gmail.com>
>>> wrote:
>>>> 
>>>> I don't know what I should look at. I see a set of few components in a
>>>> folder, a binary jquery a config file but I don't see any sample how to
>>> use
>>>> jquery in Royale or a custom jquery.
>>>> 
>>>> Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta,
>> 2/02/2022
>>>> à(s) 07:47:
>>>> 
>>>>> Have you looked at the jquery lib on royale-asjs ?
>>>>> 
>>>>> 
>>>>> From: Hugo Ferreira<ma...@gmail.com>
>>>>> Sent: Wednesday, February 2, 2022 4:26 AM
>>>>> To: Apache Royale Development<ma...@royale.apache.org>
>>>>> Subject: Jquery
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> I want to build a wrapper for a js library that requires JQuery.
>>>>> How to add JQuery to Royale App before loading the external library ?
>>>>> 
>>>>> I already tried everything (loading dinamically on the wrapper) and
>> also
>>>>> try to put directly on the html template and I didn't be able to put
>>> JQuery
>>>>> and this library working together.
>>>>> 
>>>>> 
>>> 
>>> 
>> 
>> 


Re: Jquery

Posted by Hugo Ferreira <hf...@gmail.com>.
Perhaps what Harbs said:

"You need this in your external-library-path:

../js/libs/jquery.swc"

Is the solution and will inject the jQuery.js dependency.

Where I set this on a VS Code type project ?

Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
à(s) 11:09:

> If you debug you’ll see $ is a function, but not $(…).button. So I think
> the lib is there.
>
> From: Hugo Ferreira<ma...@gmail.com>
> Sent: Wednesday, February 2, 2022 1:00 PM
> To: Apache Royale Development<ma...@royale.apache.org>
> Subject: Re: Jquery
>
> I don't want to use the set of jQuery components.
> What I want is to add the jQuery.js library to use a externs lib toastr (
> https://github.com/CodeSeven/toastr) that requires jQuery.
> The $ is not a function is exactly the missing of jQuery.js library.
> I tried to add the library but I was not able to do until now.
>
> Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
> à(s) 10:45:
>
> > There’s an example in
> >
> > …\royale-asjs\examples\royale\RoyaleStore_jquery
> >
> > I just ran in and saw a runtime error [1], but maybe you can figure it
> out.
> >
> > [1] TypeError: $(...).button is not a function
> >
> > From: Harbs<ma...@gmail.com>
> > Sent: Wednesday, February 2, 2022 12:36 PM
> > To: Apache Royale Development<ma...@royale.apache.org>
> > Subject: Re: Jquery
> >
> > You just need to include the JQuery externs SWC and you can use JQuery
> > like you would in a normal web app.
> >
> > Check out manualtests/RoyaleTest_jquery.
> >
> > Just FYI: Beware or JQuery components. We found that JQuery components
> had
> > a very bad performance impact on our app. We had two JQuery components
> > which were responsible for most of the lag in our app. Getting rid of
> them
> > had an incredible effect on performance.
> >
> > > On Feb 2, 2022, at 11:52 AM, Hugo Ferreira <hf...@gmail.com>
> > wrote:
> > >
> > > I don't know what I should look at. I see a set of few components in a
> > > folder, a binary jquery a config file but I don't see any sample how to
> > use
> > > jquery in Royale or a custom jquery.
> > >
> > > Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta,
> 2/02/2022
> > > à(s) 07:47:
> > >
> > >> Have you looked at the jquery lib on royale-asjs ?
> > >>
> > >>
> > >> From: Hugo Ferreira<ma...@gmail.com>
> > >> Sent: Wednesday, February 2, 2022 4:26 AM
> > >> To: Apache Royale Development<ma...@royale.apache.org>
> > >> Subject: Jquery
> > >>
> > >> Hi,
> > >>
> > >> I want to build a wrapper for a js library that requires JQuery.
> > >> How to add JQuery to Royale App before loading the external library ?
> > >>
> > >> I already tried everything (loading dinamically on the wrapper) and
> also
> > >> try to put directly on the html template and I didn't be able to put
> > JQuery
> > >> and this library working together.
> > >>
> > >>
> >
> >
>
>

RE: Jquery

Posted by Yishay Weiss <yi...@hotmail.com>.
If you debug you’ll see $ is a function, but not $(…).button. So I think the lib is there.

From: Hugo Ferreira<ma...@gmail.com>
Sent: Wednesday, February 2, 2022 1:00 PM
To: Apache Royale Development<ma...@royale.apache.org>
Subject: Re: Jquery

I don't want to use the set of jQuery components.
What I want is to add the jQuery.js library to use a externs lib toastr (
https://github.com/CodeSeven/toastr) that requires jQuery.
The $ is not a function is exactly the missing of jQuery.js library.
I tried to add the library but I was not able to do until now.

Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
à(s) 10:45:

> There’s an example in
>
> …\royale-asjs\examples\royale\RoyaleStore_jquery
>
> I just ran in and saw a runtime error [1], but maybe you can figure it out.
>
> [1] TypeError: $(...).button is not a function
>
> From: Harbs<ma...@gmail.com>
> Sent: Wednesday, February 2, 2022 12:36 PM
> To: Apache Royale Development<ma...@royale.apache.org>
> Subject: Re: Jquery
>
> You just need to include the JQuery externs SWC and you can use JQuery
> like you would in a normal web app.
>
> Check out manualtests/RoyaleTest_jquery.
>
> Just FYI: Beware or JQuery components. We found that JQuery components had
> a very bad performance impact on our app. We had two JQuery components
> which were responsible for most of the lag in our app. Getting rid of them
> had an incredible effect on performance.
>
> > On Feb 2, 2022, at 11:52 AM, Hugo Ferreira <hf...@gmail.com>
> wrote:
> >
> > I don't know what I should look at. I see a set of few components in a
> > folder, a binary jquery a config file but I don't see any sample how to
> use
> > jquery in Royale or a custom jquery.
> >
> > Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
> > à(s) 07:47:
> >
> >> Have you looked at the jquery lib on royale-asjs ?
> >>
> >>
> >> From: Hugo Ferreira<ma...@gmail.com>
> >> Sent: Wednesday, February 2, 2022 4:26 AM
> >> To: Apache Royale Development<ma...@royale.apache.org>
> >> Subject: Jquery
> >>
> >> Hi,
> >>
> >> I want to build a wrapper for a js library that requires JQuery.
> >> How to add JQuery to Royale App before loading the external library ?
> >>
> >> I already tried everything (loading dinamically on the wrapper) and also
> >> try to put directly on the html template and I didn't be able to put
> JQuery
> >> and this library working together.
> >>
> >>
>
>


Re: Jquery

Posted by Hugo Ferreira <hf...@gmail.com>.
I don't want to use the set of jQuery components.
What I want is to add the jQuery.js library to use a externs lib toastr (
https://github.com/CodeSeven/toastr) that requires jQuery.
The $ is not a function is exactly the missing of jQuery.js library.
I tried to add the library but I was not able to do until now.

Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
à(s) 10:45:

> There’s an example in
>
> …\royale-asjs\examples\royale\RoyaleStore_jquery
>
> I just ran in and saw a runtime error [1], but maybe you can figure it out.
>
> [1] TypeError: $(...).button is not a function
>
> From: Harbs<ma...@gmail.com>
> Sent: Wednesday, February 2, 2022 12:36 PM
> To: Apache Royale Development<ma...@royale.apache.org>
> Subject: Re: Jquery
>
> You just need to include the JQuery externs SWC and you can use JQuery
> like you would in a normal web app.
>
> Check out manualtests/RoyaleTest_jquery.
>
> Just FYI: Beware or JQuery components. We found that JQuery components had
> a very bad performance impact on our app. We had two JQuery components
> which were responsible for most of the lag in our app. Getting rid of them
> had an incredible effect on performance.
>
> > On Feb 2, 2022, at 11:52 AM, Hugo Ferreira <hf...@gmail.com>
> wrote:
> >
> > I don't know what I should look at. I see a set of few components in a
> > folder, a binary jquery a config file but I don't see any sample how to
> use
> > jquery in Royale or a custom jquery.
> >
> > Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
> > à(s) 07:47:
> >
> >> Have you looked at the jquery lib on royale-asjs ?
> >>
> >>
> >> From: Hugo Ferreira<ma...@gmail.com>
> >> Sent: Wednesday, February 2, 2022 4:26 AM
> >> To: Apache Royale Development<ma...@royale.apache.org>
> >> Subject: Jquery
> >>
> >> Hi,
> >>
> >> I want to build a wrapper for a js library that requires JQuery.
> >> How to add JQuery to Royale App before loading the external library ?
> >>
> >> I already tried everything (loading dinamically on the wrapper) and also
> >> try to put directly on the html template and I didn't be able to put
> JQuery
> >> and this library working together.
> >>
> >>
>
>

RE: Jquery

Posted by Yishay Weiss <yi...@hotmail.com>.
There’s an example in

…\royale-asjs\examples\royale\RoyaleStore_jquery

I just ran in and saw a runtime error [1], but maybe you can figure it out.

[1] TypeError: $(...).button is not a function

From: Harbs<ma...@gmail.com>
Sent: Wednesday, February 2, 2022 12:36 PM
To: Apache Royale Development<ma...@royale.apache.org>
Subject: Re: Jquery

You just need to include the JQuery externs SWC and you can use JQuery like you would in a normal web app.

Check out manualtests/RoyaleTest_jquery.

Just FYI: Beware or JQuery components. We found that JQuery components had a very bad performance impact on our app. We had two JQuery components which were responsible for most of the lag in our app. Getting rid of them had an incredible effect on performance.

> On Feb 2, 2022, at 11:52 AM, Hugo Ferreira <hf...@gmail.com> wrote:
>
> I don't know what I should look at. I see a set of few components in a
> folder, a binary jquery a config file but I don't see any sample how to use
> jquery in Royale or a custom jquery.
>
> Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
> à(s) 07:47:
>
>> Have you looked at the jquery lib on royale-asjs ?
>>
>>
>> From: Hugo Ferreira<ma...@gmail.com>
>> Sent: Wednesday, February 2, 2022 4:26 AM
>> To: Apache Royale Development<ma...@royale.apache.org>
>> Subject: Jquery
>>
>> Hi,
>>
>> I want to build a wrapper for a js library that requires JQuery.
>> How to add JQuery to Royale App before loading the external library ?
>>
>> I already tried everything (loading dinamically on the wrapper) and also
>> try to put directly on the html template and I didn't be able to put JQuery
>> and this library working together.
>>
>>


Re: Jquery

Posted by Harbs <ha...@gmail.com>.
You just need to include the JQuery externs SWC and you can use JQuery like you would in a normal web app.

Check out manualtests/RoyaleTest_jquery.

Just FYI: Beware or JQuery components. We found that JQuery components had a very bad performance impact on our app. We had two JQuery components which were responsible for most of the lag in our app. Getting rid of them had an incredible effect on performance.

> On Feb 2, 2022, at 11:52 AM, Hugo Ferreira <hf...@gmail.com> wrote:
> 
> I don't know what I should look at. I see a set of few components in a
> folder, a binary jquery a config file but I don't see any sample how to use
> jquery in Royale or a custom jquery.
> 
> Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
> à(s) 07:47:
> 
>> Have you looked at the jquery lib on royale-asjs ?
>> 
>> 
>> From: Hugo Ferreira<ma...@gmail.com>
>> Sent: Wednesday, February 2, 2022 4:26 AM
>> To: Apache Royale Development<ma...@royale.apache.org>
>> Subject: Jquery
>> 
>> Hi,
>> 
>> I want to build a wrapper for a js library that requires JQuery.
>> How to add JQuery to Royale App before loading the external library ?
>> 
>> I already tried everything (loading dinamically on the wrapper) and also
>> try to put directly on the html template and I didn't be able to put JQuery
>> and this library working together.
>> 
>> 


Re: Jquery

Posted by Hugo Ferreira <hf...@gmail.com>.
I don't know what I should look at. I see a set of few components in a
folder, a binary jquery a config file but I don't see any sample how to use
jquery in Royale or a custom jquery.

Yishay Weiss <yi...@hotmail.com> escreveu no dia quarta, 2/02/2022
à(s) 07:47:

> Have you looked at the jquery lib on royale-asjs ?
>
>
> From: Hugo Ferreira<ma...@gmail.com>
> Sent: Wednesday, February 2, 2022 4:26 AM
> To: Apache Royale Development<ma...@royale.apache.org>
> Subject: Jquery
>
> Hi,
>
> I want to build a wrapper for a js library that requires JQuery.
> How to add JQuery to Royale App before loading the external library ?
>
> I already tried everything (loading dinamically on the wrapper) and also
> try to put directly on the html template and I didn't be able to put JQuery
> and this library working together.
>
>

RE: Jquery

Posted by Yishay Weiss <yi...@hotmail.com>.
Have you looked at the jquery lib on royale-asjs ?


From: Hugo Ferreira<ma...@gmail.com>
Sent: Wednesday, February 2, 2022 4:26 AM
To: Apache Royale Development<ma...@royale.apache.org>
Subject: Jquery

Hi,

I want to build a wrapper for a js library that requires JQuery.
How to add JQuery to Royale App before loading the external library ?

I already tried everything (loading dinamically on the wrapper) and also
try to put directly on the html template and I didn't be able to put JQuery
and this library working together.