Commit graph

31 commits

Author SHA1 Message Date
PalmDevs
d0ee081ac5
fix(lib): update filters 2025-10-12 01:27:53 +07:00
PalmDevs
3a57fe820c
fix(lib): support filtering for 297202 2025-09-04 01:29:16 +07:00
Palm
5f5fc6f2b2
feat!: module finders refactor (#6)
- Renamed `byX` filters to `withX`.
  It is more correct. For example: You don't lookup, wait for, or get modules **BY** props. You lookup, wait for, and get modules **WITH** props.
- Renamed `*byImportedPath` to `*withImportedPath`
  For consistency with the above change.
- Renamed `getModule` to `getModules`.
  The API allows getting multiple modules and not just a single one. Types are renamed as well.
  `getModuleByImportedPath` remains the same as it only gets one single module with a unique imported path.
- `withX` filter **helpers** removed.
  They can now be replaced with the new capability-based `and` filter.
- `preferExports` and `moduleStateAware` filters removed.
  They can now be replaced with the new capability-based `and` filter.
- Composite finders renamed.
  `some` -> `or`, `every` -> `and`
- Composite finders takes a capability-based approach.
- Filter generators now need to attach runtime flag to let the system know whether the generated filter can be used to filter modules without proper exports or not.

## Misc.

- Removed useless unsub call in Profile Badges
- Use `queueMicrotask` with `asap`

# Features

## Capability-based approach to composite filters

```js
// Old
byProps(...).withDependencies(...)
// Old, same as: preferExports(byProps(...), byDependencies(...))
every(byDependencies(...), byProps(...))
// Old, ordering matters, this would fail unexpectedly!
every(byProps(...), byDependencies(...))

// New
withProps(...).and(withDependencies(...))
// New (as well), ordering doesn't matter, this has the same result as above
withDependencies(...).and(withProps(...))
```
2025-08-30 09:19:57 +07:00
PalmDevs
c33086435e
feat(lib/modules/finders/filters): deprecate undefined and allow null in byDependencies
`null` is more correct semantically (and also shorter to type). `undefined` should only be module IDs that cannot be found, in which case, a warning log has been added.
2025-08-25 21:22:06 +07:00
PalmDevs
c2d12321f6
chore(lib/modules): simplify imports 2025-08-13 01:27:49 +07:00
PalmDevs
e7b4413675
chore: format 2025-08-05 20:39:09 +07:00
PalmDevs
2e455cf2c5
feat: add ability to decorate plugin APIs, move private properties to WeakMap stores 2025-07-20 23:06:56 +07:00
PalmDevs
050b147147
fix(lib/externals/react-native-clipboard): also clean up destructure references 2025-07-14 10:02:52 +07:00
PalmDevs
e48e45226f
fix(utils/proxy): accept nested options in destructure 2025-07-14 09:53:06 +07:00
PalmDevs
996e4f5994
fix(lib/utils/proxy)!: disallow passing type-strings to ProxifyOptions.hint 2025-07-13 19:18:41 +07:00
PalmDevs
4b2a612374
chore(lib/utils): do not pluralize submodules 2025-07-11 17:33:06 +07:00
PalmDevs
78e8a96034
fix(lib/react)!: ReactJsxRuntime -> ReactJSXRuntime
JSX is JavaScript XML, which should be capitalized
2025-07-10 21:23:39 +07:00
PalmDevs
075f33f6c6
chore: cleanup 2025-07-05 13:56:52 +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
5171e2cfba
fix(lib): revert bf9e723 partially 2025-06-16 20:20:04 +07:00
PalmDevs
bf9e723e73
chore: update rolldown and use defineLazyProperties to set lazy-loaded plugin APIs 2025-06-16 09:01:50 +07:00
PalmDevs
e181dd2c1c
fix(lib/externals/react-navigation): lookup ReactNavigationStack by shorter prop 2025-06-14 21:49:39 +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
fd44d95749
fix(lib/externals/browserify): stricten nodeUtil's filter 2025-06-12 23:53:19 +07:00
PalmDevs
ba835cdfbc
fix(lib/externals/react-navigation): correct filter for ReactNavigationStack 2025-06-12 23:21:32 +07:00
PalmDevs
6b5c5a62c3
fix(lib/externals/shopify): correct filter for FlashList 2025-06-12 22:15:16 +07:00
PalmDevs
a04cacf9d8
fix(lib): define lazy properties with arrow functions 2025-06-09 19:45:02 +07:00
PalmDevs
3619993dc0
fix(lib): export types exports as types-only 2025-06-08 18:47:42 +07:00
PalmDevs
2c56aa87c1
fix(lib/plugins): move unscoped.externals to its own pkg 2025-06-06 20:51:07 +07:00
PalmDevs
2b905801c3
chore: format 2025-06-03 16:24:58 +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
066f6c9671
fix: remove sparse arrays from lookups 2025-05-15 15:13:19 +07:00
PalmDevs
81f529c607
feat(lib/externals): export react-native-clipboard 2025-05-10 02:12:05 +07:00
PalmDevs
bea3439c5e
fix(lib): refactor modules, react, utils 2025-05-09 21:21:06 +07:00
PalmDevs
9e857d7751
chore(lib/externals): refactor 2025-05-08 23:43:25 +07:00
PalmDevs
98b84a43c7
feat(lib): add externals 2025-05-08 19:10:40 +07:00