youtype / mypy_boto3_builder

Type annotations builder for boto3 compatible with VSCode, PyCharm, Emacs, Sublime Text, pyright and mypy.
https://youtype.github.io/mypy_boto3_builder/
MIT License
544 stars 36 forks source link

Website crashing: best ways to view underlying TypeDefs? #184

Closed eli-kir closed 1 year ago

eli-kir commented 1 year ago

Just wanted to say how much I appreciate your work on this library. This is one of those "is it a bug or a feature" moments, but I'm filing under bug just because of how important I think being able to view the docs is. If you have an alternate suggestion for viewing the docs, I'm happy to oblige and close, but I've had to view the files directly in venv/..../lib/python3.8/site-packages/mypy_boto3_ec2/, which gets the job done, but is less than ideal.

Describe the bug As an example, loading the docs for createsnapshotrequestvolumecreatesnapshottypedef is nigh impossible. The page seems to load at first, but any attempt to move around is met with lag and a soon an alert asking if I want to kill the page.

To Reproduce Steps to reproduce the behavior: Viewing the link above should hopefully yield the same results I and my colleagues experience. This has been tested on both chrome and firefox. We don't have macs, so Safari isn't an option, but given how big the EC2 stubs are, I doubt any browser handles a page this big with ease.

Additional context

OS: Ubuntu 20.04.5 LTS

Browser: Chrome Version 110.0.5481.177 (Official Build) (64-bit)
eli-kir commented 1 year ago

I should also mention that disabling javascript is a solution, but I'm not entirely sure it's t h e solution

vemel commented 1 year ago

Thank you for the report. Might be an issue with the material theme. Will take a look.

vemel commented 1 year ago

MarkDown version works fine: https://github.com/youtype/boto3_stubs_docs/blob/main/docsmd/mypy_boto3_ec2/type_defs.md#createsnapshotrequestvolumecreatesnapshottypedef

So, it looks like Material Theme code block rendering is too expensive.

Possible solutions:

vemel commented 1 year ago

Yes, the problem was that pygments creates a very complex HTML to render. I am going to move code syntax highlighting to client side with highlight.js. New docs should be released this weekend.

vemel commented 1 year ago

@eli-kir I moved syntax highlight to the client side using highlight.js. The page should be way more responsive now. Please check and let me know if it works for you as it should.

eli-kir commented 1 year ago

It's beautiful! Super fast now, thanks for this fix!