-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
fix(partially-fix-cold-start): add another component as layer for lazy loading #1121
Open
jerensl
wants to merge
7
commits into
asyncapi:master
Choose a base branch
from
jerensl:fix/cold-start
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+23
−3
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b38d62f
fix(cold-start): add another component as layer for lazy loading
jerensl 209e9d3
fix(cold-start): add description about the issue
jerensl 27ed834
fix(cold-start): simplify description and add reference issue
jerensl 8c82775
chore(versioning): add versioning for fixing cold start
jerensl 9aa9181
Merge branch 'master' into fix/cold-start
KhudaDad414 888feaa
Merge branch 'master' into fix/cold-start
asyncapi-bot dbb4efd
Merge branch 'master' into fix/cold-start
jerensl 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"studio-next": patch | ||
--- | ||
|
||
Fix ~4 seconds cold start and client side lazy loading |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use client' | ||
import dynamic from 'next/dynamic' | ||
const StudioWrapper = dynamic(() => import('@/components/StudioWrapper'), {ssr: false}) | ||
|
||
/* | ||
Calling StudioWrapper as Code Splitting in Server Components will also make them be included in server-side rendering, | ||
that's why we added another layer and told them as client components to make the code splitting work in client-side only | ||
|
||
Related Issue: https://github.com/asyncapi/studio/issues/1118 | ||
Reference: https://github.com/vercel/next.js/issues/49454#issuecomment-1830053413 | ||
*/ | ||
export default async function StudioEditor() { | ||
return ( | ||
<StudioWrapper /> | ||
) | ||
} |
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.
I tested the result and it seems like it is working. the only issue that I see here is the layers that we are adding. StudioEditor -> StudioWrapper -> CodeEditor. do you think we can do something about it? maybe combine them into one wrapper? or at least two?
if that's not possible, can you also add a comment on why this wrapper has been created?
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.
The reason we added
StudioEditor
is that we are unable to make root-level pages(/) as client components, so we added an extra component as a client component to call the StudioWrapper as code splitting