ES modules packages for RDF/JS

Hello community

I would like to share with you a GitHub org I have created yesterday to slowly migrate some RDF/JS packages to native es modules and es modules only (that is, no esm [1] or dual packages).

Please check https://github.com/rdf-esm

This of course means cutting ties to node <12 but future-proofing for latest standards today. So, while this path not suit some back-end projects which cannot upgrade to node 12 or 13 (only latter supporting es modules without flag), this should be very welcome for web projects where a more efficient tree-shaking will be possible.

I and, I think, some other members of our community may have been a little unhappy about the node-centrism of the @rdfjs packages on NPM. Of course, webpack and other bundlers are very proficient in combining packages written in different module styles, that is far from ideal. I started with something I needed specifically for a web project: @rdfjs/formats-common [2] and @rdfjs/sink-map [3]

The @rdf-esm versions of those packages lazy-load the parsers/serializers so that the formats-common package can be efficiently chunked rather than bundling all parsers even if they will never be used.

Additionally, I re-did the data-model which was already 99%-done and stuck in Pull Request limbo. You will find the packages in a new npm scope [4]

I hope you will find this effort useful. I know that creating a new GitHub organisation and NPM scope may be controversial but the apparent impasse and reluctance to adopt the modules standard leave me little choice if I want make the best out of RDF/JS in browser environment. I expect that in the long run the divergence shall prove temporary.

In any case, 

Best,
Tom

[1]: https://npm.im/esm
[2]: https://github.com/rdf-esm/formats-common
[3]: https://github.com/rdf-esm/sink-map 
[4]: https://www.npmjs.com/search?q=rdf-esm 

Received on Sunday, 17 May 2020 20:32:07 UTC