On Thu, Apr 12, 2018 at 10:52 PM, Thomas De Schampheleire <
patrickdeping...@gmail.com> wrote:

> Hi Alessandro,
> Thanks a lot for this information.
> If I understood correctly you wouldn't even need npm at all, correct?

Yes, that's correct.
npm nor node are required. Dukpy tries to replace them both.

> Do you know of an example project that is using this?

I used it on some closed source projects, mostly to compile ES6 and JSX.

> Where would you handle this bundle creation and nodejs downloads? From
> setup.py? From a gearbox command?

I usually go through webassets itself which creates the bundle and caches
it on application startup.
But I also wrote fabric based scripts for command line in a few projects
where no backend was involved.

Both gearbox and setup.py would be perfectly reasonable solutions to
compile those. I'd say I have no strong opinion on how this should happen
and I change it from project to project myself according to the needs of
the project. The approach of going through tgext.webassets is very
convenient because it happens automatically on app startup and nothing has
to be done, but it should be easy to contribute a command to
tgext.webassets to precompile those bundles.

And do you have suggestions with respect to the handling of external
> asserts when creating a pypi package, in particular taking into account
> licensing aspects of the GPL (Kallithea is a gplv3 project).

I usually predownload them an ship them in a ./js_modules directory within
the project as far as the license allows it.
While it's in theory possible to have dukpy download the requirements on
install through setup_requires, I never did it in practice.

Some time ago I wrote a short article to showcase how dukpy could be used
to compile JSX which also creates a javascript bundle for the app:
It might help giving a better understanding of the whole thing.
kallithea-general mailing list

Reply via email to