help-librejs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-librejs] Using sourcemaps for license information.


From: Kevin Cox
Subject: [Help-librejs] Using sourcemaps for license information.
Date: Fri, 25 Apr 2014 20:24:02 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

Hello,

I was watching a FOSDM talk about librejs and the general movement and
thought it sounded like a really interesting initiative.

I was wondering if you guys have considered putting the license
information in source map files.  These are files that are designed to
help debugging minified scripts by mapping the minified version back to
the original source.

These are linked by a comment in the minified file and contain a way to
obtain the original source (either inline in the sourcemap or via a
link) and are supported in many popular browsers (at least firefox and
chromium).

These maps are a simple json object and it would be easy to add
information such as license and ideal links to the source (for example
to a project page rather than just the raw file).  For example a set of
attributes could be:

_FSFLicenseURL: ...
_FSFLicenseCode: a short unique code to identify the license
_FSFLicenseFree: A boolean for if the code is free.

Obviously once accepted into the v4 spec the '_FSF' prefix can be
dropped.  I have but a code variable there but if you used a magnet link
it would be unnecessary.

I think that a huge advantage to this approach is that sitemaps are
quickly becoming popular and above the site link comment (which many
scripts already have) it doesn't require adding a single byte to a
"typical" page download.  This is a strong selling point for performance
oriented sites and many sites already have sourcemaps integrated into
their build system, so adding a couple of flags shouldn't be too hard.
Furthermore it puts all of the metadata for a javascript file in one place.

Another benefit is that the metadata is kept with the source, meaning
that public CDN's[0][1] can manage this information once and all sites
that use these files will have their javascript license information
available.

The major downside is that these maps are often larger than the minified
file and would be needed to be downloaded to check the license.

Just some food for thought.

-- 
Cheers,
Kevin

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]