Draft
Conversation
54ee7b4 to
acd8f18
Compare
The primary motivation for this is loading libdiscoreWasmFetch along with web, as well as cleaning up Webpack patching code in general. We have to support *multiple requires* existing, so the main require in web gets marked with a special field. There's also multiple modules, some with conflicting IDs(!!!), so I'm not sure how that behaves. I do not know if patching modules in the other scripts works. I haven't tested this very well, so feedback is appreciated! Browser support isn't done yet, and noTrack will also need to be updated for the libdiscore launch signature now that it's actually being evaluated.
Most of this was to work around extensions adding markdown while having dependencies on React breaking with multi-webpack. Remapped stub modules now insert modules *before* injected modules are processed, meaning they should now inject on the same chunk as their remapped dependencies are added in some cases. Injected modules can now splice into chunks that are being currently inserted. This reduces chunk count (like it matters) and should be a slight speedup since a separate chunk doesn't need to be processed right after. The initial set of Webpack modules is now treated as a fake chunk and is also has injected modules spliced into it. Entrypoint modules are delayed slightly as they have to go into a new chunk to get required properly. (hopefully this is coherent enough rambling of how this works)
fc00a68 to
308ccb3
Compare
I genuinely do not know any other better way to do this without forcing extensions to load later (which means either forcing authors to rework things or outright breaking what I fixed in an earlier commit; neither are desireable). This is still early enough in the load cycle that no HTTP requests are made yet, so none of them are missing `launch_signature` in their super properties.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reopened from #294 because Cyn forgot to retarget it. Womp womp.
The primary motivation for this is loading libdiscoreWasmFetch along with web, as well as cleaning up Webpack patching code in general. We have to support multiple requires existing, so the main require in web gets marked with a special field. There's also multiple modules, some with conflicting IDs(!!!), so I'm not sure how that behaves. I do not know if patching modules in the other scripts works.
I haven't tested this very well, so feedback is appreciated! Browser support isn't done yet, and noTrack will also need to be updated for the libdiscore launch signature now that it's actually being evaluated. (We also may want to consider not patching this, as it's possible it might benefit us if Discord employees are intentionally flagging us anyways...)
Cyn reported that this was crashing her with her config, but it didn't work for me, so it's probably one of the extensions she had enabled that I don't have downloaded.