Commit graph

53 commits

Author SHA1 Message Date
PalmDevs
54f5d94205
feat: warn user to update loader if native cache format is outdated 2026-08-02 17:10:53 +07:00
PalmDevs
bd5ee5c1f1
chore(lib): clarify doc 2026-08-01 14:49:54 +07:00
PalmDevs
da08b94f76
fix(lib/assets): skip useless comparison during pre-init 2026-07-28 12:12:22 +07:00
PalmDevs
3f60b4dfb7
feat!: more plugin system improvements + API changes + other fixes
BREAKING CHANGES:

- lib/modules!: Renamed `callBridgeMethod*` to `callNativeMethod*` and interface `Methods` to `NativeMethods`. This is to achieve naming consistency with the native API and be more clear.
- lib/storage!: Renamed to `@revenge-mod/json-storage`. A storage can be in any arbitrary format. While there's little potential for non-JSON storage formats, but the naming should allow for it regardless. This is not a drop-in replacements. There are breaking changes in export names and new APIs.
- plugins/revenge.api.storage!: Renamed to `revenge.api.jsonStorage`. Plugin options are renamed and its structure has changed as well.
- Native now holds the path for official storage APIs. This update uses new paths without any migration!
- lib/plugins!: `Plugin.errors` is now read-only. Use `Plugin.reportError(e)` instead.
- lib/plugins!: `Plugin.flags` has been completely removed in favor of these methods: `Plugin.requireReload()`, `Plugin.disable()`.

OTHER CHANGES:

- Fixed sorting for 'Enabled first'
- Updated native method names to be more consistent
- Cleand up dead code
- Make methods more 'safe' by removing non-null assertion casts
2026-07-09 23:47:53 +07:00
PalmDevs
3c657c36b2
fix(lib/assets): cache assets immediately when uncached 2026-01-24 18:13:45 +07:00
PalmDevs
772bd2a283
fix(lib): use new nested withDependencies filters everywhere 2025-10-29 19:34:38 +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
dba76a9f81
feat(lib): proper caching for assets and modules lib 2025-09-16 01:02:13 +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
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
bb7b1ae05c
feat(lib/assets): micro-optimizations 2025-08-22 02:37:48 +07:00
PalmDevs
c2d12321f6
chore(lib/modules): simplify imports 2025-08-13 01:27:49 +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
37ed46226c
chore(lib/assets): document use of unproxify to trigger set module ID 2025-08-04 09:42:50 +07:00
PalmDevs
578b78dd7e
feat(lib/modules/finders/waits): cached-only waits 2025-07-31 19:15:08 +07:00
PalmDevs
c640a0e5a0
fix(lib/modules/metro/patches): make it work with inlineConst bundler option 2025-07-30 20:17:12 +07:00
PalmDevs
7d7d6a4358
feat(lib): small performance improvements 2025-07-27 17:07:50 +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
fbc2d0e796
fix(lib/assets): do wait before proxified lookup 2025-07-14 09:54:30 +07:00
PalmDevs
74fef6a3e4
chore(lib/assets): correct typo, remove useless log 2025-07-13 20:04:42 +07:00
PalmDevs
a98de1ce9d
chore(lib/assets)!: revert 056e082 2025-07-13 19:52:40 +07:00
PalmDevs
ec062a78df
feat(lib/assets): allow using AssetsRegistry during preinit 2025-07-13 19:29:44 +07:00
PalmDevs
cc7635005b
fix(lib/assets)!: rename exports
`AssetRegistry*` -> `AssetsRegistry*`
2025-07-13 19:20:54 +07:00
PalmDevs
c331f1fb84
fix(lib/assets): throw error when accessing uninitialized assets-registry 2025-07-13 18:12:18 +07:00
PalmDevs
056e082fdb
feat(lib/assets): add isAssetsRegistryInitialized and onAssetsRegistryInitialized 2025-07-13 15:56:56 +07:00
PalmDevs
4b2a612374
chore(lib/utils): do not pluralize submodules 2025-07-11 17:33:06 +07:00
PalmDevs
075f33f6c6
chore: cleanup 2025-07-05 13:56:52 +07:00
PalmDevs
8f0755c4e7
fix: get turbo modules from turbo module proxy 2025-07-02 21:46:13 +07:00
PalmDevs
e714960335
fix(lib): fix type errors 2025-07-01 17:30:53 +07:00
PalmDevs
77f8d62720
fix: improve perf by not returning implicitly 2025-06-17 19:53:58 +07:00
PalmDevs
921d997230
fix(lib/assets/caches): remove useless async modifiers 2025-06-16 19:59:02 +07:00
PalmDevs
6e5c4d41a4
fix(lib/assets)!: do not fallback to first type when type is specified 2025-06-12 22:14:41 +07:00
PalmDevs
f2badf63f9
fix(lib/assets/caches): fix cached check logic 2025-06-08 22:07:40 +07:00
PalmDevs
bf3c95b16e
fix(lib/assets/caches): wait for cache to finish loading before attempting to force cache 2025-06-08 21:37:54 +07:00
PalmDevs
5b3a8bc5ab
feat: see commit description
- Shim React and React Native
- Move src/components to lib/components
- Exposed lib/components to `unscoped.components`
- scipts/build: Properly set footer sourceURL
- plugins/developer-settings: Debounce searching in Asset Browser
- plugins/settings: Debounce searching in Plugins
2025-06-08 19:01:33 +07:00
PalmDevs
e510eea36e
feat(lib/assets)!: set metadata on asset objects, remove redundant APIs, add new APIs and parameters 2025-06-07 15:14:28 +07:00
PalmDevs
123bc83640
feat(lib/assets): improve caching 2025-06-06 21:13:00 +07:00
PalmDevs
2b905801c3
chore: format 2025-06-03 16:24:58 +07:00
PalmDevs
a1db2dbb2c
feat(lib/assets)!: modify cache struct, change how overrides work, cleanup APIs 2025-06-02 15:56:07 +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
456829e92a
feat(lib/assets): export getAllAssets 2025-05-10 02:12:13 +07:00
PalmDevs
bea3439c5e
fix(lib): refactor modules, react, utils 2025-05-09 21:21:06 +07:00
PalmDevs
5587ede6ba
chore(lib/assets): refactor 2025-05-08 23:41:55 +07:00
PalmDevs
75837d48cc
feat(lib/assets): add getAssetModuleId 2025-05-08 18:40:53 +07:00
PalmDevs
73dbf1aa2e
fix(lib/assets): make RN resolve custom assets properly 2025-05-07 00:51:43 +07:00
PalmDevs
72bd9c00fb
feat(lib/assets): add api for registering custom and overriding assets 2025-05-07 00:17:12 +07:00
PalmDevs
7450447c1b
feat(lib/assets)!: store asset IDs separately, prepare for asset override support 2025-05-07 00:13:22 +07:00
PalmDevs
3807f7c944
fix(lib/assets): make the patches work again 2025-05-02 22:05:31 +07:00
PalmDevs
28e1929ee9
fix(lib/assets/patches): immediately cache assets without waiting 2025-04-30 18:54:15 +07:00
PalmDevs
7a7f470ff4
fix(lib)!: move modules/common to own libs 2025-04-29 18:25:55 +07:00