perf(synced-lyrics): virtual scrolling #3162
No reviewers
Labels
No labels
awaiting-reply
breaking changes
bug
cannot-reproduce
dependencies
documentation
duplicate
electron-issue
enhancement
fix-available
good first issue
help wanted
invalid
javascript
need more information
need rebase
official-youtube-music-issue
plugin request
question
release
security
stale
Status: blocked
typo
wontfix
ytmd-issue
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: YTMD/youtube-music#3162
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "chore/synced-lyrics-virtual-scroll"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
An attempt to improve the performance of the synced-lyrics renderer.
TODO:
virtua
for the virtual scrollingcurrent
|previous
|upcoming
to the parent componentThis should massively improve the performance of the lyrics renderer, and prevent the huge lags that take place after switching songs.
Please use -E option like
pnpm i -E virtua
@ -9,3 +9,3 @@
"esModuleInterop": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"moduleResolution": "bundler",
If
moduleResolution
is set tobundler
, certain dependencies cannot be imported. e.g.youtubei.js
.@ -9,3 +9,3 @@
"esModuleInterop": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"moduleResolution": "bundler",
can you ellaborate on that?I see the issueany other
moduleResolution
introduces issueswell, technically we are using a bundler, so this is more correct
but I'll have to try to resolve that issue as well
@ -9,3 +9,3 @@
"esModuleInterop": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"moduleResolution": "bundler",
looks like it wasn't a big deal
I am actually stuck about the lyrics picker no longer auto-hiding.
I opened a discussion on the
virtua
repository to discuss how this should be properly done.Otherwise, I'll have to resort to weird trickery using absolute positioning, which would look ass.
by having a discriminated union, I can have the lyrics picker be an item in the virtual scroller, so I can make it have
position: sticky
!so the only thing holding me back, is that the lyrics picker gets unmounted when you scroll away (because this is a virtual list)
waiting on https://github.com/inokawa/virtua/pull/681
Alright, I think by the end of today I'll mark this PR ready for review!
@JellyBrick could you put a warning in the release notes, that this will likely break any custom CSS applied to the synced-lyrics?
Squashed the commits because they were too many.
@JellyBrick I decided to include a better romanization method in this PR
No need to worry about tiny-pinyin anymore, I not only fixed the
w e i r d s p a c i n g
it has for English, but I massively improved the quality of the romanized lyrics by usingtinyld
and then as fallback I use the old detection methods, and I noticed a huge improvement in japanese/chinese songs
the reason I included these changes in this PR, is because it would be "laggy" to do it w/o virtual scrolling
virtual scrolling allows us to lazily romanize the lyrics
--
before:

after:

--
before:

after:
