Library length limit?

22 views
Skip to first unread message

Bruce Sherwood

unread,
Sep 5, 2016, 10:47:01 PM9/5/16
to Project Jupyter
Jupyter VPython (pip install vpython; see vpython.org) includes a JavaScript program that invokes the GlowScript WebGL 3D graphics library to display 3D animations in a notebook cell. When that library went from 420 KB to 620 KB there were frequent JavaScript errors in require.js, concerning "mismatched anonymous define() modules". Splitting the GlowScript JavaScript library into two pieces, of lengths 280 KB and 340 KB, solved the problem.

Is it a bug or a feature that a JavaScript library has to be less than (apparently) 500 KB?

MinRK

unread,
Sep 6, 2016, 5:32:18 AM9/6/16
to Project Jupyter
I don't believe there is a size limit, but it's possible there was a race condition only revealed by the larger size and thus longer download time.

-MinRK

On Tue, Sep 6, 2016 at 4:47 AM, Bruce Sherwood <bruce.s...@gmail.com> wrote:
Jupyter VPython (pip install vpython; see vpython.org) includes a JavaScript program that invokes the GlowScript WebGL 3D graphics library to display 3D animations in a notebook cell. When that library went from 420 KB to 620 KB there were frequent JavaScript errors in require.js, concerning "mismatched anonymous define() modules". Splitting the GlowScript JavaScript library into two pieces, of lengths 280 KB and 340 KB, solved the problem.

Is it a bug or a feature that a JavaScript library has to be less than (apparently) 500 KB?

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/0d71a075-fd07-4fe2-b169-8c49b37f1a29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Bruce Sherwood

unread,
Sep 6, 2016, 10:25:28 AM9/6/16
to Project Jupyter
It's a good suggestion that this could be a race condition. However, it's then odd that every other execution works. Here is the structure we're using. In the Python portion of the vpython module were these statement (before breaking the glow library into two pieces):

package_dir = os.path.dirname(__file__)
notebook.nbextensions.install_nbextension(path = package_dir+"/data/jquery-ui.custom.min.js",overwrite = True,user = True,verbose = 0)    
notebook.nbextensions.install_nbextension(path = package_dir+"/data/glow2.1.min.js",overwrite = True,user = True,verbose = 0)
notebook.nbextensions.install_nbextension(path = package_dir+"/data/glowcomm.js",overwrite = True,user = True,verbose = 0)

And here was the start of the glowcomm.js file:

define(["nbextensions/jquery-ui.custom.min","nbextensions/glow.2.1.min"], function() {
/*jslint plusplus: true */

I inherited these statements from a colleague far more knowledgeable about Jupyter than me, but I would assume that these statements are intended to ensure that all libraries are loaded before execution starts, no? I repeat that breaking glow2.1.min.js into two pieces completely eliminated the problem, whereas one might expect that adding another library would enhance a race condition.
Reply all
Reply to author
Forward
0 new messages