Commit graph

24 commits

Author SHA1 Message Date
PalmDevs
c49f3eb471
fix(lib/discord/common)!: split to own submodules + don't restrict everything to init+ 2026-07-31 14:51:15 +07:00
PalmDevs
f1b96648e2
fix(lib/discord/actions): update filters for 334204+ 2026-06-13 01:00:19 +07:00
PalmDevs
5043b026ad
fix(lib/discord): update filters for 330201+ 2026-05-13 01:22:33 +07:00
PalmDevs
a17706327f
fix(lib/discord): update filters for 328200+ 2026-04-28 10:15:54 +07:00
PalmDevs
d8897d8c4d
feat(lib/discord/common): expose and switch filters to use ImportTrackerModuleId 2026-01-17 20:54:14 +07:00
PalmDevs
1a8704fae6
fix(lib/discord): module filters for 304203+ 2025-11-01 20:09:44 +07:00
PalmDevs
b6d1cff9f5
feat(lib/modules)!: filter scopes + fixes and improvements
# Features

- Filters now control what types of modules they see.
- Filters can be reinstantiated via `.new()`
- Added the `Not` type in @revenge-mod/utils/types

# Fixes

- Pitfall with `lookupModules` and `withDependencies` without `uninitialize: true` fixed.
- Filter type-metadata is now stored in a single object instead of multiple parameters.
- Incorrect caching behavior for `lookupModules` where cache always reports not found if you finish the iterator.
- Also attempt to report not found when using `lookupModule`.
2025-10-28 01:01:17 +07:00
PalmDevs
d0ee081ac5
fix(lib): update filters 2025-10-12 01:27:53 +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
996e4f5994
fix(lib/utils/proxy)!: disallow passing type-strings to ProxifyOptions.hint 2025-07-13 19:18:41 +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
e83078abc8
feat(lib/discord): correct and add file paths for modules for reference 2025-07-04 22:23:56 +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
c8567e1a7c
fix(lib/discord/actions): lookup AlertActionCreators with includeUninitialized 2025-06-14 21:47:59 +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
dfda3afc68
fix(lib/discord/actions): stricten ActionSheetActionCreators's filter 2025-06-11 23:19:25 +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
ca7ef6ea1a
feat(lib)!: refactor discord, add export utils/discord 2025-05-09 21:52:43 +07:00
PalmDevs
ef5f2ce87c
fix(lib)!: refactor structure 2025-05-08 19:10:42 +07:00
PalmDevs
7cf05a6f53
feat(lib/discord/actions): export ToastActionCreators 2025-05-05 19:22:59 +07:00
PalmDevs
93decc2d63
feat(lib/discord): exports actions and polyfills 2025-05-04 20:31:48 +07:00