yewstack / yewstack/yew

Server-side data fetching not re-rendering

Open
#3,023 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
32.8k
Forks
1.5k
Avg merge
5h 34m
Merged PRs (30d)
2

Description

Problem
Merging the server-side rendering+data-fetching example, and the server-side routing example results in empty renders when navigating back to the component that uses server-side fetching.

It's entirely possible I've made a mistake in transcribing the examples, but I can't

Steps To Reproduce
Steps to reproduce the behavior:

  1. I combine the examples here in this repository (ignore the Bazel stuff, that's additional work)
  2. trunk build index.html
  3. cargo run --features=ssr --bin simple_ssr_server -- --dir dist/
  4. Navigate to localhost:8081 – see nav + random uuid rendered
  5. Click the "Hi" link – see nav + "Hi" rendered
  6. Use the back button, or click the "Home" link – see only nav rendered
  7. Reload the root page - see nav + random uuid rendered

Expected behavior
Either cached value from the first render, or re-render with a new random uuid

Screenshots
Initial load:
Screenshot 2022-12-09 at 19 44 54
After clicking "hi" link:
Screenshot 2022-12-09 at 19 45 01
Clicking "home" or via browser back button:
Screenshot 2022-12-09 at 19 45 07

Environment:

  • Yew version: yew: 0.20.0 yew-router: 0.17.0
  • Rust version: 1.64.0
  • Browser and version, if relevant: Safari 16.1 & Chrome 107.0.5304.121

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using the yew-ssr-bazel example and the commands trunk build index.html and cargo run --features=ssr --bin simple_ssr_server -- --dir dist/. Trace the server-side fetching and routing behavior when navigating from the root to “Hi” and back, then verify that the root renders its cached or newly fetched UUID instead of only the navigation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.