-
Notifications
You must be signed in to change notification settings - Fork 381
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
loading JS files confuses the module system #429
Comments
Unfortunately bkHelper.loadList can't just do the "defined = undefined" trick because it has to be in force then the fetched code is evaluated which happens asynchronously. we could use the success/failure callbacks to reset it back but that means that while it's running other code would also be tricked. it might help if the javascript plugin had list of URLs to load in its spec and it handled them automatically? also maybe we should just always have "define = undefined" in the user's javascript. |
This is actually harder than that to do right. The problem is if you have a notebook that loads a random JS file, then uses that code say to create an interactive chart, then you share the notebook, it will not work on the sharing server. And if someone downloads the notebook from the sharing server, then it would not work for them until they download and install the dependency. So I propose an "importJS" command that not only loads the JS properly, but actually stores it in the notebook (in the namespace). This is actually a general problem for notebooks, not only for loading JS file but other random files that might be read by the code in a notebook. in each language, in the beaker runtime, we can provide this wrapped load function that caches the result in the notebook. It should check the file modtime every time it runs, and if the original file has been modified it should read it again. |
a complication with the above is if the loaded JS file recursively loads other JS files. |
new plan: in the language manager have some GUI for finding libs (eg bower github file url). when found, include in the notebook, and then have them loaded and accessible to code run in JS cells. |
…corated the ui-select-sort directive to disable dragging in ui-select
…corated the ui-select-sort directive to disable dragging in ui-select
See #421
basically if JS in a cell calls loadJS or loadList, and the loaded code tries to define a module, it will fail to load.
probably these function should do the define = undefined trick.
The text was updated successfully, but these errors were encountered: