On Sat, Aug 4, 2018 at 7:24 AM Fabio Valentini <decathorpe@gmail.com> wrote:
On Sat, Aug 4, 2018, 13:11 Greg Sheremeta <greg@gregsheremeta.com> wrote:
On Sat, Aug 4, 2018 at 3:48 AM Miro Hrončok <mhroncok@redhat.com> wrote:
On 4.8.2018 01:17, Greg Sheremeta wrote:
> Hi,
>
> This page
> https://fedoraproject.org/wiki/Packaging:JavaScript
> is terribly outdated. Even when it was created years ago, IMO the advice
> was questionable. Today, it's definitely bad advice.
>
> Modern web applications use webpack for JavaScript. With webpack,
> JavaScript is minified and bundled, and sometimes assets are even
> injected. I realize bundling libraries is bad for an old-school
> RPM-based application. But no one packages JavaScript into RPMs (try to
> find react and friends), and the page is leading to confusion on my team.
>
> To prevent confusion, acceptable options would be: either simply
> deleting the page, or placing a giant "don't follow this outdated
> advice" banner at the top.

We don't generally do either of those. If the guidelines are outdated,
they need to to be updated, not deleted.

--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok

Ok. Then I suggest this page be updated to roughly say client-side JavaScript should not be packaged in RPMs.

But in which other way would you distribute JavaScript libraries that are needed for packages?

Various projects depend on those libraries (jQuery, etc.), and they need to be distributed (or bundled) in RPMs, so other RPMs can depend on them - there's no way around that, at least none that I can see.

Good question. IMO that model should be obsoleted. Over time, projects can move to yarn + webpack or the next hipster tools after those :)

jQuery is a poor example of a modern web app library. 10 years ago when apps were simpler and people used only a handful of libraries per app, sure, maybe it made sense to try to wrap JavaScript libraries in RPMs. Today, run 'create-react-app' to get a react skeleton -- your app will have only 3 direct dependencies [https://paste.fedoraproject.org/paste/Q~9DHrXnbFKiHwTFv97IkQ], but over 700 indirect dependencies [https://paste.fedoraproject.org/paste/rPVZ51YKJ3GomluY9x3KPw]. Because the JavaScript community prefers tiny libraries with very frequent releases, it will never be attainable to package them.

A few other points:

1 "[Fedora has] a standard to avoid duplication of system libraries. This applies as much to JavaScript libraries" -- with modern apps, this standard is not possible. Current tools are built so that multiple versions of libraries are allowed to co-exist, nest, etc. See a typical yarn cache or node_modules directory, for example, or my create-react-app skeleton example [https://paste.fedoraproject.org/paste/rPVZ51YKJ3GomluY9x3KPw].

2 Especially considering mobile devices, it is now bad practice to stream the untouched JavaScript library contents to the browser. Instead, webpack can perform optimizations on the client side application payload. We want as few network round trips as possible, and the payload should be minified / compressed / deduped etc. Sometimes assets are even embedded. (In other words, why would you dump an entire library to a client when only a single 10-line function from that file is needed.)

Best wishes,
Greg
 

Fabio

_______________________________________________
packaging mailing list -- packaging@lists.fedoraproject.org
To unsubscribe send an email to packaging-leave@lists.fedoraproject.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/packaging@lists.fedoraproject.org/message/62Y5FPM2MJJIVVUXTTDL4JQ4X4N4N4AA/