froala / react-froala-wysiwyg

React component for Froala WYSIWYG HTML Rich Text Editor.
https://froala.com/wysiwyg-editor
562 stars 130 forks source link

`froala-editor` should be a peer dependency #164

Open elliottsj opened 5 years ago

elliottsj commented 5 years ago

Currently, froala-editor is declared as a regular dependency.

Let's say my application declares these dependencies:

{
  "dependencies": {
    "froala-editor": "3.0.0",
    "react-froala-wysiwyg": "3.0.0"
  }
}

With some strict package managers like pnpm or yarn pnp, or using npm install --global-style, we end up with a directory structure like:

node_modules/
  froala-editor/
  react-froala-wysiwyg/
    node_modules/
      froala-editor/

Notice that there are two froala-editor/ folders.

This is problematic because my application imports plugins from the root froala-editor/ folder, but they don't take effect on the react component because react-froala-wysiwyg initializes its the editor instance from the nested react-froala-wysiwyg/node_modules/froala-editor/ folder.

To support this plugin system, froala-editor should really be a peer dependency of react-froala-wysiwyg.

gondar00 commented 5 years ago

Related to #161 ??

elliottsj commented 5 years ago

Unrelated

elliottsj commented 4 years ago

Whoops; this is only fixed on the Yolk-HQ fork.