ajayyy / DeArrow

Crowdsourcing better titles and thumbnails on YouTube
https://dearrow.ajay.app
GNU General Public License v3.0
1.24k stars 33 forks source link

Move bulk of title formatting logic to separate library #242

Open netux opened 3 months ago

netux commented 3 months ago

To test this pull request, follow the instructions in the wiki.


Second half of #241.

[^1]: I'm not 100% sure how cross-gitmodule changes should work. In theory, if the maze-utils submodule is pinned to a specific commit then this should be fine, right?

ajayyy commented 3 months ago

At the moment maze utils is not imported as a module, but a folder, so I'm not sure it would work to delete the cld-3 dependency. I think it won't compile

ajayyy commented 3 months ago

Your understanding of submodules is correct

netux commented 3 months ago

At the moment maze utils is not imported as a module, but a folder, so I'm not sure it would work to delete the cld-3 dependency. I think it won't compile

Hmm, it was working on my machine. I guess I'll add that dependency back then.

netux commented 3 months ago

Hmm, it was working on my machine. I guess I'll add that dependency back then.

I'm now looking for a way to make the dependency optional. I was thinking putting it in peer dependencies of maze-utils and wrapping the import in a try...catch so SponsorBlock could compile without it, but...

  1. Webpack complains about the import when cld3-asm is not installed, even when LOAD_CLD = false
  2. Even if that's somehow solved, there is yet another import of cld3-asm, but only for one of its types. I doubt there is any way to conditionally exclude type imports in Webpack

So I'll now look into moving all of the title formatting stuff into its own library. @ajayyy could you create a repo for this? It makes more sense if its under your name and control.

ajayyy commented 3 months ago

Created a repo: https://github.com/ajayyy/DeArrowFormatting

netux commented 2 months ago

Hello. Any hopes of this getting looked at anytime soon? 😄