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

fix: do not SSR index page #573

Closed
wants to merge 11 commits into from

Conversation

himself65
Copy link
Contributor

@himself65 himself65 commented Mar 6, 2024

Fixes: #543

Copy link

vercel bot commented Mar 6, 2024

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

Name Status Preview Updated (UTC)
waku ✅ Ready (Inspect) Visit Preview Mar 6, 2024 6:08pm

Copy link

codesandbox-ci bot commented Mar 6, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@himself65 himself65 force-pushed the himself65/fix-dynamic-page branch from cdbf145 to 53bad46 Compare March 6, 2024 04:11
Copy link
Contributor Author

@himself65 himself65 left a comment

Choose a reason for hiding this comment

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

oh no, git checkout delete some of my changes

Comment on lines +119 to +122
if (isStatic) {
const moduleIds = await unstable_collectClientModules(input);
path2moduleIds[pathname] = moduleIds;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Hmm, I think we want to use path2moduleIds for dynamic pages too (even though, it's suboptimal).

If unstable_collectClientModules is only the place of the problem, it doesn't actually leak the information because it's thrown away.
That said, I wish there would be an alternative way to collect client modules without running the code. Can we statically analyze the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, yes we can. I read the React-server source code, we could collect client info during vite build

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my current idea is to add a hook on the resolve module function and give id -> moduleId[] Map in the analysis plugin

Copy link
Owner

Choose a reason for hiding this comment

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

that sounds nice. we may need some research, so this would come at v0.21 or later.

Copy link
Owner

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
@dai-shi
Copy link
Owner

dai-shi commented Mar 16, 2024

#573 (comment)

Let's start it over.

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.

server components (even dynamic) runs on build unexpectedly (through unstable_collectClientModules)
2 participants