User talk:JSherman (WMF)/revertrisk.js

More comments
Hi @JSherman (WMF), and thanks for making this!

Since this is the foremost example of a working Vue user script, would it be possible for you to add more comments to things to explain what they are/do? I'm thinking especially of things like  and. I'm also curious about how we can load Codex icons in user scripts – maybe you know? I've tried with mw.loader.using, but that doesn't seem to work. Jon Harald Søby (talk) 11:56, 20 November 2023 (UTC)


 * "Since this is the foremost example of a working Vue user script, would it be possible for you to add more comments to things to explain what they are/do? I'm thinking especially of things like and"
 * I'll take a pass at adding more comments!
 * "I'm also curious about how we can load Codex icons in user scripts"
 * I don't think that's possible at the moment. Unfortunately, icons aren't available directly through the resource loader for performance reasons. To access them, you have to define a dynamic packageFile (see Using Codex icons in MediaWiki). Gadgets can use packageFiles, but the dynamic files require server side code to generate the response (which would contain the icon data in this case). FWIW, there is a task for this feature, though nobody has sorted out how to implement it yet (see T311099). JSherman (WMF) (talk) 21:08, 20 November 2023 (UTC)
 * Some comments added with links to more info. JSherman (WMF) (talk) 21:31, 20 November 2023 (UTC)
 * Another thought on codex icons: we may be able to just copy the icon data directly into the script. I'll try it out and add an icon to the script if it works. JSherman (WMF) (talk) 15:55, 21 November 2023 (UTC)
 * I verified that the icon svg can be copied into a js variable. It's hacky, but it works for now. I've updated the script to use that technique to add an icon. JSherman (WMF) (talk) 20:11, 21 November 2023 (UTC)
 * Oh that's weird. There isn't an SVG file somewhere that can be linked, the SVG data itself has to be copy pasted? – Novem Linguae (talk) 20:53, 21 November 2023 (UTC)
 * "Oh that's weird. There isn't an SVG file somewhere that can be linked[...?]"
 * that is my understanding for codex-icons today; there is a discussion going on about how to make it better though.
 * "the SVG data itself has to be copy pasted?"
 * that's one way to do it for now; I also showed another way using the non-mediawiki version of codex-icons pulled in from an external host in T311099, but I don't think that's a good solution. JSherman (WMF) (talk) 15:18, 22 November 2023 (UTC)