4 ms·
Have you tried Tanstack, they have a headless solution that is pretty neat. Also work with vanilla.
by yashasolutions 2y ago
Have you tried Tanstack, they have a headless solution that is pretty neat. Also work with vanilla.
- _heimdall 2y agoI've found it way easier to keep table logic on the server since that's almost certainly where the data lives. Any filtering, sorting, pagination, etc in the client should just trigger an AJAX call PR similar (HTMX works great here) to request an updated table and swap in the new markup. Tanstack table, and really any table library running in the browser, is extremely heavy and complex to manage and maintain. You either end up with a copy of your entire dataset living in the browser memory or any changes to the view still requests to the server, getting back JSON instead of HTML. That JSON has to be parsed, merged with the current state, and run through client-side rendering logic to update the DOM to end up with the HTML that could have been rendered on the server directly from the original data source.
- Waterluvian 2y agoThis feels like the complete opposite in terms of performance. Plus it fails to cover any case where we’re just not reporting database records. Eg. Client-side data generation and analysis.
- _heimdall 2y agoPerformance is a whole other ball of wax. A comparison can be done, but you have to set context first with regards to the size and shape of the data set, network conditions, filtering/sorting features, etc. You'd really want to factor in database bandwidth limitations at that point, as any fully client-side table library will need to load all the data first. My primary point was on the simplicity of the stack and ease of maintaining. I would expect a performance gain in most cases as well, though there are definitely cases where client-side would perform better.
- 7sigma 2y agoI love tansack but even better is inertiajs, no need for an API. You get the benefits of spa without paying the tax of writing api