Skip to content

Commit

Permalink
2.4/1.2 Release (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
lugehorsam committed Jun 1, 2022
1 parent a15fd5f commit 1f25781
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,21 @@ The format is based on [keep a changelog](http://keepachangelog.com/) and this p

### Unreleased

### Added
- Added more details comments and documentation on objects and methods.

### Changed
- Changed data structure used to pass session variables to authentication methods. The old structure used was a `Map<string, string>`. We now use the `Record<string, string>` for serialization support.
- Changed `StreamData.stream_presence` to `StreamData.sender`. This field should be populated correctly now.
- Changed `MatchData.presences` to a singular `MatchData.presence`. This presence represents the sender. This field should be populated correctly now.
- Match and party data payloads are now serialized as protobuf when using the protobuf adapter.
- Because of this change, `sendMatchState` and `sendPartyData` can now receive bytes as input. If bytes are sent using the default text adapter, they are base64 encoded to a string.
- These functions can no longer receive data payloads of type `any`. Any object previously passed in must be serialized to a string or bytes. This change is enforced at compile time.
- Also due to this change, `MatchData` and `PartyData` have their `data` fields typed as a `Uint8Array`. This breaks
backwards compatibility. Users who send a string as their match or party data will need to use a utility such as `TextDecoder` to deserialize the string. This change is enforced at compile time.

### Fixed
- Fixed an issue with our base64 dependency in React Native.

### [2.3.0]

Expand Down
2 changes: 1 addition & 1 deletion packages/nakama-js-protobuf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@heroiclabs/nakama-js-protobuf",
"version": "1.1.0",
"version": "1.2.0",
"description": "Websocket adapter adding protocol buffer support to the Nakama Javascript client.",
"main": "dist/nakama-js-protobuf.cjs.js",
"module": "dist/nakama-js-protobuf.esm.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/nakama-js-test/socket-match.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ describe('Match Tests', () => {
}, customid1, customid2, customid3, JSON.stringify(outerPayload), adapter);

expect(matchDataString).not.toBeNull();
expect(JSON.parse(matchDataString).toEqual(outerPayload));
expect(JSON.parse(matchDataString)).toEqual(outerPayload);
});

it.each(adapters)('should join a match, then do not send data to excluded presences', async (adapter) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/nakama-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@heroiclabs/nakama-js",
"version": "2.3.0",
"version": "2.4.0",
"scripts": {
"build": "node build.js",
"docs": "typedoc index.ts --gaID UA-89839802-1 --out ../../docs"
Expand Down

0 comments on commit 1f25781

Please sign in to comment.