Where to add reference to 3rd Party JS Libraries?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Where to add reference to 3rd Party JS Libraries?

Darius Clarke
Hi, 

So loading the libraries amber needs from the 'support' folder is now done in the amber.js. 

How do I add the reference to load the 3rd party library my application needs? Should that go in the html page, or somewhere in my application's package?

Cheers,
Darius

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Where to add reference to 3rd Party JS Libraries?

Herby Vojčík


Darius Clarke wrote:
> Hi,
>
> So loading the libraries amber needs from the 'support' folder is now
> done in the amber.js.

No, amber.js does nothing except configuring require.js.
The single require call in inline <script> does all the loading.

> How do I add the reference to load the 3rd party library my
> application needs? Should that go in the html page, or somewhere in my
> application's package?

In HTML as <script src> if it is non-AMD 3rd party library.
In HTML in require call in the list of dependencies, if it is AMD 3rd
party library; configuring paths as needed in directly preceding
require.config call.
(the previous case includes amber libraries as well, as shown in "How to
load amber" wiki page, since amber packages are also AMD modules)

> Cheers,
> Darius

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Where to add reference to 3rd Party JS Libraries?

Hannes Hirzel
Hi Darius,

In addition to what Herby wrote about AMD and non-AMD modules

He updated
    https://github.com/amber-smalltalk/amber/wiki/Writing-my-first-app
and
    https://github.com/amber-smalltalk/amber/wiki/How-to-load-amber
last Saturday. Worth checking out as it has changed slightly.

So if you have amber, your project called 'hello' and a third party
library, e.g. d3 I understand that directory layout should look like
this


projects/vendor/amber/
projects/vendor/d3/
projects/hello
projects/hello/st
projects/hello/js

I as well am interested on a worked out example on how to load a third
party AMD library.
However just going for a <script src> seems to be the easiest.

--Hannes

On 9/12/13, Herby Vojčík <[hidden email]> wrote:

>
>
> Darius Clarke wrote:
>> Hi,
>>
>> So loading the libraries amber needs from the 'support' folder is now
>> done in the amber.js.
>
> No, amber.js does nothing except configuring require.js.
> The single require call in inline <script> does all the loading.
>
>> How do I add the reference to load the 3rd party library my
>> application needs? Should that go in the html page, or somewhere in my
>> application's package?
>
> In HTML as <script src> if it is non-AMD 3rd party library.
> In HTML in require call in the list of dependencies, if it is AMD 3rd
> party library; configuring paths as needed in directly preceding
> require.config call.
> (the previous case includes amber libraries as well, as shown in "How to
> load amber" wiki page, since amber packages are also AMD modules)
>
>> Cheers,
>> Darius
>
> Herby
>
> --
> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Where to add reference to 3rd Party JS Libraries?

Darius Clarke
Thank you Herby and Hannes. That helps. 


On Thu, Sep 12, 2013 at 8:08 PM, H. Hirzel <[hidden email]> wrote:
Hi Darius,

In addition to what Herby wrote about AMD and non-AMD modules

He updated
    https://github.com/amber-smalltalk/amber/wiki/Writing-my-first-app
and
    https://github.com/amber-smalltalk/amber/wiki/How-to-load-amber
last Saturday. Worth checking out as it has changed slightly.

So if you have amber, your project called 'hello' and a third party
library, e.g. d3 I understand that directory layout should look like
this


projects/vendor/amber/
projects/vendor/d3/
projects/hello
projects/hello/st
projects/hello/js

I as well am interested on a worked out example on how to load a third
party AMD library.
However just going for a <script src> seems to be the easiest.

--Hannes

On 9/12/13, Herby Vojčík <[hidden email]> wrote:
>
>
> Darius Clarke wrote:
>> Hi,
>>
>> So loading the libraries amber needs from the 'support' folder is now
>> done in the amber.js.
>
> No, amber.js does nothing except configuring require.js.
> The single require call in inline <script> does all the loading.
>
>> How do I add the reference to load the 3rd party library my
>> application needs? Should that go in the html page, or somewhere in my
>> application's package?
>
> In HTML as <script src> if it is non-AMD 3rd party library.
> In HTML in require call in the list of dependencies, if it is AMD 3rd
> party library; configuring paths as needed in directly preceding
> require.config call.
> (the previous case includes amber libraries as well, as shown in "How to
> load amber" wiki page, since amber packages are also AMD modules)
>
>> Cheers,
>> Darius
>
> Herby
>
> --
> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.