Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Send preloaded data to client #3

Closed
Rich-Harris opened this issue Dec 14, 2017 · 2 comments
Closed

Send preloaded data to client #3

Rich-Harris opened this issue Dec 14, 2017 · 2 comments

Comments

@Rich-Harris
Copy link
Member

Rather than the initial page doing preload on both server and client, the server should send the preloaded data with the client app, so that it's unnecessary.

@EmilTholin
Copy link
Member

EmilTholin commented Jan 12, 2018

Do you think the preload data should be sanitized, like e.g. in the Redux documentation?

JSON.stringify(preloadedData).replace(/</g, '\\u003c')

Or maybe something like serialize-javascript should be used?

Rich-Harris added a commit that referenced this issue Jan 14, 2018
Serialize preloaded data for initial page and serve to client
@Rich-Harris
Copy link
Member Author

@EmilTholin excellent point — serialize-javascript seems like the right choice, I went with that. Thanks for the rec.

Closed via #87

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants