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

Add a companion package for the host page #4

Open
jtpio opened this issue Nov 19, 2024 · 1 comment
Open

Add a companion package for the host page #4

jtpio opened this issue Nov 19, 2024 · 1 comment
Milestone

Comments

@jtpio
Copy link
Collaborator

jtpio commented Nov 19, 2024

The companion package will be developed from the same repo.

It will:

  • provide an API to send messages to the embedded IFrame
  • allow taking an id of an IFrame as parameter, to know to which IFrame to send messages to
  • default to using the first IFrame if not configured otherwise
  • be packaged as an independant JavaScript package, so it's easier to reuse in other projects
@jtpio jtpio added this to the 0.1.0 milestone Nov 19, 2024
@jtpio
Copy link
Collaborator Author

jtpio commented Nov 21, 2024

Posting more thoughts here for the companion package:

  • we can structure the repo as a monorepo with:
    • packages/jupyterlab-iframe-commands-host: the companion package to be used on the host
    • packages/jupyterlab-iframe-commands-extension: the JupyterLab extension that will be enabled in the IFrame
    • at the top-level, we can keep the Python package which is only used for packaging and distributing the JupyterLab extension via PyPI
    • use lerna for consistency with other repos, and to be able to build everything easily from the root folder
  • the demo in this repo would make use of both the companion package and the JupyterLab extension
  • consumers of the companion package will be able to use with something like this in their code (as an example):
import { CommandBridge } from 'jupyterlab-iframe-commands-host';

const bridge = new CommandBridge({ iframeId: 'jupyterlab' });
await bridge.execute('test-command');

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

No branches or pull requests

1 participant