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 <hferreira...@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 <yishayj...@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<mailto:hferreira...@gmail.com>
>> Sent: Wednesday, February 2, 2022 1:00 PM
>> To: Apache Royale Development<mailto:dev@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 <yishayj...@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<mailto:harbs.li...@gmail.com>
>>> Sent: Wednesday, February 2, 2022 12:36 PM
>>> To: Apache Royale Development<mailto:dev@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 <hferreira...@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 <yishayj...@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<mailto:hferreira...@gmail.com>
>>>>> Sent: Wednesday, February 2, 2022 4:26 AM
>>>>> To: Apache Royale Development<mailto:dev@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.
>>>>> 
>>>>> 
>>> 
>>> 
>> 
>> 

Reply via email to