If Magento developers complain about Magento, often building or extending upon Magento Admin Panel grids and forms is named as the foremost nightmare. We can not fix that. What we can do - though - is add a new fresh layer for building Magento admin grids and forms: Easier to create, easier to extend, faster in performance. A fresh slate..
<block
name="yireo-training.example-admin.grid"
template="Loki_AdminComponents::grid.phtml">
<arguments>
<argument name="provider" xsi:type="string">
Magento\Catalog\Api\ProductRepositoryInterface
</argument>
</arguments>
</block>
Just define a block with as template Loki_AdminComponents::grid.phtml
and a provider
pointing to your data provider: A repository class, a collection class or a custom array class. And Loki takes care of the rest.