Integrating npm front-end with Kallithea

Andrew Shadura andrew at shadura.me
Wed Nov 8 14:05:49 UTC 2017


On 8 November 2017 at 14:42, Mads Kiilerich <mads at kiilerich.com> wrote:
> On 11/08/2017 01:44 PM, Andrew Shadura wrote:
>>
>> On 8 November 2017 at 12:37, Mads Kiilerich <mads at kiilerich.com> wrote:
>>>
>>> On 11/08/2017 08:53 AM, Andrew Shadura wrote:
>>>>
>>>> Why can't use use any of the Python implementations of Less? Or use
>>>> either JS one or Python one depending on what's available?
>>>
>>>
>>> I guess we could. I don't have an opinion on that. Those that do the work
>>> get to decide. And I do see the value of sticking to the most commonly
>>> used
>>> tool chain.
>>
>> Well, I did submit a proof of concept using lesscpy two years ago, and
>> that went nowhere.

> Can you find a reference to it so we can re-evaluate?

https://lists.sfconservancy.org/pipermail/kallithea-general/2015q2/000788.html

>>> Less is one thing - then comes javascript and minifier ... and the need
>>> to
>>> be able to use custom variables when building Bootstrap.
>>
>> Does any of this need npm?

> The most obvious and simple way to do it do use npm. But given enough
> effort, everything can of course be done differently.

>>> I don't think less is the problem. It comes "for free" with the solution
>>> to
>>> some of the bigger problems:
>>>
>>> * We "need" bits and pieces from npm packages. Primarily Bootstrap, but
>>> also
>>> all the other front end libraries that are so hard to vendor in a GPL
>>> compatible way.
>>
>> Which bits?

> jQuery, datatables, the whole list of front-end code we more or less have
> vendored now.

I'm much less concerned about vendoring than about a huge dependency
on npm and its infrastructure.

>>> * We thus need npm to download the packages.
>>>
>>> * We need the right build tools for these packages ... and they also come
>>> from npm by default (and nothing else is supported).
>>
>> I don't understand what's so difficult about Lessing a bunch of files
>> and amalgamating them afterwards so that we absolutely have to use the
>> upstream's build system.
>>
> What is your concern and over-all goal? That we only use Python tools and
> only have dependencies from pypi, and thus either vendor all external
> dependencies or find them as source packages on pypi so we can build it with
> python tooling at install time?
>
> I would like that, but I don't think it is feasible. It would have too much
> overhead and be too non-standard.

My concern about npm isn't only that it is a whole different
programming language, but that the infrastructure around npm is too
chaotic to be reasonable, there are too many indirect dependencies,
too many moving parts, things change a lot and too often. It's not
something I would like to base anything, to be honest.

I think we definitely need to somehow vendor jQuery and other js
libraries, and — absolutely — Bootstrap. We need to be able to
reproducibly build it from the source, and npm not only doesn't make
that easier, but complicates that task and makes our build system more
fragile.

-- 
Cheers,
  Andrew


More information about the kallithea-general mailing list