Upgrade Immutable to 3.8.1
Do you want to request a feature or report a bug? Feature
What is the current behavior? Current versions of Draft use Immutable 2.7.4
What is the expected behavior? Would be useful to upgrade to latest version (3.8.1) to reduce dependancy mismatch (Working on project that needs 3.8.1, which means I need 2 versions of immutable). Also is worth setting Immutable as a peer dependancy rather than a dependancy so people are aware if there is a mismatch.
Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js? Had a quick look and 0.91, 0.10-stable & 0.10-alpha all depend on 2.7.4
Completely agree, would be nice to have such an update of the dependencies. Plus, the #607 is still open, and this can cause some serious problems on some browsers.
I did have a quick look at upgrading it fork, but looks like it isn't a trivial task. Would be happy to have a go if the maintainers think it would be a useful thing?
Related to #879
Could we declare Immutable as a ^ version rather than ~ so that we can be on any later minor version rather than a specific one? This would allow us to upgrade minor versions in our apps without having to get a new version of draft-js every time.
This would be great! If anyone wants to work on it, we'll make time to review the PR.
Hey folks, any updates on this one? I found this issue as a performance critical. The logging message appears on each user typing, thus is slowing performance significantly.
Seconded that an update on this would be helpful. The logging messages are really detrimental.
Hi there, I just discovered that my bundled code contains two copies of immutable because of draft-js' old version dependency. We are using [email protected] in our code, [email protected] is [email protected].
There are fixes for immutable Records between these two versions that we assert in tests in our code and that which would improve performance of draft-js as a whole.
Hi, wanted to see if there are any plans on doing this? As others have said, the console.warn is on every input changed and causes serious slowdown.
Hi @shakdoesgithub ,
There is an open PR for bumping to immutable 4 on https://github.com/facebook/draft-js/pull/1439 however if you would like to work on the meantime to bump to 3.8.1 that would be awesome as well
As previously mentioned, if you're running into this issue with the hundreds of console.warn and the serious degrade in performance because of it. One simple fix is to fork draft-js and include the fork into your project. I have a fork of draft js with version 3.8.1 of Immutable, that anyone can use if they like until an updated version of Immutable is added to draft-js.
@CarsonYong Perhaps I'm missing some context here, but would it be worth it to try submitting your bump as a pull request?
The work was enormous, but somehow I managed to pull it through ;) https://github.com/facebook/draft-js/pull/1573
Edit: Oh, crap, it's failing flow type check. I'll take back everything I said.
@TomiS we're all rooting for you!
@TomiS is there any update on this? I'm getting loads of warning messages using Immutable via DraftJS.
Not really much to say. There are ~20 flow errors to solve after updating immutable to 3.8.x. Some of them seem quite simple but there is one problematic:
Error: node_modules/immutable/dist/immutable.js.flow:406
406: static of<T>(...values: T[]): SetSeq<T>;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function type. This type is incompatible with
387: static of<T>(...values: T[]): IndexedSeq<T>;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function type
This parameter is incompatible:
406: static of<T>(...values: T[]): SetSeq<T>;
^^^^^^^^^ SetSeq. This type is incompatible with
387: static of<T>(...values: T[]): IndexedSeq<T>;
^^^^^^^^^^^^^ IndexedSeq
It looks like an internal type error in immutable.js that probably cannot be fixed outside that lib. I can get rid of that error by setting
.*/node_modules/immutable/dist/immutable.js.flow
in the ignore section of .flowconfig but all the other errors also disappear which is probably not cool.
Ah seems annoying. I have zero experience with flow, otherwise I'd lend a hand. Are there any maintainers (@flarnie) that could jump in to help?
Did this ever get fixed? I'm getting flooded by these messages making it hard to see relevant logs. Feels like a DDOS attack on my console.
Did this ever get fixed?
If you add your own dependency for a newer version of Immutable the errors should go away. I have this in my dependencies:
"immutable": "^3.8.2",