-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add a JS lib to support trame-client API through an iframe #2
base: master
Are you sure you want to change the base?
Conversation
similar to trame-client js-api, trame-iframe js-api provides an agnostic library that can be installed in a regular JS project. trame-iframe js-api could be installed in a host application (could be react/streamlit/vue/... based) to proxy the trame API calls through the iframe to the Communicator and the trame application. The goal is to replicate the trame-client js-api features to make it transparent to the consumer code. API: - trame.state.set - trame.state.update - trame.state.watch - trame.trigger This is still possible to directly interact with the Communicator from an host application by manually sending/listening to events.
{ | ||
"name": "@kitware/trame-iframe-client", | ||
"version": "0.0.5", | ||
"license": "MIT", |
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.
Why MIT instead of Apache?
@@ -0,0 +1,21 @@ | |||
The MIT License (MIT) |
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.
Why MIT instead of Apache?
/** | ||
* @returns promise function with a "resolve" attribute, so it can be resolved from outside the promise executor | ||
*/ | ||
function promiseCreator() { |
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.
maybe want to provide resolve
and reject
?
self._attributes["ref"] = f'ref="{self.__ref}"' | ||
self._attributes["parent_origin"] = f'parentOrigin="{self._parent_origin}"' |
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.
no need to set _attributes if you add it to self._attr_names
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 at a high level.
uses: Kitware/trame-client#29 for state watchers API