Commit graph

25 commits

Author SHA1 Message Date
PalmDevs
97534c9d04
feat(lib/modules/native): add fs 2025-09-16 01:02:18 +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
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
497bb232ea
chore: update dependencies 2025-08-25 19:19:22 +07:00
PalmDevs
c2d12321f6
chore(lib/modules): simplify imports 2025-08-13 01:27:49 +07:00
PalmDevs
79ce47c2bc
feat(lib/modules/metro): use Map for storing module dependencies for quicker access, rename file 2025-07-17 16:55:08 +07:00
PalmDevs
9e6614a1bd
chore: lint and format 2025-07-10 21:26:27 +07:00
PalmDevs
9560a8320b
feat(lib/modules/metro)!: more performance wins 2025-07-09 01:28:44 +07:00
PalmDevs
3619993dc0
fix(lib): export types exports as types-only 2025-06-08 18:47:42 +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
273294df82
fix(lib/modules/finders)!: remove find* apis
- `find` APIs are merely a wrapper for `wait` and `lookup` APIs. I think the developer should already know whether the module they're trying to get is initialized already or not by the time their plugin runs.
In the `init` phase, most important packages such as React, React Native, React JSX Runtime, Native modules, etc. are already initialized. So, the `lookup` APIs can be used here instead.

- While I am not sure what exactly gets initialized after `init` until `start`, you can simply do trial and error to see if the module is initialized or not. If it is not, you can use `wait` API to wait for it to be initialized.

- `lookup` can also be used inside `wait` if you know a certain module would be initialized after another module.

With all the above reasons, I think the `find*` APIs are redundant and should be removed.
2025-05-13 10:35:07 +07:00
PalmDevs
bea3439c5e
fix(lib): refactor modules, react, utils 2025-05-09 21:21:06 +07:00
PalmDevs
20af127254
fix(lib)!: move modules/native/discord and its types to discord/native 2025-04-29 18:41:22 +07:00
PalmDevs
7a7f470ff4
fix(lib)!: move modules/common to own libs 2025-04-29 18:25:55 +07:00
PalmDevs
87ff29a36a
feat(lib/modules/common)!: export more commons 2025-04-27 21:14:41 +07:00
PalmDevs
d251b401c9
chore(lib): refactor libs for preinits and inits 2025-04-27 20:58:40 +07:00
PalmDevs
89b9fa7958
chore(lib): migrate usage of .d.ts to .ts 2025-04-27 20:58:33 +07:00
PalmDevs
0ff9c83f5b
feat(lib/modules): export common 2025-04-27 14:45:14 +07:00
PalmDevs
c4fbbb61d8
fix(lib/modules/native)!: prepare dir structure for native interop 2025-04-27 14:44:59 +07:00
PalmDevs
e5e3fb6936
fix(lib/modules): export types 2025-04-11 18:38:57 +07:00
PalmDevs
f9c048b623
feat(lib/modules): export metro, fix finders result checks, refactor filters to use creator function, add loose dependency checks 2025-04-10 02:06:43 +07:00
PalmDevs
c67b1f5821
chore: format 2025-04-03 23:00:51 +07:00
PalmDevs
d92898ccc8
feat(lib): initial implementation of @revenge-mod/modules 2025-03-30 23:32:17 +07:00