Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Message pack protocol in TS client #631

Merged
merged 3 commits into from Aug 9, 2017
Merged

Message pack protocol in TS client #631

merged 3 commits into from Aug 9, 2017

Conversation

moozzyk
Copy link
Contributor

@moozzyk moozzyk commented Jul 3, 2017

Note: it is not plugged in yet - #677 required to make it work end-to-end)

@moozzyk
Copy link
Contributor Author

moozzyk commented Aug 7, 2017

🆙📅 - rebased on latest dev

"browserify": "^13.1.1",
"del": "^2.2.2",
"gulp": "^3.9.1",
"gulp-typescript": "^3.1.3",
"jasmine": "^2.5.2",
"msgpack-lite": "^0.1.26",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually looking if we can use https://github.com/mcollina/msgpack5 which is not 0.x

import { IHubProtocol, MessageType, HubMessage, InvocationMessage, ResultMessage, CompletionMessage } from "./IHubProtocol";
import { BinaryMessageFormat } from "./Formatters"

var msgpack = require("msgpack-lite");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

They added typings a day after I wrote this code. Switching to typings will make this ugliness go away.

"browserify": "^13.1.1",
"del": "^2.2.2",
"gulp": "^3.9.1",
"gulp-typescript": "^3.1.3",
"jasmine": "^2.5.2",
"msgpack5": "^3.5.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Eilon - non-0.x msgpack library for approval

Copy link
Member

Choose a reason for hiding this comment

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

This package is approved for use here. I logged #696 for adding the third party notices file.

@moozzyk
Copy link
Contributor Author

moozzyk commented Aug 7, 2017

🆙📅

"browserify": "^13.1.1",
"del": "^2.2.2",
"gulp": "^3.9.1",
"gulp-typescript": "^3.1.3",
"jasmine": "^2.5.2",
"msgpack5": "^3.5.0",
Copy link
Member

Choose a reason for hiding this comment

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

This package is approved for use here. I logged #696 for adding the third party notices file.

moozzyk and others added 3 commits August 8, 2017 12:13
Before we would rely on error being null to detect whether to read results and we had an additional 'hasResult' field. Now all this information is codified in a field.
Makes it much easier to parse in JavaScript (also is more MsgPacky)
@moozzyk
Copy link
Contributor Author

moozzyk commented Aug 8, 2017

⌚ - still need a review. @Eilon approval is for usage of msgpack5 and not the PR in general.

Copy link
Member

@davidfowl davidfowl left a comment

Choose a reason for hiding this comment

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

Looks mostly mechanical 👍 . Can you write the spec next? That'll help me understand how we're using msgpack. It's really hard to look at tests with tons of hex 😄

@moozzyk
Copy link
Contributor Author

moozzyk commented Aug 9, 2017

Yes, spec update is coming.

@@ -137,32 +148,41 @@ private void WriteMessageCore(HubMessage message, Stream output)

private static void WriteInvocationMessage(InvocationMessage invocationMessage, Packer packer, Stream output)
{
packer.PackArrayHeader(5);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

btw. @neuecc predicted this...

@moozzyk moozzyk merged commit e2cec0b into dev Aug 9, 2017
@moozzyk moozzyk deleted the pawelka/msgpack-js branch August 23, 2017 23:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants