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

Flickering state in HMR #19

Open
MangelMaxime opened this issue Aug 16, 2018 · 3 comments
Open

Flickering state in HMR #19

MangelMaxime opened this issue Aug 16, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@MangelMaxime
Copy link
Member

MangelMaxime commented Aug 16, 2018

When working on my canvas experimentation I had the same Flickering problem with HMR.

For me it was due to event registration using addEventListener because the previous one isn't removed moving the mouse for example still trigger the old one and because the previous Elmish app isn't destroyed there is some kind of a conflict probably and depending on which event take place the App 1 or 2 render.

Edit: I put it here just so we can later take a look at this issue if needed and if we have the time for it.

@MangelMaxime MangelMaxime added the enhancement New feature or request label Aug 16, 2018
@MangelMaxime
Copy link
Member Author

I discover yesterday that we have a addEventListener listening for the URL change. It's could be one of the cause.

In Elmish the toNavigable module check if the previous URL is defferent from the new one. This limit the HMR problem for Elmish application.

@alfonsogarciacaro
Copy link
Member

Ah, it can be. Does HMR work if we remove the hash change event listener? I did it thinking of the REPL in a frame where you would send new code through params, but we're getting more events now. If this is indeed the problem, I can think of two solutions:

  • Disable the event listener in debug mode with #if !DEBUG (easiest)
  • Implement Elmish navigation so it's easier to manage more actions through the URL

@MangelMaxime
Copy link
Member Author

I don't know yet. I just discover this event listener yesterday when reviewing the PR for #reset.

I am planning to remove current listener and use Elmish navigation module so it's more standard. :)

I think we do have others listener attach at other places. Will probably take a look at the issues in the REPL later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants