Giter VIP home page Giter VIP logo

Comments (3)

MangelMaxime avatar MangelMaxime commented on June 7, 2024 1

Yes, indeed it would be ideal to have a common Elmish.HMR (Fable.Lit will still keep some specific HMR code but that's unrelated to Elmish).

That's fine to me as this is specific to Fable.Lit

Elmish.Browser (though it'd be nice to remove the dependency if we had termination capabilities)

I think that when we have termination capabilities it should be able to remove the old listener.

Another possibility would be to add this code directly to Elmish.React with #if DEBUG as it only checks a global variable so it doesn't even need a dependency on Elmish.HMR.

This code also checks if there is the HMR modules presents.

In the past Eugene said he didn't want to have any code specific to HMR in the main modules. I think this is both to keep the code simple and also because he can't assure to be able to maintain it.

I am only able to maintain HMR because I invested a lot of time initially in it and even today it requires a lot of works to make it works correctly.

We can try to ask Eugene opinion on it today.

The ideal scenario would be:

  1. Having Fable.Elmish.Browser use termination feature to clean itself
  2. Fable.Elmish.React check for the global variable and wrap the HMR code inside a #if DEBUG directive
  3. Make Fable.Elmish.HMR dependant on Fable.Elmish elmish allowing it be used in Fable.Lit.Elmish, Fable.Snabbom.Elmish, Fable.Elmish

from fable.lit.

alfonsogarciacaro avatar alfonsogarciacaro commented on June 7, 2024 1

I removed HMR from Lit.Elmish 1.4. We'll live with the React dependency for now :)

from fable.lit.

alfonsogarciacaro avatar alfonsogarciacaro commented on June 7, 2024

Yes, indeed it would be ideal to have a common Elmish.HMR (Fable.Lit will still keep some specific HMR code but that's unrelated to Elmish).

The main issue, as you said, are Elmish.HMR dependencies, particularly Fable.React and to a lesser extent Elmish.Browser (though it'd be nice to remove the dependency if we had termination capabilities). We can break Elmish.HMR into Elmish.HMR/Elmish.HMR.React but this means React users will have to install an extra package to make it work. Another possibility would be to add this code directly to Elmish.React with #if DEBUG as it only checks a global variable so it doesn't even need a dependency on Elmish.HMR.

from fable.lit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.