Wikipedia talk:WikiProject JavaScript: Difference between revisions

Content deleted Content added
Line 56:
Any opinions on this? [[User:SkSlick|SkSlick]] ([[User talk:SkSlick|talk]]) 01:08, 13 December 2020 (UTC)
:True. [[WP:RedWarn]] ran into this issue (cc {{u|Ed6767}}). Would be nice if you could specify some build options to be applied to a JS/TS file after you hit "Save", so we could at least use Babel. Or maybe the devs could give us a few checkboxes with various transpilers (Babel, TS compiler) for each user script. Shouldn't be that tough to add. [[User:Enterprisey|Enterprisey]] ([[User talk:Enterprisey|talk!]]) 17:01, 13 December 2020 (UTC)
::{{small|(not Ed, but)}} Hard agree with the sentiments here. As a developer more skilled with modern web technologies, trying to piece together code for Wikipedia has been a hassle. Old MediaWiki JavaScript has been quite the problem for RedWarn, especially now when we're rewriting RedWarn from the ground up using TypeScript. MediaWiki's codebase not having type definitions is another pain in the rear, since every time we want to use a function or property within MediaWiki's <code>mw</code>, we've had to place whatever we need in a [https://gitlab.com/redwarn/redwarn-web/-/raw/dev-rwTS/src/mediawiki.d.ts declaration file] that has been expanding even more and more as progress goes on. I've tried to automatically grab the types based on the provided JSDoc inside of the source, but to no avail, as it it extremely complicated to do so. Since a rewrite of MediaWiki's JavaScript parts is ''(unfortunately)'' out of the question (unless WMF wants to spend some funds to make that happen), we've had to deal with this old and clunky method. My best advice would be to have the [https://doc.wikimedia.org/mediawiki-core/master/js/ MW JS documentation] at hand whenever making scripts, and just rely on your best senses to see which goes with which. Sure, it's a strong timesink, but once you're used to the extremely old and aging JavaScript codebase, it shouldn't really be a problem. Babel/TS transpilers don't sound that bad, but that might raise some security or performance issues. I guess the only way to find out if that's the case would be to actually bring that suggestion to the Phab. But if there's anything that Wikipedia has taught me about its developers, it's that there's a lot of people who are overly attached to old processes and tech, and that introducing changes as big as these (especially when it uses newer technologies) is commonly met with a lot of criticism. <span style="background:#ffff00;color:#00159c;">'''''[[User:Chlod|Chlod]]'''''</span>&nbsp;<small style="font-size:calc(1em - 2pt)">([[User talk:Chlod|say&nbsp;hi!]])</small> 17:31, 13 December 2020 (UTC)