-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Lazy load model properties #4280
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
Comments
I think the best approach for this is to add a For example, This will be challenging: Swagger-Client will need some reworking in order to keep up with depth (we can't encode that metadata into the definition as we go, since that data may be used as base data for a later call to the resolver), and Swagger-UI will need to be able to tell when a subtree needs further resolution (currently it just checks to see if data for a given path exists at all). |
This comment has been minimized.
This comment has been minimized.
Profiling the expanding action: Rendering the whole model property tree takes half of the time; and converting the model tree to an immutable map takes the other half. Profiling the folding action: It's worth mentioning that, lazy loading model properties should only delay the performance degradation, because the more properties loaded the less it could be efficient and fluent. Storing the spec with a plain json object in the state can avoid the conversion; but is error-prone without enforcing a code convention and code review. And it also requires a lot of changes to the existing code. Is it possible to delay the subtree resolving process to the render function? Other than lazy loading, delay resolving also improves the performance. Resolving includes:
There's no need to load/resolve/render unless necessary. I've also noticed that unnecessary re-rendering happens. But I'm not sure how much it is slowing down. |
We have similar problem, where many of our models have more properties and each property and it sub properties takes lot of time to expand and browser hangs some time to load its properties. It would be helpful if we have a lazy load option for the properties. may be by setting some depth option. |
Demonstration API definition
petstore.swagger.io/...&url=https://heldersepu.github.io/hs-scripts/swagger/4248_swagger.json
Expected Behavior
Fast expansion of model properties
Current Behavior
Very slow expansion of model properties
Possible Solution
Lazy load model properties like we do the models
Context
Looking at the current implementation, the collapsed models show right away (big thanks 2 @shockey)
Expanding small models is quick, but the largest models (such as
Patrimonio
) takes quite a while, once it fully expands, expanding child models takes no time...I believe that is because we are loading the entire tree of the model.
The text was updated successfully, but these errors were encountered: