-
Notifications
You must be signed in to change notification settings - Fork 26
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
Improve quantification of advantages #57
Comments
I have no interest in "winning" any framework wars, or in disparaging other libraries. React is a very useful library, one I've used and still use in many projects. Inferno's perf gains with v4 are impressive -- congrats to its authors. I don't know Nerv well, but wish them the best. At the same time, I don't think we're at an end to the changes in the JS ecosystem. There will be something after React, which also probably means after the React work-alikes. And as long as that's the case, we need people trying out alternatives and seeing what works, what doesn't. I think React has two really good ideas:
But React has two shortcomings:
Surplus is an experimental solution to those two issues.
If I were to rank reasons to try Surplus, I'd say:
There are two ways to be fast: do stuff faster, or do less stuff. Surplus is largely fast from the latter. There's not a lot of abstraction between the JSX you write and the DOM operations it generates. It almost treats JSX as a macro language for the DOM. In my mind, that simplicity is really the more important quality than performance. |
I'm just going to chime in even though I have no connection to the development of this package, and what follows is opinionated but maybe as an outsider I can provide a bit different perspective. The fact that this is even a conversation puts some merit in the potential of this sort of approach. In many ways Surplus seems to be a modern take on techniques that pre-existed the rise of React and it's component model. There are a few different ways to handle change detection and rendering and while fine grain change detection hasn't had a champion for a while(I don't count MobX as most of it's performance benefits get lost in it still feeds into VDOM) this library shows it's potential in modern JS. Personally while the performance is an area of interest for me it is also the the API that immediately caught my attention. Not so much what's there but what's not there:
That all being said there are still tradeoffs. CycleJS is another framework which is very different than others that suffers similarly. The difference there is Surplus isn't so opinionated in it's functional approach, and to me the fact at any given point in time you can still know the value of moving parts makes it a lot simpler. For me the standouts are:
I feel Surplus place is a bit similar to something like hyperHTML, even if it isn't trying to take a stance. It's showing that core DOM spec can go a long way and is a bit of a bet on the Web being the future (VS using a different abstraction that compiles down to native). It doesn't have to be that way but that's how I perceive it's position today. Given Surplus really is just the render library and makes even less assumptions than React and is similarly functionally composable other than being unproven doesn't seem particularly better or worse suited for any specific type of application. |
@ryansolid That's a great summary and very much in line with my thinking. Thanks for taking the time and writing at such length. |
I really like the advantages this framework has to offer in terms of eliminating the performance/complexity/interop costs of a virtual DOM but think this needs to be made much more clear. From current results [1] of krausest / js-framework-benchmark [2] I see very limited performance advantages over Inferno and Nerv, and they seem to beat Surplus as well as each other in certain cases. The current results in [1,2] make it very difficult to justify using this framework over the industry-proven React-style front-end APIs offered by the performant Inferno and Nerv frameworks. This case becomes especially challenging if we would consider the existence of React Native, now with interop with a number of popular libraries and frameworks such as ReactXP, Vue/RN, Angular/RN, etc.
It would be great if we could find a way to better quantify the advantages of using this framework over the existing VDOM-based frameworks, at least in a certain class of applications. I did really enjoy updating the CodePen sample, watching whether or not the demo would keep working as I made the proposed cleanup changes in #56.
[1] https://rawgit.com/krausest/js-framework-benchmark/master/webdriver-ts-results/table.html
[2] https://github.com/krausest/js-framework-benchmark
P.S. ds300 / ddom seems to offer some similar functionality (get rid of VDOM), using the React JSX compiler.
The text was updated successfully, but these errors were encountered: