Commit graph

26 commits

Author SHA1 Message Date
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
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
7b3ede1904
chore(lib/react/native/patches): refactor to one instead patch 2025-08-19 21:46:32 +07:00
PalmDevs
c2d12321f6
chore(lib/modules): simplify imports 2025-08-13 01:27:49 +07:00
PalmDevs
934b25de08
chore(lib): make assignments more readable 2025-08-05 20:37:37 +07:00
PalmDevs
b8ed2bf334
fix(lib/react/native): do not do patches until wait matches 2025-07-31 19:19:40 +07:00
PalmDevs
578b78dd7e
feat(lib/modules/finders/waits): cached-only waits 2025-07-31 19:15:08 +07:00
PalmDevs
78614c1cc9
chore: move SettingRendererConfig patches to lib, refactor how lifecycles are run 2025-07-19 23:23:32 +07:00
PalmDevs
feaf1cd194
feat(lib/react/jsx-runtime): switch to objects for storage 2025-07-18 23:44:24 +07:00
PalmDevs
4edc6c3821
fix(lib/react/jsx-runtime): fix typings issues 2025-07-16 20:05:20 +07:00
PalmDevs
4f46b5a635
feat(lib/react/jsx-runtime)!: improve types 2025-07-15 22:05:11 +07:00
PalmDevs
6a38136762
fix(lib)!: breaking changes
- Remove `noopFalse` from `@revenge-mod/utils/callback`
- Do not return result from unpatch/undo/unsub functions
- `onSettingsModulesLoaded` from `@revenge-mod/discord/modules/settings` now calls the callback immediately if settings modules are already loaded instead of throwing
2025-07-13 15:53:44 +07:00
PalmDevs
7bfb703e01
fix(lib/react/jsx-runtime): init patch set when undefined 2025-07-13 00:26:21 +07:00
PalmDevs
811bd30756
chore: revert 8347e24 2025-07-12 21:05:27 +07:00
PalmDevs
8347e24e54
chore(lib/react)!: remove jsx-runtime
This has been made because no developer will likely ever require this API.

The current API assumes you already have an instance of the component, which means you can likely already patch that component instance itself.

The API can be made more powerful by taking any string names, and comparing it to the component's type name, type displayName, name, displayName, etc., but it will introduce performance bottlenecks.
2025-07-11 01:15:20 +07:00
PalmDevs
14920bc21a
fix(lib/react/jsx-runtime/patches): bug and performance fixes
- Compute fiber normally if there are no instead patches
- Store all patch kinds in one single Map
- Attempt cleanup after unpatch
2025-07-11 00:59:02 +07:00
PalmDevs
2a0d91878f
feat(lib/react): add jsx-runtime 2025-07-10 21:25:46 +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
075f33f6c6
chore: cleanup 2025-07-05 13:56:52 +07:00
PalmDevs
2b905801c3
chore: format 2025-06-03 16:24:58 +07:00
PalmDevs
37664aaa55
chore: format 2025-05-19 01:43:41 +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
bea3439c5e
fix(lib): refactor modules, react, utils 2025-05-09 21:21:06 +07:00
PalmDevs
ef5f2ce87c
fix(lib)!: refactor structure 2025-05-08 19:10:42 +07:00
PalmDevs
930f8221c0
chore: format 2025-05-05 21:17:42 +07:00
PalmDevs
7a7f470ff4
fix(lib)!: move modules/common to own libs 2025-04-29 18:25:55 +07:00