Skip to content

fix(ssr-react): remove context from render#276

Merged
ArnaudBarre merged 2 commits intovitejs:mainfrom
chaejunlee:main
Jan 21, 2024
Merged

fix(ssr-react): remove context from render#276
ArnaudBarre merged 2 commits intovitejs:mainfrom
chaejunlee:main

Conversation

@chaejunlee
Copy link
Copy Markdown
Contributor

Description

closes #227

The example seems not to be using "Data Router". In that case, we only provide location without context to <StaticRouter />. Therefore, I just removed context out of the files regarding it.

If it needs an example with "Data Router", I can add one. However, since react-router uses vite, I don't think the example won't be so much different than the react-router one.

So the bottom line is:

  1. I have fixed the playground example
  2. I think ssr with vite is better explained in react-router's repository

Additional context

I would like to add some tests around RSC, however because react-router only support loader pattern of remix, not the RSC, it won't be easy.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@chaejunlee chaejunlee changed the title fix: remove context from render fix(ssr-react): remove context from render Dec 30, 2023
@ArnaudBarre
Copy link
Copy Markdown
Member

Thanks for fixing this. The playground are mostly here for testing purpose and not for example.
With Remix built on top of Vite and the complexity of state of the art SSR with React, I think this is out of the scope of this repo and as you said better handled in other repo that provide better abstractions like Remix

@ArnaudBarre ArnaudBarre merged commit 4051323 into vitejs:main Jan 21, 2024
@thxl2010
Copy link
Copy Markdown

Excuse me, I'm experiencing an issue with CSS not loading when using lazy loading.

The manifest contains mappings of module IDs to their associated chunks and asset files.

I did't find context.modules for vite react ssr. The @vitejs/plugin-vue supports it for vue. What about the @vitejs/plugin-react?

@hi-ogawa
Copy link
Copy Markdown
Contributor

@thxl2010 Can you create a issue to elaborate your setup in detail?

@thxl2010
Copy link
Copy Markdown

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.

SSR example misuses React Router v6

4 participants