-
Notifications
You must be signed in to change notification settings - Fork 267
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
Avoiding the ridiculous loading time of the repository's GitHub page #90
Comments
Forgot to mention that the benefits of this method should mainly be:
And the 2nd reason is important because it can potentially deter a large number of new users, who might get impatient and think the repo isn't going to load and go elsewhere instead. |
Totally agree, i will think this afternoon a way to implement what you said. Thanks @tomleb3 |
I was trying this, but for example in instagram and other websites, there is the Content Security Policy. So loading a cdn or doing a request to a url outside instagram or the allowed list would fail. |
Yeah I wish that was possible, that would have been ideal. The main difference is that when rendering it in a GH readme file it's very sluggish and heavy. I'll make an example in my forked repo in the coming days and show you what I mean :) |
Nono I understand you now haha, I will make it in the afternoon. I hope the people still understand how to do it. I will try to be precise with the new readme instructions |
I think they'll manage if we explain it well enough. Also, we have a few options here. For example, we can render just the script, or we could maybe just have a "copy" button in the page with the script inside of it. If we decide to go for the second option, see Github's built-in themes for such sites. On second thought I think it might even be nicer than just rendering the script. |
@davidarroyo1234 Ok so I played around with this. Achieves the desired result IMO. Everything is fast again, and with this format I don't think we need to worry about the script's length. |
If we agree on this, then I'll make a related PR at the main repo, and then you'll just need to enable deployment from the repo's settings. |
Looks good, maybe i would put some type of toolbar to easily copy the script |
Alright, let me know if you need any help with this. |
Also the lag only seems to happen on chrome based browsers like chrome or edge. Firefox is unaffected |
Interesting, haven't actually tested on Firefox. |
Hey @davidarroyo1234
I want to add some features but I can't risk making the code any larger.
You've seen how long it takes it to load the GH page.
With a good internet connection and PC it's bearable, but anything less and it becomes quite annoying.
Obviously this is due to the ~51k characters of code in the main Readme.md file.
So we've talked in the past about the solution of a bookmarklet / browser extension / etc...
They all have their pros and cons.
I thought about something simpler.
We can add an HTML template to the code, which contains the script, and render it like a CDN.
For example, here is the CDN link for jQuery - https://code.jquery.com/jquery-3.7.0.min.js
So basically an HTML page containing just the script and should therefor be rather snappy to load.
We can add a link to it in the main Readme and explain how to use it.
Basically the users would need to open the link, click the text 3 times which will automatically select all of it, and then copy and paste, same as before.
The site could be hosted on GH pages, which is free and would be part of this repo.
Let me know what you think :)
The text was updated successfully, but these errors were encountered: