-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issues with Root.fromJSON/#addJSON, search global for Long
- Loading branch information
Showing
16 changed files
with
165 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,31 @@ | ||
This folder contains prebuilt browser versions of [protobuf.js](https://github.com/dcodeIO/protobuf.js). When sending pull requests, it is not required to update these. | ||
|
||
Prebuilt files are in source control to enable pain-free CDN usage through [RawGit](http://rawgit.com/): | ||
Prebuilt files are in source control to enable pain-free frontend respectively CDN usage: | ||
|
||
Development: | ||
CDN usage | ||
--------- | ||
|
||
Development: | ||
``` | ||
<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.0.0/dist/protobuf.js"></script> | ||
``` | ||
|
||
Production: | ||
|
||
``` | ||
<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.0.0/dist/protobuf.min.js"></script> | ||
``` | ||
|
||
**NOTE:** Remember to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/releases) your project depends upon. | ||
|
||
Frontend usage | ||
-------------- | ||
|
||
Development: | ||
``` | ||
<script src="node_modules/protobufjs/dist/protobuf.js"></script> | ||
``` | ||
|
||
Production: | ||
``` | ||
<script src="node_modules/protobufjs/dist/protobuf.min.js"></script> | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
var protobuf = require(".."), | ||
data = require("../bench/bench.json"); | ||
|
||
var root = protobuf.Root.fromJSON({ | ||
"nested": { | ||
"Test": { | ||
"fields": { | ||
"string": { | ||
"type": "string", | ||
"id": 1 | ||
}, | ||
"uint32": { | ||
"type": "uint32", | ||
"id": 2 | ||
}, | ||
"inner": { | ||
"type": "Inner", | ||
"id": 3 | ||
} | ||
}, | ||
"nested": { | ||
"Inner": { | ||
"fields": { | ||
"int32": { | ||
"type": "int32", | ||
"id": 1 | ||
}, | ||
"innerInner": { | ||
"type": "InnerInner", | ||
"id": 2 | ||
}, | ||
"outer": { | ||
"type": "Outer", | ||
"id": 3 | ||
} | ||
}, | ||
"nested": { | ||
"InnerInner": { | ||
"fields": { | ||
"long": { | ||
"type": "int64", | ||
"id": 1 | ||
}, | ||
"enum": { | ||
"type": "Enum", | ||
"id": 2 | ||
}, | ||
"sint32": { | ||
"type": "sint32", | ||
"id": 3 | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"Enum": { | ||
"values": { | ||
"ONE": 0, | ||
"TWO": 1, | ||
"THREE": 2, | ||
"FOUR": 3, | ||
"FIVE": 4 | ||
} | ||
} | ||
} | ||
}, | ||
"Outer": { | ||
"fields": { | ||
"bool": { | ||
"rule": "repeated", | ||
"type": "bool", | ||
"id": 1, | ||
"options": { | ||
"packed": true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}); | ||
|
||
var Test = root.lookup("Test"); | ||
for (var i = 0; i < 100000000; ++i) | ||
Test.encode(data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.