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

Better logic to set webpack public path in AMD modules #3508

Merged
merged 1 commit into from
Jul 6, 2022

Conversation

jasongrout
Copy link
Member

@jasongrout jasongrout commented Jul 3, 2022

Fix for #3474.

This uses the technique from jupyter-widgets/widget-cookiecutter#103 to get the public path for amd modules and creates an example that uses the amd modules built for html-manager.

This is another take on #3464, since that approach did not work to set the public path in AMD modules. Essentially, since AMD modules are executed asynchronously, the webpack 'auto' public path logic does not work. Instead, we use the requirejs-specific 'module' magic dependency, which allows us to get the path to the current AMD module, and use that to get the public path. We do this public path computation in a separate script to isolate it from any library code.

@jasongrout jasongrout added this to the 8.0 milestone Jul 3, 2022
@github-actions
Copy link

github-actions bot commented Jul 3, 2022

Binder 👈 Launch a binder notebook on branch jasongrout/ipywidgets/requirepublic

@jasongrout jasongrout marked this pull request as ready for review July 6, 2022 17:26
@jasongrout jasongrout changed the title [WIP] Better logic to set webpack public path in AMD modules Better logic to set webpack public path in AMD modules Jul 6, 2022
Fixes jupyter-widgets#3474.

This is another take on jupyter-widgets#3464, since that approach did not work to set the public path in AMD modules. Essentially, since AMD modules are executed asynchronously, the webpack 'auto' public path logic does not work. Instead, we use the requirejs-specific 'module' magic dependency, which allows us to get the path to the current AMD module, and use that to get the public path. We do this public path computation in a separate script to isolate it from any library code.
@jasongrout
Copy link
Member Author

@vidartf @ibdafna @martinRenou - can one of you review this and approve/merge it if it looks good, and then I'll release another RC of widgets 8 with these fixes?

Copy link
Member

@ibdafna ibdafna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glanced at this quickly and it looks good! Thank you!

@ibdafna ibdafna merged commit 763dbb9 into jupyter-widgets:master Jul 6, 2022
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

Successfully merging this pull request may close these issues.

2 participants