sqlpage / SQLPage

Fast SQL-only data application builder. Automatically build a UI on top of SQL queries.
https://sql.datapage.app
MIT License
1.57k stars 89 forks source link

feat: add lazy component #615

Open mtt-artis opened 2 weeks ago

mtt-artis commented 2 weeks ago

Hi šŸ‘‹,

I'm working with some resource-intensive queries that take some time to execute, and the embed option on the card component works really well. However, Iā€™d like to prevent layout shifts and avoid having cards nested inside other cards.

The lazy component follows a similar logic but provides an element you can style before it's replaced with the actual content.

Please feel free to make any changes, rename the component (coming from React/Solid, that's what comes naturally to me), or guide me in the right direction.

If you like this implementation, I'd be happy to add it to the documentation.

lovasoa commented 2 weeks ago

Hello ! This sounds like a very useful component to add, and I'll be happy to integrate it. Thank you ! :blush:

Could you please:

mtt-artis commented 2 weeks ago

hi šŸ‘‹, Thanks for your comments

  • remove the indentation changes to make the code easier to review

could we invest for future change and make the indentation consistent across the file ?

I can add tests and documentation during the next WE if you don't mind šŸ˜‰

lovasoa commented 2 weeks ago

Yes, we can set an indentation standard, but maybe after your PR? You are going to end up with large conflicts for nothing, otherwise. I need a clean diff in this PR to review it.