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

if moduleName contains a slash, use a different module/path #1995

Merged
merged 2 commits into from Mar 16, 2018

Conversation

Projects
None yet
3 participants
@maartenbreddels
Member

maartenbreddels commented Mar 13, 2018

This is useful if a package contains multiple widget extensions (I use this for ipysheet).
For instance, use:
_model_module = Unicode('ipysheet/renderer').tag(sync=True)
The embed manager will try got get ipysheet/renderer.js from the server its running on (which is a valid request, and useful for local testing), if that fails it will fetch:
https://unpkg.com/ipysheet@semver/dist/renderer.js

@vidartf

This comment has been minimized.

Member

vidartf commented Mar 13, 2018

Does this need to special case @my-namespace/mymodule ?

@maartenbreddels

This comment has been minimized.

Member

maartenbreddels commented Mar 13, 2018

Indeed, good call. Do you see any other issues with this?

@jasongrout

This comment has been minimized.

Member

jasongrout commented Mar 16, 2018

The only other issue I see with this is that it still inserts the dist/ - is there a way we don't have to hardcode that portion either? I don't see a way to have it nicely support both the other widget managers, but perhaps you have an idea?

@maartenbreddels

This comment has been minimized.

Member

maartenbreddels commented Mar 16, 2018

In the notebook this works without issues, requirejs handles it without issues, Jupyter lab also doesn't mind the extra slash in the registry. I think the 'dist/' part is ok, I see it as a manager specific implementation.

@jasongrout

This comment has been minimized.

Member

jasongrout commented Mar 16, 2018

I think the 'dist/' part is ok, I see it as a manager specific implementation.

Oh right - it is very specific to how the html manager is fetching things.

@jasongrout

This comment has been minimized.

Member

jasongrout commented Mar 16, 2018

Looks good to me, then. Thanks!

@jasongrout jasongrout merged commit 49edada into jupyter-widgets:master Mar 16, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jasongrout jasongrout modified the milestones: Minor release, 7.2 Mar 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment