Commit graph

44 commits

Author SHA1 Message Date
PalmDevs
b1d65fbda2
feat(plugins/recovery): detect freezes much earlier + show stack traces 2026-08-14 01:48:31 +07:00
PalmDevs
c49f3eb471
fix(lib/discord/common)!: split to own submodules + don't restrict everything to init+ 2026-07-31 14:51:15 +07:00
PalmDevs
b250450367
feat(lib/plugins): reexpose EnabledLate flags property as startedLate 2026-07-26 16:01:09 +07:00
PalmDevs
2b665164e9
fix(plugin/api.json-storage): handle when plugin hasn't been initialized when clearing storage 2026-07-26 00:54:20 +07:00
PalmDevs
9b412a9404
feat!: new repo system + versioning system support + bug fixes
BREAKING CHANGES:
- New versioning system: Allowing any amount of number segments, with prerelease support.
  - Any number of segments is supported: 1, 1.0, 1.0.0, 1.0.0.0, ...
  - Prerelease labels are compared "digit-run", similar to Debian.
  - Plugins must specify a version.
  - User-facing plugins should use CalVer. API plugins should use SemVer.
    Revenge APIs use SemVer while the new `discord` dependency parses the Discord version string directly.
- Dependency is now a Map, with support for version ranges and optional. Suggested URL is removed. (See new repo system)
- Plugins will now have to declare a dependency on `revenge.api` (Revenge API version) and `discord` (Discord version).
- Manifest now requires a format version (currently `1`)

New APIs:
- lib/plugins/utils: Utilities to format versioning

Features:
- New repo system: Repository design is inspired by Linux package repositories.
  - Repos host manifest, versions, channels, download URL/size, and hash for multiple plugins.
  - New dependency system: Plugins are versioned, and shouldn't break when updates come.
    Plugins can now declare dependency on supported Discord/Revenge API versions, so they won't break with auto-updates.
    Dependencies can be optional, but dependency on `revenge.api` and `discord` must be required.
    Dependents are soft-disabled when dependencies don't satisfy. Once satisfied, the plugin can start again.
  - All updates for running plugins REQUIRE a reload to prevent stale linking issues. Both native and JS-side.
  - Update checking is handled entirely by JS. But the native-side still handles installation, indexing, and verification.
  - Local indexes are updated against remote indexes. Dependency checking always uses local indexes.
  - Users can add custom repositories and custom their priority order. URL is the identity.
- Plugins can now have custom data URI icons instead of being restricted to React Native app assets.
- External plugin installs require UI confirmation before installing.
- Pending Update and Pending Reload filters in Plugins page.
- Ability to browse external plugins in repositories. Official repository will be added soon.

