hocuspocus
hocuspocus copied to clipboard
Inaccurate document type check in onLoadDocument
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.