Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update deps and remove protons #153

Merged
merged 10 commits into from
Apr 28, 2021

Conversation

vasco-santos
Copy link
Collaborator

@vasco-santos vasco-santos commented Apr 7, 2021

Updating all the dependencies and removing protons in favour of protobufjs for smaller bundles and avoiding bundle problems with web-encoding. This follows the work that is in progress in libp2p to use protobufjs everywhere. As a bonus, we can create type definitions automatically.

rpc.d.ts and rpc.js were generated by protobufjs CLI based on the proto file. Scripts for generating/updating them were also added

Needs:

@vasco-santos vasco-santos force-pushed the chore/update-deps-and-remove-protons branch 7 times, most recently from aec5b0f to 615b7d0 Compare April 7, 2021 19:25
@vasco-santos
Copy link
Collaborator Author

@hugomrdias I am having issues with mocha in playwright similar to hugomrdias/playwright-test#52

Are you aware of any regression?

@codecov-io
Copy link

codecov-io commented Apr 7, 2021

Codecov Report

Merging #153 (91849c1) into master (12626e8) will decrease coverage by 19.70%.
The diff coverage is 72.15%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #153       +/-   ##
===========================================
- Coverage   92.00%   72.29%   -19.71%     
===========================================
  Files           2        2               
  Lines          25     1776     +1751     
  Branches        0      146      +146     
===========================================
+ Hits           23     1284     +1261     
- Misses          2      492      +490     
Impacted Files Coverage Δ
ts/message/rpc.js 72.15% <72.15%> (ø)
test/utils/index.js 87.50% <0.00%> (+4.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12626e8...91849c1. Read the comment docs.

@vasco-santos vasco-santos force-pushed the chore/update-deps-and-remove-protons branch from 615b7d0 to 1b14088 Compare April 7, 2021 20:24
@vasco-santos vasco-santos force-pushed the chore/update-deps-and-remove-protons branch from 3097df1 to dd8f462 Compare April 8, 2021 15:45
@vasco-santos
Copy link
Collaborator Author

We need to update gossipsub build step to rely on aegir. We can use noise as an example. I don't want to add more scope to this PR, so I will create an issue to track this change

rvagg
rvagg previously approved these changes Apr 10, 2021
Copy link

@rvagg rvagg left a comment

Choose a reason for hiding this comment

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

sgtm, lots of ? + |null again but I guess that's reasonable for now, can improve later
(also pending dev dep)

@vasco-santos vasco-santos force-pushed the chore/update-deps-and-remove-protons branch from 5527b4f to 22a63ef Compare April 13, 2021 10:09
@vasco-santos
Copy link
Collaborator Author

sgtm, lots of ? + |null again but I guess that's reasonable for now, can improve later

libp2p/js-libp2p-interfaces#89 (comment)

@vasco-santos vasco-santos force-pushed the chore/update-deps-and-remove-protons branch from a6571c3 to b831d2a Compare April 15, 2021 09:48
@vasco-santos
Copy link
Collaborator Author

vasco-santos commented Apr 15, 2021

This PR is having some CI troubes, as it has some old hanging jobs. Either way, this is ready for review and pending the final release of js-libp2p, once everything is ready

@vasco-santos vasco-santos marked this pull request as ready for review April 15, 2021 16:14
wemeetagain
wemeetagain previously approved these changes Apr 15, 2021
Copy link
Member

@wemeetagain wemeetagain left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@achingbrain
Copy link
Collaborator

achingbrain commented Apr 16, 2021

@vasco-santos the prepare script needs to generate the protobuf files too, otherwise you get:

../../node_modules/libp2p-gossipsub/src/index.js:32:22: error: Could not resolve "./message/rpc"
  32 │ const rpc_1 = require("./message/rpc");

because the generated files are missing:

$ ls -l node_modules/libp2p-gossipsub/src
total 264
-rw-r--r--   1 alex  staff   8304 26 Oct  1985 constants.d.ts
-rw-r--r--   1 alex  staff   9237 26 Oct  1985 constants.js
-rw-r--r--   1 alex  staff    472 26 Oct  1985 get-gossip-peers.d.ts
-rw-r--r--   1 alex  staff   1235 26 Oct  1985 get-gossip-peers.js
-rw-r--r--   1 alex  staff    702 26 Oct  1985 heartbeat.d.ts
-rw-r--r--   1 alex  staff  13885 26 Oct  1985 heartbeat.js
-rw-r--r--   1 alex  staff  11413 26 Oct  1985 index.d.ts
-rw-r--r--   1 alex  staff  44334 26 Oct  1985 index.js
-rw-r--r--   1 alex  staff    275 26 Oct  1985 interfaces.d.ts
-rw-r--r--   1 alex  staff     77 26 Oct  1985 interfaces.js
-rw-r--r--   1 alex  staff   1929 26 Oct  1985 message-cache.d.ts
-rw-r--r--   1 alex  staff   3522 26 Oct  1985 message-cache.js
drwxr-xr-x  20 alex  staff    640 16 Apr 11:18 score
-rw-r--r--   1 alex  staff   1739 26 Oct  1985 tracer.d.ts
-rw-r--r--   1 alex  staff   3356 26 Oct  1985 tracer.js
drwxr-xr-x  12 alex  staff    384 16 Apr 11:18 utils

@vasco-santos
Copy link
Collaborator Author

bah, not generating because the file is commited. But it needs to be moved to src on ts compile. I will change it in a sec

@vasco-santos vasco-santos force-pushed the chore/update-deps-and-remove-protons branch from f693515 to 954fa45 Compare April 16, 2021 10:40
@vasco-santos
Copy link
Collaborator Author

@achingbrain done, can you retry?

@achingbrain
Copy link
Collaborator

@vasco-santos Much better, thanks!

@vasco-santos vasco-santos force-pushed the chore/update-deps-and-remove-protons branch from 53bcefd to a6de21e Compare April 28, 2021 13:52
@vasco-santos vasco-santos merged commit 41232f5 into master Apr 28, 2021
@vasco-santos vasco-santos deleted the chore/update-deps-and-remove-protons branch April 28, 2021 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants