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

Asynchronous rendering in Remix projects. #6346

Open
gbalint opened this issue Sep 10, 2024 · 0 comments
Open

Asynchronous rendering in Remix projects. #6346

gbalint opened this issue Sep 10, 2024 · 0 comments

Comments

@gbalint
Copy link
Contributor

gbalint commented Sep 10, 2024

In Remix projects we know for a while that even though flushSync is called in the dispatch flow, it is not guaranteed that Remix rendering happens synchronously.

That was the reason to enable the resize/mutation observers in select mode (see #5838 ), to make sure the dom walker is executed again after Remix rendering is ready.

However, it turned out that it also happens that all the project code renders asynchronously, and the canvas root container is not in the dom yet during the dispatch flow. (Even though that should only happen to parts of the app inside the Remix app (inside the Outlet))

How to reproduce:

  1. Create new Remix starter project: http://localhost:8000/p?accessLevel=public&clone=concrete-utopia/utopia-remix-starter
  2. Open the code editor
  3. Open root.js (e.g. by double clicking on the Outlet in the navigator
  4. Edit the code and cause a build error like this:
image
  1. Fix the code.

If you log the canvas root container element in resubscribeObservers (which is called in the dispatch flow), sometimes you will see that it is null even during the last dispatch after the code change. You may need to try it a few times and/or reload the project to try again.

TODO:

  • Understand why and how this could happen
  • If possible fix it
  • Check if Remix update could help (see Notes)

Notes:

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

1 participant