Comments (11)
@MangelMaxime Thanks a lot for the detailed explanation 😄, these are all valid points indeed. However, I think it is worth noting that snabbdom has the advantage over React when it comes to enforcing statelessness, there are no components, which I thought was the whole point of Elm. React can be totally stateless but it leaks that abstraction and let the developer decide how he makes his state soup.
Anyways, that was just two cents :)
Keep up the good work 👍
from elmish.
😱 But why?
from elmish.
@Zaid-Ajaj just a side note: baseline React lib itself has no stateful components and as this is elmish, you'd have a hard time making use of such a component (I've tried that with some of the legacy Native components), so I don't think it's a valid concern.
from elmish.
@MangelMaxime Thanks for sharing the long-term view, +1 for performance.
from elmish.
Yes I probably should have explain the reasons :)
I tried to use the Snabbdom DSL over a real case application and it's neither readable neither maintainable.
There is too much code pollution due to the separation between the events
, property
, etc.
So the solution would be to convert the DSL to something else and this something else is the same as React (which is the same as the Fable-arch, Elm ones etc.).
After, discussion with @et1975 we conclude having to maintain both could be hard and also leads to the same mess up as with fable-arch and elmish.
Elmish, will probably have others renderer available in the future. For example, for WebGL, ReactVR or another target than the DOM.
And yet the performance where better with Snabbdom but the ones we got with react are pretty decent. If we have some performance problem, in the application this would probably come from the user code and not react-dom.
Finally, snabbdom was still in alpha stage and shouldn't be used by a lot of people (As no one reported the bug it's having when dealing with nested application) so it's the best time to remove it.
from elmish.
@et1975 Yeah you are right, the default is stateless (what it should be). I am not againt stateful tho, I think it just should be implementation detals rather than consumption details :)
from elmish.
@MangelMaxime I wanted to ask for some time, does the same reasoning preclude adding support for preact too?
from elmish.
@ncave
For the moment, I would say yes.
The reason are if we add preact support we will end up with the same DSL as for React.
So for the moment, I prefer focusing my effort on testing the template and working on the doc site (which is now my priority).
After, as preact offer the same API as react but with better performance (from my search 8-10 times better) than react we could consider supporting it :). Performance problems are rarely hit I think, but having a quicker renderer is never something bad from my point of view.
But we need to guide the user to one of the renderer and avoid the situation like: "I'm starting a project but don't understand the difference between React and "renderer X". Which one should I use".
We could say later:
- Browser = preact because it's faster, smaller and that something cool :)
- Mobile = react-native so use need to use react
To conclude, if someone want to add the support of another renderer I don't think myself and @et1975 are close to this idea :). But the new renderer need to provide something more than react IMO.
This is my opinion perhaps @et1975 got another one ?
from elmish.
Personally I didn't find the situation confusing at any point and as long everything remains sufficiently decoupled I'd always welcome additional renderers. In fact, we had some folks here at work trying to get WPF one going... it didn't go well :)
A console renderer for node apps could be fun too!
from elmish.
@et1975 Actually, someone was already working on such implementation for WPF. I would just go for fable-electron instead
from elmish.
We've seen it, the point is rather to use elmish as is (which works) and target WPF which works on trivial stuff, but introducing a VDOM on top of WPF is not a promising direction when there's react-native that already works on Windows. If there was an existing differ for WPF, now that would be worth a look!
from elmish.
Related Issues (20)
- Expose Program module functions as C#/VB compatible extension methods HOT 6
- Subscribe to DOM events via `Program.withSubscription` HOT 2
- How to pass an external event into a program? HOT 30
- Zaid's fromAsync Cmd HOT 3
- Ability to stop subscriptions HOT 9
- Cmd helpers for checking success by option HOT 4
- Double subscribe when dispatching during sub startup
- None of the duplicate subscriptions should be started HOT 12
- Subscription doc updates for v4
- Is there an expected time to get to a stable version of v4 HOT 2
- Elmish for WebSharper apps HOT 4
- Question about FSharp.Core version HOT 4
- Cmd.OfFunc.whatever HOT 9
- Docs: String.replicate piece raises an exception HOT 1
- Remove redundant Subscription trace logs HOT 6
- Replacement with ofEffect for ofSub not working as in v3? HOT 3
- Proposal: port Elm's virtual dom to work with Feliz HOT 4
- [Question] Elmish way of disposing component dependencies HOT 1
- Suggestion: Cmd.OfTask.attempt with untyped Task HOT 1
- How to dispose of `Cmd.ofEffect` events handler? HOT 2
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 elmish.