Wrong import path in dist/y-prosemirror.cjs file
charesbast opened this issue · comments
This doesn't work because Jest doesn't understand module exports. I'll fix the issue, but I want to make clear that jest is lacking behind in the ecosystem.
Eventually I'd like to move away from these custom path transformations.
Thx for the super quick response :)
PS: I assume you've seen it but actually it's not just awareness, all imports are impacted
Hi @charesbast,
I hope you agree with me that we shouldn't keep stuck in a decade-old process to bundle modules. We have had wide ESM support for a long time and we have very useful features like "conditional imports" that make my life immensely easier + it allows for smaller imports that don't require environment checks (there are different bundles for browser and node).
Jest is a big pain point for me (as are other module bundlers that don't advance). I decided to continue using "conditional imports" because I don't want to return back to absolutely qualified imports.
Don't despair, Yjs + extensions are still usable in Jest. Here is a Jest config from the Jupyter project: https://github.com/jupyterlab/jupyterlab/blob/master/testutils/src/jest-config.ts