Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@hgiesel
Copy link
Contributor

@hgiesel hgiesel commented Nov 22, 2021

Improvements:

  • Supports pressing Enter to accept Mathjax, Shift-Enter for newline
  • Show this information as placeholder on empty Mathjax
  • Give Mathjax a min-width for less resizing on small sizes (and no resize when placeholder disappears)
  • Delete button
  • Only use one ResizeObserver for all Mathjax images (hopefully closes mathjax editor is leaking memory #1491 ?)

Unrelated:

  • Add bazel directories to .prettierignore and run from root once. This formatted json and css files in rslib and ftl. I've executed it by accident on the root sometimes, which formatted bazel files, which broke bazel for me. I saw no reason not to include those files in other directories in formatting.

@dae
Copy link
Member

dae commented Nov 23, 2021

Thanks Henrik!

@hikaru-y does this resolve the mem leak for you?

@dae dae merged commit 2778b92 into ankitects:main Nov 23, 2021
@dae
Copy link
Member

dae commented Nov 23, 2021

This introduced a warning during build - maybe we could work around it with a temporary variable?

Warning - unrecognized UnaryExpression operator 40!
This is an edge case unaccounted for in svelte2tsx, please file an issue:
https://github.com/sveltejs/language-tools/issues/new/choose
-$imageHeight

@hikaru-y
Copy link
Contributor

@dae
I tried the latest main branch(675155e), and unfortunately the issue(#1491) remains. I looked into the cause a bit. It appears that the MathJax images (SVG data URI) are cached in memory and are not released until the end of the session. I think this is because the contents are dynamically rewritten in the editor, and a page refresh never happens.

Screenshot (DevTools)

mathjax-editor

To be honest, I'm not sure if this is an issue that needs to be solved or not, because the amount of memory usage that increases each time a card is selected is so small that it shouldn't be a big problem for users unless they select hundreds of cards in total.

@dae
Copy link
Member

dae commented Nov 24, 2021

Thanks for checking. If the leak is small and does eventually get cleaned up, I think you're probably right that we don't need to worry about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mathjax editor is leaking memory

3 participants