-
Notifications
You must be signed in to change notification settings - Fork 945
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 way to use require fallback? #2026
Conversation
@maartenbreddels - can you review this one, as you were involved in the issue over in pythreejs? |
This can also go into a patch release of html manager, so we don't have to rush it for 7.2. |
Let me check this one, I think the idea is solid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one issue, but even when I fixed that and try
require_1.toUrl(moduleName)
which gives good output, it does not lead to a network request.
Isn't a better solution for jupyter-threejs to provide an anonymous module?
} | ||
require.config({ | ||
paths: { | ||
moduleName: moduleNameToCDNUrl(moduleName, moduleVersion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will add a key 'moduleName', I think you need to do sth like
let config = {paths: {}}
config.paths[moduleName] = moduleNameToCDNUrl(moduleName, moduleVersion)
You should be able to put []
around moduleName, but the resulting js was without that, so I wouldn't rely on that.
Ok, the issue is that require already 'knows' 'jupyter-threejs' failed, since it requested it before doing the CDN request (it queried for ./jupyter-threejs.js), and refuses to do so again. This can be fixed using |
Didn't work, you need to take off the
|
Since the function is not exported, I just removed the |
This works for me locally now. |
yes works here too. |
See discussion in jupyter-widgets/pythreejs#171 .