Skip to content

Commit d246024

Browse files
committed
Other: Minor optimizations to dependencies, build process and tsd
1 parent 33d14c9 commit d246024

25 files changed

+65
-64
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"browser": true
55
},
66
"globals": {
7+
"ArrayBuffer": true,
78
"Uint8Array": true,
89
"Float32Array": true,
910
"Float64Array": true,

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ branches:
1616
matrix:
1717
include:
1818
- node_js: 6
19-
script: set -e; if [ -n "$SAUCE_USERNAME" ]; then travis_wait npm run zuul; sleep 3; fi
19+
script: set -e; if [ -n "$SAUCE_USERNAME" ]; then npm install zuul@3.11.1 zuul-ngrok@4.0.0; travis_wait npm run zuul; sleep 3; fi
2020
- node_js: 6
2121
script: npm run coverage-ci

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ The `pbjs` utility is also capable of generating static code (hint: works with j
418418
$> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto
419419
```
420420

421-
will generate static code for definitions within `file1.proto` and `file2.proto` to a CommonJS module `compiled.js`, which then can be used with just the [minimal library](#distributions).
421+
will generate static code for definitions within `file1.proto` and `file2.proto` to a CommonJS module `compiled.js`.
422422

423423
**ProTip!** Documenting your .proto files with `/** ... */`-blocks or (trailing) `/// ...` lines translates to generated static code.
424424

@@ -465,9 +465,9 @@ $> pbjs -t static-module file1.proto file2.proto | pbts -o bundle.d.ts -
465465

466466
### On reflection vs. static code
467467

468-
While using .proto files directly requires the [full library](#distributions) respectively pure reflection/JSON the [light library](#distributions), pretty much all code but the relatively short descriptors is shared.
468+
While using .proto files directly requires the full library respectively pure reflection/JSON the light library, pretty much all code but the relatively short descriptors is shared.
469469

470-
Static code, on the other hand, requires just the [minimal library](#distributions), but generates additional, albeit editable, source code without any reflection features.
470+
Static code, on the other hand, requires just the minimal library, but generates additional, albeit editable, source code without any reflection features.
471471

472472
There is no significant difference performance-wise as the code generated statically is pretty much the same as generated at runtime and both are largely interchangeable as seen in the previous section.
473473

cli/targets/static.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = static_target;
44
var protobuf = require("../.."),
55
cliUtil = require("../util"),
66
UglifyJS = require("uglify-js"),
7-
esprima = require("esprima"),
7+
espree = require("espree"),
88
escodegen = require("escodegen"),
99
estraverse = require("estraverse");
1010

@@ -161,7 +161,7 @@ function beautifyCode(code) {
161161
}
162162
}).code;
163163
// Properly beautify
164-
var ast = esprima.parse(code);
164+
var ast = espree.parse(code);
165165
estraverse.replace(ast, {
166166
enter: function(node, parent) {
167167
// rename short vars

dist/light/protobuf.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/light/protobuf.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/light/protobuf.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/light/protobuf.min.js.gz

14 Bytes
Binary file not shown.

dist/light/protobuf.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/minimal/protobuf.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)