Skip to content
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

React Portal #4

Closed
lalitkapoor opened this issue Feb 2, 2020 · 2 comments
Closed

React Portal #4

lalitkapoor opened this issue Feb 2, 2020 · 2 comments

Comments

@lalitkapoor
Copy link

I wonder if the reason React Portal isn't working is because of this facebook/react#12653

@TeemuKoivisto
Copy link
Owner

Hey @lalitkapoor, I have fixed the rendering issue with portals. The link you provided was indeed relevant although there was various other moving parts that needed also to be addressed. Apologies for taking this long to answer 😅 .

Yet as I have researched this topic, mainly by examining the other PM-React editors out there, I have found that using portals might not actually be preferable due to some React's async vs ProseMirror's sync rendering issues.

https://bitbucket.org/atlassian/atlaskit-mk-2/commits/d520a6fb6dab1027d3873eec9317c4e8574d07fb

Idk. Will have to research that later on if problems arise. Now I'm just trying to complete the full editor.

@TeemuKoivisto
Copy link
Owner

@lalitkapoor I think I have now fixed the portals to the best of my ability as possible. The portals are rendered only once per dispatchTransaction which should avoid a performance bottleneck with too many nodeViews firing updates in one transaction. But from what I can tell from the flame graphs I think the biggest bottle neck is now React itself as it is not maybe that suitable for rendering multiple small components vs one big tree. I have been thinking about implementing the example editor in Svelte to see how much better it is but time will tell.

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

No branches or pull requests

2 participants