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

Compatibility with loading routes #204

Closed
t4t5 opened this issue May 31, 2016 · 4 comments
Closed

Compatibility with loading routes #204

t4t5 opened this issue May 31, 2016 · 4 comments

Comments

@t4t5
Copy link

t4t5 commented May 31, 2016

Here's the problem: we want to use FastBoot to speed up initial loading time BUT we also want to keep our loading-routes so that, once Ember has loaded, transitioning between routes gives the user instant UI feedback.

What happens instead is that the correct server-rendered page starts loading at first, but is then taken over by the loading-route as soon as the JavaScript kicks in, only to go back to the data (that was initially server-rendered) again once the API calls are done.

Here's a video showing what that looks like: http://cl.ly/0C430b2d0c1e

What would be the best way of handling this?

@tomdale
Copy link
Contributor

tomdale commented Jun 24, 2016

@t4t5 I think the best way to handle this case is to ensure that the model data used to do the initial, server-side render is also included in the HTML payload. FastBoot will handle this serialization for you automatically via the shoebox API (see https://github.com/ember-fastboot/fastboot#the-shoebox).

@tomdale
Copy link
Contributor

tomdale commented Jun 24, 2016

@t4t5 Gonna close this issue, but please comment if you have further questions about "the shoebox."

@tomdale tomdale closed this as completed Jun 24, 2016
@bakerac4
Copy link
Contributor

Hey @tomdale, I was experiencing the same thing as @t4t5 so I implemented the shoebox. But after I did it I realized I still had a problem, in that my app is using store.query. We generally have admin pages that have paging and filtering. What is your recommendation for this approach?

@bakerac4
Copy link
Contributor

I ended up creating an addon called ember-data-fastboot-route. It handles serialization and loading of data from the shoebox for all routes that have a model defined. Read more here. It fixed both my issues with the loading substates and using store.query for server side paging

xg-wang pushed a commit to xg-wang/ember-cli-fastboot that referenced this issue Nov 16, 2020
…/debug-4.1.0

fix(package): update debug to version 4.1.0
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

No branches or pull requests

3 participants