Latest Quill Release using deprecated DOMNodeInserted mutation event
highvoltz opened this issue ยท 39 comments
The latest quill release is using deprecated mutation event DOMNodeInserted that will be removed/disabled from Chrome around July 2024. See https://chromestatus.com/feature/5083947249172480
Platforms:
Chrome browser
Version:
1.3.7
We are working on the 2.0 release which has already removed the use of mutation events.
We are working on the 2.0 release which has already removed the use of mutation events.
Hi @luin is there any update on this? Any tendative date for the new release with this issue fixed?.
Thank you so much in advance.
Good luck with the revamp!
I'm facing this error. can anyone help me with fixing this?
[Deprecation] Listener added for a synchronous 'DOMNodeInserted' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.
Me also facing the same error now with "react-quill": "^2.0.0":
[Deprecation] Listener added for a synchronous 'DOMNodeInserted' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.
Any update on this?
I am also facing this issue, any updates. Many thanks team for your hard work
@luin Do you know if the changes implemented for this issue in Version 2 will be breaking changes? I ask because we use a library that uses Quill (Vue2-editor) and they haven't responded to my question about their upgrade plan/timeline.
@erinknowles0501 It's an internal change so I don't expect any breaking changes introduced by it. Having said that, v2 does include some other breaking changes.
@luin do you have any updates on this?
We are working on the 2.0 release which has already removed the use of mutation events.
@EdManukyan We've already released 2.0.0-beta.0 and it's feature-complete. We are looking for feedbacks from the community before a stable release.
@luin thanks for the quick response, any date prediction on stable release ?
@erinknowles0501 It's an internal change so I don't expect any breaking changes introduced by it. Having said that, v2 does include some other breaking changes.
@luin Thanks for your reply, I have another question - when DOMNodeInserted is removed from browsers, will Version 1 still work to some extent?
@mjwweb The package link that you provided is not the official package. You can install the beta version with `npm install quill@beta".
Any update because I am still getting the warning also. or do you suggest we go with the beta version for now? I see you mentioned something about the beta version.
@luin Thanks for your reply, I have another question - when DOMNodeInserted is removed from browsers, will Version 1 still work to some extent?
Hi, I'd love to know the answer to this question also! FYI, you can test in Chrome by going to chrome://flags/#mutation-events
and selecting "Disabled". Then restart the browser. That will make all Mutation Events (including DOMNodeInserted
) not do anything, as they will in July by default. Would someone be able to verify that this still works with a pre-2.0 QuillJS? In my own testing, v1.0 seems to work fine for normal operations, even without Mutation Events functioning. But it's definitely possible I missed something.
Side note, please see https://developer.chrome.com/blog/mutation-events-deprecation for more details about this removal. In my analysis, it turns out QuillJS is the top cause of usage of Mutation Events across the web. It'd be great to know whether their removal will be a breaking change or not. I really appreciate that they've been removed from v2.0. Good luck with that launch.
@luin anything about the comment above ?
[Deprecation] Listener added for a synchronous 'DOMNodeInserted' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.
I'm facing this error while working in Quill. Please help me with this guys
Google's current plan is to remove mutation events in Chrome 127 which will be stable on July 30, 2024. Does this mean that will no longer work?
https://developer.chrome.com/blog/mutation-events-deprecation
Hi all ๐
We just released Quill 2.0.0-rc.0 (npm install quill@2.0.0-rc.0
), which has already been modernized and doesn't use the deprecated APIs anymore. It's recommended to upgrade from 1.x.x to that version. You can find the documentation and migration guide on https://v2.quilljs.com/ and please also feel free to let me know if you encounter any issues.
We plan to release 2.0.0 on March 1st if anyone prefers to a stable version.
Hello, I'm using version 2.0 of react quill, but the warning message keeps appearing.
@brunowbbs react-quill 2.0 uses quill 1.3. You can actually use Quill in your React project directly without react-quill: https://quilljs.com/playground/react
I'm using react-quill V2 and i got warning from chrome . can anyone help me how to solve this.
[Deprecation] Listener added for a synchronous 'DOMNodeInserted' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.
@Sivakumar0703 We'd love to offer helps for the react-quill project to upgrade to Quill v2 but haven't seen any signals the project would accept PRs for that. Before react-quill gets upgraded, you can refer to https://quilljs.com/playground/react to see how you can use Quill in a React project without any third-party libraries.
@luin the playground example is helpful, but it would be really nice to have examples in typescript as well.
Also, Quill v2 is written in typescript, but you are not exposing some of the types, such as Options
and ExpandedOptions
. This makes it difficult to create a wrapper component around Quill with proper type checking.
@Sivakumar0703 I am also using Quill in React and I just switched from using react-quill to just Quill. The example in the playground is useful but might be hard to read with all the extra features displayed.
Here is a very simplified version of how I implemented it. We must now use useRef to manually create a reference to a DOM element and then manage the lifecycle by initialising Quill in a useEffect hook.
Rendering Quill editor from the parent component:
<QuillEditor passText={setText} placeholder={placeholder} />
In my quill component:
import React, { useEffect, useRef } from 'react';
import Quill from 'quill';
const QuillEditor = ({ passText, placeholder }) => {
const editorRef = useRef(null);
useEffect(() => {
const quill = new Quill(editorRef.current, {
theme: 'snow',
modules: {
toolbar: [
['bold', 'italic', 'underline', 'strike'],
// Other options...
],
},
});
// Detect changes
quill.on('text-change', () => {
let content = quill.root.innerHTML;
passText(content);
});
return () => {
quill.off('text-change');
};
}, [passText, placeholder]);
// Rendering the QuillEditor component with a reference to the DOM element
return <div ref={editorRef} />;
};
export default QuillEditor;
Be ready for some changes. If you are using ordered lists and bullet lists in your Quill editor, I have a CSS hack to overcome the fact that the new version of Quill wraps every lists in <ol>
tags.
@Sivakumar0703 We'd love to offer helps for the react-quill project to upgrade to Quill v2 but haven't seen any signals the project would accept PRs for that. Before react-quill gets upgraded, you can refer to https://quilljs.com/playground/react to see how you can use Quill in a React project without any third-party libraries.
thank you. i have switched from react-quill to quill and everything is ok now. could you tell me how handle images when using quill toolbar because when i click on image icon a prompt is opened for entering the image url.
@Sivakumar0703 I am also using Quill in React and I just switched from using react-quill to just Quill. The example in the playground is useful but might be hard to read with all the extra features displayed.
Here is a very simplified version of how I implemented it. We must now use useRef to manually create a reference to a DOM element and then manage the lifecycle by initialising Quill in a useEffect hook.
Rendering Quill editor from the parent component:
<QuillEditor passText={setText} placeholder={placeholder} />
In my quill component:
import React, { useEffect, useRef } from 'react'; import Quill from 'quill'; const QuillEditor = ({ passText, placeholder }) => { const editorRef = useRef(null); useEffect(() => { const quill = new Quill(editorRef.current, { theme: 'snow', modules: { toolbar: [ ['bold', 'italic', 'underline', 'strike'], // Other options... ], }, }); // Detect changes quill.on('text-change', () => { let content = quill.root.innerHTML; passText(content); }); return () => { quill.off('text-change'); }; }, [passText, placeholder]); // Rendering the QuillEditor component with a reference to the DOM element return <div ref={editorRef} />; }; export default QuillEditor;
Be ready for some changes. If you are using ordered lists and bullet lists in your Quill editor, I have a CSS hack to overcome the fact that the new version of Quill wraps every lists in
<ol>
tags.
Thank you. Your ref helped me a lot.
@adgoncal Will exporting Options
. What the use case for ExpandedOptions
since it's supposed to be used internally?
Edited: Exported in 2.0.0-rc.4
@luin thank you! If ExpandedOptions
is only used internally, then there's no reason to export it. I only mentioned it because Options
was not, and I was looking for alternatives.
@luin, I installed the latest version of Quill (npm install quill@2.0.0-rc.4
) in React TypeScript + Vite. The warning disappeared, but the Editor didn't set the default text value that I had predefined. I had to uninstall this version and revert to version 1.3.7 that I had before.
I'm also using PrimeReact and importing the component as import { Editor } from 'primereact/editor';
Do you know if it might be due to a PrimeReact error?
If any of you have a solution for this issue using an updated version, I'm all ears and would be very grateful.
Thanks for your hard work! :)
I'm also using PrimeReact and importing the component as
import { Editor } from 'primereact/editor';
Do you know if it might be due to a PrimeReact error?If any of you have a solution for this issue using an updated version, I'm all ears and would be very grateful.
A quick search on primereact's issues show they do not yet support Quill 2. They're waiting for the official release: primefaces/primereact#5960
@luin, I installed the latest version of Quill (
npm install quill@2.0.0-rc.4
) in React TypeScript + Vite. The warning disappeared, but the Editor didn't set the default text value that I had predefined. I had to uninstall this version and revert to version 1.3.7 that I had before.I'm also using PrimeReact and importing the component as
import { Editor } from 'primereact/editor';
Do you know if it might be due to a PrimeReact error?If any of you have a solution for this issue using an updated version, I'm all ears and would be very grateful.
Thanks for your hard work! :)
Hello, did you find a solution? I have a similar problem with Angular 17.1.2, PrimeNg 17.13, quill@2.0.0-rc.5 I am using a reactive form and it does not recognize the default value of a "formControlName". I tried downgrading the version to quill@1.3.7 and it works but I get the warning.
Any help is welcome.
Quill 2.0 has been released (announcement post) with many changes and fixes. If this is still an issue please create a new issue after reviewing our updated Contributing guide ๐
@brunowbbs react-quill 2.0 uses quill 1.3. You can actually use Quill in your React project directly without react-quill: https://quilljs.com/playground/react
When I try to use quill in my react project created by Vite + TypeScript, I got a lot of errors. Can you please share a version works with TypeScript?
Yes so same issue here, I use "react-quill": "^2.0.0" in my react app, and in the browser I receive "quill.js:4233 [Deprecation] Listener added for a 'DOMNodeInserted' mutation event. This event type is deprecated, and will be removed from this browser VERY soon. Usage of this event listener will cause performance issues today, and represents a large risk of imminent site breakage. Consider using MutationObserver instead. See https://chromestatus.com/feature/5083947249172480 for more information." I was hoping it would be fix it in 2.0.0 but still I receive this warning, knowing that there wont be mutation events in Chrome 127 (going stable on July 30 2024) it seems like a big issue for us, any fix coming in the next weeks?
Going to lock this conversation as the issue has been fixed in Quill 2.0. For people that come here due to the warning:
- The warning only exists in Quill 1.x and has been fixed in Quill 2.0. Upgrading to Quill 2.0 should fix it.
react-quill
is a third-party library.react-quill
v2 uses Quill v1. You can use Quill 2.0 without a library. Here's an example: https://quilljs.com/playground/react.- If you are looking for an example using Quill v2 in a real project, here's an example: https://github.com/quilljs/webpack-example/tree/main.
- I haven't tested but Quill 1.x should still work after the event type is removed from the browser. Although it's still recommended to upgrade to Quill 2.0.
Please feel free to create a new ticket if you find new issues.