[05:36:07] hi tech nerds, question cuz its 12:30am and im going loco, anyone see an issue on https://meta.miraheze.org/wiki/User:PixDeVl/common.js#L-54 ? [05:37:05] im getting a parser error for an unexpected . on line 55, and `Warning: Functions declared within loops referencing an outer scoped variable may lead to confusing semantics. ($)` on 54 [06:24:24] I think MW doesn't recognize optional chaining `variable?.` syntax? [06:25:30] The warning is just a lint warning and shouldn't stop the JS from being parsed by MW, I think [09:45:11] [1/2] How do i make this horizontal? [09:45:12] [2/2] https://cdn.discordapp.com/attachments/1006789349498699827/1437015155257901076/SPOILER_xczxzcxvxvc.PNG?ex=6911b427&is=691062a7&hm=a3bae94b729167df2e6a3372a316a83e613cd612c905f5e9def89cbeea386a8a& [10:11:40] yeah looks like `?.` is an ES2020 feature [11:29:20] afaik mediawiki doesn't parse user JS so that shouldn't really matter [11:29:49] (at least it doesn't minify it) [14:31:57] i always rewrite `?.` with a long string of `&&`‘s [14:32:58] Yeah. This code works when i paste the part inside the anon function into console, so i dont think it’s breaking anything [14:33:16] I do need to figure out why I won’t work to load from common.js tho [14:48:59] and await/async with long chain too [14:49:15] which doesn't work either in mediawiki's js [14:54:34] [1/3] `const wikidiscover = ((data || {}).query || {}).wikidiscover` is a verbose alternative to optional chaining. [14:54:34] [2/3] I forgot if deconstruction works on MW. It's difficult to understand, so not exactly recommended. [14:54:35] [3/3] `const { query: { wikidiscover } = {} } = data || {};` [14:58:42] deconstruction is es6 so probably fine [15:00:09] the unexpected `.` might be because `wikis?.[dbname]` is not valid syntax afaik, you need to remove the extra dot [15:00:45] or convert it to property access syntax instead of array access [15:01:00] although nvm only array access makes sense here [15:01:20] [1/2] i always use such long thing:ThinkingHardMH: [15:01:21] [2/2] https://cdn.discordapp.com/attachments/1006789349498699827/1437094717442490490/image.png?ex=6911fe40&is=6910acc0&hm=51619ee85d20635c2d88a2cbde6c68ff4f2052891279196a73c25d7f98db4b9c& [15:02:10] It's considered valid syntax by MDN: [15:02:35] oh, that's stupid [15:03:24] I’ll be fully honest the original snippet for this script was LLM generated and this is a holdover from that so I’m not precisely sure how that works [15:06:11] [1/5] you could try [15:06:12] [2/5] ```js [15:06:12] [3/5] const wikiInfo = data && data.query && data.query.wikidiscover && data.query.wikidiscover.wikis && data.query.wikidiscover.wikis[dbname]; [15:06:12] [4/5] ``` [15:06:13] [5/5] instead, which is es2016 compatible [15:06:36] or whatever es MW uses [15:12:32] I’ll see later [15:13:01] Though I don’t think that’s the issue, unless the fact the code that works in console is going through the mw bits is causing the error [15:21:19] [1/5] the script loads for me on beta without parse errors after I changed the two lines to [15:21:20] [2/5] ```js [15:21:20] [3/5] const wikiInfo = data && data.query && data.query.wikidiscover && data.query.wikidiscover.wikis && data.query.wikidiscover.wikis[dbname]; [15:21:20] [4/5] const count = data && data.query && data.query.wikidiscover && data.query.wikidiscover.count; [15:21:21] [5/5] ``` [15:22:33] [1/2] I'll help the first 10 people interested on how to  start earning $100k or more within a week, but you will reimburse me 10% of your profits when you receive it. Note: only interested people should send a friend request or send me a dm! ask me (HOW) via Telegram username @Edward_Pryce1 [15:22:33] [2/2] Or use the telegram link in my bio [15:23:10] <_arawynn> @Discord Moderators [17:18:19] turn it into a gallery? [20:53:12] [1/2] I've gone through the list of our deployed extensions and added all of them that weren't available in codesearch yet to nonwmf-extensions: [20:53:12] [2/2] This will hopefully make it easier for us to fix compatibility issues (e.g. removed methods or classes) ahead of time [21:21:13] We should probably add that to the add an extension page tbh [21:43:05] good point, done