[19:09:39] DannyS712: following on from that cool Vue-on-wiki demo to did, how does one suck in some other Vue file if you had components defined in it? Or do they need to be recast and inlined into the main JS file somehow? [19:12:01] you mean components defined in a different onwiki file? [19:18:31] yes, i know it wouldn't be able to pull down from npm or anything like that [19:19:21] and ideally I'd like to have to avoid defining RL modules since that makes it extremely awkward to use debug versions [19:24:50] hmm, let me think about that, I'm not possitive [19:27:38] oh, use Vue.component (with Vue retrieved from require() as shown in https://meta.wikimedia.org/wiki/User:DannyS712/VueDemo.js) and then I think it is defined for all other code that wants to use it. I'm not sure about that, my experience with Vue components is only SFC [22:41:20] DannyS712: but then how to refer to it from `components` in the main app (i.e. VueDemo)? [22:43:26] just use in the template if you registered that component (I think, I'll test soon) [22:45:40] looks like it's racing between the run functions [22:46:30] oh, yeah, you need to ensure components are defined first... [22:47:55] i wish mw.loader.load returned a promise like using [22:49:34] okay, component demo https://meta.wikimedia.org/wiki/User:DannyS712/VueDemo.js works. If you have multiple files, you'll need to ensure they are run first - eg have mw.myVueComponentSetup be a function that the component file defines and the source file calls [22:50:10] > component file defines and the source file calls [22:50:21] aha: i was totally over thinking that [22:50:30] component file defines and the main app file calls [22:51:03] other than RL, is there a canonical way to make sure that doesn't race? [22:53:11] doing it inside `$( document ).ready()` seems to work, but it feels sus [22:54:12] i.e. `$( document ).ready()` calls `window.VueDemo.run`, which calls `mw.myVueComponent.run( require );` [22:55:07] setTimeout to wait a bit? [22:55:07] Infinite loop `while ( ( mw.myThingIsDone || false ) !== true ) { }` [22:55:49] brutal, but fair enough [22:55:59] just wondered if there was a hack with mw.hook that was known to be The Way [22:56:03] (or whatever) [22:56:23] mw.hook would probably be better, not sure if there is a standard though [22:57:47] OK, I;ll give it a think [22:58:50] my personal "standard" for config hooks is somewhat similar: common.js does `mw.hook( 'scriptname.config' ).add( function ( cfgObject ) { ...mutate it here; } )` [22:59:22] the script itself does `mw.hook( 'scriptname.config' ).fire( configObjectInstance );` [22:59:47] which seems to work though probably only as long as you have one "adder" [23:00:23] or you don't mutate the same part of the object, or you don't care