Skip to content

Commit

Permalink
Other: Coverage progress
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Jan 18, 2017
1 parent dfc7c43 commit 49053ff
Show file tree
Hide file tree
Showing 40 changed files with 522 additions and 97 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [6.5.0](https://github.com/dcodeIO/protobuf.js/releases/tag/6.5.0)
# [6.5.0](https://github.com/dcodeIO/protobuf.js/releases/tag/6.5.0) ([release](https://github.com/dcodeIO/protobuf.js/releases/tag/6.5.0))

## Breaking
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/3946e0fefea415f52a16ea7a74109ff40eee9643) Initial upgrade of converters to real generated functions, see [#620](https://github.com/dcodeIO/protobuf.js/issues/620)<br />
Expand Down Expand Up @@ -116,7 +116,7 @@
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/0643f93f5c0d96ed0ece5b47f54993ac3a827f1b) Some cleanup and added a logo<br />
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/169638382de9efe35a1079c5f2045c33b858059a) use $protobuf.Long<br />

# [6.4.0](https://github.com/dcodeIO/protobuf.js/releases/tag/6.4.0)
# [6.4.0](https://github.com/dcodeIO/protobuf.js/releases/tag/6.4.0) ([release](https://github.com/dcodeIO/protobuf.js/releases/tag/6.4.0))

## Breaking
[:hash:](https://github.com/dcodeIO/protobuf.js/commit/a017bf8a2dbdb7f9e7ce4c026bb6845174feb3b1) Dropped IE8 support<br />
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Usage
$> npm install protobufjs [--save --save-prefix=~]
```

**Note:** protobuf.js uses a [semver](https://semver.org)-incompatible versioning scheme currently. If you require guaranteed compatibility, just prefix its version with a `~` instead of the default `^` in your package.json's dependencies. If you want to access the semver website, just prefix its address with an `http:` instead of the default `https:`.
**Note:** protobuf.js uses a [semver](https://semver.org)-incompatible versioning scheme currently. For API compatibility, just prefix its version with a `~` instead of a `^` in your package.json's dependencies. If you want to access the semver website, just prefix its address with `http:` instead of `https:`.

```js
var protobuf = require("protobufjs");
Expand Down
90 changes: 90 additions & 0 deletions bench/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/highlight.min.js"></script>
<script src="https://cdn.rawgit.com/bestiejs/benchmark.js/2.1.3/benchmark.js"></script>
<script src="https://cdn.rawgit.com/dcodeIO/long.js/3.2.0/dist/long.min.js"></script>
<script src="https://cdn.rawgit.com/dcodeIO/protobuf.js/master/dist/protobuf.min.js"></script>
<script>
var data = {
"string" : "Lorem ipsum dolor sit amet.",
"uint32" : 9000,
"inner" : {
"int32" : 20161110,
"innerInner" : {
"long" : {
"low": 1051,
"high": 151234,
"unsigned": false
},
"enum" : 1,
"sint32": -42
},
"outer" : {
"bool" : [ true, false, false, true, false, false, true ],
"double": 204.8
}
},
"float": 0.25
};

var root = protobuf.parse("syntax = \"proto3\";\
message Test {\
string string = 1;\
uint32 uint32 = 2;\
Inner inner = 3;\
float float = 4;\
message Inner {\
int32 int32 = 1;\
InnerInner innerInner = 2;\
Outer outer = 3;\
message InnerInner {\
int64 long = 1;\
Enum enum = 2;\
sint32 sint32 = 3;\
}\
}\
enum Enum {\
ONE = 0;\
TWO = 1;\
THREE = 2;\
FOUR = 3;\
FIVE = 4;\
}\
}\
message Outer {\
repeated bool bool = 1;\
double double = 2;\
}").root;

var Test = root.lookup("Test");
var buf = Test.encode(data).finish();
var msg = Test.fromObject(data);
var obj = Test.toObject(msg);

var tests = {
"encoding": {
"Test.encode": "Test.encode(data).finish();",
"JSON.stringify": "JSON.stringify(data)"
},
"Test.decode": "Test.decode(buf);",
"Test.encode + decode": "Test.decode(Test.encode(data).finish());",
"Test.verify": "Test.verify(data);",
"Test.fromObject": "Test.fromObject(obj);",
"Test.toObject": "Test.toObject(msg);"
};
</script>
<style>body { font-family: sans-serif; } h2 { font-size: 1em; }</style>
</head>
<body>
<h1>protobuf.js browser benchmark</h1>
<script>
Object.keys(tests).forEach(function(name) {
document.write("<h2>" + name + "</h2>");
document.write("<pre><code class=\"javascript\">" + tests[name] + "</code></pre>");
});
hljs.initHighlightingOnLoad();
</script>
</body>
</html>
52 changes: 33 additions & 19 deletions dist/noparse/protobuf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/noparse/protobuf.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/noparse/protobuf.min.js

Large diffs are not rendered by default.

Binary file modified dist/noparse/protobuf.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/noparse/protobuf.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 49053ff

Please sign in to comment.