Skip to content

Commit 2bad611

Browse files
committed
Merge branch 'master' into gh-pages
2 parents 1a73262 + f406808 commit 2bad611

14 files changed

+39
-130
lines changed

README.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
---
1010

11+
> **NOTE:** The npm package name changed to `urijs`
12+
13+
---
14+
1115
I always want to shoot myself in the head when looking at code like the following:
1216

1317
```javascript
@@ -17,9 +21,7 @@ var separator = url.indexOf('?') > -1 ? '&' : '?';
1721
url += separator + encodeURIComponent("foo") + "=" + encodeURIComponent("bar");
1822
```
1923

20-
I still can't believe javascript - the f**ing backbone-language of the web - doesn't offer an API for mutating URLs. Browsers (Firefox) don't expose the `Location` object (the structure behind window.location). Yes, one could think of [decomposed IDL attributes](http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#url-decomposition-idl-attributes) as a native URL management library. But it relies on the DOM element <a>, it's slow and doesn't offer any convenience at all.
21-
22-
How about a nice, clean and simple API for mutating URIs:
24+
Things are looking up with [URL](https://developer.mozilla.org/en/docs/Web/API/URL) and the [URL spec](http://url.spec.whatwg.org/) but until we can safely rely on that API, have a look at URI.js for a clean and simple API for mutating URIs:
2325

2426
```javascript
2527
var url = new URI("http://example.org/foo?bar=baz");
@@ -79,20 +81,14 @@ See the [About Page](http://medialize.github.io/URI.js/) and [API Docs](http://m
7981

8082
URI.js (without plugins) has a gzipped weight of about 7KB - if you include all extensions you end up at about 13KB. So unless you *need* second level domain support and use URI templates, we suggest you don't include them in your build. If you don't need a full featured URI mangler, it may be worth looking into the much smaller parser-only alternatives [listed below](#alternatives).
8183

82-
URI.js is available through [npm](http://npmjs.org/), [bower](http://bower.io/), [Jam](http://jamjs.org/), [spm](http://spmjs.io/) and manually from the [build page](http://medialize.github.io/URI.js/build.html):
84+
URI.js is available through [npm](https://www.npmjs.com/package/urijs), [bower](http://bower.io/search/?q=urijs), [cdnjs](https://cdnjs.com/libraries/URI.js) and manually from the [build page](http://medialize.github.io/URI.js/build.html):
8385

8486
```bash
8587
# using bower
8688
bower install uri.js
8789

88-
# using Jam
89-
jam install URIjs
90-
9190
# using npm
92-
npm install URIjs
93-
94-
# using spm
95-
spm install urijs
91+
npm install urijs
9692
```
9793

9894
### Browser ###
@@ -101,13 +97,13 @@ I guess you'll manage to use the [build tool](http://medialize.github.io/URI.js/
10197

10298
### Node.js and NPM ###
10399

104-
Install with `npm install URIjs` or add `"URIjs"` to the dependencies in your `package.json`.
100+
Install with `npm install urijs` or add `"urijs"` to the dependencies in your `package.json`.
105101

106102
```javascript
107103
// load URI.js
108-
var URI = require('URIjs');
104+
var URI = require('urijs');
109105
// load an optional module (e.g. URITemplate)
110-
var URITemplate = require('URIjs/src/URITemplate');
106+
var URITemplate = require('urijs/src/URITemplate');
111107

112108
URI("/foo/bar/baz.html")
113109
.relativeTo("/foo/bar/sub/world.html")
@@ -121,14 +117,14 @@ Clone the URI.js repository or use a package manager to get URI.js into your pro
121117
```javascript
122118
require.config({
123119
paths: {
124-
URIjs: 'where-you-put-uri.js/src'
120+
urijs: 'where-you-put-uri.js/src'
125121
}
126122
});
127123

128-
require(['URIjs/URI'], function(URI) {
124+
require(['urijs/URI'], function(URI) {
129125
console.log("URI.js and dependencies: ", URI("//amazon.co.uk").is('sld') ? 'loaded' : 'failed');
130126
});
131-
require(['URIjs/URITemplate'], function(URITemplate) {
127+
require(['urijs/URITemplate'], function(URITemplate) {
132128
console.log("URITemplate.js and dependencies: ", URITemplate._cache ? 'loaded' : 'failed');
133129
});
134130
```
@@ -199,14 +195,14 @@ If you don't like URI.js, you may like one of the following libraries. (If yours
199195
* [furl (Python)](https://github.com/gruns/furl)
200196
* [mediawiki Uri](https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/mediawiki/mediawiki.Uri.js?view=markup) (needs mw and jQuery)
201197
* [jurlp](https://github.com/tombonner/jurlp)
202-
* [jsUri](http://code.google.com/p/jsuri/)
198+
* [jsUri](https://github.com/derek-watson/jsUri)
203199

204200
#### URL Parsers ####
205201

206202
* [The simple <a> URL Mutation "Hack"](http://jsfiddle.net/rodneyrehm/KkGUJ/) ([jsPerf comparison](http://jsperf.com/idl-attributes-vs-uri-js))
207203
* [URI Parser](http://blog.stevenlevithan.com/archives/parseuri)
208204
* [jQuery-URL-Parser](https://github.com/allmarkedup/jQuery-URL-Parser)
209-
* [Google Closure Uri](http://closure-library.googlecode.com/svn/docs/closure_goog_uri_uri.js.html)
205+
* [Google Closure Uri](https://google.github.io/closure-library/api/class_goog_Uri.html)
210206
* [URI.js by Gary Court](https://github.com/garycourt/uri-js)
211207

212208
#### URI Template ####
@@ -244,6 +240,13 @@ URI.js is published under the [MIT license](http://www.opensource.org/licenses/m
244240

245241
## Changelog ##
246242

243+
### 1.16.1 (September 19th 2015) ###
244+
245+
Package Management Cleanup - no changes to source code!
246+
247+
* renaming package to "urijs", was "URIjs" (because npm decided to go lower-case at some point and maintaining capitals in your package name poses all sorts of stupid issues)
248+
* removing [jam](http://jamjs.org/), [spm](http://spmjs.org/), `component.json` and `URI.jquery.json` as nobody cared that URI.js was stuck on 1.14 for a year
249+
247250
### 1.16.0 (July 24th 2015) ###
248251

249252
* **SECURITY** fixing [`URI.parseHost()`](http://medialize.github.io/URI.js/docs.html#static-parseHost) to rewrite `\` to `/` as Node and Browsers do - [Issue #233](https://github.com/medialize/URI.js/pull/233)

URI.jquery.json

Lines changed: 0 additions & 38 deletions
This file was deleted.

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "URIjs",
3-
"version": "1.16.0",
2+
"name": "urijs",
3+
"version": "1.16.1",
44
"main": "src/URI.js",
55
"ignore": [
66
".*",

build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function build(files) {
2929
output_format: "text",
3030
output_info: "compiled_code"
3131
}, function(data) {
32-
var code = "/*! URI.js v1.16.0 http://medialize.github.io/URI.js/ */\n/* build contains: " + files.join(', ') + " */\n" + data;
32+
var code = "/*! URI.js v1.16.1 http://medialize.github.io/URI.js/ */\n/* build contains: " + files.join(', ') + " */\n" + data;
3333
$progress.hide();
3434
$out.val(code).parent().show();
3535
$out.prev().find('a').remove();

component.json

Lines changed: 0 additions & 37 deletions
This file was deleted.

docs.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ <h3 id="constructor">URI Constructor</h3>
192192
// URI parts object
193193
var uri = new URI({
194194
protocol: "http",
195-
host: "example.org"
195+
hostname: "example.org"
196196
});
197197

198198
// without new keyword
@@ -1140,7 +1140,7 @@ <h3 id="static-encode">URI.encode()</h3>
11401140

11411141
<h3 id="static-decode">URI.decode()</h3>
11421142
<p>Decode an URI component</p>
1143-
<pre class="prettyprint lang-js">URI.encode("h%C3%A4%20lo%23w%2Arl%3Ad%21") === "hä lo#w*rl:d!";
1143+
<pre class="prettyprint lang-js">URI.decode("h%C3%A4%20lo%23w%2Arl%3Ad%21") === "hä lo#w*rl:d!";
11441144
// note:
11451145
URI.decode === decodeURIComponent;</pre>
11461146

package.json

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "URIjs",
3-
"version": "1.16.0",
2+
"name": "urijs",
3+
"version": "1.16.1",
44
"title": "URI.js - Mutating URLs",
55
"author": {
66
"name": "Rodney Rehm",
@@ -54,23 +54,7 @@
5454
"src/URI.fragmentURI.js",
5555
"LICENSE.txt"
5656
],
57-
"jam": {
58-
"main": "src/URI.js",
59-
"include": [
60-
"src/URI.js",
61-
"src/IPv6.js",
62-
"src/SecondLevelDomains.js",
63-
"src/punycode.js",
64-
"src/URITemplate.js",
65-
"src/jquery.URI.js",
66-
"src/URI.min.js",
67-
"src/jquery.URI.min.js",
68-
"src/URI.fragmentQuery.js",
69-
"src/URI.fragmentURI.js",
70-
"LICENSE.txt"
71-
]
72-
},
73-
"npmName": "URIjs",
57+
"npmName": "urijs",
7458
"npmFileMap": [
7559
{
7660
"basePath": "/src/",
@@ -89,8 +73,5 @@
8973
"jshint-stylish": "~0.1.5",
9074
"grunt": "~0.4.2",
9175
"grunt-contrib-jshint": "~0.8.0"
92-
},
93-
"spm": {
94-
"main": "src/URI.js"
9576
}
9677
}

src/IPv6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* URI.js - Mutating URLs
33
* IPv6 Support
44
*
5-
* Version: 1.16.0
5+
* Version: 1.16.1
66
*
77
* Author: Rodney Rehm
88
* Web: http://medialize.github.io/URI.js/

src/SecondLevelDomains.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* URI.js - Mutating URLs
33
* Second Level Domain (SLD) Support
44
*
5-
* Version: 1.16.0
5+
* Version: 1.16.1
66
*
77
* Author: Rodney Rehm
88
* Web: http://medialize.github.io/URI.js/

src/URI.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* URI.js - Mutating URLs
33
*
4-
* Version: 1.16.0
4+
* Version: 1.16.1
55
*
66
* Author: Rodney Rehm
77
* Web: http://medialize.github.io/URI.js/
@@ -72,7 +72,7 @@
7272
return this;
7373
}
7474

75-
URI.version = '1.16.0';
75+
URI.version = '1.16.1';
7676

7777
var p = URI.prototype;
7878
var hasOwn = Object.prototype.hasOwnProperty;

src/URI.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/URITemplate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* URI.js - Mutating URLs
33
* URI Template Support - http://tools.ietf.org/html/rfc6570
44
*
5-
* Version: 1.16.0
5+
* Version: 1.16.1
66
*
77
* Author: Rodney Rehm
88
* Web: http://medialize.github.io/URI.js/

src/jquery.URI.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* URI.js - Mutating URLs
33
* jQuery Plugin
44
*
5-
* Version: 1.16.0
5+
* Version: 1.16.1
66
*
77
* Author: Rodney Rehm
88
* Web: http://medialize.github.io/URI.js/jquery-uri-plugin.html

src/jquery.URI.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)