-
Notifications
You must be signed in to change notification settings - Fork 144
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
Initial data #106
Closed
Closed
Initial data #106
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d728849
add initial data loading
thejessewinton 64f6ec3
initial server data, then client, and cache
thejessewinton 5fc4d7e
Revert "initial server data, then client, and cache"
thejessewinton 3386ab0
Revert "Revert "initial server data, then client, and cache""
thejessewinton 4b7962b
update static params
thejessewinton ae5aa52
rm console
thejessewinton 172c4da
optimistic UI
thejessewinton 306d1f5
fix
thejessewinton 7e6824d
add suspense for static
thejessewinton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
import { type ReactNode } from 'react' | ||
import { Header } from '../_components/header' | ||
import { Footer } from '../_components/footer' | ||
import { AuthProvider } from '../_providers/auth' | ||
import { getServerAuthSession } from '~/server/auth' | ||
|
||
export default async function DefaultLayout({ | ||
children, | ||
}: { | ||
children: ReactNode | ||
}) { | ||
const session = await getServerAuthSession() | ||
|
||
return ( | ||
<AuthProvider session={session}> | ||
<div className="max-w-3xl px-6 mx-auto"> | ||
<Header /> | ||
{children} | ||
<div className="py-20"> | ||
<Footer /> | ||
</div> | ||
<div className="max-w-3xl px-6 mx-auto"> | ||
<Header /> | ||
{children} | ||
<div className="py-20"> | ||
<Footer /> | ||
</div> | ||
</AuthProvider> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How long does this query take? If it's slow, we should fix the query before caching it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's coming in about 490ms, so pretty long...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great info. I checked insights and this query looks like it's max taking 5-10ms. Which is slow for that query & data size, so can likely be optimized. But that's not the source of the 490ms.
Next places to look:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, I'll keep digging in, get it fixed up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beam's DB is located in us-east-1:
The Vercel functions are in iad1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ayrton @mscoutermarsh I've done a fair amount of work here to try and get this faster, and have also improved some of the UI using the initial data.
On the query latency, I'm not seeing anything happening on the Prisma end that would lead to higher latency like this; in some testing, caching the query calls seemed to have done quite a bit to improve load times across the board (176ms). Overall, the Prisma and data implementations are exactly the same as the old one, but in the 2.0 we're getting the data on the server rather than the client, and we're removing loading skeletons, which we had before. Since that would block the TTFB, I think it could be leading to us noticing a slower initial load. Any suggestions for getting this stronger are welcome, I'll try and get them implemented over the weekend.