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 ssrExchange's client-mode defaulting based on suspense-mode #369

Merged
merged 3 commits into from
Aug 5, 2019

Conversation

kitten
Copy link
Member

@kitten kitten commented Aug 5, 2019

Previously it was impossible to use the ssrExchange together with suspense mode on the client-side, since the ssrExchange assumes that it's on the server, when the suspense mode is turned on.

This PR adds a separate isClient option to ssrExchange, so it can be told whether it's running on the client-side manually.

Copy link
Collaborator

@JoviDeCroock JoviDeCroock left a comment

Choose a reason for hiding this comment

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

Looks good to me 💯

@kitten kitten merged commit 1857e20 into master Aug 5, 2019
@kitten kitten deleted the fix/ssr-exchange-client-flag branch August 5, 2019 17:22
@iamstarkov
Copy link
Contributor

nice

mode on the client-side as well.

```js
const ssrCache = ssrExchange({ isClient: !!process.browser });
Copy link
Contributor

Choose a reason for hiding this comment

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

afaik, typeof window !== 'undefined' is better

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, totally, process.browser is a "Webpack-ism" which is noted here but that's fine too. I'm just assuming that people will be able to decide themselves :)

Copy link
Contributor

Choose a reason for hiding this comment

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

true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Oh no! A bug or unintented behaviour.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants