#๐Ÿ‘พ-core-development

1 messages ยท Page 141 of 1

charred monolithBOT
high oracle
#

based ven

jagged cloak
#

ohhhh yikes

austere talon
#

i think an even worse offense || /s || is that in his blog he messed up the css so it's a horrible mobile experience and the footer is randomly floating in the middle of the article

#

i wanted to give him a chance so i read his blog and responses to the transphobia but his blog made it even worse fear like defending nazis is an insane hill to die on

high oracle
#

I think this alone is enough

#

fuck that dude

#

why does discord even have a feature to restrict users from changing their own nicknames

#

stupid fucking website

#

useful? maybe

austere talon
#

i mean i kinda get it if they make their name like super racist or impersonate others but at the same time u could just ban them xd

high oracle
#

yes.

austere talon
#

and especially now that automod can quarantine people until they change their name

#

like try changing your username here to f slur

#

you will be quarantined (unable to interact with the server) until you change it back

junior olive
high oracle
#

I geniunely feel sorry for people who have programming passion to do cool stuff like compositors just for them to turn out edgy 16 year olds

jagged cloak
#

yea

charred monolithBOT
analog knoll
#

What are you guys working on?

high oracle
#

CUDA to OpenCL translator

#

you're welcome

analog knoll
#

You also rewrote my mom in kotlin it seems ๐Ÿ˜„ and anything in vencord rn?

high oracle
#

as for vencord I'm trying to make ScreenCaptureKit work with electron

analog knoll
#

that sounds cool ^-^ mind sharing your branch, i am curious

high oracle
#

haven't pushed yet as I haven't even gotten a working build

#

it's a pain in the ass

analog knoll
#

Oh I see, well, good luck with that

high oracle
#

thanks

jagged cloak
#

u should datamine discord source

#

theres an experiment for it iirc

#

xdd

lime stone
jagged cloak
#

change nickname is a role permission

#

and not really discord can do whatever changes they want technically

#

its tied into automod

high oracle
high oracle
lime stone
jagged cloak
#

that says above everyone lol

high oracle
#

uh yes I know

#

I said above

austere talon
#

wait i need to responsor nookies and co O.O

lime stone
#

yeah, so every role is above everyone

#

๐Ÿ˜ญ wdym

high oracle
#

whatever

austere talon
jagged cloak
#

rip

lime stone
#

every permission of everyone applies to everyone

jagged cloak
#

rresponsor NOW

austere talon
#

actually @limber skiff did u figure out why you're not getting your money

lime stone
#

you can't remove them without taking them away from everyone

jagged cloak
#

toad why do you think muted roles work

austere talon
#

maybe i should wait with responsoring until we're sure it goes to you xd

limber skiff
#

nope

austere talon
#

did u contact shithub support

#

they're scamming u so hard

limber skiff
#

I didnt lol

#

so true

austere talon
#

do

lime stone
jagged cloak
#

are htye still not g iving u money

limber skiff
#

I have to wait 1 month before it tries to pay again

#

maybe they cant send the money

#

but they should email you with the issue or something

analog knoll
#

Ignorant question: Vesktop and Vencord, what's the difference

#

I see that Vesktop is using Vencord libs I guess, why split it then

lime stone
#

vencord modifies discord, vesktop is an electron application made from scratch

#

they're not really comparable, they're entirely different things :P

analog knoll
#

Both of them are electron applications that use discord web and both modify it

high oracle
analog knoll
#

ohhh makes sense

high oracle
#

Vesktop is a separate electron client that displays discord

#

Unlike Vencord, Vesktop's modifications won't suddenly disappear after a client update

analog knoll
#

"ArmCord already supports Vencord but makes it pretty limited for us" I understand now, cool. So Vencord is injecting into Vesktop on launch

high oracle
#

at this point it's more like vesktop is injecting discord into vencord

lime stone
#

do you mean vencord into discord

analog knoll
lime stone
#

indeed

misty raptor
#

me when the

austere talon
#

:o

turbid hatch
#

i saw the email but i didnt poke cuz i thought u just didnt wanna sponsor

#

:P

austere talon
#

ohhh

#

nah it cancelled everything xd

turbid hatch
#

ripp

austere talon
#

it even locked my github account lmaoo

#

it said my account was disabled cause i didn't pay my subscriptions

#

it showed a massive red banner everywhere but i could still use github xd

#

but yeah i just forgot to put money on my card xd

turbid hatch
#

wtff

#

weird

austere talon
#

ill responsor soon :3

turbid hatch
#

dwww at ur own pace :3

#

but

#

@limber skiff

#

YOU

limber skiff
#

HI

turbid hatch
#

YOU HAVE BEEN CONSCRIPTED

#

INTO THE USERCSS SQUAD

austere talon
#

but yeah im gonna wait with sponsoring nookies again cause legit none of the money is paid out to him

turbid hatch
#

ill take it and forward it if needed

austere talon
#

github unsane

turbid hatch
#

not sarcasm i will genuinely do it

limber skiff
turbid hatch
#

OKAY

#

THANK YOU

#

ITS LITERALLY JUST MAKING THE COLORPICKER WORK 100% OF THE TIME AND THEN ITS FIXED

limber skiff
#

I WILL MAKE UR FUNCTION TO REQUIRE THE USER SETTINGS CHUNKS

turbid hatch
#

YES THANK YOU

#

MUCH LOVE

austere talon
#

wait what

#

isn't it already loaded when you open settings

#

why doesn't it work?

turbid hatch
#

user settings -> profiles loads it

#

if you just go to user settings it doesnt

#

and since you can go user settings -> themes -> theme settings, it wont load at all and it errors

#

so i'm conscripting nookies to fix it

#

cause im too brainfogged to work it out rn

austere talon
#

ohhhh

turbid hatch
#

go to user settings

#

then go to themes

#

then edit a theme's setting

#

:P

#

you dont need to load the colorpicker to get there

limber skiff
#

how does client theme works then

turbid hatch
#

i did tell you it didnt work

#

when i tried it

limber skiff
#

wait

#

lewi you are tripping

#

as soon as you load user settings the color picker loads

#

what's your find

turbid hatch
#

the same as clienttheme

#

i copy pasted it xd

limber skiff
#

it should work then

turbid hatch
#

on latest canary opening user settings didnt do it

limber skiff
#

I just tested with ClientTheme and it worked

turbid hatch
#

try it with mine then

limber skiff
#

let me make function first

limber skiff
#

ok it's gonna take a bit cuz I'm changing more stuff I noticed is wrong

#

COPILOT IS SO POGGERS

misty raptor
#

copilot really is based

austere talon
#

makeIndirectFind

limber skiff
#

it's for this

#

we forgot to do it for the component related finds

lime stone
#

can you just get copilot to write the whole codebase

charred monolithBOT
#

I've been having the problem shown in the video above, basically regardless of which client I use for discord.

The theory I have is that the video isn't being properly compressed. When someone screenshares from Windows and there's a lot of movement then the video quickly tends to become heavily compressed. Looking like 144p or even worse in darker footage. Meanwhile; even though the framerate sucks, the frames themselves seem to be of much higher quality regardless of movement on L...

#

I've been having the problem shown in the video above, basically regardless of which client I use for discord.

The theory I have is that the video isn't being properly compressed. When someone screenshares from Windows and there's a lot of movement then the video quickly tends to become heavily compressed. Looking like 144p or even worse in darker footage. Meanwhile; even though the framerate sucks, the frames themselves seem to be of much higher quality regardless of movement ...

limber skiff
#

I dont like this

austere talon
#

yeah it looks bad

#

weird name

limber skiff
#

yeah but the way it works is bad too

#

I dont know how else to do it

limber skiff
#

naming things is so hard ๐Ÿ˜”

austere talon
#

why do we need a util for it

limber skiff
#

decor will use it

#

and also so we test in the reporter

analog knoll
#

I am enjoying reading the code so much just for the correct use of typescript ^-^

still wasp
#

can anyone send me the link for the plugin dev docs? (if there are any)

still wasp
#

thanks!

#

jesus this is confusing

#

my brain boutta explode

austere talon
#

those docs are kinda outdated

#

there are other ones floating around somewhere

analog knoll
#

openNewUpdateWindow

const win = new BrowserWindow({
        width: 500,
        autoHideMenuBar: true,
        alwaysOnTop: true,
        webPreferences: {
            preload: join(__dirname, "updaterPreload.js"),
            nodeIntegration: false,
            contextIsolation: true,
            sandbox: true
        },
        icon: ICON_PATH
    });

    makeLinksOpenExternally(win);

Could I ask about the updaterPreload.js, where can I find it? It does not seem to be in the Vesktop project when I search for it

charred monolithBOT
still wasp
austere talon
still wasp
#

any idea how i could find them?

#

fuck it ill just read other plugins until i pick up on it lmao

lime stone
still wasp
#

oh sick

#

thanks

austere talon
#

but yeah reading other plugins helps a lot

lime stone
#

I got their name right first try

#

I wish I could remember the hash

limber skiff
#

I want your opnion on it ven

misty raptor
#

someone is getting this weird error where โ€œmapMangledModuleLazyโ€ seems to not be found in the webpack

#

but it works when i compile it

#

js not them

#

and idk what could be the cause of that

limber skiff
#

mapMangledModuleLazy is gone

#

you dont need it anymore

misty raptor
#

well what exists now

limber skiff
#

ok so basically mapMangledModuleLazy was for when exports names were random, so you could match a module and map their exports to a human readable property name

#

exports names are no longer random, so you can just match the module you want and access the export by the normal name

misty raptor
#

so like via findByCode?

limber skiff
#

nono

misty raptor
#

here is what i do rn