Fixes/Refactor:
- Refactored Plugin-related settings to a separate "Plugin Settings" plugin.
- Masonry layout fixes in landscape.
- Updated plugins now show "reload to apply" toast instead.
- Removed dead code.
2026-07-25 23:43:44 +07:00
PalmDevs
fb35d7af95
fix(plugins/api.json-storage): remove entire dir when clearing and only update storage when needed 2026-07-19 20:19:19 +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
420f3e803e
fix(lib/plugins)!: update storage layout
No migration here. It also replaces some specific APIs.
2026-07-07 00:28:05 +07:00
PalmDevs
bf8b99efb9
feat(lib/plugins): external plugins support
This is the first draft. Things may change in the future.
Loader changes are required as well.
2026-07-07 00:03:46 +07:00
PalmDevs
4fd5a28edc
feat(plugins/no-track): block /science requests 2026-05-13 01:54:35 +07:00
PalmDevs
46440ffdde
feat(plugins/no-track): log attempts to set __SENTRY__ in dev builds 2026-04-07 22:36:13 +07:00
PalmDevs
5c892bb8a1
fix(lib/plugins/apis): set most APIs during pre-init phase 2026-04-07 22:03:13 +07:00
PalmDevs
13722b994b
fix(plugins/no-track): crash on 310205+
Discord updated Sentry and now Sentry attempts also to set __SENTRY__ each attempt it tries to get the value, so now we fake the carrier instead.
2025-12-13 22:43:02 +07:00
PalmDevs
da8c535544
fix(plugins/settings): clear storage properly on errored plugins
Previous code did not handle API being undefined after plugin is stopped.
Code has also been abstracted to be inside the storage API provider.
2025-10-23 17:05:25 +07:00
PalmDevs
cb3b12f2ee
fix(plugins/no-track): correctly block AnalyticsTrackingActionCreators 2025-10-17 17:47:43 +07:00
PalmDevs
67c3d9ec8d
chore(lib/plugins): update internal names with correct terminology 2025-10-14 00:37:24 +07:00
PalmDevs
5956d19125
chore: use import defer 2025-09-10 00:51:28 +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
PalmDevs
c2d12321f6
chore(lib/modules): simplify imports 2025-08-13 01:27:49 +07:00
PalmDevs
d386035342
chore(lib/storage): move Storage#use initialization back to library 2025-08-12 16:56:10 +07:00
PalmDevs
dcfe40c1d7
feat(lib/storage): add Storage#subscribe 2025-08-11 16:39:23 +07:00
PalmDevs
578b78dd7e
feat(lib/modules/finders/waits): cached-only waits 2025-07-31 19:15:08 +07:00
PalmDevs
00e9794baf
chore(plugins/no-track): make AnalyticsActionHandlers patch more readable 2025-07-30 20:17:57 +07:00
PalmDevs
b27fd9221a
fix(plugins/no-track): remove immediate discord lib dependency 2025-07-22 19:12:54 +07:00
PalmDevs
f5ed49d4e2
fix: declare unscoped storage API using decorators instead 2025-07-21 14:06:51 +07:00
PalmDevs
2e455cf2c5
feat: add ability to decorate plugin APIs, move private properties to WeakMap stores 2025-07-20 23:06:56 +07:00
PalmDevs
7b99a59a73
chore(lib/plugins): improve plugin manifest consistencies 2025-07-18 18:29:50 +07:00
PalmDevs
8ca50309eb
chore(plugins/logging): only register on dev builds 2025-07-18 02:03:26 +07:00
PalmDevs
7f88185d55
chore(plugins/no-track): reset color in warn log 2025-07-13 19:23:01 +07:00
PalmDevs
8d00748a6a
chore(plugins/no-track): do not implicitly return 2025-07-13 15:59:45 +07:00
PalmDevs
09114af96f
chore(plugins/logging): log start stage in dev builds 2025-07-13 00:26:11 +07:00
PalmDevs
0c5e636cb5
fix(plugins/no-track): wait for discord analytics modules during start stage 2025-07-13 00:16:41 +07:00
PalmDevs
5e06aa831d
feat: move hardcoded values to build constants, display source repo & license + remove github org in settings 2025-07-12 02:51:07 +07:00
PalmDevs
4b2a612374
chore(lib/utils): do not pluralize submodules 2025-07-11 17:33:06 +07:00
PalmDevs
c66dace21b
chore: cleanup questionable code 2025-07-11 15:53:12 +07:00
PalmDevs
f4c5ea15a2
fix(plugins/logging): remove __BUILD_ENV__ references 2025-07-11 15:19:57 +07:00
PalmDevs
c63e6cebc8
fix(plugins/no-track): use hooks instead of modifying directly 2025-07-10 12:40:47 +07:00
PalmDevs
705225f05a
fix(plugins/no-track): patch SentryUtils 2025-07-09 23:29:14 +07:00
PalmDevs
dd0ee59f94
feat(plugins/no-track): improve sentry blocking, noop AnalyticsTrackActionCreators 2025-07-09 20:15:46 +07:00
PalmDevs
f1869de92a
fix(plugins/no-track): only cleanup waits 2025-06-16 18:14:32 +07:00
PalmDevs
23d250d163
feat(plugins/no-track): use noop from lib, add ReloadRequired flag when enabling late, unmark essential 2025-06-14 17:55:08 +07:00
PalmDevs
2b905801c3
chore: format 2025-06-03 16:24:58 +07:00
PalmDevs
fe43fd14d4
feat: import plugins using import.meta.glob 2025-05-22 00:06:36 +07:00