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

Update plugin API #1196

Merged
merged 5 commits into from
Apr 19, 2018
Merged

Update plugin API #1196

merged 5 commits into from
Apr 19, 2018

Conversation

yann300
Copy link
Collaborator

@yann300 yann300 commented Mar 26, 2018

data.arguments.push((error, result) => {
response(data.type, data.id, error, result)
data.value.push((error, result) => {
response(data.key, data.type, data.id, error, result)
})
api[data.key][data.type].apply({}, data.arguments)
Copy link

Choose a reason for hiding this comment

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

data.arguments should be data.value

@@ -8,25 +8,31 @@ window.addEventListener('message', receiveMessage, false)
window.onload = function () {
document.querySelector('input#testmessageadd').addEventListener('click', function () {
window.parent.postMessage(JSON.stringify({
action: 'request',
key: 'editor',
Copy link

Choose a reason for hiding this comment

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

key: 'editor' should be key: 'config'

})

document.querySelector('input#testmessageremove').addEventListener('click', function () {
window.parent.postMessage(JSON.stringify({
action: 'request',
key: 'editor',
Copy link

Choose a reason for hiding this comment

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

key: 'editor' should be key: 'config'

})

document.querySelector('input#testmessagerget').addEventListener('click', function () {
window.parent.postMessage(JSON.stringify({
action: 'request',
key: 'editor',
Copy link

Choose a reason for hiding this comment

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

key: 'editor' should be key: 'config'

* type: <string>,
* value: <array>,
* error: (see below)
*}
Copy link
Contributor

Choose a reason for hiding this comment

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

I just checked again: https://github.com/ethereum/remix-ide/issues/1156

  • The original proposal is var { id, status, type, key, value } = msg
  • You said you would like to add the action field to indicate "response/notification/request".
  • That would make it var { action, id, status, type, key, value } = msg
  • But now the status is/was renamed to error i guess.

Just to make sure how i have to think about it :-)
So i guess we now have: var { action, id, error: status, type, key, value } = msg

I would say that is fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

The above comment is just for me to clarify.
If this is how it's meant, i would say the PR looks good to me :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes except that error is undefined if there's no error

@yann300 yann300 merged commit 1cff4b7 into master Apr 19, 2018
@axic axic deleted the updatepmluginAPI branch April 19, 2018 09:58
@yann300 yann300 removed the 3 - Review label May 8, 2018
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.

3 participants