Commit graph

405 commits

Author SHA1 Message Date
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
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
69fff07c1f
fix(lib/storage): read options.load and act in Storage directly 2025-08-19 21:37:11 +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
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
ac3546a53d
chore: make internal library imports more readable 2025-08-13 00:51:28 +07:00
PalmDevs
d386035342
chore(lib/storage): move Storage#use initialization back to library 2025-08-12 16:56:10 +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
7f1b116a63
fix(lib/utils/callback): only use enqueueJob if engine queue is used 2025-08-11 16:49:50 +07:00
PalmDevs
fca5dd1559
chore(lib/plugins): set arrays lengths to zero to reset states 2025-08-11 16:48:33 +07:00
PalmDevs
28f8c02869
fix(lib/discord/flux): patch dispatch method instead of using interceptors
Previously patched events weren't being returned at all.
2025-08-11 16:47:59 +07:00
PalmDevs
dcfe40c1d7
feat(lib/storage): add Storage#subscribe 2025-08-11 16:39:23 +07:00
PalmDevs
02c1c69abc
chore: cleanup 2025-08-09 02:12:29 +07:00
PalmDevs
ab5b131b8b
feat: improve types generation 2025-08-09 02:07:29 +07:00
PalmDevs
05c0b093ea
fix(lib): remove and add exports 2025-08-09 01:02:44 +07:00
PalmDevs
e7b4413675
chore: format 2025-08-05 20:39:09 +07:00
PalmDevs
934b25de08
chore(lib): make assignments more readable 2025-08-05 20:37:37 +07:00
PalmDevs
6c596a4a5c
fix(lib/assets): remove now-useless lookup
It no longer matches during preinit.
2025-08-05 20:37:06 +07:00
PalmDevs
ce188950cd
feat(lib/discord): add flux APIs 2025-08-05 20:36:08 +07:00