Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: AuthShowcase only makes query when logged in #675

Merged
merged 5 commits into from
Nov 3, 2022

Conversation

c-ehrlich
Copy link
Member

@c-ehrlich c-ehrlich commented Nov 2, 2022

✅ Checklist

  • I have followed every step in the contributing guide (updated 2022-10-06).
  • The PR title follows the convention we established conventional-commit
  • I performed a functional test on my final commit

Changelog

A lot of people seem to be confused that there are tRPC errors in the console as soon as they open their app

Example (there have been a bunch of these): https://discord.com/channels/966627436387266600/1020552951116333217/threads/1030282705734226051

This avoids those errors by only enabling the query if there is a user. As a nice benefit it also acts as builtin documentation for passing undefined for the input and using the enabled option.


Screenshots

(taken after starting the dev server and navigating to localhost:3000 without being logged in)

Before:
Screenshot 2022-11-02 at 21 24 57

After:
Screenshot 2022-11-02 at 21 24 16

💯

@vercel
Copy link

vercel bot commented Nov 2, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
create-t3-app ⬜️ Ignored (Inspect) Nov 2, 2022 at 10:36PM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented Nov 2, 2022

🦋 Changeset detected

Latest commit: b968636

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-t3-app Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added 📌 area: cli Relates to the CLI 📌 area: t3-app Relates to the generated T3 App labels Nov 2, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2022

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 59
🟢 Accessibility 98
🟢 Best practices 93
🟠 SEO 86
🟠 PWA 54

Lighthouse ran on https://create-t3-app-git-no-auth-errors-t3-oss.vercel.app/

@c-ehrlich c-ehrlich marked this pull request as ready for review November 2, 2022 20:43
@c-ehrlich c-ehrlich changed the title feat: AuthShowcase doesn't make query when not logged in feat: AuthShowcase only makes query when logged in Nov 2, 2022
Copy link
Member

@nexxeln nexxeln left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cooooool

@juliusmarminge juliusmarminge merged commit 5d20745 into next Nov 3, 2022
@juliusmarminge juliusmarminge deleted the no-auth-errors branch November 3, 2022 05:49
devvianto605 pushed a commit to devvianto605/create-devviantex-nextjs-app-deprecated that referenced this pull request Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📌 area: cli Relates to the CLI 📌 area: t3-app Relates to the generated T3 App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants