Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Merged javascript files: preserve licence and copyright in merged file #1640

Closed
robocoder opened this Issue · 8 comments

4 participants

@robocoder
Collaborator

It's debateable whether or not this is necessary when minifying on-the-fly...

reference: http://code.google.com/p/minify/source/browse/branches/2.1.4/min/lib/JSMin.php
Keywords: interesting

@robocoder
Collaborator

Reference: http://www.gnu.org/philosophy/javascript-trap.html

Stallman suggests the following notice where JavaScript is embedded in a page:

   Copyright (C) YYYY  Developer

    The JavaScript code in this page is free software: you can
    redistribute it and/or modify it under the terms of the GNU
    General Public License (GNU GPL) as published by the Free Software
    Foundation, either version 3 of the License, or (at your option)
    any later version.  The code is distributed WITHOUT ANY WARRANTY;
    without even the implied warranty of MERCHANTABILITY or FITNESS
    FOR A PARTICULAR PURPOSE.  See the GNU GPL for more details.

    As additional permission under GNU GPL version 3 section 7, you
    may distribute non-source (e.g., minimized or compacted) forms of
    that code without the copy of the GNU GPL normally required by
    section 4, provided you include this license notice and a URL
    through which recipients can access the Corresponding Source.
@JulienMoumne
Collaborator

The merged javascript file contains third party javascript libraries.

From a license compatibility point of view, would it be ok to add this notice at the beginning of the merged file ?

@robocoder
Collaborator

I would leave the license headers at the beginning of each minified file because that's how it appears now with pre-minified files that are simply included (e.g., jquery.js and jquery-ui.js).

It should be as simple as updating JSMin.php and making sure the comment headers in each JavaScript file consistently uses /*! ... */ so that it is preserved in the minified output.

p.s. ignore comment:2.

@mattab
Owner

I am not confident with 'updating JSMin.php' and vote for a wontfix. The important thing is that we take licenses seriously and any Piwik user is able to find out the licenses of the libraries we use by looking at the well maintained file: https://github.com/piwik/piwik/blob/master/LEGALNOTICE

Most Open Source projects don't have such a file, so this is already a great effort to make visible the libraries we use and their licenses.

won't fix

@robocoder
Collaborator

A couple of points:

  • This isn't aimed at users who install Piwik for their own use. It's intended for users of a hosted Piwik service where this interaction may be (or rather, "is" interpreted by Stallman) to be a form of "conveying" the software.
  • If we don't update jsmin.php to the newer version, we have to backport some fixes (eg mb.func_overload).
@JulienMoumne
Collaborator

jsmin is deprecated, cf : https://github.com/rgrove/jsmin-php/ :

This project is unmaintained. I stopped using it years ago. You shouldn't use it. You shouldn't use any version of JSMin.

I found https://github.com/tedivm/JShrink as a replacement and will remove jsmin while fixing #4373.

JShrink preserves licenses.

@mattab
Owner

In fbd4675: Refs #1640 Adding jshrink to LEGALNOTICE + update help text

@robocoder robocoder added this to the Future releases milestone
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@JulienMoumne JulienMoumne fixes #4373, #1640 6624e27
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.