convergencelabs / monaco-collab-ext

Adds collaborative editing capabilities to the Monaco Editor
https://convergencelabs.com
MIT License
219 stars 25 forks source link

Support default export? #6

Closed cktang88 closed 3 years ago

cktang88 commented 4 years ago

I have a project using this with Webpack and React.

Currently I'm importing by:

import * as MonacoCollabExt from "@convergencelabs/monaco-collab-ext";

This was counterintuitive, and took me a while of debugging Webpack errors to figure out.

I think it's more intuitive to import with

import MonacoCollabExt from "@convergencelabs/monaco-collab-ext";

or even

import { MonacoCollabExt } from "@convergencelabs/monaco-collab-ext";
mmacfadden commented 4 years ago

Thanks for commenting! I might be a a bit confused here, and I have to validate this tomorrow (I am on a mobile device now with out access to the code), but wouldn't instead you just want to do something like this:

import { RemoteCursorManager, EditorContentManager } from "@convergencelabs/monaco-collab-ext";

The MonacoCollabExt namespace is really only used if you are hot-linking using a script tag with the umd distribution. We could probably update the documentation to make that more clear.