<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 12, 2018 at 10:52 PM, Thomas De Schampheleire <span dir="ltr"><<a href="mailto:patrickdepinguin@gmail.com" target="_blank">patrickdepinguin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Hi Alessandro,<div><div class="gmail-h5"><div><br></div><div dir="auto"><span style="color:rgb(34,34,34)">Thanks a lot for this information.</span><br></div></div></div><div dir="auto">If I understood correctly you wouldn't even need npm at all, correct?</div></div></blockquote><div><br></div><div>Yes, that's correct.</div><div>npm nor node are required. Dukpy tries to replace them both.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto">Do you know of an example project that is using this?<br></div></div></blockquote><div><br></div><div>I used it on some closed source projects, mostly to compile ES6 and JSX. </div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto"></div><div dir="auto">Where would you handle this bundle creation and nodejs downloads? From setup.py? From a gearbox command?</div></div></blockquote><div><br></div><div>I usually go through webassets itself which creates the bundle and caches it on application startup.<br></div><div>But I also wrote fabric based scripts for command line in a few projects where no backend was involved.</div><div><br></div><div>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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto">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).</div></div></blockquote><div><br></div><div>I usually predownload them an ship them in a ./js_modules directory within the project as far as the license allows it.</div><div>While it's in theory possible to have dukpy download the requirements on install through setup_requires, I never did it in practice.</div><div><br></div><div>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: <a href="https://medium.com/@__amol__/es2015-and-react-in-pure-python-environment-b326dc15012c">https://medium.com/@__amol__/es2015-and-react-in-pure-python-environment-b326dc15012c</a></div><div>It might help giving a better understanding of the whole thing.</div><div><br></div><div> </div></div></div></div>