Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8716be7
Fix 343 unhandled rejection on connect (#345)
Aschen Dec 19, 2018
27fa579
Put document:create optional args in last position (#348)
Aschen Dec 21, 2018
7390dfb
[build] update webpack build config to fix raw web usage (#349)
Njuelle Dec 26, 2018
6d0104c
Have host param mandatory for protocols (#350)
Aschen Dec 27, 2018
a1169cd
fix conflicts
Njuelle Jan 4, 2019
9ca0529
Add method to use custom controllers in the SDK (#353)
Aschen Jan 7, 2019
db802ae
Merge branch '6-beta' into 6-dev
etrousset Jan 7, 2019
8519d8c
[babel] replace the deprecated preset
scottinet Jan 8, 2019
f50a18a
[compat] remove Symbol usages (incompatible with react native)
scottinet Jan 8, 2019
8654581
[webpack] fix broken babel loader configuration
scottinet Jan 8, 2019
e4b1d61
[babel] isolate babel configuration to its own config file
scottinet Jan 8, 2019
4864624
[doc] update the cjs/import examples
scottinet Jan 8, 2019
93ded12
[babel] specific target configurations
scottinet Jan 9, 2019
075b341
[babel] specific target configurations
scottinet Jan 9, 2019
74fc7ab
[webpack] make distinct packages for both node/react and browsers
scottinet Jan 9, 2019
5623c42
[deps] remove unused dependency
scottinet Jan 9, 2019
bf947a4
[react] fix packaging
scottinet Jan 9, 2019
534b003
wtf
scottinet Jan 9, 2019
f22adb7
fix webpack build when installed as a dependency
scottinet Jan 9, 2019
cc1d366
Update webpack.config.js
xbill82 Jan 10, 2019
23bec1f
[webpack] fix bad json format
scottinet Jan 10, 2019
e130e2a
Merge pull request #355 from kuzzleio/react-native-compat
xbill82 Jan 10, 2019
343ed3e
fix npm install link
Aschen Jan 15, 2019
7f91d5b
Merge branch '6-dev' of github.com:kuzzleio/sdk-javascript into 6-dev
Aschen Jan 15, 2019
a0f419e
Fixed call to checkToken after reconnection (#359)
xbill82 Jan 15, 2019
ca1a8a1
Fix 343 unhandled rejection on connect (#345)
Aschen Dec 19, 2018
fb9c20c
Put document:create optional args in last position (#348)
Aschen Dec 21, 2018
cdef983
[build] update webpack build config to fix raw web usage (#349)
Njuelle Dec 26, 2018
cb57a3c
Have host param mandatory for protocols (#350)
Aschen Dec 27, 2018
2de9750
Add method to use custom controllers in the SDK (#353)
Aschen Jan 7, 2019
23e0739
fix npm install link
Aschen Jan 15, 2019
a37b867
[babel] replace the deprecated preset
scottinet Jan 8, 2019
9648f3d
[compat] remove Symbol usages (incompatible with react native)
scottinet Jan 8, 2019
df88a7f
[webpack] fix broken babel loader configuration
scottinet Jan 8, 2019
d68b0cf
[babel] isolate babel configuration to its own config file
scottinet Jan 8, 2019
6192fe6
[doc] update the cjs/import examples
scottinet Jan 8, 2019
dfe7559
[babel] specific target configurations
scottinet Jan 9, 2019
fe54dc2
[babel] specific target configurations
scottinet Jan 9, 2019
77fd9d4
[webpack] make distinct packages for both node/react and browsers
scottinet Jan 9, 2019
e862ae9
[deps] remove unused dependency
scottinet Jan 9, 2019
c7815fb
[react] fix packaging
scottinet Jan 9, 2019
43e9e7f
wtf
scottinet Jan 9, 2019
23b1912
fix webpack build when installed as a dependency
scottinet Jan 9, 2019
8d2aac5
Update webpack.config.js
xbill82 Jan 10, 2019
0991439
[webpack] fix bad json format
scottinet Jan 10, 2019
2229e25
Fixed call to checkToken after reconnection (#359)
xbill82 Jan 15, 2019
8c8b8ac
Merge branch '6-dev' of github.com:kuzzleio/sdk-javascript into 6-dev
scottinet Jan 17, 2019
e8aa279
Release 6.0.0-beta-6
scottinet Jan 17, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
presets: [
[
'@babel/env',
{
targets: {
browsers: ['> 1%']
}
}
]
],
plugins: [
['@babel/plugin-transform-for-of', {'assumeArray': true}]
]
};
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ try {

This SDK can be used either in NodeJS or in a browser.

### NodeJS
### Node.js

```
# Beta v6
npm install git://github.com/kuzzleio/sdk-javascript.git#6-beta
npm install kuzzle-sdk@beta
```

### Browser
Expand Down Expand Up @@ -102,18 +102,19 @@ But you'll still need to pick the built version (which ships with the package).

```javascript
// with the classic require...
const { Kuzzle } = require('kuzzle-sdk/dist/kuzzle.js')
const { Kuzzle } = require('kuzzle-sdk')
// ... or with the new import directive.
import { Kuzzle } from 'kuzzle-sdk/dist/kuzzle.js'
import { Kuzzle } from 'kuzzle-sdk'
```

## Available protocols
Currently, the SDK provides 3 protocols: `Http`, `WebSocket` and `SocketIO`.

Currently, the SDK provides 3 protocols: `Http`, `WebSocket` and `SocketIO`.

WebSocket and Socket.IO protocols implement the whole Kuzzle API, while the **HTTP protocol does not implement realtime features** (rooms and subscriptions).
While Socket.IO offers better compatibility with older web browsers, our raw WebSocket implementation is about 20% faster.

#### NodeJS
#### Node.js

We recommend using the `WebSocket` protocol, but you can still use `Http`, `SocketIO` or even a custom protocol if you want.

Expand Down Expand Up @@ -225,8 +226,8 @@ Each controller is accessible from the Kuzzle object. The controller's actions a
For example, for the `create` action of the `document` controller ([document:create](https://docs-v2.kuzzle.io/api/1/controller-document/create)):
```js
const options = { refresh: 'wait_for' };
const documentBody = { hello: 'world' };
kuzzle.document.create('my-index', 'my-collection', documentBody, 'my-uniq-id', options)
const document = { hello: 'world' };
kuzzle.document.create('my-index', 'my-collection', document, 'my-uniq-id', options)
```

The parameters of each method differ according to the parameters expected in the API.
Expand Down
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const
ora = require('ora'),
webpack = require('webpack'),
webpackConfig = require('./webpack.config.js'),
spinner = ora('Building SDK for browser use...');
spinner = ora('Building SDK...');

process.env.NODE_ENV = 'production';

Expand Down
Loading