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 some type of check command #112

Open
paddymul opened this issue Apr 9, 2023 · 3 comments
Open

Add some type of check command #112

paddymul opened this issue Apr 9, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@paddymul
Copy link

paddymul commented Apr 9, 2023

Problem

I have had a lot of trouble trying to package and deploy jupyterlab widgets. Particularly around "module not found errors". There are many moving parts to a widget, and it would be nice to know at build time what doesn't line up.

From my investigations I can see module names pop up in the following places

package.json -> name
this is imported into js or src version.ts as MODULE_NAME

MODULE_NAME is used in
DOMWidgetModel extending models on the js/ts side

MODULE_NAME is also used in plugin.ts in the activateWidgetExtension function via registry.registerWidget

There is also an EXTENSION_ID used for IPlugin

Then on the python side there is

_frontend.py which references a hardcoded module_name

finally in ipydatagrid.json there is the following form

  "load_extensions": {
    "ipydatagrid/extension": true
  }
}

I think this gets converted into an install.json

I am trying to take the ipydatagrid repo as a baseline and first strip out everything to a very simple installable pip package (with it's own repo).

Then I want to put my ipywidget on to of that repo.


Another way of stating this is: "When I look at an existing working repo for an ipywidget - like ipydatagrid. I see the string ipydatagrid repeated in a variety of locations referencing different things - a python module, the name of an npm package, the MODULE_NAME of an ipywidget. and as part of the string of some type of jupyter notebook registration piece".

I understand that by convention ipydatagrid will be the same in each place, it would be nice to read an explanation of the true meaning of each occurence.

Proposed Solution

There should be some type of check command included with hatch-jupyter-builder that will make a good faith attempt to verify that all of these strings line up properly.

Additional context

I filed a related bug against widget-ts-cookiecutter
jupyter-widgets/widget-ts-cookiecutter#131

@paddymul paddymul added the enhancement New feature or request label Apr 9, 2023
@welcome
Copy link

welcome bot commented Apr 9, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@paddymul
Copy link
Author

paddymul commented Apr 9, 2023

After further investigation,
ipydatagrid:_jupyter_labextension_paths
also seems very important.

the code seems to be called here
https://github.com/jupyterlab/jupyterlab/blob/fd875338edd5b1bbe360760c25ae740c2a42daaa/jupyterlab/federated_labextensions.py

It is difficult to tell when python modules are being referenced, and when js paths relative to python modules are being referenced.

@paddymul
Copy link
Author

paddymul commented Apr 9, 2023

I added a minimal reproduction repo https://github.com/paddymul/ts-ipywidget-starter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant