Page MenuHomePhabricator

peerjs in VisualEditor has no unminified source
Closed, ResolvedPublic

Description

Added in https://gerrit.wikimedia.org/r/c/VisualEditor/VisualEditor/+/836877

The unminified source is needed for GPL compliance (the source needs to be provided in the desired form to make modifications in), and makes things much easier for downstream distributors like Debian. And it's generally good practice in case we ever do need to patch something, having a human-readable source in git already.

Event Timeline

Thanks @Legoktm! Hmm, this is technically tricky because the source is in typescript, which would require a whole extra compilation system in our build process. But I think we are ok because:

  1. PeerJS is MIT licensed
  2. VisualEditor is MIT licensed
  3. We commonly include other libraries without including the full source (i.e. we do not bundle the entire source in the technical sense of “the preferred form of the work for making modifications to it", as specified in the GPL). An example would be our copy of jquery.js — it's not minified, but nor is it the separate files used in the upstream project.

Therefore I think a reasonable compromise would be to include the compiled unminified javascript.

Change #1110751 had a related patch set uploaded (by Divec; author: Divec):

[VisualEditor/VisualEditor@master] Replace PeerJS with unminified version

https://gerrit.wikimedia.org/r/1110751

Thanks @Legoktm! Hmm, this is technically tricky because the source is in typescript, which would require a whole extra compilation system in our build process. But I think we are ok because:

  1. PeerJS is MIT licensed
  2. VisualEditor is MIT licensed

This is true but since they are being distributed as a part of the MediaWiki tarball, it also needs to be GPL compliant.

  1. We commonly include other libraries without including the full source (i.e. we do not bundle the entire source in the technical sense of “the preferred form of the work for making modifications to it", as specified in the GPL). An example would be our copy of jquery.js — it's not minified, but nor is it the separate files used in the upstream project.

Therefore I think a reasonable compromise would be to include the compiled unminified javascript.

Agreed, and that's actually what I was hoping for (but didn't make super clear, apologies). I find it easier to think about in the hypothetical of "if we had to patch PeerJS tomorrow, how would we prefer to do it?" With jQuery we'd just edit the jquery.js file (and have) rather than taking the raw upstream source, editing it, running it through the build process, and then updating the file. I assume we would also be okay doing the same with PeerJS.

Thank you for the quick response and submitting the patch!

We decided to include the unminified source in the repo, but still actually *use* the minified source. That addresses the concern about source inclusion / patchability, while still keeping the build size down to a minimum (see discussion on the gerrit patch).

Change #1110751 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Include unminified PeerJS in the repo (unused)

https://gerrit.wikimedia.org/r/1110751

Change #1120634 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (71ec17652)

https://gerrit.wikimedia.org/r/1120634

Change #1120634 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (71ec17652)

https://gerrit.wikimedia.org/r/1120634

dchan claimed this task.

@dchan Would it be possible to have this backported to 1.43?