tonsky/datascript

Provide ES6 module version in the npm package

zeitstein opened this issue · 4 comments

Attempting to try out DataScript in SvelteKit, but unable to do so. While it seems this is completely a SvelteKit issue, I'm wondering whether it would be possible to provide an ES6 compatible version of the npm package? Thanks!

I am not experienced in JS ecosystem, what isn’t currently compatible? And what do I need to change? Are there any drawbacks (e.g. some other system will break?)

Having started using JS fairly recently, I'm only familiar with using ES6, which enabled using JS modules natively. After posting the issue, I saw that datascript-mori seems compatible with the ES6 (ECMAScript 2015) syntax. Though I wasn't able to use it; perhaps unsurprisingly, as it seems to use the same wrapper as Datascript.

I'm sorry I can't be of much help.

Turns out it works with import d from "datascript", but not with import { datascript as d } from "datascript". This is a known 'issue' when importing to ESM from CommonJS. Sorry for wasting your time!

No problem, glad it’s resolved!