Skip to content

feat: Add error handling, loading states, and prop validation#1

Open
wgpullen wants to merge 1 commit intomainfrom
feature/improve-error-handling
Open

feat: Add error handling, loading states, and prop validation#1
wgpullen wants to merge 1 commit intomainfrom
feature/improve-error-handling

Conversation

@wgpullen
Copy link
Copy Markdown
Owner

Summary

This PR improves the user experience and code quality of the HackerNews clone:

Changes

  • Hot.vue: Added loading state, error notification with retry button, replaced N+1 API calls with Promise.all
  • ListItem.vue: Added proper Vue.js prop validation (type, required, default), removed commented-out code

Why

  • Users currently see a blank page while data loads
  • No error feedback when API calls fail
  • Props had no validation, risking runtime errors
  • Commented-out code was cluttering the component

Testing

  • Manual testing of loading/error states
  • Existing unit tests still pass

- Hot.vue: Add loading spinner, error notification with retry button
- Hot.vue: Replace N+1 API calls with Promise.all for performance
- Hot.vue: Extract API_BASE constant for maintainability
- ListItem.vue: Add proper prop validation (type, required, default)
- ListItem.vue: Remove commented-out Elliott error code
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 14, 2026

Deploy Preview for weshackernews ready!

Name Link
🔨 Latest commit 182d45c
🔍 Latest deploy log https://app.netlify.com/projects/weshackernews/deploys/69de7a93534e8d0008873cb4
😎 Deploy Preview https://deploy-preview-1--weshackernews.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 project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant