-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Initial prerendering #62
Comments
Have you made progress on this at all? This is a big blocker to use using ReDoc for the Docker API documentation. I've had a play around with Universal, but it looks like the app is a long way off working with it. Do you think it might be possible/easier to use something like prerender in the interim? |
I've given it a shot with Prerender, and it actually sort of works. The page renders okay, but nothing is functional. Eventually the client-side ReDoc kicks in and things become functional. The main problems are:
This doesn't really help with load times, because the documentation isn't really functional until the client-side ReDoc has loaded. Presumably with the Angular Universal prerendering, it'll use the existing DOM, so it actually speeds up the load time? |
Hi @bfirsh , this is an interesting problem that affects us too. @RomanGotsiy is away on vacation right now. He'll be back towards the end of next week. |
@RomanGotsiy Any thoughts on how this could be done? I'm eager to help implement this, but I don't want to waste my time if existing thought has been up into it. |
Hey @bfirsh,
AFAIK Universal prerendering will use the existing DOM so the page won't jump to the top. It will be still non-functional until ReDoc loads but after it loads all events (mouse clicks, key presses) will be replayed. + I believe Angular developers have introduced a Universal pattern which should help to improve UX until ReDoc is loaded. Summing up: let me look into this as well so as to refresh my knowledge. I will post my thoughts here. |
@RomanGotsiy Have you had a chance to look at this? Any thoughts? |
@bfirsh, I had a quick look but unfortunately still haven't had time to dive into this. |
@bfirsh finally I've managed to get to this. I did some quick tests with this approach. The results are following:
So resulting performance improvement was not so big and I didn't like it. Right now I'm working on alternative approach: lazy rendering.
I will probably implement some fallback for IE/Edge and Safari for now (e.g. they will load just as before) and will release it till the end of week. |
Nice. That sounds great. 👍 |
@bfirsh I have released to CDN beta version of ReDoc with the mentioned above performance optimisations Could you test it and provide your feedback? This version is only on CDN, it is not available via npm |
Nice - works a treat. :) |
I'm Happy you liked 😀. So you will proceed with it, right? I will keep this as beta a few more days and then will release new version. |
We will indeed proceed! Thanks so much for this. :) |
Just released a new version
|
Implemented in by redoc-cli |
@RomanHotsiy In the latest README, lazy-rendering is mentioned as "Not Implemented". Any reason for that? We are also facing the slow loading issue in redoc |
For big specs initial page rendering takes too much time.
Using Angular2 Universal prerendering should fix this issue.
This feature should be optional and should work via CLI e.g.:
The text was updated successfully, but these errors were encountered: