Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

deps: Switch from json-rpc-engine to @metamask/json-rpc-engine #16

Merged
merged 2 commits into from
Jul 20, 2023

Conversation

legobeat
Copy link
Contributor

@legobeat legobeat commented Jul 20, 2023

  • Switch from json-rpc-engine to renamed and maintained @metamask/json-rpc-engine
    • Add @metamask/utils for types moved there
  • Bump @metamask/safe-event-emitter from ^2.0.0 to ^3.0.0.

This is related to #14 but I don't think either should be blocking the other.

@legobeat legobeat requested a review from a team as a code owner July 20, 2023 04:15
@legobeat legobeat requested review from mcmire and Gudahtt July 20, 2023 04:16
@socket-security
Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@metamask/json-rpc-engine 7.0.0 network +17 4.1 MB metamaskbot
@metamask/safe-event-emitter 3.0.0 None +0 8.07 kB gudahtt
@metamask/utils 5.0.2 network +15 3.92 MB metamaskbot

🚮 Removed packages: [email protected]

@socket-security
Copy link

socket-security bot commented Jul 20, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: @metamask/[email protected], @ethereumjs/[email protected], @metamask/[email protected], @metamask/[email protected], [email protected], [email protected], @types/[email protected], [email protected], @scure/[email protected]

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore [email protected] bar@* or ignore all packages with @SocketSecurity ignore-all

@legobeat
Copy link
Contributor Author

@SocketSecurity ignore @metamask/[email protected]
@SocketSecurity ignore @ethereumjs/[email protected]
@SocketSecurity ignore @metamask/[email protected]
@SocketSecurity ignore @metamask/[email protected]
@SocketSecurity ignore [email protected]
@SocketSecurity ignore [email protected]
@SocketSecurity ignore @types/[email protected]
@SocketSecurity ignore [email protected]
@SocketSecurity ignore @scure/[email protected]

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Looks good!

export function providerFromMiddleware(
middleware: JsonRpcMiddleware<unknown, unknown>,
): SafeEventEmitterProvider {
export function providerFromMiddleware<
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, this is much better.

@legobeat legobeat merged commit b6d1502 into MetaMask:main Jul 20, 2023
@legobeat legobeat deleted the deps-metamask-json-rpc-engine branch July 20, 2023 23:42
@mcmire
Copy link
Contributor

mcmire commented Jul 24, 2023

@legobeat It looks like this is causing build failures when upgrading core: MetaMask/core#1547. I missed that the types got changed in @metamask/json-rpc-engine and that affected this package too. So in hindsight, it appears this should have been released as a breaking change. Should we deprecate 1.0.1 and re-release it as 2.0.0? If so I can reach out to the appropriate people.

@mcmire
Copy link
Contributor

mcmire commented Jul 25, 2023

Another update that came along with bumping json-rpc-engine is that this package now requires Node 16, as evidenced here: MetaMask/eth-block-tracker#167

@Gudahtt
Copy link
Member

Gudahtt commented Jul 25, 2023

Should we deprecate 1.0.1 and re-release it as 2.0.0? If so I can reach out to the appropriate people.

Yes, this sounds appropriate

@legobeat
Copy link
Contributor Author

legobeat commented Jul 25, 2023

@legobeat It looks like this is causing build failures when upgrading core: MetaMask/core#1547. I missed that the types got changed in @metamask/json-rpc-engine and that affected this package too. So in hindsight, it appears this should have been released as a breaking change. Should we deprecate 1.0.1 and re-release it as 2.0.0? If so I can reach out to the appropriate people.

Dang, should have left it at #17. Yes, sounds right.

Perhaps something like https://github.com/devoto13/yarn-plugin-engines is worth considering (until yarnpkg/berry#1177)

@legobeat
Copy link
Contributor Author

legobeat commented Jul 25, 2023

Retracted in #19
Follow-up in #20

legobeat added a commit to legobeat/eth-json-rpc-provider that referenced this pull request Jul 25, 2023
Required by update of `@metamask/json-rpc-engine` (MetaMask#16)
legobeat added a commit to legobeat/eth-json-rpc-provider that referenced this pull request Jul 26, 2023
Required by update of `@metamask/json-rpc-engine` (MetaMask#16)
legobeat added a commit to legobeat/eth-json-rpc-provider that referenced this pull request Jul 26, 2023
Required by update of `@metamask/json-rpc-engine` (MetaMask#16)
legobeat added a commit that referenced this pull request Jul 26, 2023
Required by update of `@metamask/json-rpc-engine` (#16)
legobeat added a commit to legobeat/eth-json-rpc-provider that referenced this pull request Jul 27, 2023
Required by update of `@metamask/json-rpc-engine` (MetaMask#16)
legobeat added a commit that referenced this pull request Aug 2, 2023
Required by update of `@metamask/json-rpc-engine` (#16)
@legobeat legobeat mentioned this pull request Aug 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants