-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
feat: add createExternalExtensionProvider #152
Conversation
shanejonas
commented
Apr 30, 2021
- remove index.d.ts
- remove index.d.ts
a872031
to
22f6f35
Compare
const currentMetaMaskId = getMetaMaskId(); | ||
const metamaskPort = chrome.runtime.connect( | ||
currentMetaMaskId, | ||
) as Runtime.Port; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to cast this to play nicely with the webextension-polyfill-ts
type that extension-port-stream
uses, doesnt seem to match exactly to the type chrome.runtime.connect
returns which is a chrome.runtime.Port
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Port- and stream-related types seem to be incompatible 100% of the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting to look at this now. We should delete index.d.ts
in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I have one request and one question:
Request: Since there are multiple of them, can we move all of the extension-related files into a new folder src/extension-provider
?
Question: I'd like us to only use the BaseProvider
instead of the inpage provider, to force consumers of this off the legacy API. What do you think of that?
const currentMetaMaskId = getMetaMaskId(); | ||
const metamaskPort = chrome.runtime.connect( | ||
currentMetaMaskId, | ||
) as Runtime.Port; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Port- and stream-related types seem to be incompatible 100% of the time.
index.d.ts removal in this PR: #153 |
added |
00379bc
to
db5d701
Compare
db5d701
to
82eaee5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Originally introduced in MetaMask#152
Originally introduced in: - MetaMask#152 - MetaMask#249