#
const createMessageRecord = mapMangledModuleLazy("createMessageRecord:", {fn: filters.byCode("MessageTypes.THREAD_CREATED")})```
#

how do i translate this into non-mapMangledModule speak

limber skiff
#

const { createMessageRecord } = findByPropsLazy("createMessageRecord", "updateMessageRecord")

misty raptor
#

interesting...

#

thank you

limber skiff
#

literally just finding this by props and destructuring/accessing createMessageRecord

#

g is the function you used to match

misty raptor
#

yeah i knew all that i just forget how to use the find by props thing

#

because i know nothing about js

#

or ts

#

or webpack or discord

limber skiff
#

before the update this was prob something like
Y: function() {
return g
}

misty raptor
#

would the destructuring work if the lazy thing is async?

limber skiff
#

that's why you used mapMangled

misty raptor
#

or like whats the { } for

#

idk javascrip

limber skiff
misty raptor
#

woah

#

magical

limber skiff
#

yeah

misty raptor
#

Error: webpack.findByProps found no module

#

i believe this is what we call an epic fail

still wasp
#

how do i make a color variable in plugin settings?

misty raptor
#

fixed

#

by not destructuring

#

sadly it is just not meant to be (it unwraps as soon as possivle instead of doing some wacky more lazy thing)

limber skiff
#

are you up to date?

misty raptor
#

i am up to date on vencord

limber skiff
#

it should work tho

misty raptor
#

well it makes sense

#

the module probably isnt loading until after the thing is called

limber skiff
#

where are you calling it?

misty raptor
#

and the { } negates the lazy aspect

misty raptor
limber skiff
#

lazy stuff was updated

#

it works with destructuring now

misty raptor
#

well

#

didnt work for me so idk

#

bug perhaps

limber skiff
misty raptor
#

if i was able to send images

#

i could show u

#

git says up to date

limber skiff
#

let me test it

misty raptor
#

oh wait

#

wait wait waitwati

#

running a test

#

yeah no still doesnt work

#

wait

#

nvm

#

ok so i "pulled" and it said up to date

#

but i forgor to sync the fork

#

so this is my bad

limber skiff
#

yeah it does work

#

just tested

misty raptor
#

yes i realized the error in my ways

#

now we r all smooth sailing

#

back to waiting

limber skiff
#

and @junior olive

austere talon
#

notice some things from quick skim

#

ill give proper review sooon

#

gonna shower now

olive aurora
#

stinky vee

misty raptor
#

proper review on keyworded notifiere

junior olive
limber skiff
austere talon
#

probably not xd

limber skiff
junior olive
#

Can you use it in like practice

limber skiff
#

the thing that wreq.el uses

junior olive
#

The module id

#

Tbh does that need to be specified? All the requires I've seen are standard

#

I have a regex in my version

limber skiff
#

a single module can have more than one

#

so you need the regex to match the one you need exactly

junior olive
#

hmm

#

so yours matches a whole module

#

mine takes a single func that requires

limber skiff
#

yes but yours cant match the one correctly when it has more than one

junior olive
#

If the function passed has more than one yeah

#

ok

#

hm

#

I think I understand how yours works

limber skiff
#

also

#

it cant match if there isnt any function exported that loads the stuff

#

mine can cuz it matches the whole module

junior olive
#

yeah but mine wasn't really built for that level of utility

limber skiff
#

your function wouldnt work for any of this

junior olive
#

I know

limber skiff
#

for both reasons

junior olive
#

it wasn't built to that level of utility

limber skiff
#

yeah

#

I'm just explaining why it is the way it is

junior olive
#

I'll mess around with it later I can't really give any notes on the code right now

#

Does it return a promise when called that resolves when the modules are loaded?

limber skiff
#

yes

charred monolithBOT
frail skyBOT
#
Bad Patches

NoTrack (found no module):
ID: -
Match: window.DiscordSentry=

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

#
Bad Patches

NoTrack (found no module):
ID: -
Match: window.DiscordSentry=

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

charred monolithBOT
austere talon
#

we need to fix AhoReacted scrolling issues or maybe remove it

#

people keep complaining

olive aurora
#

AhoreActed is a selfbot

austere talon
#

NO

lime stone
#

no

#

do not ๐Ÿ˜ญ

lime stone
olive aurora
#

replugged is malware

limber skiff
olive aurora
#

by removing it

limber skiff
#

nop

half shell
charred monolithBOT
austere talon
#

i would undo the entire webpack change

#

@limber skiff

#

if anything you'd have to do smth like this

function makeIndirectFind<F extends (...args: any[]) => FilterFn>(name: string, filterFactory: F) {
    return function indirectFind(...args: Parameters<F>) {
        const res = find(filterFactory(...args), { isIndirect: true });
        if (!res)
            handleModuleNotFound(name, ...args);

        return res;
    };
}

const findByProps2 = makeIndirectFind("findByProps", filters.byProps);
const findByCode2 = makeIndirectFind("findByCode", filters.byCode);
#

but you're still ruining types and stacktraces

limber skiff
#

well it was just to not copy so much code on every find

charred monolithBOT
austere talon
austere talon
# austere talon

this has 0 useful information and why i even moved to the way it is now

limber skiff
#

what way?

austere talon
#

that every find calls handleModuleNotFound

charred monolithBOT
limber skiff
#

oh I see what you mean

#

ahhhh

austere talon
limber skiff
#

LOL

#

hey it's a pull request!!!

austere talon
#

just undo it all

limber skiff
#

that suggestion might be better though

#

it avoids us writing the same code over and over

austere talon
limber skiff
#

and with the amount of finds we have it's quite a lot

#

hmmm

#

aight

limber skiff
austere talon
#

idgi

misty raptor
#

me when

austere talon
#

that name is misleading anyway

#

it should be named findModuleFactory

#

or smth like that

#

its not finding the module itself

limber skiff
#

either way it should be returning the module factory

#

not this

austere talon
#

why can it not return our wrapper

limber skiff
#

cuz I wanna match code on it

austere talon
#

we patch .toString() on it

limber skiff
#

oh wtf

#

it wasnt working for another reason then

#

and when I fixed it I added returning the original at the same time

#

๐Ÿ˜”

austere talon
#

String(func) wont work

#

but func.toString() will

limber skiff
#

nah i'm doing toString

austere talon
#

actually even String() works

limber skiff
#

search should use the patched one then right

austere talon
limber skiff
#

String calls toString

austere talon
#

it's purely for devtools

limber skiff
#

alright

austere talon
#

like this

#

the reason it gives you originals is so you can right click > show func definition

limber skiff
#

I see

#

ngl you have many good points

#

so much knowledge ๐Ÿ˜ญ

austere talon
#

i mean i wrote all this code :pp

limber skiff
#

true lol

#

thank you copilot

#

look at it go

austere talon
#

why are u rewriting it manually ๐Ÿ˜ญ

#

just undo your commit and copy paste ur needed changes

limber skiff
#

meh it's fine

#

I rewrote the descriptions too

#

it would take longer

#

@austere talon do you want me to undo this

austere talon
#

its fine

#

its kinda whatever youre right that string is simpler

limber skiff
#

k let me run tsc so I dont mess up shit

austere talon
#

i think i did the casting to number cause in discords code its numbers

#

but there is no point casting

#

so youre not wrong

limber skiff
#

yeah

#

it's annoying to keep casting

#

aight I did your changes

#

oh wait

#

I see why it doesnt work

#

byCode uses Function.prototype.toString

#

that's why it returns our factory

limber skiff
#

@junior olive

const loadChunks = Vencord.Webpack.extractAndLoadChunksLazy(['name:"UserSettings"'], /\i\.el\("(.+?)"\).{0,50}name:"UserSettings"/); // The first group here is the entry point id

loadChunks(); // Returns a promise of the result of requiring the entry point module, or undefined if something failed
junior olive
#

good

limber skiff
#

the return

junior olive
#

now to wait for this to be merged then add it to decor and then go back to waiting for a review and merge for decor huskfluent

#

It seems fine

#

Nookies do you think you could review decor at some point please blobcatcozy

limber skiff
#

yeah

#

it's just that I have been busy doing the latest things for vencord

junior olive
#

Yeah no I understand

limber skiff
#

I also really wanna experiment with someone manipulating the webpack initialize script discord loads

#

so I can modify it

junior olive
#

no immediate rush but i would like to get it into vencord before december

#

so if you could keep reviewing it on your radar i'd greatly appreciate that

limber skiff
#

but it's different because you cant patch it like webpack modules

#

since it's literally the script that setups webpack ๐Ÿ˜‚

junior olive
#

u can prolly get it via js monkeypatching shit right?

limber skiff
#

yeah I think so

junior olive
#

yeah gl

limber skiff
#

I need to prevent the script element that loads it from running

#

manually fetch the script

#

modify what I need and run the modified

limber skiff
#

@austere talon what do you think of this way of making webpack initialize script not run

Object.defineProperty(Function.prototype, "c", {
    set(v: any) {
        if (new Error().stack?.includes("discord.com")) {
            throw new Error("nop");
        }

        Object.defineProperty(this, "c", {
            value: v,
            configurable: true,
        });
    },
    configurable: true
});
#

NGL THIS IS SO COOL

charred monolithBOT
austere talon
#

wtf are u doing lmao

#

wait we can use that for async loading

#

to make self updating ext

limber skiff
#

which actually worked

limber skiff
austere talon
austere talon
limber skiff
#

let me send you screenshot

austere talon
#

which would allow us to make a self updating extension

tame escarp
#

question: do web stores let you have self-updating extensions

limber skiff
#

and it's so easy

tame escarp
austere talon
#

the purpose is specifically to avoid having to rely on webstores

tame escarp
#

evil

austere talon
limber skiff
#

yeah

tame escarp
#

@austere talon let the monopoly take over you. you must use the extension stores

limber skiff
#

I error the original, fetch it, modify and run

#

erroring is so good it even gives me the asset url lmao

#

the fetch is pretty much instant cuz it's disk cached

limber skiff
#

or like keep it and load async on it

charred monolithBOT
charred monolithBOT
charred monolithBOT
surreal fiber
charred monolithBOT
tame prawn
#

Where i can check vencord docs?

charred monolithBOT
charred monolithBOT
misty raptor
#

the keywords notify now has ignore bot ๐Ÿ’ช๐Ÿ’ช

charred monolithBOT
warped turret
limber skiff
#

check if their id matches UserStore.getCurrentUser().id

charred monolithBOT
formal sable
#

yo, the Vencloud readme says
PROXY_HEADER should be used if you're running it behind a reverse proxy or another service (i.e., Cloudflare).
What value does it needs to be set to? Any particular header i gotta setup in my nginx config?

charred monolithBOT
charred monolithBOT
#

I'll add my experience as well.
I've tried streaming using Vesktop on both my desktop PC (Nvidia GTX 1060) and my laptop (AMD Vega 8), and they run equally slow at "about 5 fps" according to my friends.

However, I've tried other solutions before, like Discord-Screenaudio, and they seem to suffer from the same issue, as opposed to the regular Discord client.
As others have mentioned, even though the framerate is low, the picture quality remains perfect, it never shows compression or artif...

charred monolithBOT
dawn coyote
#

yes but it's very broken if I wasn't in that guild and did not have a nickname and per guild avatar and it made the client make my profile to clyde

charred monolithBOT
#

This PR basically just allows for the repo to be used in portainer.

.env is read by docker-compose (and podman-compose) by default so there is no need to hard require the .env file. When the .env file is hard required it's impossible to run this repository as a stack from portainer.

Notes:

  • 8080 is used in healthchecks so I've set it up internally that 8080 is used due to them
  • There is no need to update the documentation on the README file as the end user will not feel a...
charred monolithBOT
#

I think it's cleaner for Portainer setups to have it as

env_file:
  - stack.env

instead of duplicating a bunch of variables.
Then one should add those environment variables inside Portainer under the compose editor (it uses stack.env as file name)
The easiest way for that is to enable the advanced editor and just paste the content of .env.example

olive aurora
#

wtf is a portaijer

#

docker users need to be stopped

charred monolithBOT
jagged cloak
#

docker users when i undock their containers

charred monolithBOT
#

Yeah yeah we could add stack.env into the docker-compose.yml file and make it the default one. Then the documentation should be updated, but I'm also not really up for doing that. It would break the current deployment as stack.env wouldn't be present.

This way with duplicating the variables in compose file:

  • The variables have their own context in the file so you don't have to look at other files
  • A bit more universal as it's not putting any hard requirements

I would *per...

misty raptor
#

keyword

#

woah

#

@wary void why did u delete that message

charred monolithBOT
warped turret
#

How can I visually change status of a user?

I found out that function O(e) in 913365 is exactly what's responsible for displaying an avatar with a status, so that if I patch it to be "dnd", everyone appears with this status.

However, the problem is that function O(e)'s argument has only parsed data, so I don't have a user object, not even an id.

I've surfed through tons of modules and spend hours of debugging and at most found that

935409 -- avatar in popup (also in 337328 ?)
759210 -- avatar in full modal
87657 -- avatar in friend list (also in 146378 ?)
570687 -- avatar in DM list
61918 -- avatar in members list (also in 888503 ?)
540853 -- avatar in DM title

I'm sure there is a global entry point that leads to that O function, but also has a user reference.
Unfortunately, printing stack trace didn't help.

misty raptor
#

theres probably some event that carries the information relating to status

#

so u coudl prob just intercept that

#

change it

#

for an individual user

#

idk what ur exactly trying to do though

nimble plaza
#

for context for everyone:

wraith vessel
#

I can probably port my autocorrect to #๐Ÿ—’-textreplace-rules but I don't know if its fast enough to search 11k lines (~5500 terms) should I do it?

#

I did it.

#

where is the configuration file for the plugin stored?

limber skiff
#
const { isMobileOnline } = findStoreLazy("PresenceStore");

// the patch:
{
  find: ".Messages.ACCOUNT_SPEAKING_WHILE_MUTED",
  replacement: {
    match: /renderAvatarWithPopout\(\){.+?className:\i\.avatar(?=,?)/,
    replace: "$&,isMobile:$self.isMobileOnline()"
  }
}

// inside your plugin object:
isMobileOnline() {
  return isMobileOnline(UserStore.getCurrentUser().id);
}
wraith vessel
#

cool

frail skyBOT
#
Bad Patches

NoTrack (found no module):
ID: -
Match: window.DiscordSentry=

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

#
Bad Patches

NoTrack (found no module):
ID: -
Match: window.DiscordSentry=

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

limber skiff
#

reporter is so speedy now

junior olive
charred monolithBOT
limber skiff
#

lets test

frail skyBOT
#
Bad Patches

NoTrack (found no module):
ID: -
Match: window.DiscordSentry=

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

#
Bad Patches

NoTrack (found no module):
ID: -
Match: window.DiscordSentry=

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

limber skiff
#

wtf it worked

#

we didnt get rate limited

#

@austere talon requesting all chunks at the same time with Promise.all didnt get us rate limited

#

literally

limber skiff
junior olive
#

make it even faster ๐Ÿ™„ @limber skiff

limber skiff
#

bro cant

#

most time wasnt even cuz of the report

#

@junior olive did you see how I patched webpack initializer

junior olive
#

I didn't how do u do it

limber skiff
junior olive
#

wack ๐Ÿ˜ญ

#

cool tho

limber skiff
#

I error it ๐Ÿ˜‚

#

it's the only way

#

I searched a lot you cant stop a script for executing

junior olive
#

that is so hacky

#

but if it works

#

now merge chunk extractor so i can use it ๐Ÿ”ฅ

limber skiff
#

it works very well mao

wraith vessel
junior olive
#

welcome to vencord merge/review system

limber skiff
junior olive
#

gah

wraith vessel
wraith vessel
limber skiff
#

mainly the api

#

just gonna do one thing real quick

charred monolithBOT
olive aurora
limber skiff
#

lmao

#

it is

#

I havent changed it yet

olive aurora
#

on my phone ur delimiters are literally invisible

limber skiff
#

true

charred monolithBOT
limber skiff
#

@junior olive does the module you get the entry point have more than 1 .el call?

#

I added a default matcher that will capture the first found

wraith vessel
# limber skiff in datastore

I must be stupid sorry. I can't find any items with that name; is it a file or a folder and what would the path be?

junior olive
#

I can't check rn

grave mangoBOT
limber skiff
#

do you know what the data store is

#

indexed db

misty raptor
#

notifyi

mystic bay
#

idk if this is the right place to suggest things, but would be pretty cool if we could have an option for streamer mode to auto enable on vesktop when u stream your screen to a voice channel
bc on a wayland linux system, u can only share your screen with ur whole display, so would be cool to utilize the built in streamer mode to prevent desktop notifications while sharing screen without having to manually enable it

limber skiff
#

๐Ÿ˜‚ I dont disagree

#

I suffer from it too

livid heath
# limber skiff .

naming it ChunkLoader would be more appropriate
also not a big fan of that datar uri svg match

limber skiff
#

oh

#

that's uncomitted code

#

It's my testing stuff

livid heath
#

we need ast based patching in vencord UmaruSmug

livid heath
limber skiff
#

naming what ChunkLoader though?

livid heath
#

WebpackInitializer

#

since it is actually the chunk loader

limber skiff
#

hmmm

#

I mean loading chunks is a part of, but what I'm patching is the stuff that defines the webpack require function and stuff

livid heath
#

yop thats part of the chunk loader

#

it has the __webpack_require__ function and it patches the webpackChunkdiscord_app array's push method to trigger loading of dependant chunks and also other things

limber skiff
#

actually it patches .push to mainly run callbacks and push to __webpack_require__.m

#

chunk loading stuff is done using other methods in __webpack_require__

#

.m push and callbacks

dense fossilBOT
limber skiff
#

lmao

jagged cloak
#

waaw

limber skiff
jagged cloak
#

lol why is it in here

limber skiff
#

or WebpackBootstrapper

#

did I write that right

jagged cloak
#

sounds right

limber skiff
#

aight

austere talon
#

AST parsing is so verbose and unreadable

jagged cloak
#

i would double never use that

#

and i only tipped the iceberg on regex patching

limber skiff
limber skiff
#

lol

limber skiff
#

I know my theme suck ๐Ÿ˜ข

jagged cloak
#

lool

#

fix theme when

limber skiff
#

rn

jagged cloak
#

u even disagree w yourself ๐Ÿ˜ญ

limber skiff
#

yeah lmao I have issues seeing brackets too

#

it was mainly cuz I made my terminal match vsc theme

junior olive
#

hop on monokai pro

limber skiff
#

ngl

#

rose pines sucks on vscode even without background

#

why did they make colors so hard to distinguish

limber skiff
austere talon
#

so ugly wtf

junior olive
#

now hop on monokai pro machine

austere talon
#

i don't like it

limber skiff
#

that's what I used to use

junior olive
limber skiff
junior olive
#

ew

austere talon
#

i found monokai pro pretty m

#

but that looks kinda bad

junior olive
#

nop its fakekai pro

limber skiff
austere talon
#

anyway gruvbox material is very similar to monokai pro but not proprietary / paid

limber skiff
#

I didnt even knew monokai was paid

austere talon
#

monokai pro is

limber skiff
#

how is a color scheme paid

#

wtf?

austere talon
#

i use monokai pro dark + transparent with miku background

#

so perfect

junior olive
#

ven merge timezonedb when??

junior olive
#

i use machine ithink

oak hull
limber skiff
austere talon
#

yop

#

that's very similar to my theme

junior olive
#

i lied

#

spectrum is waht i use

austere talon
#

there's an extension that automates it and fixes checksum

limber skiff
#

omg really

oak hull
#

one dark pro darker / city lights

livid heath
junior olive
#

i feel like transparency would make editing worse for me

junior olive
limber skiff
#

I did this manually

limber skiff
#

.push does not load chunks

#

and by load I mean make their script that pushes to webpack modules load and execute

austere talon
limber skiff
#

the code that loads chunks is .el and .e

junior olive
#

no flat image crap ๐Ÿ™

austere talon
charred monolithBOT
livid heath
#

[[], {}, init] this is what .push is given
the first element of that array contains ids of chunks which the current chunk depends on
second has module id => func mappings
third is an optionall function to be ran immediately after leading this chunk

austere talon
junior olive
#

why dont they just add built in bg support i dont get it

livid heath
limber skiff
#

MY EYES

livid heath
junior olive
austere talon
livid heath
austere talon
#

yeah we don't

livid heath
limber skiff
#

however the .push method only marks a chunk as loaded

#

which happens here

#

the actual chunk loading happens on other functions

austere talon
#

that's not what's being discussed

limber skiff
#

actually, it marks chunks as loaded and resolves their promise

austere talon
#

and your description for the first argument doesn't seem accurate anyway

limber skiff
#

yeah

livid heath
#

WHAT maybe i need to rework my notes

limber skiff
#

it has to do with chunks, but it's not exactly that

#

I dont know what it is exactly

#

but I know what happens with it

swift fjord
#

catppuccin mocha

#

everything

limber skiff
#

I spent like the last 3 days debugging webpack and understand it's shit

livid heath
#

catppucchin latte pleadey

austere talon
limber skiff
#

but not gonna lie I still have no fucking clue what .O does

austere talon
#

it doesn't work if you make the first argument empty and if you push two chunks with the same id in first arg it skips the second one

charred monolithBOT
#

While the keybinds do work if the program is focused, the program doesn't seem to check for them when it isn't focused. This should be possible to implement since the program uses X11 like the official client, however I'm unsure what it would take to implement it. It would be a nice QOL feature though, since currently this means I can't use a keybind to mute when the program is unfocused, which is the main purpose of having keybinds.

livid heath
austere talon
#

so it's likely something like current chunk id, but at the same time then it doesn't make sense why it's an array

in any case, i never looked into it much because i don't have any reason to

limber skiff
limber skiff
#

what the fuck does this do

#

it's impossible to understand

livid heath
#

i was under the pretence that ids present in that array are loaded before initializing the current chunk but it might not be the case according to nookies

austere talon
#

just read webpack source code o.o

livid heath
#

i'm reading the new chunk loader (i hate rspack)

limber skiff
austere talon
#

no

limber skiff
#

all the other webpack stuff I have seen dont have this .O thing

livid heath
#

we need a new 2023-post-rspack client sourcemap leak

livid heath
limber skiff
limber skiff
limber skiff
#

that would actually make sense

livid heath
#

guhh aint reading rspack
id rather read 500 lines of minfied chunk loader rather than rust code that creates these chunk loders

limber skiff
#

yeah I have no idea how to search for what .O is

#

either way

livid heath
#

ven
which one of these does pisscord use

limber skiff
#

wreq.el loads chunk based on their entry point module, as according to this map @livid heath

livid heath
#

i see

limber skiff
#

.el internally calls wreq.e which loads a single chunk

livid heath
#

i'll just go on another chunk-loader-reading-session for 10 hours bleh

limber skiff
#

and each chunk has their asset url mapped here

limber skiff
#

I've spent a lot of time lately understanding how it works

livid heath
#

that is very kind of you, but i'm not really good at explaining myself and i'll probably give you a headache asking things

limber skiff
#

lol

#

I've recently explained to a friend how vencord does regex patching as a whole

charred monolithBOT
#

I've tried discord-screenaudio, vesktop, and pipewire-screenaudio all with the same results. Depending on the situation some clients can be better than others, but there's some apps that are so bad that in order to stream them I had to connect to my computer through moonlight and stream that on a windows or mac system. It seems to be the more multi core cpu usage the worse the stream, and i also cant seem to find any solid indication that discord streaming is actually using my video encoder.

livid heath
#

okay i think i found where .O is supposed to be in rspack

limber skiff
#

:O

#

where

grave mangoBOT
# austere talon https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108...

**RuntimeGlobals.js: **Lines 265-273

/**
 * register deferred code, which will run when certain
 * chunks are loaded.
 * Signature: (chunkIds: Id[], fn: () => any, priority: int >= 0 = 0) => any
 * Returned value will be returned directly when all chunks are already loaded
 * When (priority & 1) it will wait for all other handlers with lower priority to
 * be executed before itself is executed
 */
exports.onChunksLoaded = "__webpack_require__.O";
limber skiff
#

lmao ven found it

livid heath
#

i did at the same time, except in rspack

limber skiff
#

it means it waits for all the chunk scripts to load

#

before executing discord entry point

#

when you open discord the html comes with a lot of script tags directly into it

livid heath
#

yeah i know that much

limber skiff
#

one is the webpack initializer and the some of the rest if not all are webpack chunks

livid heath
#

mhm css class mapping chunks, normal js chunk

swift fjord
#

deferring just means running after something

#

like when you add the defer attribute to a script tag it'll get ran after everything is loaded

grave mangoBOT
# austere talon https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108...

**ImportScriptsChunkLoadingRuntimeModule.js: **Lines 112-130

`var installChunk = ${runtimeTemplate.basicFunction("data", [
    runtimeTemplate.destructureArray(
        ["chunkIds", "moreModules", "runtime"],
        "data"
    ),
    "for(var moduleId in moreModules) {",
    Template.indent([
        `if(${RuntimeGlobals.hasOwnProperty}(moreModules, moduleId)) {`,
        Template.indent(
            `${RuntimeGlobals.moduleFactories}[moduleId] = moreModules[moduleId];`
        ),
        "}"
    ]),
    "}",
    `if(runtime) runtime(${RuntimeGlobals.require});`,
    "while(chunkIds.length)",
    Template.indent("installedChunks[chunkIds.pop()] = 1;"),
    "parentChunkLoadingFunction(data);"
])};`
austere talon
#

anyway the first argument to push just seems to be array of chunkIds this chunk contains like i expected

#

not sure why it's an array

#

webpackChunk.push([["banana", "apple"], {}])

#

this marks banana and apple chunks as initialised

limber skiff
#

yeah it does exactly that

limber skiff
#

that's literally the .push patch ๐Ÿ˜ญ

austere talon
#

wdym ๐Ÿ˜ญ

#

i just searched webpack source code

limber skiff
#

how did you search for it

#

what did you search for

swift fjord
#

oh does it wait until all the chunks in the list are loaded before running the lambda

austere talon
austere talon
#

the webpack repo is so hard to navigate so u HAVE TO search xd

limber skiff
#

yeah lmao

#

I hate code that is split in so many places

livid heath
#

monorepos crying

junior olive
#

When are we making the unified webpack + metro utils

limber skiff
#

monorepos are so stupid

austere talon
# limber skiff ohh

i first searched .push = cause i figured not much code will ever overwrite push other than webpack

#

and that's how i found out that the global name is chunkLoadingGlobal

#

so i took it from there

austere talon
#

everything documented

limber skiff
#

el is rspack stuff

#

normal webpack doesnt have it

austere talon
#

yeah

#

i just noticed that

limber skiff
#

ngl .el is so pog

#

before all chunk loading was inline

austere talon
#

btw you probably don't even need to keep track of what chunks you already loaded

austere talon
#

cause .e is ensureChunk

limber skiff
#

yeah e only loads if it isnt loaded

#

ohhh

#

this is why .push calls

#

to execute the callback when all chunks needed are loaded

#

does anyone know what is harmony

austere talon
#

just es6 modules

livid heath
#
__webpack_require__.hmd = function(module) {
    module = Object.create(module);
    if (!module.children) module.children = [];
    Object.defineProperty(module, 'exports', {
        enumerable: true,
        set: function() {
            throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
        }
    });
    return module;
}
austere talon
#

export and import

limber skiff
#

oh

austere talon
#

as opposed to commonjs (module.exports, require)

#

don't worry about it

limber skiff
#

I dont want to even try to understand it

austere talon
#

i mean it's really simple

#
// es6 module / harmony
export let banana = "๐ŸŒ";
import { readFile } from "fs";

// commonjs
module.exports.banana = "๐ŸŒ";
exports.banana = "๐ŸŒ"; // equivalent
const { readFile } = require("fs")
limber skiff
#

this is crazy, everything is documented

austere talon
#

there's also other module loaders like amd but those are kinda irrelevant now

livid heath
#

idk why it's an array but i do have a chunk which has multiple ids

oak hull
austere talon
#

commonjs sucks ass

oak hull
austere talon
#

es modules are highly superior

livid heath
#

YES

oak hull
#

could be because 99% of the js code i wrote used commonjs

austere talon
#

from before es6 was finished

limber skiff
#

welp those were documetations were nice to see

#

most stuff I knew but now I know what the .O function does

#

I really thought discord webpack had their own stuff

karmic turtle
#

New to front end and Iโ€™m wondering if thereโ€™s a tutorial or guide on how to theme or style Discord with CSS? And also, is there a way to get a BetterDiscord plugin working with Vencord? I really want to use Devilbroโ€™s ViewServersAsChannels plugin with Vencord

limber skiff
#

but guess it's all normal stuff/rspack

livid heath
#

i refuse to believe discord would put in enough efforts to build a custom webpack solution

limber skiff
#

no other site I looked at used that chunk stuff

austere talon
#

what chunk stuff

limber skiff
#

the whole chunk loading system

austere talon
#

btw i haven't yet figured out what's the difference between webpackJsonP and webpackChunk_*

limber skiff
#

I look at the webpack and of other sites and they all had their modules loaded at once

austere talon
#

i always just thought wpJsonP was older and wpChunk was new but the webpack repo has code for both

#

๐Ÿค”

livid heath
#

jsonp is old yes

grave mangoBOT
livid heath
#

the distinction between both is vauge
but afaik with jsonp you had a callback webpackJsonp(...) whereas with chunk you have .push

austere talon
#

does webpackJsonP have to do with https://en.wikipedia.org/wiki/JSONP

JSONP, or JSON-P (JSON with Padding), is a historical JavaScript technique for requesting data by loading a <script> element, which is an element intended to load ordinary JavaScript. It was proposed by Bob Ippolito in 2005. JSONP enables sharing of data bypassing same-origin policy, which disallows running JavaScript code to read media DOM elem...

#

so webpackJsonP would use script tags for loading chunks whereas webpackChunk uses fetch

junior olive
#

Is chunkloader in dev yet#

limber skiff
#

webpackChunk still uses script tags

#

basically discord creates a script tag with the chunk url and deletes it as soon as it loads and executes

livid heath
#

yop

limber skiff
austere talon
#

insane

#

why don't they use fetch

#

oh ig it makes sense in terms of csp

#

if you use fetch you have to eval which means u gotta make csp pretty unstrict by allowing eval

#

if you use script tags you can use a nonce and have strict csp

limber skiff
junior olive
#

sad

#

how long

austere talon
austere talon
#

listen, it's a great album

junior olive
#

why tho

limber skiff
#

@austere talon is this regex too overengineered

let a = /\.el\("(.+?)"\)(?<=(\i)\.el.+?)\.then\(\2\.bind\(\2,"\1"\)\)/`
junior olive
#

what the hell ๐Ÿ˜ญ

limber skiff
#

I wanted to make sure it wouldnt match wrong stuff, since it's the default matcher

limber skiff
austere talon
limber skiff
#

๐Ÿ’€

junior olive
#

i was gonna share my regex

#

its so simple but its too simple

#

pre-rs it was good tho

limber skiff
livid heath
#

so okay
initializer is loaded -> creates script tag, sets promise for chunk in an object -> chunk gets loaded, chunk resolves the promise for ids in in the array
is that how it is ๐Ÿค”

limber skiff
#

to not match a random .el call which isnt the require one

#

๐Ÿ™‚

livid heath
#

valid

junior olive
#

isn't that the only time el will be used..

limber skiff
#

it's made super specific to make sure it is the require one

livid heath
#

so better safe than sorry

limber skiff
#

but at the same time the regex is efficient

junior olive
#

ok well

#

get this mf in dev ๐Ÿ™

livid heath
#

i mean you could include this section in your match to be comcrete

#

wait thats not el\

limber skiff
#

lots of chunks are loaded and they are all pushed to webpackChunkdiscord_app, when webpack initializer is run, it patches .push to resolve chunk loading promises but also executes the function that resolves the promises for already present chunks in webpackChunkdiscord_app

#

.push also sets modules to .m but that's whatever to mention rn (the same function that resolves promises sets .m)

