Commit graph

575 commits

Author SHA1 Message Date
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
0c991ae42a
chore(shims): remove bad file in tsconfig 2025-09-02 10:25:08 +07:00
PalmDevs
d842c16903
feat(plugins/api.storage): remove gotcha with load: true 2025-09-02 10:24:15 +07:00
PalmDevs
ab81c4b726
feat(plugins/settings): add optional descriptions for plugin list filters 2025-08-31 20:04:10 +07:00
PalmDevs
408c8463ac
feat(plugins/settings): exclude API plugins, turn on match all by default for plugin list 2025-08-31 20:04:03 +07:00
PalmDevs
83cd04d5b1
fix(plugins/settings): key FormSwitch to prevent animation on fast scrolls 2025-08-30 23:23:37 +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
a7ba4a4391
chore(README): clarify more on how external scripts should map imports 2025-08-25 21:52:05 +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
d410656ec2
fix(scripts/build): only minify with dead code elimination 2025-08-25 20:10:25 +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
PalmDevs
68b84ea203
fix(plugins/developer-kit): move IconComponent lookup outside function 2025-08-20 20:51:05 +07:00
PalmDevs
50a3804709
fix(plugins/developer-kit): use new icons for fallback displays 2025-08-20 20:49:23 +07:00
PalmDevs
04fccbb149
fix(lib/discord/design): update filter for Design on 295204+ 2025-08-20 20:20:49 +07:00
PalmDevs
0d370638a5
chore(lib/modules/finders/filters): update key in docs for createFilterGenerator example 2025-08-20 17:28:15 +07:00
PalmDevs
913c987951
fix(lib/modules/finders/filters): generate proper keys for relative.withDependencies 2025-08-20 17:27:36 +07:00
PalmDevs
a0c03057b4
fix(lib/modules/types): correct definition for Metro.ModuleDefinition['publicModule'] 2025-08-19 21:48:38 +07:00
PalmDevs
4ed96c8512
fix(lib/modules/finders/wait): do not log matched cached waits in non-"debug wait" builds 2025-08-19 21:47:43 +07:00
PalmDevs
7b3ede1904
chore(lib/react/native/patches): refactor to one instead patch 2025-08-19 21:46:32 +07:00
PalmDevs
180b8b858d
chore(plugins/user-badges): use push + pop instead of unshift + shift 2025-08-19 21:45:48 +07:00
PalmDevs
69fff07c1f
fix(lib/storage): read options.load and act in Storage directly 2025-08-19 21:37:11 +07:00
PalmDevs
138b0dc651
chore(shims/react~jsx-runtime): revert to basic shimming 2025-08-19 02:40:41 +07:00
PalmDevs
0356581e22
chore: update dependencies 2025-08-19 02:40:02 +07:00
PalmDevs
78ccd4286f
fix(lib/modules/native): match implementation with lastest changes 2025-08-17 03:46:59 +07:00
PalmDevs
b817178e8e
fix(lib/modules/finders/filters): type FilterGenerator without ts-expect-error 2025-08-17 00:56:27 +07:00
PalmDevs
e689976e28
feat(lib/modules/native): API for calling custom native methods 2025-08-17 00:55:42 +07:00
PalmDevs
a9f04b2bc6
fix(shims): unproxify to prevent additional lookups 2025-08-17 00:53:08 +07:00
PalmDevs
d8b2d0302d
chore(lib/modules/finders/wait): use existing parameter for exports in waitForModuleByImportedPath 2025-08-13 21:38:02 +07:00
PalmDevs
c2d12321f6
chore(lib/modules): simplify imports 2025-08-13 01:27:49 +07:00
PalmDevs
e0c2ca7d6c
fix(lib/modules/native): getNativeModule should fallback to legacy if turbo module doesn't exist 2025-08-13 01:12:36 +07:00
PalmDevs
3563daed39
fix(lib/plugins): only run dependencies that aren't already running 2025-08-13 00:56:23 +07:00
PalmDevs
2b69e17d68
feat(plugins/settings): show Reload required dialog immediately after flag update 2025-08-13 00:54:14 +07:00
PalmDevs
d38a0394f6
fix(plugins/settings): trailing comma in Reload required dialog content 2025-08-13 00:54:01 +07:00
PalmDevs
ac3546a53d
chore: make internal library imports more readable 2025-08-13 00:51:28 +07:00
PalmDevs
a94e75a6c0
chore: update dependencies 2025-08-13 00:51:27 +07:00
PalmDevs
d88962c3b0
fix(scripts/build): turn off broken inlineConst bundler flag
It inline consts some values (notably the settings module loaded status to always be false) which causes unintended side effects.
2025-08-13 00:46:50 +07:00
PalmDevs
d386035342
chore(lib/storage): move Storage#use initialization back to library 2025-08-12 16:56:10 +07:00
PalmDevs
333ba5622e
fix(scripts/types): also generate definitions for index components import 2025-08-11 20:14:27 +07:00
PalmDevs
4193661de8
fix(plugins/settings): make sure plugin name does not overflow 2025-08-11 20:10:52 +07:00
PalmDevs
d10dbefdc4
chore(scripts/build): update comment on build flags 2025-08-11 17:40:50 +07:00
PalmDevs
7712b818f8
feat(lib/discord)!: flatten api structure 2025-08-11 17:21:12 +07:00
PalmDevs
3963db69b8
feat(lib/discord/flux): add optional generics 2025-08-11 17:00:44 +07:00
PalmDevs
2c6e54a81b
chore: setup lifecycles before initializing plugins 2025-08-11 16:52:26 +07:00
PalmDevs
a089865d12
chore: update dependencies 2025-08-11 16:51:09 +07:00
PalmDevs
7f1b116a63
fix(lib/utils/callback): only use enqueueJob if engine queue is used 2025-08-11 16:49:50 +07:00