-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Upgrade Immutable to 3.8.1 #950
Comments
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 |
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 #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 ;) 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:
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 |
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", |
Adding immutable 3.8.x in your own dependency doesn't work. We really need to upgrade the version in draft.js. |
So, I took another attempt on this. With the latest flow-bin (0.70) the errors already look quite nice. However, I encountered this: Btw. As a workaround, in our app we did this (in package.json, using yarn):
Seems to work (fingers crossed) |
If I run flow in draft-js codebase with immutable 3.8.2, I get total of 34 flow errors.
In our app, we are using a variant of immutable flow typings where this line: All the others are errors originate from the draft-js codebase and should be relatively easy to fix. So I think with little effort this update should be really doable. But it would require a few batch fixes to immutable 3.8.x typings. |
I was checking for progress on this issue and stumbled upon this workaround: #1647 (comment) I had to specify |
@TomiS so flow errors in draft-js itself is holding it back from beeing fixed? so immutable 3.8.x basically works with draft.js? |
@macrozone We've been successfully running draft-js by forcing Immutable.js 3.8.2 (with |
i can also confirm that it works with immutable 3.8.2 |
Presumably because our code is within a monorepo, but I had to modify the Yarn resolutions config to:
to force Yarn to use version |
This is just crazy. The issue is more than 2 years old, this library is downloaded more than a million times a month, and still no one has been able to upgrade one of its dependencies one minor version!!! |
Hi @kylebebak, thanks for bringing this up again. Let me provide a bit of context as to why this is not as simple as upgrading a dependency one minor version. Draft.js is used internally at Facebook and is depending, like the rest of the www codebase on a version of immutable.js pinned to As @flarnie pointed out in #1289, upgrading Draft.js to While I agree it is desirable to upgrade immutable to We will update this issue as the situation evolves. |
@claudiopro I did what @dchambers and other suggested and put 3.8.2 into my That was an interesting experience, it gave me the first true reason I've had to use |
@kylebebak that must've been why it worked for me originally since I use yarn. |
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
The text was updated successfully, but these errors were encountered: