Commit graph

435 commits

Author SHA1 Message Date
PalmDevs
1a8704fae6
fix(lib/discord): module filters for 304203+ 2025-11-01 20:09:44 +07:00
PalmDevs
772bd2a283
fix(lib): use new nested withDependencies filters everywhere 2025-10-29 19:34:38 +07:00
PalmDevs
8e2abb9e6f
fix(lib/modules/finders/filters): use runFilter for nested withDependencies filters 2025-10-29 19:33:24 +07:00
PalmDevs
300d506125
feat(lib/modules/finders/filters): allow nested filters in withDependencies 2025-10-28 01:18:12 +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
dde81af9f6
chore(lib/modules/finders/lookup): warn for bad filters without uninitalized modules 2025-10-27 00:35:40 +07:00
PalmDevs
c8906b442a
feat(lib/plugins)!: bind lifecycle this to plugin 2025-10-26 23:08:36 +07:00
PalmDevs
f61661ac27
fix(lib/discord/design): correct types for Design and TableRow 2025-10-26 13:55:22 +07:00
PalmDevs
bdf2b142d7
feat(lib/patcher): hook priority 2025-10-24 21:27:07 +07:00
PalmDevs
b2a378a3b2
chore(lib/storage): document default options 2025-10-23 17:04:24 +07:00
PalmDevs
0f7218aa1a
fix(lib/storage): only call get after delete if already loaded 2025-10-23 17:04:14 +07:00
PalmDevs
0f0c5f85eb
fix(lib/plugins): clear Errored flag properly on prepare 2025-10-23 17:02:19 +07:00
PalmDevs
a2f330e7e2
chore: remove #lib syntax
Autocomplete is annoying.
2025-10-22 22:24:26 +07:00
PalmDevs
776e61ad47
fix(lib/storage): unintended behaviors
- Fixed Storage#delete() always returning false regardless of success
- Clone deep default option to prevent unintended behavior after deleting storage
2025-10-22 22:23:48 +07:00
PalmDevs
2bc2a9fd08
fix(lib/plugins): expose internal metadata via function instead 2025-10-22 22:19:42 +07:00
PalmDevs
d44ec8fd6d
feat(lib/utils/object): add cloneDeep 2025-10-22 22:18:33 +07:00
PalmDevs
86cf81ca56
fix(lib/discord/types): add missing justify and align prop for Stack 2025-10-22 22:13:47 +07:00
PalmDevs
38becc38a1
fix(lib/discord/types): add missing props for SettingsListRenderer.SettingsList 2025-10-18 19:05:52 +07:00
PalmDevs
fbf2396d94
feat: catch and report fatal initialization errors 2025-10-17 15:49:50 +07:00
PalmDevs
e9f611e325
feat(lib/modules/native/fs): add additional methods 2025-10-14 21:49:55 +07:00
PalmDevs
67c3d9ec8d
chore(lib/plugins): update internal names with correct terminology 2025-10-14 00:37:24 +07:00
PalmDevs
fc679a4d15
fix(lib/plugins): do not incorrectly mark plugin status + do not race on rejected promises, if errored 2025-10-14 00:35:45 +07:00
PalmDevs
17fd1ec0bd
fix(plugins/settings): correct path for SettingsNavigator patch 2025-10-13 00:45:07 +07:00
PalmDevs
d0ee081ac5
fix(lib): update filters 2025-10-12 01:27:53 +07:00
PalmDevs
349c23eced
fix: correct misleading terms 2025-09-17 17:14:22 +07:00
PalmDevs
4f612edda4
fix(lib/plugins): do not emit flagUpdate if new flag is same 2025-09-17 17:14:21 +07:00
PalmDevs
82153eb512
feat(lib/storage): allow set-replacing, add update mode to subscriptions 2025-09-17 17:14:20 +07:00
PalmDevs
e4cb41fa2b
feat(lib/plugins): save plugin states 2025-09-16 01:02:29 +07:00
PalmDevs
53ba8a2975
feat(lib/modules/native/fs): rename deleteFile to rm 2025-09-16 01:02:27 +07:00
PalmDevs
4d93159632
chore(lib/modules/native): remove useless String() call on error 2025-09-16 01:02:25 +07:00
PalmDevs
97534c9d04
feat(lib/modules/native): add fs 2025-09-16 01:02:18 +07:00
PalmDevs
d8d85cfab1
fix(lib/modules/metro/runtime): add flag once importedAll or importedDefault exports cached 2025-09-16 01:02:16 +07:00
PalmDevs
dba76a9f81
feat(lib): proper caching for assets and modules lib 2025-09-16 01:02:13 +07:00
PalmDevs
67345aa82e
feat(lib/modules/native): types for calls 2025-09-16 01:02:11 +07:00
PalmDevs
fc5e776121
chore: format 2025-09-10 00:56:53 +07:00
PalmDevs
e389a6b61b
fix(lib/discord/patches/flux): bind function instead of using Reflect.apply
It may result in better performance.
2025-09-10 00:53:51 +07:00
PalmDevs
bd214823d4
fix(lib/modules/finders/get): correct types for getModules with options 2025-09-10 00:52:58 +07:00
PalmDevs
622df65cbf
chore: replace side-effect requires with imports mapping to requires
So the code editor can report errors for bad imports.
import statements are mapped to require statements via a bundler plugin.
2025-09-10 00:47:39 +07:00
PalmDevs
790c30a6d5
fix: debug build flags 2025-09-04 01:29:18 +07:00
PalmDevs
54c6a2ffdd
fix(lib/modules/finders/filters): correctly generate key for relative.withDependencies 2025-09-04 01:29:18 +07:00
PalmDevs
d5a7ab6d7b
fix(lib/modules/finders): early return if non-dynamic filter used on uninitialized module 2025-09-04 01:29:17 +07:00
PalmDevs
3a57fe820c
fix(lib): support filtering for 297202 2025-09-04 01:29:16 +07:00
PalmDevs
d842c16903
feat(plugins/api.storage): remove gotcha with load: true 2025-09-02 10:24:15 +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
Palm
2d9a791249
feat: fluent interface for finder filters (#5)
* feat(lib/modules/finders/filters): DSL-style filters implementation

* fix(lib/modules/finders/filters): extend helpers with `Function` proto

To not break compatibility with weird usages of existing filters. Allows using `apply`, `call`, etc.

* chore(lib/modules/finders/filters): add examples with helpers
2025-08-25 21:45:42 +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
497bb232ea
chore: update dependencies 2025-08-25 19:19:22 +07:00
PalmDevs
d5941354fa
fix(lib/utils/proxy): update types and documentation for destructure 2025-08-25 19:03:00 +07:00
PalmDevs
bb7b1ae05c
feat(lib/assets): micro-optimizations 2025-08-22 02:37:48 +07:00
PalmDevs
63fd1938cf
feat(lib/modules): micro-optimizations + logic fixes
FIXES:
- `getInitializedModuleExports` now returns `undefined` correctly on uninitialized modules instead of empty objects.
- `NotFoundResult` for lookups is now a frozen array
- `lookupModuleByImportedPath` now returns `LookupNotFoundResult` as a union instead of `[]`

PERFORMANCE:
- Optimized Array checks with `byDependencies` filter
- Micro-optimized finders and filters
- `ModuleDefinition`s no longer allocate their `Module` object immediately after defined
2025-08-22 02:32:07 +07:00