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

Projects
None yet
1 participant
@jasongrout
Member

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 some commits Aug 10, 2017

Change embedding to just always use require.
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>`

This comment has been minimized.

@jasongrout

jasongrout Aug 10, 2017

Member

TODO: fix these links.

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

@jasongrout jasongrout force-pushed the jasongrout:embedrequire branch from 7eed820 to 6cb4d86 Aug 11, 2017

@jasongrout

This comment has been minimized.

Member

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.

@jasongrout

This comment has been minimized.

Member

jasongrout commented Aug 11, 2017

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

@jasongrout jasongrout merged commit 857f07b into jupyter-widgets:master Aug 11, 2017

1 check passed

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

@jasongrout jasongrout modified the milestone: 7.0 Aug 11, 2017

@chrisjsewell chrisjsewell referenced this pull request Aug 11, 2017

Closed

Freezing embedded html #41

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