feat: add virtualization (configurable)#2623
Open
audipasuatmadi wants to merge 4 commits intoRedocly:mainfrom
Open
feat: add virtualization (configurable)#2623audipasuatmadi wants to merge 4 commits intoRedocly:mainfrom
audipasuatmadi wants to merge 4 commits intoRedocly:mainfrom
Conversation
* add virtualization to redoc * address code review, simply stuffs --------- Co-authored-by: Putu Audi Pasuatmadi <audipasuatmadi@users.noreply.github.com>
…id of the api endpoint
NGanip
approved these changes
Nov 26, 2024
alfinm01
approved these changes
Nov 28, 2024
AlexVarchuk
requested changes
Dec 30, 2024
Collaborator
AlexVarchuk
left a comment
There was a problem hiding this comment.
Hi @audipasuatmadi thank you for the contribution to Redoc.
I investigated your solutions, but it totally broke navigation and scrolls in the documentation, we cannot merge it as it is. Please improve it. Thanks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What/Why/How?
Projects with very large APIs often experience significant lag and frequent crashes when using Redoc. To address this issue, virtualization has been introduced. Virtualization allows elements to be rendered only when they are near the user's viewport, significantly reducing memory consumption for very large API documentation.
Virtualization is made optional because not every project would benefit from enabling it by default. It is advantageous only when the data is large, as it introduces an additional overhead of calculating the virtualization. When the data is not substantial, the drawbacks of this overhead outweigh the benefits.
Benchmark result

Using edge profiler, each recorded in 20 seconds in an OpenAPI docs with 192,076 (190K+) lines
Reference
Closes #2615
Tests
Introduced extra unit tests. Results of running all the tests:

Screenshots (optional)
Kapture.2024-11-26.at.14.21.22.mp4
Check yourself