#

and then when all required chunks loaded webpack initializer calls the entry point

livid heath
#

lots of chunks are loaded and they are all pushed to webpackChunkdiscord_app
understood that (multiple script tags are made leading to multiple chunks being loaded
when webpack initializer is run, it patches .push to resolve chunk loading promises but also executes the function that resolves the promises for already present chunks
pretty much what i said

limber skiff
#

yeah

limber skiff
junior olive
#

thanks

charred monolithBOT
junior olive
#

THANK YOU

#

i will go use it

#

then decor is really ready for review (i am willing to bribe mfs for this!)

limber skiff
#

let me go ahead and run reporter to make sure I didnt explode something

verbal pumice
#

narrator: he did, in fact, explode something

limber skiff
#

๐Ÿ˜ญ dont say that

junior olive
#

sad

#

ill array it

limber skiff
#

yes it sadly needs to be array

livid heath
#

this is what i understood

frail skyBOT
#
Bad Patches

NoTrack (found no module):
ID: -
Match: window.DiscordSentry=

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

limber skiff
#

because there is the regex after it

limber skiff
frail skyBOT
#
Bad Patches

NoTrack (found no module):
ID: -
Match: window.DiscordSentry=

Bad Webpack Finds

None

Bad Starts

None

Discord Errors

None

limber skiff
#

and the .O call at the end calla the callbacks waiting for some chunks to be resolved

austere talon
livid heath
austere talon
#
function thing(...codes: string[] | [...string[], RegExp]) {
    const regex = codes.at(-1) instanceof RegExp ? codes.pop() : DEFAULT;
}```
limber skiff
#

oh

#

ehhh

#

it's fine as array lol

junior olive
#

this actually comes in handy for me

livid heath
limber skiff
#

wdym typescript it's literally an array?

junior olive
limber skiff
#

not bad ngl

junior olive
#

should i wait to push if you're changing it's usage

limber skiff
#

nah I'm not gonna change it

junior olive
#

okay

limber skiff
#

I will keep as is cuz it's better for jsdocs

junior olive
#

so few utils now

livid heath
limber skiff
livid heath
#

and advancedmessages was called over engineered

junior olive
#
/*
 * Vencord, a Discord client mod
 * Copyright (c) 2023 Vendicated and contributors
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

import { extractAndLoadChunksLazy } from "@webpack";

export const requireAvatarDecorationModal = extractAndLoadChunksLazy(["openAvatarDecorationModal:"]);

export const requireCreateStickerModal = extractAndLoadChunksLazy(["isDisplayingIndividualStickers:", ".CREATE_STICKER_MODAL"]);
limber skiff
#

nice

#

you didnt even have to specify a matcher

junior olive
#

most of the plugin is ui

limber skiff
#

also try finding a single code that can match the right function instead of 2

junior olive
#

yeah that seems fucking hellish

limber skiff
#

but if you can't it's fine

junior olive
#

module 77162

livid heath
#

WHAT i find it better to have multiple sample points to find something rather than just one

junior olive
#

i found one

#

"stickerPadding"

#

kinda

#

...

limber skiff
#

decor is pretty well made ngl

#

at least ui wise

junior olive
#

thank you that was the goal of it

limber skiff
#

I havent looked much at code

junior olive
#

seamless experience

limber skiff
#

yeah

junior olive
#

hope we can get it reviewed and merged before december ๐Ÿ™‚

junior olive
livid heath
#

you know what else is made well ui wise -
i'll not continue

junior olive
limber skiff
#

that works too

livid heath
#

blobcatcozy had to spend hours on the mention logic to make the UI and api experience seamless