Solid is another smart-compiler, virtual-dom-less frontend component building library. If you're wondering how this is different from Svelte, the author has a Medium post on it[0]. [0]: https://medium.com/@ryansolid/javascript-ui-compilers-compar...
Solid – A declarative JavaScript library for building user interfaces
131–140 of 178 posts
Re: Solid – A declarative JavaScript library for building user interfaces
#132Earlier quoted context omitted.
There's usually no render function to call in these types of frameworks as far as I understand (my experience being a little Svelte). I imagine in your scenario the psuedo code to achieve what you want would be written. list2 = bubble_sort(list1) removeItem = () => delete list2[random index] ... The compiler will see a change to the list2 variable anywhere that removeItem is called and annotate the code to make the a…
Note that the item is deleted from list1. The framework should (I suppose) track that list2 depends on list1 through bubble_sort(). Are the dependencies implicit? Or should they be declared explicitly?
Re: Solid – A declarative JavaScript library for building user interfaces
#133I've been playing around with your library for the last hour and so far it's excellent, pretty what I had hoped for after working with React for a while. The performance of individual renders is one area of improvement but I think the main contribution is the clarity the update model provides. React works well until you try to avoid re-rendering and then it really falls appart. For example, updating a context re-rend…
I do return a proxy. It's just readonly. I really like the unidirectional data flow and explicit read write segregation of react. This adds so much control without having to add Framework like control mechanisms. I know it isn't easy, but it something that makes the solution elegant in the end. I think that passing data should also mean the choice of passing the ability to update it. That is a problem I have with alm…
Re: Solid – A declarative JavaScript library for building user interfaces
#134I've been playing around with your library for the last hour and so far it's excellent, pretty what I had hoped for after working with React for a while. The performance of individual renders is one area of improvement but I think the main contribution is the clarity the update model provides. React works well until you try to avoid re-rendering and then it really falls appart. For example, updating a context re-rend…
state changes are not tracked by diffing, it is much more interesting. You can read about it here https://www.atfzl.com/understanding-solid-reactivity-basics
Re: Solid – A declarative JavaScript library for building user interfaces
#135Earlier quoted context omitted.
state changes are not tracked by diffing, it is much more interesting. You can read about it here https://www.atfzl.com/understanding-solid-reactivity-basics
Thanks, that makes a lot of sense (basically Mobx but fine-grained). When I mentioned diffing, I meant for updating state objects like lists. Your ` ` element only updates if a new list is created, but only re-renders the changed elements. I assume this is accomplished by diffing the old and the new list?
Re: Solid – A declarative JavaScript library for building user interfaces
#136Earlier quoted context omitted.
My annoyance with that talk is he never compared Svelte with multi-threaded React. It was the natural next thing to look at but it was like “okay my point stands let’s move on” haha.
Well maybe we should compare apples to apples. With React you go down a rabbithole of workarounds around their initial concepts (like hooks) until you wonder why you chose it in the first place.
Re: Solid – A declarative JavaScript library for building user interfaces
#137Earlier quoted context omitted.
I do return a proxy. It's just readonly. I really like the unidirectional data flow and explicit read write segregation of react. This adds so much control without having to add Framework like control mechanisms. I know it isn't easy, but it something that makes the solution elegant in the end. I think that passing data should also mean the choice of passing the ability to update it. That is a problem I have with alm…
I'm not sure I understand your argument in favor of setState correctly. By splitting the state into two parts (a read-only view, and a setState function to update it), isn't the opposite being accomplished? It is now possible to pass the data without passing the ability to update it, or vice-versa. Which could very well be desirable but could be accomplished by other means (i.e. leaving to the parent the choice of pa…
Also don't be worried about copying the array that much. I'm doing that in the JS Framework Benchmark and it's still about the fastest with 10k items. The real key is identifying where you don't need to update the list at all just the items in it. That being said you can do an update without copying the array like this:
setState('list', state.list.length, newItem);
Granularity of performance isn't a silver bullet. Being fine-grained doesn't necessarily make everything faster (especially creation). The power is that granularity is arbitrary so it can be maximized to the type of situation, completely independent of component structure.
Re: Solid – A declarative JavaScript library for building user interfaces
#138Re: Solid – A declarative JavaScript library for building user interfaces
#139Solid is another smart-compiler, virtual-dom-less frontend component building library. If you're wondering how this is different from Svelte, the author has a Medium post on it[0]. [0]: https://medium.com/@ryansolid/javascript-ui-compilers-compar...
One thing the article doesn't really dive too far into is that Svelte is template driven, while Solid is more about React's jsx-drive-components. As I've used both style methods for years, I think I'm growing fond of Svelte's template approach as the best general purpose solution. This is because usually my pages are 70% static and can be expressed as simple nearly vanilla web-idiomatic html pages. Being able to keep…
Re: Solid – A declarative JavaScript library for building user interfaces
#140Solid looks like Surplus.js mix react.js