1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-05 02:28:31 +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,24 +65,47 @@ 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;
try { if ( component_class.Preload ) {
component = new route.props.component; try {
} catch(err) { component = component_class.Preload();
this.log.error('Error instantiating component for forced chunk loading.', err); } catch(err) {
component = null; this.log.error('Error instantiating preloader for forced chunk loading.', err);
} component = null;
}
if ( ! component || ! component.props || ! component.props.children || ! component.props.children.props || ! component.props.children.props.loader ) if ( ! component || ! component.props || ! component.props.loader )
continue; continue;
try { try {
component.props.children.props.loader().then(() => { component.props.loader().then(() => {
this.log.info('Successfully forced a chunk to load using route', route.props.path) this.log.info('Successfully forced a chunk to load using route', route.props.path)
}); });
} 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 pre-loader to force loading of another chunk.');
}
} else {
try {
component = new route.props.component;
} catch(err) {
this.log.error('Error instantiating component for forced chunk loading.', err);
component = null;
}
if ( ! component || ! component.props || ! component.props.children || ! component.props.children.props || ! component.props.children.props.loader )
continue;
try {
component.props.children.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 loader to force loading of another chunk.');
}
} }
break; break;