Browse Source

chore(license): update to less encumbered license

previous license placed some restictions this one does not
Josh Habdas 1 year ago
parent
commit
5b1fd9d470
Signed by: Josh Habdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74
8 changed files with 46 additions and 66 deletions
  1. 4
    0
      .npmignore
  2. 13
    0
      COPYING
  3. 0
    15
      LICENSE
  4. 21
    33
      README.md
  5. 2
    2
      package.json
  6. 1
    1
      rollup.config.js
  7. 1
    1
      src/fetch-inject.js
  8. 4
    14
      src/injectors.js

+ 4
- 0
.npmignore View File

@@ -1,3 +1,7 @@
1
+.*
2
+*.md
3
+*.yml
4
+*.json
1 5
 .DS_Store
2 6
 node_modules
3 7
 rollup.config.js

+ 13
- 0
COPYING View File

@@ -0,0 +1,13 @@
1
+            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2
+                    Version 2, December 2004
3
+
4
+ Copyright 2016-2018 Josh Habdas <jhabdas@protonmail.com> (https://habd.as)
5
+
6
+ Everyone is permitted to copy and distribute verbatim or modified
7
+ copies of this license document, and changing it is allowed as long
8
+ as the name is changed.
9
+
10
+            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12
+
13
+  0. You just DO WHAT THE FUCK YOU WANT TO.

+ 0
- 15
LICENSE View File

@@ -1,15 +0,0 @@
1
-BTC License
2
-
3
-© 2017-2018, 13AMDq9isKtQTxMQG4w7Yo7cEhqKAqQ4Lz
4
-
5
-Permission to use, copy, modify, and/or distribute this software for any
6
-purpose with or without fee is hereby granted, provided that the above
7
-copyright notice and this permission notice appear in all copies.
8
-
9
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

+ 21
- 33
README.md View File

@@ -1,44 +1,30 @@
1
-<h1 align="center">Fetch Inject</h1>
1
+# Fetch Inject
2 2
 
3
-<p align="center">
4
-  <strong>A fetching async loader and DOM injection sequencer for high-performance websites.</strong>
5
-</p>
3
+> Dynamically inline assets into the DOM using [Fetch Injection](https://hackcabin.com/post/managing-async-dependencies-javascript/).
6 4
 
7
-<p align="center">
8
-  <a href="https://cost-of-modules.herokuapp.com/?p=fetch-inject@latest">
9
-    <img src="https://img.shields.io/badge/dependencies-0-8892BF.svg?style=flat-square" alt="Zero dependencies">
10
-  </a>
11
-  <a href="https://cdn.jsdelivr.net/npm/fetch-inject">
12
-    <img src="http://img.badgesize.io/https://cdn.jsdelivr.net/npm/fetch-inject@latest/dist/fetch-inject.min.js?compression=brotli&style=flat-square" alt="Size of IIFE bundle with brotli compression">
13
-  </a>
14
-  <a href="https://www.jsdelivr.com/package/npm/fetch-inject">
15
-    <img src="https://data.jsdelivr.com/v1/package/npm/fetch-inject/badge" alt="Hits per month from jsDelivr CDN">
16
-  </a>
17
-  <a href="https://www.npmjs.com/package/fetch-inject">
18
-    <img src="https://img.shields.io/npm/dm/fetch-inject.svg?style=flat-square" alt="NPM downloads per month">
19
-  </a>
20
-  <a href="https://www.npmjs.com/package/fetch-inject">
21
-    <img src="https://img.shields.io/npm/v/fetch-inject.svg?style=flat-square" alt="Latest NPM version">
22
-  </a>
23
-</p>
5
+![Zero dependencies](https://img.shields.io/badge/dependencies-0-8892BF.svg?style=flat-square&longCache=true)
6
+![Compressed size](http://img.badgesize.io/https://cdn.jsdelivr.net/npm/fetch-inject@latest/dist/fetch-inject.min.js?compression=brotli&style=flat-square)
7
+[![Hits per month via jsDelivr CDN](https://data.jsdelivr.com/v1/package/npm/fetch-inject/badge)](https://www.jsdelivr.com/package/npm/fetch-inject)
8
+[![NPM downloads per month](https://img.shields.io/npm/dm/fetch-inject.svg?style=flat-square)](https://www.npmjs.com/package/fetch-inject)
9
+[![Latest NPM version](https://img.shields.io/npm/v/fetch-inject.svg?style=flat-square)](https://www.npmjs.com/package/fetch-inject)
24 10
 
25
-<p align="center"><strong><a href="https://news.ycombinator.com/item?id=14380191">Discuss it on Hacker News</a></strong></p>
11
+Read the [**Hacker News discussion**](https://news.ycombinator.com/item?id=14380191).
26 12
 
27
-## Background
13
+## Overview
28 14
 
29
-This library implements a performance optimization technique [known as](https://hackcabin.com/post/managing-async-dependencies-javascript/) _Fetch Injection_ for managing async dependencies with JavaScript. It also works for stylesheets too, and was designed to be extensible for _any_ resource type which can be loaded using [`fetch`](https://devdocs.io/dom-fetch/).
15
+Fetch Inject implements a Web performance optimization technique known as [Fetch Injection](https://hackcabin.com/post/managing-async-dependencies-javascript/) for managing asynchronous JavaScript dependencies. It works for stylesheets too, and was designed to be extensible for any resource type that can be loaded using [`fetch`](https://devdocs.io/dom-fetch/).
30 16
 
31
-Use Fetch Inject to dynamically import page resources such as JS and CSS in parallel (even across the network), and load them into your page in a desired sequence.
17
+Use Fetch Inject to dynamically import external JavaScript and CSS resources in parallel (even across the network), and load them into your page in a desired sequence, at a desired time and under desirable runtime conditions.
32 18
 
33
-Because it uses [Fetch API](http://devdocs.io/dom/fetch_api), Fetch Inject will work alongside [Service Workers](http://devdocs.io/dom-service-workers/), enabling you take the performance of your [Progressive Web Apps](https://julian.is/article/progressive-web-apps/) to an entirely new level.
19
+Because it uses [Fetch API](http://devdocs.io/dom/fetch_api) Fetch Inject works alongside [Service Workers](http://devdocs.io/dom-service-workers/) enabling offline-first applications and improving performance in bandwidth-restricted environments.
34 20
 
35 21
 ## Playground
36 22
 
37
-Try <a href="https://codepen.io/jhabdas/pen/MpVeOE?editors=0012" target="_blank">Fetch Inject on CodePen</a>. Reference the [Use Cases](#use-cases) to enhance your understanding of what this library can do for you.
23
+Try [CodePen Playground](https://codepen.io/jhabdas/pen/MpVeOE?editors=0012). Reference the [Use Cases](#use-cases) to enhance your understanding of what Fetch Injection can do for you.
38 24
 
39
-## Waterfalls
25
+## Performance
40 26
 
41
-Here're example waterfalls using Fetch Inject to loading the WordPress Twenty Seventeen theme over 4G with an unprimed browser cache and subsequent load using Service Worker caching. Notice most of the latency with service workers occurs simply waiting for the HTML to load.
27
+The following network waterfall diagrams were produced using Fetch Inject to load the WordPress Twenty Seventeen theme for a performance talk [given at](https://habd.as/talks/screaming-fast-wordpress-redis-vultr/) WordCamp Ubud 2017. Stats captured over a 4G network using a mobile hotspot. One shows the speed of the page load with an unprimed browser cache and the other using Service Worker caching. Notice with Service Workers most of the perceived latency with occurs simply waiting for the HTML response to load.
42 28
 
43 29
 <p>
44 30
   <img src="https://github.com/jhabdas/fetch-inject/blob/master/docs/fetch-inject-unprimed-cache.png?raw=true" title="Fetch Inject Unprimed Cache" width="48%" alt="Screenshot of network waterfall showing parallel resource loading using Fetch Inject">
@@ -74,7 +60,7 @@ A [`Promise`](http://devdocs.io/javascript/global_objects/promise) that resolves
74 60
 
75 61
 Fetch Inject is available on NPM and CDN. It ships in the following flavors: IIFE, UMD and ES6.
76 62
 
77
-Save latest minfied UMD bundle to a file with [cURL](https://curl.haxx.se/):
63
+Save latest minified UMD bundle to a file with [cURL](https://curl.haxx.se/):
78 64
 
79 65
     curl -o fetch-inject.umd.min.js https://cdn.jsdelivr.net/npm/fetch-inject
80 66
 
@@ -86,7 +72,7 @@ Install the latest `1.7` patch release using [NPM](https://www.npmjs.com/):
86 72
 
87 73
     npm i -p fetch-inject@~1.7
88 74
 
89
-Download the `1.8.1` ES6 module using [`fetch`](http://devdocs.io/dom/windoworworkerglobalscope/fetch):
75
+Download the `1.8.1` ES6 module bundle using [`fetch`](http://devdocs.io/dom/windoworworkerglobalscope/fetch):
90 76
 
91 77
 ```js
92 78
 fetch('https://cdn.jsdelivr.net/npm/fetch-inject@1.8.1/dist/fetch-inject.es.min.js')
@@ -322,6 +308,8 @@ Access the plugin beta [Hyperdrive repo](https://github.com/wp-id/hyperdrive) on
322 308
 
323 309
 ## License
324 310
 
325
-© 2017, <a href="bitcoin:13AMDq9isKtQTxMQG4w7Yo7cEhqKAqQ4Lz?label=Comfusion&message=Donation%20for%Fetch%20Inject">13AMDq9isKtQTxMQG4w7Yo7cEhqKAqQ4Lz</a>
311
+Copyright (C) 2017–2018 Josh Habdas <jhabdas@protonmail.com>
326 312
 
327
-[![Fetch Inject](https://static.hackcabin.com/images/qr/btc-license.png)](https://hackernoon.com/introducing-the-btc-license-28650887eb11)
313
+This work is free. You can redistribute it and/or modify it under the
314
+terms of the Do What The Fuck You Want To Public License, Version 2,
315
+as published by Sam Hocevar. See the COPYING file for more details.

+ 2
- 2
package.json View File

@@ -2,7 +2,7 @@
2 2
   "name": "fetch-inject",
3 3
   "version": "1.11.0",
4 4
   "description": "Dynamically inline assets into the DOM using Fetch Injection.",
5
-  "author": "Josh Habdas <jhabdas@protonmail.com> (https://habd.as/)",
5
+  "author": "Josh Habdas <jhabdas@protonmail.com>",
6 6
   "module": "dist/fetch-inject.es.js",
7 7
   "main": "dist/fetch-inject.umd.js",
8 8
   "keywords": [
@@ -34,5 +34,5 @@
34 34
     "standard-version": "^4.4.0",
35 35
     "uglify-es": "^3.3.9"
36 36
   },
37
-  "license": "BTC"
37
+  "license": "WTFPL"
38 38
 }

+ 1
- 1
rollup.config.js View File

@@ -35,7 +35,7 @@ const minifiedConfigs = activeConfigs.reduce(
35 35
     Object.assign({}, activeConfig, {
36 36
       plugins: [
37 37
         uglify({}, minify),
38
-        license({ banner: `/*! Fetch Inject v<%= pkg.version %> | © <%= moment().format('YYYY') %>, 13AMDq9isKtQTxMQG4w7Yo7cEhqKAqQ4Lz | @license BTC */` }),
38
+        license({ banner: `/*! Fetch Inject v<%= pkg.version %> | Copyright (C) <%= moment().format('YYYY') %> Josh Habdas <jhabdas@protonmail.com> | @license WTFPL */` }),
39 39
         ...activeConfig.plugins
40 40
       ],
41 41
       output: {

+ 1
- 1
src/fetch-inject.js View File

@@ -6,7 +6,7 @@ import {
6 6
  * Fetch Inject module.
7 7
  *
8 8
  * @module fetchInject
9
- * @license BTC
9
+ * @license WTFPL
10 10
  * @param {(USVString[]|Request[])} inputs Resources you wish to fetch.
11 11
  * @param {Promise} [promise] A promise to await before attempting injection.
12 12
  * @throws {Promise<TypeError>} Rejects with error on invalid arguments.

+ 4
- 14
src/injectors.js View File

@@ -1,19 +1,9 @@
1 1
 /**
2
- * BTC License
2
+ * Copyright (C) 2017—2018 Josh Habdas <jhabdas@protonmail.com>
3 3
  *
4
- * © 2017-2018, 13AMDq9isKtQTxMQG4w7Yo7cEhqKAqQ4Lz
5
- *
6
- * Permission to use, copy, modify, and/or distribute this software for any
7
- * purpose with or without fee is hereby granted, provided that the above
8
- * copyright notice and this permission notice appear in all copies.
9
- *
10
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4
+ * This work is free. You can redistribute it and/or modify it under the
5
+ * terms of the Do What The Fuck You Want To Public License, Version 2,
6
+ * as published by Sam Hocevar. See the COPYING file for more details.
17 7
  */
18 8
 
19 9
 export const head = (function(i,s,o,g,r,a,m){a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.appendChild(s.createTextNode(g.text));a.onload=r(g);m?m.parentNode.insertBefore(a,m):s.head.appendChild(a)}) // eslint-disable-line

Loading…
Cancel
Save