jacoscaz / quadstore

A LevelDB-backed graph database for JS runtimes (Node.js, Deno, browsers, ...) supporting SPARQL queries and the RDF/JS interface.

Home Page:https://github.com/jacoscaz/quadstore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BUNDLE: reduce bundle size of quadstore-comunica by working on immutable.js and decimal.js

jacoscaz opened this issue · comments

There are two potential avenues that might lead to shaving significantly more bytes out of quadstore-comunica's bundle:

  1. using something other than Immutable.js and/or enabling tree-shaking so that only Immutable's Map ends up in the bundle
  2. using one of the alternatives to decimal.js

Both of these require upstream work.

Number 1. in particular is a bit more complex as the Bindings type and factory function are declared separately in both comunica/comunica and comunica/sparqlee.

Plan and relevant PRs / commits:

  • swap decimal.js with a lighter alternative
  • move Bindings typings declaration from @comunica/bus-query-operation to @comunica/types and refactor the Bindings factory function into a BindingsFactory similar to RDF/JS DataFactory, moving it to a dedicated package @comunica/bindings-factory.
  • Align @comunica/bindings-factory with the Queryable RDF/JS spec
    • Should the typings for the Queryable RDF/JS spec end up in @rdfjs/types?
  • Align sparqlee to use @comunica/bindings-factory
  • Produce an alternative version of @comunica/bindings-factory using the hamt library or a similar alternative to Immutable.js' Map, test it within quadstore-comunica.

Done! Will ship in the next version of quadstore-comunica.