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 SSR data passing #383

Merged
merged 2 commits into from
Sep 10, 2021
Merged

Fix SSR data passing #383

merged 2 commits into from
Sep 10, 2021

Conversation

Nkzn
Copy link
Contributor

@Nkzn Nkzn commented Sep 10, 2021

The ssr-data in HTML is not passed to props, because

  • createPageRoute sets ssrData (in pagedata://) to page component props
  • loadSSRDataFromTag sets ssr-data from HTML into memory (pagedata://)
  • createPageRoute is called before loadSSRDataFromTag is called.
    • page component gets empty props

so, I moved loadSSRDataFromTag before createPageRoute.

test

examples/hello-world-ssr is same as SSR sample in the document.

  1. run the sample
  2. check the serverTime in HTML is passed to UI

@Nkzn Nkzn requested a review from ije as a code owner September 10, 2021 10:05
Copy link
Member

@ije ije left a comment

Choose a reason for hiding this comment

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

oh, my bad refactor! lgtm, thanks @Nkzn

@ije ije merged commit 2d5f897 into alephjs:master Sep 10, 2021
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.

2 participants