open-sauced / hot

πŸ•The site that recommends the hottest projects on GitHub.
https://hot.opensauced.pizza
MIT License
426 stars 148 forks source link

feat: use async hooks and beta api #296

Closed 0-vortex closed 2 years ago

0-vortex commented 2 years ago

What type of PR is this? (check all applicable)

Description

This PR adds useSWR data loading hooks with loading and a minimal HotRepositories.tsx https://beta.api.opensauced.pizza/docs implementation.

Related Tickets & Documents

closes #270 closes #272 closes #276

Mobile & Desktop Screenshots/Recordings

Added tests?

Added to documentation?

[optional] Are there any post-deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

netlify[bot] commented 2 years ago

Deploy Preview for hot-sauced-ui ready!

Name Link
Latest commit cea471d736a4413dd8cd9185b327e958102087ab
Latest deploy log https://app.netlify.com/sites/hot-sauced-ui/deploys/62f283ac66bdb40008508fd9
Deploy Preview https://deploy-preview-296--hot-sauced-ui.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

bdougie commented 2 years ago

I was looking at this and saw the deploy preview currently returns the white screen of death.

0-vortex commented 2 years ago

I was looking at this and saw the deploy preview currently returns the white screen of death.

Oh yeah, I made the not logged in checks too lax and then focused on finishing the votes - made the upvote work sometime today but got left with an unstated "voted/upvote" button, will drop the fix for not logged in along with that, almost done with the hero repos. When that happens it won't be a draft anymore πŸ•

NsdHSO commented 2 years ago

Have you considered adding the preloader for PostList ?

0-vortex commented 2 years ago

Have you considered adding the preloader for PostList ?

Yes, however that one doesn't use SWR, a correct preload mechanism there is to animate itemsPerPage skeletons. With cached values, in the hero, we can display the repository name while the other data is loading, however because this data is static, this can be done right now; in the post wrap component we load about 30 at a time so we would need a local storage cache implemented in SWR to correctly display some data.

React loading skeleton package is a bit more useful than dropping a circle loading spinner, however it requires stateful data loading, something we get with API+SWR, right now using supabase js we would have to implement that manually.

Will check the best way to display at least one skeleton in the post list and alert the user on clicking load more. πŸ•

bdougie commented 2 years ago

@open-sauced/triage take a look at this and confirm data renders

github-actions[bot] commented 2 years ago

:tada: This PR is included in version 2.22.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 2 years ago

:tada: This PR is included in version 2.24.0-beta.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 2 years ago

:tada: This PR is included in version 2.24.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: