-
Notifications
You must be signed in to change notification settings - Fork 71
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
Global Namespace Pollution #241
Comments
That’s correct. Unfortunately this is not something we can fix because it’s how AMD works: the global define is needed so that when require’d modules load asynchronously, they can register themselves with the AMD loader. |
Duplicate of d3/d3-require#33. |
@mbostock This is bit of a shame as it prevents the embedding of download notebooks in third party web sites... |
@GordonSmith It only applies if you call require, in which case you’ll need the global define or the notebook will be broken, anyway. If you don’t call require, the global define won’t be set. |
Unfortunately that is any notebook which contains some markdown as the stdlib IOW embedding any notebook which contains markdown will overwrite the previously declared global define, potentially causing pain for the hosting website. To be fair AMD require implementations have been battling this issue forever... |
@GordonSmith I recommend moving the discussion to https://talk.observablehq.com/, where others with practical experience wrt embedding might be able to assist you. As an aside, you could try to define get/set callbacks for |
I suspect this is being pulled in by d3-require, but
window.define
gets overwritten even if it existed prior to loading this library: https://github.com/d3/d3-require/blob/master/src/index.js#L88The text was updated successfully, but these errors were encountered: