JavaScript chat summary, April 23th, 2019

Below is a summary of this week’s JavaScript chat (agenda, Slack Transcript). Have a topic for discussion for the next meeting? Leave a suggested edit on next week’s agenda.

Webpack plugin to extract script dependencies

Another update was shared on a Webpack plugin discussed during the previous week’s meeting, which helps provide automation for the tedious and error-prone task of manually maintaining script dependencies. The pull request was merged this past week: PR#14869. It won’t be published to npm until WordPress 5.2 is released.

There’s a follow-up issue at PR#14837 which aims to replace the existing manually maintained packages-dependencies.php file in Gutenberg. There’s an open question there about how we handle “legacy” scripts which are still referenced on the window global, as these aren’t explicit but rather implicit dependencies. We discussed several possible solutions and decided to take the following steps:

  1. We know what these implicit dependencies are and which scripts depend on them, let’s merge those into the “extracted” set? There is already a follow-up PR#15124 opened (shortly after the meeting) by @jonsurrell.
  2. We were all in agreement that referencing the window globals is itself a problem we need to address. This is incompatible for use in an npm context and should be eliminated or substituted with an equivalent package. @aduth created an issue#15125 to keep track of it.