Commit graph

85 commits

Author SHA1 Message Date
PalmDevs
7645bfdf61
chore: new DEBUG_WAITS build flag, improve DBEUG_LOOKUPS build flag logs, other dev env fixes 2025-07-08 11:24:48 +07:00
PalmDevs
e9fedc8db4
feat: small performance wins
- Delay initializing unimportant parts until index module (ID 0) is required
- Lower memory usage by interacting with Metro's internal module list directly
2025-07-07 20:00:20 +07:00
PalmDevs
c532f5c3fd
fix(lib/modules/metro/subscriptions): run catching subscriptions 2025-07-07 18:59:49 +07:00
PalmDevs
66d95a8c49
fix(lib/modules/finders): correct types for get and lookup 2025-07-05 14:16:37 +07:00
PalmDevs
075f33f6c6
chore: cleanup 2025-07-05 13:56:52 +07:00
PalmDevs
8a7529fdbd
fix(lib/modules/finders/lookup): fix builds with DEBUG_PROXIFIED_VALUES flag on 2025-07-04 22:15:36 +07:00
PalmDevs
c067dc520d
fix(lib/modules/finders): correct filtering logic for prod builds 2025-07-04 22:14:42 +07:00
PalmDevs
2cff8ebf07
feat(lib/modules)!: add new options for lookup finders, include prefix from finders options, make utils functions safe again 2025-07-04 21:38:37 +07:00
PalmDevs
22a931de51
feat(lib/modules/metro/utils): improve perf more on bad module exports check 2025-07-03 21:38:26 +07:00
PalmDevs
75982bfb45
feat(lib/modules/metro): improve perf in patching module factories 2025-07-03 21:28:16 +07:00
PalmDevs
b56e6153a5
feat(lib/modules/metro/utils)!: remove confusing functions 2025-07-03 21:07:02 +07:00
PalmDevs
6a6a67e78f
feat(lib/modules/metro/utils): improve perf on bad module exports check 2025-07-03 21:07:01 +07:00
PalmDevs
24c4985ae8
fix(lib/modules/metro/utils): make turbo module check more performant 2025-07-03 00:02:00 +07:00
PalmDevs
50a499f6d2
fix(lib/modules/metro/utils): check if export is object before checking properties 2025-07-02 23:02:18 +07:00
PalmDevs
4fc6af8136
feat(lib/modules/finders/filters): improve perf for bySingleProp 2025-07-02 22:50:11 +07:00
PalmDevs
856b28d7ba
fix(lib/modules/finders/lookup): skip inversing boolean in initialized check 2025-07-02 22:47:49 +07:00
PalmDevs
fead7436a9
fix(lib/modules/metro/utils): add new turbo module check in isModuleExportBad 2025-07-02 22:47:10 +07:00
PalmDevs
8f0755c4e7
fix: get turbo modules from turbo module proxy 2025-07-02 21:46:13 +07:00
PalmDevs
c239c5b4f8
fix(lib/modules/finders): improve perf, correct docs 2025-07-01 17:45:49 +07:00
PalmDevs
b1e293325a
fix(lib/modules/finders/lookup): do not null cache if modules are found in lookupModules 2025-06-17 22:55:16 +07:00
PalmDevs
77f8d62720
fix: improve perf by not returning implicitly 2025-06-17 19:53:58 +07:00
PalmDevs
981e9dc080
feat(lib/modules): initial impl of modules caching
- Lookup caches have been fully implemented
- Wait caches will not exist
  - Wait APIs should simply wait until a matching module is initialized. Caching is useless when the API is for this purpose.
- Get APIs will inherit the benefits from using Lookup APIs
2025-06-16 20:25:45 +07:00
PalmDevs
cf3ded454d
fix(lib/modules/finders/filters): compare relative.withDependencies with root-relative dependencies with proper parent ID 2025-06-16 19:58:42 +07:00
PalmDevs
8851f6867b
fix(scripts/build): turn on DEBUG_MODULE_LOOKUPS build flag if dev build 2025-06-15 17:57:55 +07:00
PalmDevs
6594fc6fa1
chore(lib/utils): remove logger 2025-06-14 21:48:52 +07:00
PalmDevs
d5fa40fabd
feat(lib/modules/finders/filters)!: improve filters
- Filter generators now expose a `keyFor` method to generate filter keys.
- Dependency filtering is now more usable
  - Destructure helpers from `byDependencies` instead:
    - `looseDeps` -> `byDependencies.loose`
    - `relativeDep` -> `byDependencies.relative`
  - Nested dependencies check can now be done with relative checks via `byDependencies.relative.withDependencies`
- Dependency filtering is now more performant
  - Relative dependencies are done by bit manipulation instead
  - Reverted from stack system to recursion
  - Skip relative dependencies resolution (there is no need for it)
