GMOD / jbrowse-components

Source code for JBrowse 2, a modern React-based genome browser
https://jbrowse.org/jb2
Apache License 2.0
205 stars 61 forks source link

Avoid stream polyfill for GFF3/GTF parsing #4547

Closed cmdcolin closed 3 weeks ago

cmdcolin commented 3 weeks ago

Fixes https://github.com/GMOD/gff-js/issues/62

I extracted the non-streaming parts of the gff and gtf parsers into their own NPM packages that can be used in isolation, and called the packages gff-nostream and gtf-nostream

This reduces the need for node.js polyfills and the stream-browserify workaround

Potentially, even the streaming parts of @gmod/gff could use gff-nostream as a base package to avoid the code duplication, but right now, this would just remove @gmod/gff and @gmod/gtf entirely from the build in favor of the non-streaming new packages

note: the naming gff-nostream is a little awkward but was hard to come up with something clearly named to distinguish it from @gmod/gff

saves about 50kb ungzipped/15kb gzipped js

cmdcolin commented 3 weeks ago

The parseStringSync now only return features with no "options" object to be otherwise. reason being

this could be considered to be done somewhat different to add more options, but i think this makes the default behavior best for jbrowse usage