jupyterlab/jupyter-renderers

[3.1.0rc2] `jupyterlab-fasta` fails to render: `t.on is not a function`

lumberbot-app opened this issue · 15 comments

Description

The jupyterlab-fasta extension does not work with 3.1.0rc2

Reproduce

Can be reproduced with this gist:

image

Expected behavior

The jupyterlab-fasta extensions should work out of the box with JupyterLab 3.1.

Context

Originally reported by @bollwyvl in jupyterlite/jupyterlite#284

  • Operating System and version: Ubuntu 20.04
  • Browser and version: Firefox 89
  • JupyterLab version: 3.1.0rc2

Originally opened as jupyterlab/jupyterlab#10675 by @jtpio, migration requested by @blink1073

@bollwyvl @jtpio

This seems to be msa / Firefox related: wilzbach/msa#257

Xref: jupyterlite/jupyterlite#284

same error on chromium:
2021-08-07-142955_863x599_scrot

jupyterlab: 3.1.2
jupyterlab-fasta: 3.1.1
chromium: 92.0.4515.131

Replace if(this.seqs=[],!t instanceof Array||"at"in t)) by if(this.seqs=[],!t instanceof Array||"on"in t).
I guess there was a typo "at" --> "on".

jtpio commented

Thanks @guignonv! Would you like to open a PR?

So the upstream library (https://github.com/wilzbach/msa) looks abandoned (last PR in 2018 and the NPM package was pushed 5 years ago).

The root issue isn't in that library, however, but is in https://github.com/wilzbach/stat.seqs, which also looks abandoned.
Specifically, it's in https://github.com/wilzbach/stat.seqs/blob/master/lib/index.js#L52.

The issue can't easily be fixed here (unless you do a hacky find and replace at the end of the build stage).
It can't be fixed upstream given they seem abandoned.

Thankfully, there's a fork with fixes - https://github.com/niaid/msa. The specific fix is niaid/msa@e82512e.

Unfortunately, this isn't published to NPM and is a bit of a pain to get working.

  1. Update the "msa" entry of package.json in the fasta-extension folder to point to "https://github.com/niaid/msa".
  2. Run the install steps, which fails due to the bio.io package not being built.
  3. Go into bio.io in node_modules and manually 'build' it by running babel -d lib src.
  4. Repeat the install step and you'll have a working FASTA viewer.

Hopefully, this helps a little...

jtpio commented

Thanks @zacharyrs for investigating this.

Thankfully, there's a fork with fixes - https://github.com/niaid/msa. The specific fix is niaid/msa@e82512e.

It would have been interesting to see if they planned to open a PR to merge the fixes upstream. Although as you mentioned it doesn't seem to be actively maintained unfortunately.

Another option would also be to maintain a fork of the msa library, for example in https://github.com/jupyterlab-contrib (and move the jupyterlab-renderers there too). But this adds quite a bit of maintenance cost.

Personally I suspect we'd be best to move to their fork.

For reference, NIAID is the National Institute of Allergy and Infectious Diseases, so I suspect their fork will be well maintained.

I've contacted them to find out if they'll be publishing it to NPM, else I suppose we'll need a fork...

Hey @jtpio! Unfortunately I don't thing NIAID will be publishing their fork to NPM. I think it might be worth forking it to https://github.com/jupyterlab-contrib and publishing that to NPM ourselves.

jtpio commented

Thanks @zacharyrs for following up here.

Would you like to help with this and releasing to npm? Probably we could then fork to https://github.com/jupyterlab-contrib and add you as maintainer of the repo?

The package could be published under the @jlab-contrib/msa name for example.

Hey @jtpio, I'm keen to give it a go but I'll be honest that I'm not sure how much time I have to dedicate long-term. I can at least get the NPM builds working though so we can use it!

@zacharyrs I fork the NIAID msa repository in jupyterlab-contrib and you should have receive an invitation to become admin: https://github.com/jupyterlab-contrib/msa

Would you mind giving me your npm user id so I can invite you to the NPM organization?

@zacharyrs I fork the NIAID msa repository in jupyterlab-contrib and you should have receive an invitation to become admin: https://github.com/jupyterlab-contrib/msa

Awesome! I've just accepted that.

Would you mind giving me your npm user id so I can invite you to the NPM organization?

Should be zacharyrs.

Thanks!

Thanks I invited you to the jlab-contrib npm organization. Let us know if you have trouble publishing the package.