To make sure js-ipfs runs in all environments safely we want to get rid of all unsafe eval instances. The first round will be moving from protocol-buffers to protobufjs protons.
Code coverage is dropping dramatically with this change because it is trying to check if we test the newly generated code:
Just published a release of aegir which allows to ignore files from coverage: aegir coverage --ignore src/somefile.js
Needs this to get done - https://github.com/ipld/js-ipld-dag-pb/issues/41
Good news, we don't need to migrate, just use this version of protocol-buffers I made which switches to regular functions instead of generating them and evaling:
https://github.com/dignifiedquire/protocol-buffers/tree/fixes
perf is a bit worse, but not that bad
npm (encode) x 482,202 ops/sec ±3.14% (85 runs sampled)
npm (decode) x 1,863,500 ops/sec ±1.23% (91 runs sampled)
npm(encode + decode) x 349,692 ops/sec ±1.66% (82 runs sampled)
local (encode) x 423,864 ops/sec ±1.51% (88 runs sampled)
local (decode) x 1,042,350 ops/sec ±1.19% (94 runs sampled)
local(encode + decode) x 294,290 ops/sec ±1.39% (89 runs sampled)
Awesome @dignifiedquire !
Might make it a real module and not a fork (i.e maintained, CI, published to npm, etc)?
Probably yes
Renamed to protons: https://github.com/dignifiedquire/protons publish coming soon
Just published https://www.npmjs.com/package/protons
Awesome. Make sure to have a reference in the README to the original module and the reason that lead to the fork, other people will find useful.
there already is?
@diasdavid PRs are ready for you to review
Ok, everything merged, released and all the deps in the middle were also updated to make sure that npm always installs the latest patch version.
Test away :)
Tracking results:
Missed two modules
npm ls protocol-buffers
[email protected] /Users/dignifiedquire/opensource/ipfs/js-ipfs
├─┬ [email protected]
│ └─┬ [email protected]
│ └── [email protected] deduped
└─┬ [email protected]
└── [email protected]
> npm ls protocol-buffers
[email protected] /Users/imp/code/js-ipfs
└── (empty)
Closing?

Most helpful comment