- Filter keys for `byDependencies` fixed
2025-06-13 23:35:23 +07:00
PalmDevs
46d7cda223
chore: add build flag to debug lookups 2025-06-12 23:24:19 +07:00
PalmDevs
000e5f4514
feat(lib/modules/finders/filters): add strict option for moduleStateAware and preferExports, update docs 2025-06-11 23:17:16 +07:00
PalmDevs
ebad969eec
feat(lib/modules/finders/get): add options.max to getModule 2025-06-10 11:06:15 +07:00
PalmDevs
b3b41e260b
fix(lib/modules/finders/lookup): correct types for lookup results 2025-06-10 11:04:23 +07:00
PalmDevs
7074e256c1
fix(lib/modules/metro): default initializing module ID to null 2025-06-07 15:14:37 +07:00
PalmDevs
2b905801c3
chore: format 2025-06-03 16:24:58 +07:00
PalmDevs
f56309f448
chore(lib/modules/finders/filters): update docs 2025-05-22 00:00:11 +07:00
PalmDevs
8437c224cd
fix(modules/finders/get): mismatched args for getModule 2025-05-19 02:20:00 +07:00
PalmDevs
37664aaa55
chore: format 2025-05-19 01:43:41 +07:00
PalmDevs
a43cd5d564
feat!: plugins page, tons of API changes, and bug fixes
Plugins
- Settings: Plugins page is now semi-functional
- No Track: Added new plugin
- Developer Settings: Clean up properly
- Logging: Log in preInit stage
- Staff Settings: Add ReloadRequired flags when late-running

@revenge-mod/init
- Moved to the top-level src/index.ts instead

@revenge-mod/modules
- Switch `exports` and `id` parameters in finders APIs
- Lookups now return an array of exports and ID instead of just exports
  - Lookup ID APIs have been removed
- Add `finders.get` helper, a new alternative for `finders.find`
- Corrected documentation for subscription APIs

@revenge-mod/plugins
- Added new APIs for plugins to allow running during pre-init stages
- Added `unscoped.modules.finders.get*`
- Added `unscoped.react.native`

@revenge-mod/react
- native: Added `onRunApplication` and `onRunApplicationFinished`

@revenge-mod/utils
- callbacks: Add `noopFalse`
- promises: Fix `allSettled`
- promises: Add `sleep`
2025-05-18 22:24:48 +07:00
PalmDevs
4d31b7016c
chore(lib/modules/metro/subscriptions): update documentation 2025-05-15 16:47:02 +07:00
PalmDevs
331f509f8d
feat(lib/modules/finders/lookup): warn about bad filters in development builds 2025-05-15 15:12:29 +07:00
PalmDevs
273294df82
fix(lib/modules/finders)!: remove find* apis
- `find` APIs are merely a wrapper for `wait` and `lookup` APIs. I think the developer should already know whether the module they're trying to get is initialized already or not by the time their plugin runs.
In the `init` phase, most important packages such as React, React Native, React JSX Runtime, Native modules, etc. are already initialized. So, the `lookup` APIs can be used here instead.

- While I am not sure what exactly gets initialized after `init` until `start`, you can simply do trial and error to see if the module is initialized or not. If it is not, you can use `wait` API to wait for it to be initialized.

- `lookup` can also be used inside `wait` if you know a certain module would be initialized after another module.

With all the above reasons, I think the `find*` APIs are redundant and should be removed.
2025-05-13 10:35:07 +07:00
PalmDevs
c811e9e302
feat(lib/modules/finders/filters): add bySingleProp filter 2025-05-10 18:12:38 +07:00
PalmDevs
bea3439c5e
fix(lib): refactor modules, react, utils 2025-05-09 21:21:06 +07:00
PalmDevs
15154c05fe
feat(lib/modules/finders/filters): allow specifying custom types in byDependencies 2025-05-08 19:10:39 +07:00
PalmDevs
c0a853b2fb
fix(lib/modules/finders/filters): correct cache key generation for byDependencies 2025-05-07 17:34:55 +07:00
PalmDevs
6407b0518f
fix: optimize typechecking performance 2025-05-07 17:34:19 +07:00
PalmDevs
930f8221c0
chore: format 2025-05-05 21:17:42 +07:00
PalmDevs
7789c26d86
feat(lib/modules/finders/filters): add withoutProps 2025-05-05 19:22:58 +07:00
PalmDevs
c379d815a6
fix(lib/modules/finders/filters)!: change how relative dependency comparisons work 2025-05-01 12:57:15 +07:00
PalmDevs
384f669c68
feat(lib/modules/finders)!: check namespace before default exports, improve performance marginally 2025-05-01 00:18:42 +07:00
PalmDevs
b785bc574a
feat(lib/modules/finders)!: make filters work with returning CJS modules 2025-04-30 23:46:21 +07:00
PalmDevs
639ffbf1f0
fix(lib/modules/finders/lookup): get correct exports for uninitialized modules 2025-04-30 23:45:15 +07:00