Using Solid Signals/Stores in React
I have an app with various frontends implemented in React. I'd like to switch to SolidJS for new frontend code (and eventually convert the old ones) but it's too big a lift to do all in one go, so I was going to try adpoting Solid incrementally. There is some logic that concerns state that is shared by all the frontends so as a first step I was thinking of converting that logic to use Solid signals/stores.
It seems like signals are an independent concept and implementation and could be used as a standalone state management system, but am I missing something?
1 Reply
Have a look at SolidJS in React? Reconciling Disparate Worlds.
It's an interesting “enthusiast level problem to solve” but perhaps not a viable production migration strategy. And even if you succeeded in using Solid signals inside a React App it would most likely perform much worse than a well-structured React App while being no closer to make migrating to Solid less work. It's a situation that seems destined as a move “from bad to worse”.
If you are serious about a gradual migration isolate the smallest piece of functionality into a separate Solid app. Perhaps use IndexDB for hand over data between the apps. Then over time move more and more functionality over to the Solid App (while navigations between apps will require a full page loads).
Ryan Carniato
YouTube
SolidJS in React? Reconciling Disparate Worlds
As similar as SolidJS and React look on the surface it has been challenging to have them play nicely together. From Compilation to Compat, State Management to Adapters, I'm going to explore just how different these frameworks are and if they have any chance of working together.
[0:00] Preamble
[10:16] Very Different Runtime
[23:38] Can a Compil...
MDN Web Docs
IndexedDB API - Web APIs | MDN
IndexedDB is a low-level API for client-side storage of significant amounts of structured data, including files/blobs. This API uses indexes to enable high-performance searches of this data. While Web Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. IndexedDB provides a solut...