Redocly / redoc

📘 OpenAPI/Swagger-generated API Reference Documentation
https://redocly.github.io/redoc/
MIT License
23.15k stars 2.28k forks source link

Lazy loading on 2.x #475

Open OGKevin opened 6 years ago

OGKevin commented 6 years ago

Our documentation is quite huge, see https://doc.bunq.com. The readme states that lazy rendering is not yet implemented in 2.x. It would be a real shame to move away from ReDoc due to the long loading time.

Therefore I kindly ask if there is an ETA on the implementation of lazy loading in 2.x ?

OGKevin commented 6 years ago

bump

OGKevin commented 6 years ago

No, so you guys are not going to comment ?

RomanHotsiy commented 6 years ago

@OGKevin sorry for not responding for so long, we've been really busy recent weeks. This feature is still under consideration as:

1) lazy rendering actually makes spec loading time longer - yes it renders initial screen faster, but full spec loads nearly 2x longer 1) 2.x version anyway works much faster than 1.x (for some specs we see 15sec -> 6sec improvement) 1) You can bundle your spec using redoc-cli which will make your docs appear blazingly fast (but time-to-interactive would be similar to loading time) 1) lazy rendering is not an easy thing and complicates code base, making it much harder to support

It will definitelly not be a part of 2.0.0 release. But maybe it will land in the nearest future. I will not close this issue until the decision is made.

Thanks for your interest!

OGKevin commented 6 years ago

@RomanGotsiy thanks for the reply.

yes it renders initial screen faster

This is exactly what we are looking for. For some of our users, the page takes roughly 20+ seconds to show something else then the loading spinning wheel.

You can bundle your spec using redoc-cli which will make your docs appear blazingly fast

We have tried this solution, but unfortunatly the CLI code is not escaping a character in the description field properly, which will make the HTML invalid on all browsers except google chrome. After hours of debugging we couldn't identify which character that was and have given up on it.

You can easily reproduce this by running the bundle command on our valid swagger.json

RomanHotsiy commented 6 years ago

@OGKevin this issue was caused by \u2028 new-line delimiter in your spec. I already fixed it in the CLI and it will go into next CLI release later today. Temporary you can remove \u2028 from you spec. Here is the context of where they appear in your spec:

it will remain valid until the next sandbox reset.\u2028\u2028 For the secret, use the API key you received.
OGKevin commented 6 years ago

@RomanGotsiy thats nice to hear, thanks for the help! We will consider moving to the bundled html.

RomanHotsiy commented 6 years ago

@OGKevin redoc-cli@0.3.9 has been released with the escaping issue fixed

imissyouso commented 4 years ago

hi. Any progress with lazy rendering?

ngthtung commented 3 years ago

Hello? Anything new?

chandrashekar-cohesity commented 3 years ago

Hello! Any progress for Lazy rendering?