librelist archives

« back to archive

Re: How to remove jQuery, Underscore, Bootstrap dependencies

Re: How to remove jQuery, Underscore, Bootstrap dependencies

From:
Martin Litvaj
Date:
2014-10-23 @ 16:46
Hi,

I have an Angular website with jQuery 2 and Lo-Dash already included. I
would like to use ConverseJS but I noticed, there is jquery 1.11 and
Underscore included in minified version. There is also Bootstrap and BS JS,
which I dont want, because I use AngularStrap for BS, and I dont know if
there wont be a conflict.

What should I do?

Regards,
Martin

2014-10-23 18:38 GMT+02:00 Martin Litvaj <kamahl19@gmail.com>:

> Hi,
>
> I have an Angular website with jQuery 2 and Lo-Dash already included. I
> would like to use ConverseJS but I noticed, there is jquery 1.11 and
> Underscore included in minified version. There is also Bootstrap and BS JS,
> which I dont want, because I use AngularStrap for BS, and I dont know if
> there wont be a conflict.
>
> What should I do?
>
> Regards,
> Martin
>

Re: [conversejs] Re: How to remove jQuery, Underscore, Bootstrap dependencies

From:
Jc Brand
Date:
2014-10-24 @ 08:50
On Thu, Oct 23, 2014 at 06:46:04PM +0200, Martin Litvaj wrote:
>    Hi,
> 
>    I have an Angular website with jQuery 2 and Lo-Dash already included. I
>    would like to use ConverseJS but I noticed, there is jquery 1.11 and
>    Underscore included in minified version. There is also Bootstrap and BS
>    JS, which I dont want, because I use AngularStrap for BS, and I dont know
>    if there wont be a conflict.

The bootstrap dependency is only for the https://conversejs.org website, and is
not needed for converse.js itself.

Converse.js uses require.js to manage and load its dependencies, and a bundle
of all the code (converse.js and its dependencies) is then created via the
require.js Optimizer.

Ideally, you should also be using require.js to manage your app's JS
dependencies.

If you do, it's as simple as updating the main.js file to specify any
additional dependencies and to replace or modify any of the existing ones.

See converse.js's main.js:
https://github.com/jcbrand/converse.js/blob/master/main.js

With the require.js Optimizer, there are different builds that can be made.

See for example these:
https://github.com/jcbrand/converse.js/blob/master/src/build.js
https://github.com/jcbrand/converse.js/blob/master/src/build-no-otr.js
https://github.com/jcbrand/converse.js/blob/master/src/build-no-locales-no-otr.js

Some people are still living in the stone age and try get by without a module
loader.

For these poor misguided souls, there is the non-AMD version of converse.js:
https://github.com/jcbrand/converse.js/blob/master/non_amd.html

The docs have more info on this:
https://conversejs.org/docs/html/index.html#development

JC