ueberdosis / hocuspocus

The CRDT Yjs WebSocket backend for conflict-free real-time collaboration in your app.
https://tiptap.dev/docs/hocuspocus/introduction
MIT License
1.34k stars 128 forks source link

Inaccurate document type check in onLoadDocument #795

Open aonnikov opened 8 months ago

aonnikov commented 8 months ago

Description

We recently migrated to esbuild in our project and run into an issue with loading documents, all loaded documents were empty. After some debugging I figured out that the problem was in document class check in the onLoadDocument hook. When code is minified, symbols will be replaced (unless keepnames option is enabled) and Hocuspocus will stop loading documents. For now we solved the problem with enabling keepnames option, but it would be nice to rewrite this check to be more robust.