Skip to content

Conversation

@Aschen
Copy link
Contributor

@Aschen Aschen commented Dec 10, 2018

What does this PR do?

Expose protocol classes (Websocket, Http and SocketIO) in the root module.
Also remove the networkWrapper.

Documentation PR: kuzzleio/documentation#180

How should this be manually tested?

Run this snippet and the unit tests:

const {
  Kuzzle,
  Websocket
} = require('./index');

const
  websocketProtocol = new Websocket({ host: 'localhost', port: 7512 }),
  kuzzle = new Kuzzle(websocketProtocol);

(async () => {
  try {
    await kuzzle.connect();

    console.log(await kuzzle.server.now());
  } catch (error) {
    console.log(error);
  } finally {
    kuzzle.disconnect();
  }
})()

Other changes

  • Rename KuzzleAbstractNetwork to KuzzleAbstractProtocol
  • Rename network occurrences by protocol

@codecov-io
Copy link

codecov-io commented Dec 10, 2018

Codecov Report

Merging #341 into 6-dev will decrease coverage by 0.66%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##            6-dev     #341      +/-   ##
==========================================
- Coverage   97.23%   96.56%   -0.67%     
==========================================
  Files          28       27       -1     
  Lines        1410     1397      -13     
==========================================
- Hits         1371     1349      -22     
- Misses         39       48       +9
Impacted Files Coverage Δ
src/protocols/websocket.js 98.07% <ø> (ø)
src/protocols/socketio.js 94.64% <ø> (ø)
src/Kuzzle.js 95.56% <100%> (-4.44%) ⬇️
src/protocols/http.js 92.77% <100%> (ø)
src/protocols/abstract/realtime.js 100% <100%> (ø)
src/controllers/realtime/room.js 100% <100%> (ø) ⬆️
src/protocols/abstract/common.js 91.89% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8428770...fe6a801. Read the comment docs.

Copy link
Contributor

@scottinet scottinet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 👍
A few minor remarks, but otherwise it looks good to me.

Co-Authored-By: Aschen <amaret93@gmail.com>
@ScreamZ
Copy link
Contributor

ScreamZ commented Dec 12, 2018

Awesome good job @Aschen

@Aschen Aschen merged commit 206d140 into 6-dev Dec 13, 2018
@Aschen Aschen deleted the expose-protocol-classes branch December 13, 2018 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants