This repository was archived by the owner on Apr 28, 2025. It is now read-only.
feat!: new finders API & performance improvements#12
Open
Conversation
nexpid
reviewed
Jan 13, 2025
…ions to helper finders
…pings, refactor module subscriptions
a3344b9 to
68c3913
Compare
…save cache while restoring, remove `@revenge-mod/patcher` dependency
…r on older client versions
…, add new `limit` finder option for `findAll*()`, allow passing finder options to `findAllEager`, add `defaultExport` element to found modules
…ing `FilterObject`
…ld initialized modules first
Member
Author
|
This is totally broken on iOS and I do not know why, anyone willing to investigate before merge? |
Member
Author
|
Fixed in |
…fic module subscriptions
…occasionally freezing
4ee82a6 to
56834a6
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR introduces new finder APIs to
@revenge-mod/modulesand multiple performance improvements.Here's what the new finder APIs improved:
FinderOptionsto a finder in a predictable wayFinderOptions.wildcardinstead.findByFilePathis now constant timePerformance-related changes:
Micro-optimized pre-init code
Improved module hooking logic
Improved asset caching
Use truthy checks rather than
inchecks, as they can be up to 2.2x fasterRemoved useless
patchableModulescacheFixed always-broken cache restoration
Yield initialized modules before non-initialized ones to defer initializing new modules
Eagerly find early modules like React & React Native
Don't find unnecessary modules that aren't needed yet
Only blacklist freezing module on Android
Other changes:
warningsplugin@revenge-mod/modulesno longer depends on@revenge-mod/patcher@revenge-mod/reactno longer depends on@revenge-mod/patcherAs always, this PR includes major breaking changes. Developers may migrate from the old finder APIs to the new finder APIs like so:
Old finder APIs:
New finder APIs:
I've also removed the
ReactandReactNativeglobals to avoid polluting the environment. Use the following to access the libraries instead: