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

Wait for Monaco to initialize when MonacoEditorReactComp props are updated #682

Merged
merged 4 commits into from
Jun 25, 2024

Conversation

vrama628
Copy link
Contributor

@vrama628 vrama628 commented Jun 22, 2024

Fixes #681 and fixes #622

In MonacoEditorReactComp there's a race condition between the Monaco editor initializing and the component rerendering; if a component rerenders and triggers componentDidUpdate before Monaco has finished initializing, errors happen as described in the linked issue.

The first commit introduces a test that exhibits these errors, and the second commit fixes it by awaiting this.isRestarting in componentDidUpdate.

Copy link
Collaborator

@kaisalmen kaisalmen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much! Only two minor tweaks required. I tested this successfully already and it is basically ready for merge. Btw, you closed issue #622 with this PR as well (I added this to the description). 🎉

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@vrama628 vrama628 requested a review from kaisalmen June 25, 2024 16:20
Copy link
Collaborator

@kaisalmen kaisalmen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. LGTM.

@kaisalmen kaisalmen merged commit efe08fd into TypeFox:main Jun 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants