Introducing React Server, a powerful solution for building component-driven and modular server-side applications using React. Create server-side components just like you do on the frontend. Simplify your full-stack development and embrace the power of React on the server. Try it now!
We need a way to directly query the database in order to obtain a list of states for a given scope and key. At the moment you need to use arrays to keep track of "lists". While this makes sense for finite lists, it doesn't make sense for lists with an indefinite / growing length, such as posts in a forum.
If we implement a reactiveuseQuery hook, we can directly pass client side paging props to the database and return a reactive / live query to the server which contains all states for the requested scope.
This also mitigates the need to reflect changes to a single post in the list itself such as approving a post as the useQuery already obtains all the needed information and rerenders the component if a state has been added to the lists.
Once we implemented useQuery it replaces useState in some cases.
It's a must have for lists of an indefinite / constantly growing size. If you only have a finite number of states stored in a list then you can still use useState and keep track of your states / ids manually.
useState hasn't been optimized for large datasets. useQuery is generally preferable if you plan to increase the number of states stored in a list constantly over time.
This was a bug in the getValue function of the MemoryStore which caused the database response to overwrite a new state in the cache because the timestamps haven't been stored at the correct moment.
We currently do not have a known limit for performance or any known bottlenecks. This needs to be tested and verified and converted into presentable numbers.
This will later contain guides to troubleshooting once common issues arise. You can use this thread as reference for common problems and how to solve them.
Generation of component tree fails for dynamically rendered components if they get rendered outside its parent component. This happens when you map an array to components and the array changes. This can be solved by resolving the dynamically rendered components and creating a link in the tree.
We need to think about how to handle errors. Currently any error thrown on the serverside will be sent to the client over GraphQl. This may be helpful during development, but in a production environment you might not want to disclose sensitive information such as error messages or stack traces. This needs to be handled in a way that's flexible enough to transport errors during development but can be configured to suppress errors, e.g. in production