-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML Serialization becomes slower over time #2148
Comments
@philippkuehn Saw your linked issue on If moving forward, you plan on moving TipTap to |
@jcarvalho Oh, good to know! Yeah, would be great if you could create an issue there! 👍 BTW: the reason we moved from |
Hi, Flo here, a colleague of @jcarvalho 👋 we also looked into replacing I opened a new issue with |
Hi! Let’s see if the issue with |
The performance issue was quick-fixed already. Kudos to @holtwick for acting so fast! |
I released a new version! |
Already confirmed that this fixes the issue. And @holtwick fixed the underlying issue in parallel. Gonna look into the fix and report back later. It's a busy day 😄 |
What’s the bug you are facing?
In Node, repeated invocations of the
generateHTML
function with specific constructs cause the HTML Serialization process to become slower over time.How can we reproduce the bug on our side?
Create a new NodeJS project with the following
package.json
:Create and run the following Typescript script:
The script will output the time it takes to serialize a document to HTML, and you can notice it keeps increasing over time.
Can you provide a CodeSandbox?
No response
What did you expect to happen?
Serialization times remain roughly constant regardless of how many documents were serialized.
Anything to add? (optional)
We did a little digging on this, and found the culprit to be
hostic-dom
keeping a list of fragments in a global variable, which is never released. Running the snippet above, we can confirm theUSED_JSX
variable keeps gettingpush
ed to, containing repeated copies of<p>Hello world</p>
.Replacing
hostic-dom
with JSDOM orhappy-dom
seems to fix the issue, but it requires using lower-level TipTap APIs (and thus rendering the@tiptap/html
module useless):Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: