@@ -4,7 +4,95 @@ This project adheres to [Semantic Versioning Scheme](http://semver.org)
4
4
5
5
---
6
6
7
- ## [ Unreleased] ( https://github.com/pusher/chatkit-client-js/compare/0.6.2...HEAD )
7
+ ## [ Unreleased] ( https://github.com/pusher/chatkit-client-js/compare/0.7.0...HEAD )
8
+
9
+ ## 0.7.0 -- 2018-03-13
10
+
11
+ This version represents a radical departure from 0.6.X. The interface is very
12
+ different, and there's a good chance we'll miss some of the changes in this
13
+ log. If something isn't working after migration, the best place to look first
14
+ is probably the
15
+ [ documentation] ( https://docs.pusher.com/chatkit/reference/javascript ) .
16
+
17
+ ### Changes
18
+
19
+ - Methods with ` onSuccess ` , ` onFailure ` callbacks changed to return promises
20
+ instead. e.g.
21
+
22
+ ``` javascript
23
+ chatManager
24
+ .connect ()
25
+ .then (currentUser => {})
26
+ .catch (err => {})
27
+ ```
28
+
29
+ - All methods take a single object parameter (see the
30
+ [ documentation] ( https://docs.pusher.com/chatkit/reference/javascript ) for
31
+ details on each method's arguments)
32
+
33
+ - Delegates renamed to ` hooks ` throughout. e.g.
34
+
35
+ ``` javascript
36
+ currentUser .subscribeToRoom ({
37
+ roomId,
38
+ hooks: {
39
+ onNewMessage : m => {}
40
+ }
41
+ })
42
+ ```
43
+
44
+ - Hooks all prefixed with ` on ` . e.g. ` onNewMessage ` , ` onStartedTyping `
45
+
46
+ - ` cursorSet ` hook renamed to ` onNewCursor `
47
+
48
+ - ` authContext.queryParams ` and ` authContext.headers ` both moved to the root
49
+ options object in the token provider. e.g.
50
+
51
+ ``` javascript
52
+ const tokenProvider = new TokenProvider ({
53
+ url: ' your.auth.url' ,
54
+ queryParams: {
55
+ someKey: someValue,
56
+ ...
57
+ },
58
+ headers: {
59
+ SomeHeader: ' some-value' ,
60
+ ...
61
+ }
62
+ })
63
+ ```
64
+
65
+ - ` addUser ` and ` removeUser ` renamed to ` addUserToRoom ` and ` removeUserFromRoom `
66
+
67
+ - methods that used to accept a ` Room ` object now accept a ` roomId ` . e.g.
68
+
69
+ instead of
70
+
71
+ ``` javascript
72
+ currentUser .subscribeToRoom (myRoom, hooks) // WRONG
73
+ ```
74
+
75
+ do
76
+
77
+ ``` javascript
78
+ currentUser .subscribeToRoom ({ roomId: myRoom .id , hooks })
79
+ ```
80
+
81
+ - The behaviour of read cursors has changed: in particular cursors are now
82
+ accessed via ` currentUser.readCursor ` and set with
83
+ ` currentUser.setReadCursor ` . See the [ Read Cursors section of the
84
+ documentation] ( https://docs.pusher.com/chatkit/reference/javascript#read-cursors )
85
+ for details.
86
+
87
+ - Presence data is now accessable on any user object under ` user.presence ` . e.g.
88
+
89
+ ``` javascript
90
+ const isOnline = user .presence .state === ' online'
91
+ ```
92
+
93
+ - All users that share a common room membership are accesable under
94
+ ` currentUser.users ` , and all members of a room are accessable under
95
+ ` room.users ` .
8
96
9
97
## 0.6.2 -- 2018-02-05
10
98
0 commit comments