1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-05 10:38:30 +00:00

4.0.0-rc12.14

* Fixed: Twitch changed the internal structure of their dynamically loaded component system, preventing FrankerFaceZ from being able to force a new chunk to load to grab the internals of webpack.
This commit is contained in:
SirStendec 2018-08-27 17:22:06 -04:00
parent 0090e43316
commit d4deb36f08
2 changed files with 38 additions and 15 deletions

View file

@ -100,7 +100,7 @@ class FrankerFaceZ extends Module {
FrankerFaceZ.Logger = Logger; FrankerFaceZ.Logger = Logger;
const VER = FrankerFaceZ.version_info = { const VER = FrankerFaceZ.version_info = {
major: 4, minor: 0, revision: 0, extra: '-rc12.13', major: 4, minor: 0, revision: 0, extra: '-rc12.14',
commit: __git_commit__, commit: __git_commit__,
build: __webpack_hash__, build: __webpack_hash__,
toString: () => toString: () =>

View file

@ -65,8 +65,30 @@ export default class Switchboard extends Module {
this.log.info('Found Non-Matching Route', route.props.path); this.log.info('Found Non-Matching Route', route.props.path);
const component_class = route.props.component;
let component; let component;
if ( component_class.Preload ) {
try {
component = component_class.Preload();
} catch(err) {
this.log.error('Error instantiating preloader for forced chunk loading.', err);
component = null;
}
if ( ! component || ! component.props || ! component.props.loader )
continue;
try {
component.props.loader().then(() => {
this.log.info('Successfully forced a chunk to load using route', route.props.path)
});
} catch(err) {
this.log.warn('Unexpected result trying to use component pre-loader to force loading of another chunk.');
}
} else {
try { try {
component = new route.props.component; component = new route.props.component;
} catch(err) { } catch(err) {
@ -84,6 +106,7 @@ export default class Switchboard extends Module {
} catch(err) { } catch(err) {
this.log.warn('Unexpected result trying to use component loader to force loading of another chunk.'); this.log.warn('Unexpected result trying to use component loader to force loading of another chunk.');
} }
}
break; break;
} }