[Engineering] [Blog post] Migrating desktop twitter build tools to webpack

Jon Robson jrobson at wikimedia.org
Mon Jul 10 16:22:27 UTC 2017


Seemed a shame this email didn't get any discussion as I think it's an
interesting topic. Hoping by biting, I can ignite some conversation here ;)

So from what I understand ResourceLoader was a bit of a trailblazer in this
field and we created it way before any of these bundling tools exist.

>From what I can see webpack and many other bundlers now have good solutions
that mirror ResourceLoader's functionality, for example including
CSS/templates  inside JS files. From my understand of webpacking if you
need to care about i18n you need a bundle for every language? I guess this
is something ResourceLoader arguably does a little better/more convenient -
as the compile is handled on first request, not as a build step.

One thing I don't like about ResourceLoader over other bundlers is the
inability to import files a la Node (
https://phabricator.wikimedia.org/T133462).

When I built Weekapedia [1] (MobileFrontend rebuilt as a web app), most of
my friction came from the i18n challenges - I had to generate a RTL css
stylesheet and manage the logic for switching between versions. I don't
think this is because it's hard to do in Webpack - I just think there's a
big paradigm switch in that you now have to worry about how your tooling
solves this. How do you ship the bare minimum message keys? There might be
tooling I'm not aware of, tooling we could improve or tooling we could
write with ResourceLoader as the basis of inspiration.

I actually think it would be a really interesting POC to see what this
would look like. If nothing else, I think it would be good to talk about
the problems it solves on https://www.mediawiki.org/wiki/ResourceLoader so
others understand it. I have noticed many frontend devs who are new to our
ecosystem spend a lot of time getting there head around why we use
ResourceLoader and I think it would be great to document. This might be a
good spring board for packaging ResourceLoader up as a composer module that
other PHP based projects can use....?

[1] https://github.com/jdlrobson/weekipedia




On Tue, May 2, 2017 at 8:43 AM Joaquin Oltra Hernandez <
jhernandez at wikimedia.org> wrote:

> Hi,
>
> I read this article where a twitter engineer explains their migration from
> their custom made front-end bundling tooling to use webpack, with the good
> and the bad they found along the way, and it seemed interesting enough to
> share.
>
> https://alunny.com/articles/webpack-on-twitter-com/
>
> I was wondering, would a move like that be worth or even possible for
> MediaWiki?
>
> I thought it could be interesting to chat about the specifics of our
> ecosystem in the context of this sort of tooling migration.
> _______________________________________________
> Engineering mailing list
> Engineering at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/engineering
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.wikimedia.org/pipermail/engineering/attachments/20170710/ccd92b64/attachment.html>


More information about the Engineering mailing list