Repository navigation
Remove js code bundled with Astropy for DataTables - #17521
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
This is an alternative, slightly more radical version of #17480: It removes the bundled js code immediately instead of updating; keeping the astropy repository small. |
8b74f3b to
84ee460
Compare
|
@olebole If you could have a look if this has an impact on how you put astropy on Debian, that would be great. |
mhvk
left a comment
There was a problem hiding this comment.
I think this is a good idea - indeed, this PR fixes a suggestion I made more than 4 years ago, in #10420. There, @taldcroft commented that he was fine with it, but felt it would be nice to have some documentation about how to work offline. That may still be a good thing to do.
|
p.s. Readthedocs failure seems real, but it not very informative: |
|
I think the changelog entry should be With a detailed description of this change in the changelog, then IMO we are OK with a security-driven API change in a bugfix release. |
84ee460 to
020e4e3
Compare
|
Locally, I get the following sphinx failures: /Users/guenther/code/astropy/astropy/config/paths.py:docstring of astropy.config.paths.get_cache_dir_path:1: WARNING: py:class reference target not found: pathlib._local.Path [ref.class]
/Users/guenther/code/astropy/astropy/config/paths.py:docstring of astropy.config.paths.get_config_dir_path:1: WARNING: py:class reference target not found: pathlib._local.Path [ref.class]slightly more informative, but clearly nothing to do with this PR. I'm hope that it's just intersphinx that is flaky and I'm force-pushing new version which will trigger the tests again anyway. Maybe that's enough to pass. |
|
Please rebase again to pick up new fixes to CI. I apologize for any inconvenience caused! (p.s. At least RTD was passing again) |
|
I don't think we can backport this. I don't understand why it is milestoned to v7.0.x |
Is there a technical problem or are you concerned about backporting an API change? |
|
The latter. |
olebole
left a comment
There was a problem hiding this comment.
@hamogu In Debian, we have the philosophy to avoid calling remote servers if not really required, for privacy and for robustness reasons.
And we also don't like bundled code and I already always removed the js code :-)
The situation with this patch is actually better, because we would just replace the js URLs with pointers to files of the corresponding javascript Debian packages and depend on them.
So: that is OK for me;
Years ago, we decided to bundle DataTable (and jQuery that is depends on) with astropy. The sole purpose of this package is to display astropy table in the webbrowser and the js code was bundled to allow that functionality without being online. However, I now view this as a bug - we are not equipped to stay on top of potential js security and performance concerns. Online access is available nearly anywhere and talking to a number of users has shown that this feature is useful, but not absolutely essential for the rare offline work. Also, browsers cache libraries downloaded from a CDN, so people who use this feature frequently in fact will be able to use it offline, because their browsers will have cached the required js and css files already anyway. closes astropy#17480
I really dislike that most recently astropy keeps breaking backport and deprecation policies. Besides the removal of the bundled files it adds deprecations to the python code. If there is no technical reason that makes this a must and immediate removal then please keep it milestoned as expected, into 7.1 as to minimize out-of-schedule precedents of breaking the policies to the absolutely necessary level. |
taldcroft
left a comment
There was a problem hiding this comment.
I did not see any documentation of functional testing, but I've just done that. Using this branch.
First with internet:
- Open a notebook.
- Create a simple table
t = simple_table(). t.show_in_browser(): PASSt.show_in_browser(jsviewer=True): PASS - displays as expected. The page source shows the expecteddatatables2.1.8 js and css files.t.show_in_notebook(backend="classic"): PASS - displays as expected.
Next with no internet. Re-ran the same notebook and got the same results. The browser-cached version of the files seemed to work.
With that, this looks good to me!
|
|
it's broken in the new release, it works for me for a previous version and doesn't issue a deprecation warning. So having a new bug is not a legitimate reason for complete removal, in case someone wants to reuse this case as a precedent for future removals. |
because pathlib updates introduced a few bugs, this one is already fixed on the release branch. |
|
Yes. For posterity this is #17513 |
|
@pllim This is a classic lock where we don't agree which PR to take, though I believe that all interested parties have given their opinion, some here and some in private discussion. APE0 says that one of the coco's roles is to make decisions in case no agreement is reached. Since you, @pllim , have been part of this discussion, and, as far as I know, most of the side-conversation in other channels that are not (yet) fully documented in this PR, @taldcroft and I want to suggest that you take this to the Coco to make a decision between this PR and #17480. (If the Coco picks #17480, that probably needs a little bit more work in terms of docs and changelog, but I can do that pretty quickly - I just don't want to polish both PRs perfectly, if we take only one of them. In that case, I would rebase this PR after #17480 is merged and we would take this PR for a later release following the normal deprecation cycle.) |
|
While CoCo ponder this, here is the deal: No one is against removing JS for v7.1, so nothing stopping us from merging this into But backport is the controversial one, so we will block the backport from being merged until consensus is reached and also keep the alt PR open but switch its base to v7.0.x instead of main. So that is what I am gonna do after posting this comment. FYI. |
|
Thanks @pllim - sounds like a good plan. |
|
Technically removal of functionality in a minor release would still run against APE 2, right? But if it's 1 year after the 6.1.0 release, I would not object to that. |
Except it was a pending deprecation that in practice never shows. So, while I support the removal of the bundled JS in the next release (and thus the API change for the behaviour of a couple of kwargs), I would like to see a proper deprecation for |
|
Just a note for casual reader looking over this discussion later: This PR does NOT remove |
In that case, is it possible to throw the deprecation warning only when the method notices the bundled JS is being accessed? 🤔 |
Yes, I think that is sufficient, right? Sorry I missed that in the diff before. So since it has been removed in v7.1 (main), should we backport the deprecation warning like this but to the patched version in #17480 ? |
Better late than never at all |
Years ago, we decided to bundle DataTable (and jQuery that is depends on) with astropy. The sole purpose of this package is to display astropy table in the webbrowser and the js code was bundled to allow that functionality without being online.
However, I now view this as a bug - we are not equipped to stay on top of potential js security and performance concerns. Online access is available nearly anywhere and talking to a number of users has shown that this feature is useful, but not absolutely essential for the rare offline work.
Also, browsers cache libraries downloaded from a CDN, so people who use this feature frequently in fact will be able to use it offline, because their browsers will have cached the required js and css files already anyway.
Description
Fixes #10420