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

Use require.js to load the embed script #1615

Merged
merged 4 commits into from Aug 11, 2017

Conversation

@jasongrout
Copy link
Member

@jasongrout jasongrout commented Aug 10, 2017

This allows us to easily automatically use the local base, controls, and html manager next to the embed script, and also makes it much clearer what is going on (for example, you have to have require on the page to get the module).

The first commit in this PR takes a different approach - separate embed-cdn and embed-local files that hardcode the destination. It's a bit easier to put on the page, but it obfuscates that we are using require and how the functions are run after page load.

jasongrout added 2 commits Aug 10, 2017
This makes it much clearer what is going on, and lets us easily support automatically loading the local base, controls, and html manager next to the embed script.
@@ -13,12 +13,12 @@ replace

with

`<script src="https://unpkg.com/@jupyter-widgets/html-manager/dist/embed.js"></script>`
`<script src="https://unpkg.com/@jupyter-widgets/html-manager/dist/embed-cdn.js"></script>`
Copy link
Member Author

@jasongrout jasongrout Aug 10, 2017

Choose a reason for hiding this comment

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

TODO: fix these links.

Loading

@jasongrout jasongrout force-pushed the embedrequire branch 2 times, most recently from afe6d35 to 7eed820 Aug 11, 2017
@jasongrout
Copy link
Member Author

@jasongrout jasongrout commented Aug 11, 2017

I've settled on a different approach. We still have the dist/embed.js that lets you embed standard widgets, and does not use requirejs, so it can't load third-party widgets. We also have a requirejs module, dist/embed-require.js, which does use require.js and lets you load custom widgets.

Loading

@jasongrout
Copy link
Member Author

@jasongrout jasongrout commented Aug 11, 2017

Merging this so we can release a new version of html-manager, test, and iterate.

Loading

@jasongrout jasongrout merged commit 857f07b into jupyter-widgets:master Aug 11, 2017
1 check passed
Loading
@jasongrout jasongrout added this to the 7.0 milestone Aug 11, 2017
@jasongrout jasongrout added this to the 7.0 milestone Aug 11, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant