Skip to content

Commit cbf6d55

Browse files
committed
Merge remote-tracking branch 'origin/develop' into feature-138-should-fail
2 parents 753801f + 9a713a9 commit cbf6d55

File tree

7 files changed

+14
-40
lines changed

7 files changed

+14
-40
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,18 @@ kuzzle
100100

101101
### Javascript
102102

103-
You can install this SDK with [Bower](http://bower.io/).
104-
```
105-
bower install kuzzle-sdk --save
103+
Clone this github repository and run ``npm run build``. A ``dist`` directory will be created, containing a browser version of this SDK.
104+
105+
106+
```html
107+
<script type="text/javascript" src="dist/kuzzle.js"></script>
106108
```
107109

110+
If you want to support older browser versions, you may load `socket.io` before Kuzzle, making the SDK compatible with browsers without websocket support:
111+
108112
```html
109-
<!-- Don't forget to include socketio before kuzzle -->
110-
<script type="text/javascript" src="bower_components/socket.io-client/socket.io.js"></script>
111-
<script type="text/javascript" src="bower_components/kuzzle-sdk/dist/kuzzle.min.js"></script>
113+
<!-- Don't forget to include socketio before kuzzle SDK -->
114+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.6.0/socket.io.min.js"></script>
112115
```
113116

114117
#### <a name="basic-usage-js"></a> Basic usage
@@ -137,10 +140,6 @@ kuzzle
137140
});
138141
```
139142

140-
## Building manually
141-
142-
Clone this github repository and run ``grunt``. A ``dist`` directory will be created, containing a plain browserified version of this SDK, and a minified version.
143-
144143
## Migrating from SDK v1.x
145144

146145
* Kuzzle constructor has been changed. Instead of an URL, you have to provide a resolvable server name, or an IP address. If you need to specify a port different than the provided default values, you can do so using these two new options: `wsPort` (WebSocket port) and `ioPort` (Socket.IO port)

bower.json

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

dist/kuzzle.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.

dist/kuzzle.js.map

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

src/kuzzle.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,8 +1291,7 @@ Kuzzle.prototype.query = function (queryArgs, query, options, cb) {
12911291
* a developer simply wish to verify his token
12921292
*/
12931293
if (self.jwtToken !== undefined && !(object.controller === 'auth' && object.action === 'checkToken')) {
1294-
object.headers = object.headers || {};
1295-
object.headers.authorization = 'Bearer ' + self.jwtToken;
1294+
object.jwt = self.jwtToken;
12961295
}
12971296

12981297
if (queryArgs.collection) {

test/kuzzle/constructor.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ describe('Kuzzle constructor', () => {
10171017
should(kuzzle.offlineQueue[0].query.action).be.exactly('action');
10181018
should(kuzzle.offlineQueue[0].query.controller).be.exactly('controller');
10191019
should(kuzzle.offlineQueue[0].query.index).be.exactly('index');
1020-
should(kuzzle.offlineQueue[0].query.headers.authorization).be.exactly('Bearer fake-token');
1020+
should(kuzzle.offlineQueue[0].query.jwt).be.exactly('fake-token');
10211021
});
10221022
});
10231023
});

webpack.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ module.exports = {
2121
setImmediate: false
2222
},
2323
module: {
24-
noParse: [/ws/, /crypto/, /buffer/, /node-uuid/],
2524
loaders: [
2625
{
2726
test: /\.js$/,

0 commit comments

Comments
 (0)