10

I'm planning to use WebJars (through Maven) instead of Bower for my projects.

What's the difference between the NPM, Bower and Classic flavors of WebJars?

My understanding is that since I used Bower, I should probably just use Bower WebJars since I can be sure that those artifacts will be available. Is that the right way to think about this?

Thanks, in advance, for the help.

Adnan Z
  • 374
  • 2
  • 9

2 Answers2

6

It depends on where you want the source artifacts to come from. Classic WebJars usually come from a binary distribution of a library. Bower and NPM WebJars come from their respective sources.

The Classic WebJars are manually created and published by WebJar contributors. Bower and NPM WebJars can be published by anyone.

James Ward
  • 28,966
  • 9
  • 47
  • 79
  • Can I use dependencies from classic, NPM and Bower in a single project? Is it guaranteed that they are compatible with each other? – Alexander Myltsev Jun 11 '16 at 07:14
  • You definitely can use them in the same project. What kind of compatibility are you looking for? – James Ward Jun 11 '16 at 19:21
  • I am not expert in JavaScript and build systems such as NPM and Bower. I wonder if their standards to packing things are compatible. And situation when I use dependencies from different worlds would not cause some internal conflicts. – Alexander Myltsev Jun 12 '16 at 19:38
  • I can't think of any issues in this regard. – James Ward Jun 13 '16 at 14:31
0

We have chosen for Classic WebJars.

Differences between Classic and NPM that made us go for Classic:

  • Classic WebJars have a smaller JAR size ( For example, jQuery 3.4.1 Classic is 308 KB, NPM is 476 KB)
  • NPM WebJars expose all sources in the project, which can result in a security problem if there is Javascript code with vulnerabilities in src of that Webjar.
Kees van Dieren
  • 1,162
  • 9
  • 15