Comments (3)
Quick question: If we were to use ESM, wouldn't it still use the "node" key in the "exports" object. And the "node" key refers to a commonjs file, which is not ESM compatible?
from automerge.
You can import CommonJS from ESM:
An import statement can reference an ES module or a CommonJS module.
(automerge-backend-wasm being the CommonJS module, and the test package an ESM, in this scenario).
As per the conditional exports spec, it would use the node export in both cases:
matches for any Node.js environment. Can be a CommonJS or ES module file
So putting both together should mean that the export will work with both CommonJS and ESM - which you can test by running the test script for both the export that's there now (require) and the suggested one (node).
from automerge.
Please try the new automerge-wasm
npm package. This should work in both commonjs and mjs.
from automerge.
Related Issues (20)
- Automerge.next.load: convertRawStringsToText balloons document size
- correct use of "RawString"? HOT 1
- is there s.th. like a "RawMap" or a "RawList" HOT 1
- Cursor at end of text HOT 3
- getConflicts for op that sets to current value HOT 1
- undefined `context` in `import_value` HOT 2
- No docs for Map types? HOT 2
- Errors creating multiple large documents: error receiving message { err: RuntimeError: unreachable at __rg_oom HOT 6
- Error inflating document chunk ops: an operation referenced a missing actor id HOT 4
- [Question] Need help about merging a local doc to a shared doc HOT 2
- Memory leak with `initSyncState`
- Perf: Unexpected quadratic performance loading a collaborative text document HOT 3
- [BUG] ReferenceError: context is not defined in `proxies.ts`
- [Question] Should structuredClone objects be supported? HOT 2
- `updateText` errors out when running commitmas example HOT 1
- Error on load (with 5.10 release, after syncing back and forth a bit with sync.automerge.org) - error inflating document chunk ops: an operation referenced a missing actor id HOT 2
- rfc: consider uuid support in autoserde
- .values() ownership issue makes it hard to modify items in a collection
- Next.js example
- Dynamic strings in the assert_doc! meta-language are unwieldy HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from automerge.