Comments (3)
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:
- Having Fable.Elmish.Browser use termination feature to clean itself
- Fable.Elmish.React check for the global variable and wrap the HMR code inside a
#if DEBUG
directive - 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.
I removed HMR from Lit.Elmish 1.4. We'll live with the React dependency for now :)
from fable.lit.
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)
- Accessing children in custom element HOT 6
- Problem importing raw css into ShadowDom HOT 6
- Class Based API vnext HOT 1
- What does this mean? HOT 4
- Is there similar pattern in Lit that uses React.useContext (Context propagation)? HOT 1
- Hooks.useTransition is leaving transition-enter classname to its next sibling. HOT 4
- Simple SVG is not rendering properly HOT 3
- Lit.mapiUnique HOT 4
- Self closing tag LitComponents are not closing properly if there's an HTML element after it HOT 2
- LitLabs.motion.animate() throws an error HOT 1
- Q: wrapping requirejs amd module (durandaljs interop) HOT 2
- Incongruence in documentation HOT 1
- Update to .net 6 HOT 5
- Use of Hook.useRef HOT 1
- Upgrading to Fable.Lit 1.4.2 causes issues in Elmish types HOT 1
- Astro integration HOT 2
- Update Fable.React and Feliz Bindings HOT 4
- Hook.useTransition with more events
- Hook.Elmish doesn't rerun when props change HOT 2
- hasChanged and currying problems
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fable.lit.