[WIP] Faster & Better OldTwitter#1055
Conversation
- Console log can slow down updating of timelines when scrolling home page - MediaTweets: For added parity (i.e. For my own userscript that listens to webrequests and captures data there)
- Media elements are done
- fix elNew on prop element shenanigans - More work on templated tweetConstructor - Updated twemoji to support unicode 16.x
- TinyDomBuilder now supports class lists. - Remove old template string Quoted functions. - Started converting constructTweet functions - Added missing `lang` to tweetviewer.js
- Moved more code to js safe templates - Move dombuilder code to tdeb.js
Thanks for the interest! I'll have to look into the colors issue and see whether is feasible. It appears to be but I don't want to get people's hopes up too high. Just an edit / update: I've finished the full conversion to templating for the html. I haven't pushed the code for it just yet but it should land real soon. |
I just checked. seems like my PR doesn't contain those commits at all. I'll pull in those changes and uncomment those. |
|
If you want to return this option you'll have to rename its key to something different so that its reset for everyone and to make it off by default (and make it say that it can make oldtwitter like 5 times slower on some devices) |
Alrighty, sounds good to me. |
- On request from dimden. Default value for link colours is disabled.
Reading into a bit of time & date formatting, it seems that it can get a bit slow when calling toLocaleString. If the browser is old enough, Intl is not available. As such, we fallback to using toLocaleString.
|
Opening it up for contributions now. I don't want to expand scope too much beyond the main slowdown oldtwitter. It's plenty fast now when zooming timelines (except I think the popup tweet viewer, that seems to be seperate) There's other things that could be further optimized:
Some final timings (without CPU slowdowns, identical profile scroll): Before: After: |
|
Testing through your own OldTwitter build and yeah, everything's working so far, no issues. I can tell the sheer reduced loading speed, nice. |
I think these got caught up in my experiment. It "works" but I don't exactly like how it's handled
Did some digging. This warrants further look into tbh. Seems like when extending Doing a bit more digging, I came across this article. I'll try to implement the fix later when I'm not busy procrastinating away work 🤣 |
|
@Ristellise Seems that for tweets with more than one uploaded video, it won't do anything if you click on them, play and so. Happens only on (your own) OT build. |
Thanks for bug report. Other than this, @dimdenGD, what else is needed for this to be merged into main? |
|
Fixed. Seems like a simple mistake of copying and pasting bookmarks classList. Thanks for noticing it! |
|
Liking main tweets seems to be broken on separate tweet pages (for example https://x.com/notexttospeech/status/1937604725601673467) |
|
Also code should be formatted back to 4 spaces |
|
Reformatted to 4 spaces & fixed the missing element. Thanks for the catch. |
|
Well and last one thing is to fix what's failing the locales test |
|
I'm not sure what causes this, but some posts randomly get marked as if I bookmarked them, even though I didn't |
Super weird, did it happen previously? |
|
Reminder to self to create PR fix. This returns an error, even though the tweet seems to be valid. |
|
Might gonna revert this PR. For some reason gifs dont properly load on my phone until I click on them, making it really annoying. It's really weird because it works fine on PC. Also there's missing "Not interested in this post" and no fast Delete button on Bookmarks page |
I'll have a look when I've the spare time. |
Weird. It's not even showing up on the devtools emulation. What phone and browser version? (Browser version is probably more important.)
Spotted and fixed both of these issues. PR #1076 is here. |
|
Last Kiwi Browser version on Android. It only happens with tweet viewer tweets (need to click on tweet and see its comments). Also I noticed that tweets with multiple videos dont have controls attribute. Also "Separate text" button in context menu should only appear on phone. It shows up on computer too ever since the update. |
Fixed. Was done in css since ideally we should not be modifying the dom on screen sizes.
Got tweets i can use to reproduce for both of these? |




This PR is pretty Big (& Experimental!)
As such, I'm opening it early as a draft PR for everyone to see what I've been up to.
In general, this PR's idea is to remove the massive and hard to maintain html string block in favour of building the structure using JavaScript directly. (named "templating" in the below section)
I'm currently not allowing edits by maintainers. Once it's done I'll open up contributions.
This has 2 benefits:
Additionally, I've rolled in a couple new changes:
Potential concerns:
What's done / not done:
What's after this?
Various Odds & Ends & Notes: