JavaScript refactoring finished

44 views
Skip to first unread message

Andrey Novoseltsev

unread,
Jul 3, 2016, 6:23:11 PM7/3/16
to sage-cell
The public servers are now running the new version with JavaScript files broken up into smaller and more isolated modules. (Everything is still assembled into a single file by r.js.) Hopefully this was the last major move of JS code. Overall RequireJS usage is closer to "The Right One", which simplified loading logic a bit, but there are still issues with web pages loading other libraries.

Please test your favourite embedding cases and report any issues!

Paul Masson

unread,
Jul 4, 2016, 5:08:59 PM7/4/16
to sage-cell
On pages with multiple embedded cells I'm getting timeout issues. The first cell will process and appear, but subsequent cells don't show up at all, just white space. The affected browers are:

  Firefox on Windows 10
  Safari on Mac OS X El Capitan

Other browsers display cells as expected:

  Edge on Windows 10
  Firefox on Mac OS X El Capitan
  Chrome on Mac OS X El Capitan
  iOS 9.3 on iPad

Paul Masson

unread,
Jul 4, 2016, 5:10:05 PM7/4/16
to sage-cell
And since iOS isn't a browser, I meant Mobile Safari on iOS 9.3

Andrey Novoseltsev

unread,
Jul 4, 2016, 6:40:43 PM7/4/16
to sage-cell
On Monday, 4 July 2016 15:08:59 UTC-6, Paul Masson wrote:
On pages with multiple embedded cells I'm getting timeout issues. The first cell will process and appear, but subsequent cells don't show up at all, just white space. The affected browers are:

  Firefox on Windows 10
  Safari on Mac OS X El Capitan


Can you give links to these pages or is it consistent? Also, I can only debug on Linux and Windows 7, if it is something specific to others would be nice to get some help... Are these new issues (= after last weekend)?

There is some racing between CSS load and CodeMirror construction which I partially addressed but it still happens. However, it happens to all cells at once for me and looks like gray rectangles for code boxes. Your timeouts are probably unrelated.
 

Paul Masson

unread,
Jul 4, 2016, 7:09:43 PM7/4/16
to sage-cell
Here's an couple example links. There are three cells on each page but only the first appears in the browsers with issues:

http://paulmasson.github.io/sagemath-docs/functions/bessel_J.html

I called it a timeout issue because I saw some console messages about kernels being killed, but those are not appearing now. It looks like only one cell is processed out of the three, since I'm now only seeing messages about one kernel (unless that is intended behavior).

This is definitely a new issue caused by whatever you recently did. I've been working regularly on this GitHub site recently with no problems. What other information can I provide?

And it's really bizarre that Firefox works on Mac but not Windows.

Andrey Novoseltsev

unread,
Jul 4, 2016, 7:29:33 PM7/4/16
to sage-cell
On Monday, 4 July 2016 17:09:43 UTC-6, Paul Masson wrote:
Here's an couple example links. There are three cells on each page but only the first appears in the browsers with issues:

http://paulmasson.github.io/sagemath-docs/functions/bessel_J.html

I called it a timeout issue because I saw some console messages about kernels being killed, but those are not appearing now. It looks like only one cell is processed out of the three, since I'm now only seeing messages about one kernel (unless that is intended behavior).

Thank you - I can reproduce it on Firefox under Windows 7. If cells are not linked, there should be 3 different kernels. Looking into this...

Andrey Novoseltsev

unread,
Jul 4, 2016, 9:38:30 PM7/4/16
to sage-cell

Hate these problems that disappear once you start using debugger... TOS are turned off on public servers and it uncovered a bug in old code that was holding on to all evaluations while a dialog was shown but not while a request to server was processed. Should be fixed now and my guess is that you saw this bug in browsers that you have not used before/recently - I got it on Linux as well once I deleted localStorage.accepted_tos.

Paul Masson

unread,
Jul 4, 2016, 10:52:08 PM7/4/16
to sage-cell
That appears to have solved my issue. Thanks!

Will terms of service stay off or is this a temporary change?

Andrey Novoseltsev

unread,
Jul 4, 2016, 11:29:21 PM7/4/16
to sage-cell
On Monday, 4 July 2016 20:52:08 UTC-6, Paul Masson wrote:
That appears to have solved my issue. Thanks!

Will terms of service stay off or is this a temporary change?


Most likely remain off - they were introduced due to UW lawyers, but we no longer host there.

Paul Masson

unread,
Jul 16, 2016, 9:54:53 PM7/16/16
to sage-cell
Andrey, where can I see what version of CodeMirror is being used by SageMathCell? From the Makefile I can see that Require.js is always the latest, but I haven't found an equivalent indication for CodeMirror. Thanks.

Andrey Novoseltsev

unread,
Jul 17, 2016, 1:37:02 PM7/17/16
to sage-cell
On Saturday, 16 July 2016 19:54:53 UTC-6, Paul Masson wrote:
Andrey, where can I see what version of CodeMirror is being used by SageMathCell? From the Makefile I can see that Require.js is always the latest, but I haven't found an equivalent indication for CodeMirror. Thanks

How could you see RequireJS version from the Makefile???

Most of the JavaScript stuff comes from
https://github.com/sagemath/sagecell/blob/bec29d290408064a1b71acbd62dde01b3e14d07b/Makefile#L23
which copies Jupyter "notebook" files. They include almost everything we need including RequireJS and CodeMirror. So to figure out what version it is, you need to figure out which versions are used by the notebook bundled with Sage.

My motivation for this approach - no need for keeping track of our own dependencies, upgrading them, and making sure that they work OK with each other. Presumably things make break during upgrades to new Sage versions, but in this case we will catch breaks early and they should be easier to fix that this time (which took me about half a year).

Paul Masson

unread,
Jul 17, 2016, 2:35:39 PM7/17/16
to sage-cell
Thanks for the information. Spent some time looking for the "components" directory in the Sage repository to no avail. Now I know where it is.

There are a couple of lines in the Makefile that use the latest versions of Require.js plugins. I assumed you had to use the latest of the main library so as not to have conflicts, but the Jupyter notebook is still on the last version. Guess that doesn't cause conflicts after all.

Andrey Novoseltsev

unread,
Jul 17, 2016, 2:55:03 PM7/17/16
to sage-cell
On Sunday, 17 July 2016 12:35:39 UTC-6, Paul Masson wrote:
Thanks for the information. Spent some time looking for the "components" directory in the Sage repository to no avail. Now I know where it is.

Feel free to add it to documentation or file comments if you wish, I certainly don't try to hide things intentionally! For comparison, here is the old Makefile which used to terrify me a bit:
https://github.com/sagemath/sagecell/blob/last_ipython/Makefile
 
There are a couple of lines in the Makefile that use the latest versions of Require.js plugins. I assumed you had to use the latest of the main library so as not to have conflicts, but the Jupyter notebook is still on the last version. Guess that doesn't cause conflicts after all.

Downloading plugins seemed easier than including a fixed version into repository or dealing with submodules - offline built/usage is quite low priority (although I had to do it during Sage Days last August). They are rarely updated so I don't anticipate that things will break.

Reply all
Reply to author
Forward
0 new messages