1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-16 01:56:55 +00:00

More webpack 4 code. Make sure to asynchronously await the availability of our webpack hook everywhere that we use it that it's reasonable to wait.

This adds a new module called switchboard that abuses the root React Router instance to forcibly load a chunk, letting us grab `require()` quickly rather than waiting potentially forever for another chunk to be loaded due to user action, etc.
This commit is contained in:
SirStendec 2018-05-18 17:48:10 -04:00
parent 194f93414d
commit 86c5fee033
13 changed files with 128 additions and 24 deletions

View file

@ -25,7 +25,6 @@ export default class ChatLine extends Module {
this.inject('site');
this.inject('site.fine');
this.inject('site.web_munch');
this.inject('site.apollo');
this.inject(RichContent);
this.inject('viewer_cards');
@ -45,7 +44,7 @@ export default class ChatLine extends Module {
);
}
onEnable() {
async onEnable() {
this.chat.context.on('changed:chat.emoji.style', this.updateLines, this);
this.chat.context.on('changed:chat.bits.stack', this.updateLines, this);
this.chat.context.on('changed:chat.badges.style', this.updateLines, this);
@ -57,7 +56,7 @@ export default class ChatLine extends Module {
this.chat.context.on('changed:chat.actions.inline', this.updateLines, this);
const t = this,
React = this.web_munch.getModule('react');
React = await this.web_munch.findModule('react');
if ( ! React )
return;