-
Notifications
You must be signed in to change notification settings - Fork 34
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/reduce plugins scope #41
Conversation
…ow-ui into feat/reduce-plugins-scope
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.
very few minor things
@@ -36,13 +36,13 @@ A basic plugin could be something like | |||
<script src="MetaflowPluginAPI.js"></script> | |||
<script> | |||
(function () { | |||
Metaflow.register('run-header', () => { | |||
Metaflow.onReady((configuration, resource) => { |
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.
below it mentions There are two implemented plugin slots,
run-headerand
task-details. The desired slot must be given as parameter to a plugin API register message.
but here it removes run-header registry call - is there some equivalent of it?
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.
Updated to have mention about manifest.json
docs/plugin-system.md
Outdated
@@ -59,24 +59,16 @@ This plugin is registered to be rendered in the run header section (path /FLOW_I | |||
|
|||
## Plugin slots | |||
|
|||
There are three implemented plugin slots. `run-header`, `task-details`, and `headless`. The desired slot must be given as a parameter to a plugin API register message. | |||
There are two implemented plugin slots, `run-header` and `task-details`. The desired slot must be given as parameter to a plugin API register message. |
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.
it should probably mention plugin-api/Examples/hello-world/manifest.json and the definition of the slot for clarity
}); | ||
Metaflow.setHeight(100) |
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.
trying to understand here why setHeight(100) was replaced by setHeight()?
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.
setHeight has optional fixedHeight parameter. When no parameter is given, API will try to find out the full height of document and use that. There wasn't really need for fixed height here.
plugin-api/MetaflowPluginAPI.js
Outdated
@@ -1,145 +1,193 @@ | |||
const VERSION_INFO = { | |||
api: '0.13.0' | |||
} | |||
api: "0.14.0", |
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.
this seems to be a breaking change update, can we do a semantic version?
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.
Yes i imagine we should up it to 1.0.0
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.
lets do it and I think we can merge 1.0.0
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.
Tests workforme
Requirements for a pull request
Description of the Change
This PR reduces scope of the plugins systems to make it easier to maintain in the future.
Removes slots:
Removes exposed data
This PR also adds some feature to plugin system. Plugin slot will now provide available IDs from current URL to every plugin. Knowing flow_id, run_number or task_id might be useful for the plugin.
Other change this brings is that now plugins needs to define configurations in manifest.json instead of register function. register is replaced with onReady. It is recommended to use onReady to wrap plugin code but not absolute necessity.
Possible Drawbacks
Existing plugins using these slots or data must be updated to work with new API.