update webpack to conform to webpack 5 Discord update

pull/86/head
dperolio 3 years ago
parent dec625efaa
commit b4b349b6c7

@ -2,7 +2,7 @@
"globals": {
"vizality": true,
"$vz": true,
"webpackJsonp": true,
"webpackChunkdiscord_app": true,
"DiscordNative": false,
"GLOBAL_ENV": true
},

@ -52,7 +52,7 @@ export default async builtin => {
if (!key) {
const SelectedChannelId = getModule('getChannelId', 'getVoiceChannelId')?.getChannelId();
const ChannelStore = getModule('getChannel')?.getChannel(SelectedChannelId);
if (ariaLabel === Messages.CHANNEL_MUTE_LABEL.format({ channelName: ChannelStore?.name })) {
if (ariaLabel === Messages.CHANNEL_MUTE_LABEL?.format?.({ channelName: ChannelStore?.name })) {
if (res.props.children.props['aria-checked'] === true) {
key = 'channel-unmute';
} else {

@ -18,6 +18,8 @@
}
&-header {
line-height: 1.4;
font-size: 24px;
font-weight: 700;
&-description {
font-family: var(--font-primary);
font-weight: 500;

@ -623,7 +623,6 @@ export default class AddonManager extends Events {
throw new Error(`There was a problem while attempting to install "${addonId}"!`, err);
}
console.log('hello?');
try {
renameSync(join(this.dir, `__installing__${addonId}`), join(this.dir, addonId));
} catch (err) {

@ -17,7 +17,6 @@ const { openContextMenu, closeContextMenu } = contextMenu;
export default memo(({ source, type, addonId }) => {
const [ markdown, setMarkdown ] = useState();
const { base } = getModule('base');
const { size32, size24, size20, size16, size14, size12 } = getModule('size32');
const { anchor, anchorUnderlineOnHover } = getModule('anchorUnderlineOnHover');
const { imageWrapper } = getModule('imageWrapper');
@ -59,7 +58,7 @@ export default memo(({ source, type, addonId }) => {
const Header = `h${level}`;
return (
<Header id={slug} className={joinClassNames('vz-markdown-header', `vz-markdown-header-h${level}`, sizes[level], base)}>
<Header id={slug} className={joinClassNames('vz-markdown-header', `vz-markdown-header-h${level}`, sizes[level])}>
<Anchor className='vz-markdown-anchor' href={`#${slug}`}>
<Icon
name='Link'

@ -161,7 +161,7 @@ const StickyBar = memo(({ query, type, tab, resetSearchOptions, handleTabChange,
disabled
route={`/vizality/${toPlural(type)}/discover`}
>
{Messages.DISCOVER}
Discover
</__TabBar.NavItem>
<__TabBar.NavItem
route={`/vizality/${toPlural(type)}/browse`}

@ -11,7 +11,6 @@ export default memo(({ icon, header, description, separator = true, className, c
const { marginBottom20 } = getModule('marginBottom20');
const { content } = getModule('wrappedLayout');
const { h1 } = getModule('h1', 'h2', 'h3');
const { base } = getModule('base');
return (
<div
className={joinClassNames('vz-dashboard-content', className)}
@ -33,7 +32,7 @@ export default memo(({ icon, header, description, separator = true, className, c
size='100%'
/>
)}
<h1 className={joinClassNames('vz-dashboard-content-header', base, content)}>
<h1 className={joinClassNames('vz-dashboard-content-header', content)}>
{header}
</h1>
</div>

@ -12,14 +12,13 @@ export default memo(({ className, wrapperClassName, children }) => {
const { pageWrapper } = getModule('pageWrapper');
const { perksModal } = getModule('perksModal');
const { content } = getModule('wrappedLayout');
const { base } = getModule('base');
return (
<div className={joinClassNames('vz-dashboard', wrapperClassName, pageWrapper, perksModal)}>
<AdvancedScrollerAuto className={`${scroller} vz-dashboard-scroller`}>
<div className={joinClassNames('vz-dashboard-layout', className)}>
<ErrorBoundary
className='vz-dashboard-error-boundary'
headerClassName={joinClassNames('vz-dashboard-content-header', base, content)}
headerClassName={joinClassNames('vz-dashboard-content-header', content)}
showScene={true}
>
{children}

@ -15,7 +15,6 @@ export const Header = memo(({ icon, header, description, separator, collapsible
const { content } = getModule('wrappedLayout');
const { h1 } = getModule('h1', 'h2', 'h3');
const { size24 } = getModule('size24');
const { base } = getModule('base');
return (
<div className={joinClassNames('vz-dashboard-section-header-wrapper', { [marginBottom40]: !collapsible })}>
<div className='vz-dashboard-content-header-inner-wrapper'>
@ -27,7 +26,7 @@ export const Header = memo(({ icon, header, description, separator, collapsible
size='100%'
/>
)}
<h2 className={joinClassNames('vz-dashboard-section-header', size24, base, content)}>
<h2 className={joinClassNames('vz-dashboard-section-header', size24, content)}>
{header}
</h2>
</div>

@ -23,11 +23,11 @@ const _error = (...message) => error({ labels: [ _module, _submodule ], message
* @private
*/
const _getModules = (filter, all = false) => {
if (!this.instance?.cache) {
if (!this.instance?.c) {
return;
}
const moduleInstances = Object.values(this.instance.cache).filter(m => m.exports);
const moduleInstances = Object.values(this.instance.c).filter(m => m.exports);
if (all) {
const exports = moduleInstances.filter(m => filter(m.exports)).map(m => m.exports);
@ -82,24 +82,18 @@ export const initialize = async () => {
/**
* Wait until webpack is ready.
*/
while (!window.webpackJsonp || window.webpackJsonp?.flat(10)?.length < 8000) {
while (!window.webpackChunkdiscord_app) {
await sleep(100);
}
const instance = window.webpackJsonp.push([
[],
{
_vizality: (_, e, r) => {
e.cache = r.c;
e.require = r;
}
},
[ [ '_vizality' ] ]
let instance;
window.webpackChunkdiscord_app.push([
[ '_vizality' ],
{}, exports => instance = exports
]);
delete instance?.cache?._vizality;
this.instance = instance;
/**
* Load modules pre-fetched.
*/
for (const mdl in moduleFilters) {
this[mdl] = await _getModule(moduleFilters[mdl], true);
}

@ -43,7 +43,7 @@ exposeGlobal('__SENTRY__');
exposeGlobal('GLOBAL_ENV');
exposeGlobal('platform');
exposeGlobal('_');
exposeGlobal('webpackJsonp');
exposeGlobal('webpackChunkdiscord_app');
exposeGlobal('WebSocket', true);
fixDocument();

Loading…
Cancel
Save