Skip to content

Commit 34a79a3

Browse files
committed
chore: create plugin feature
1 parent 3bdd1f5 commit 34a79a3

File tree

18 files changed

+35
-1472
lines changed

18 files changed

+35
-1472
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ abstraction for the collaborative features of AppFlowy. It exposes cohesive modu
1818
- Entity definitions and protobuf types under `collab::entity`.
1919
- Database, document, folder, importer, plugin, and user services under `collab::database`, `collab::document`,
2020
`collab::folder`, `collab::importer`, `collab::plugins`, and `collab::user`.
21+
- The plugin subsystem (`collab::plugins`) is guarded by the optional `plugins` Cargo feature; enable it when you
22+
need local/remote persistence helpers.
2123

2224
With everything consolidated, consumers only need to depend on the `collab` crate to access the full collaborative
2325
feature set.

collab/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ tracing-wasm = "0.2"
7272
[dev-dependencies]
7373
tokio = { workspace = true, features = ["macros", "sync", "rt"] }
7474
tempfile = "3.8.0"
75-
collab = { path = "", features = ["default"] }
75+
collab = { path = "", default-features = false }
7676
chrono.workspace = true
7777
assert-json-diff = "2.0.2"
7878
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }
@@ -83,16 +83,16 @@ tokio-test = "0.4"
8383

8484
[features]
8585
default = []
86+
plugins = ["dep:rocksdb"]
8687
verbose_log = []
8788
trace_transact = []
8889
lock_timeout = []
8990
rwlock_reason = []
90-
postgres_plugin = ["rand"]
9191
import_csv = []
9292

9393
[build-dependencies]
9494
prost-build = "0.12"
9595
protoc-bin-vendored = "3.0.0"
9696

9797
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
98-
rocksdb = { version = "0.22.0", default-features = false, features = ["zstd"] }
98+
rocksdb = { version = "0.22.0", default-features = false, features = ["zstd"], optional = true }

collab/MERGE_TODO.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ highest-level consumers so that each merge simplifies the remaining ones.
4444

4545
### 2. Integrate `collab-plugins` (optional extensions)
4646

47-
- [x] Relocate `collab-plugins/src` into `collab::plugins`, preserving feature
48-
gates such as `postgres_plugin` and conditional `rocksdb`/WASM support.
47+
- [x] Relocate `collab-plugins/src` into `collab::plugins`, preserving
48+
conditional `rocksdb`/WASM support.
4949
- [x] Merge any plugin-specific feature flags and dependencies (e.g.,
5050
`tokio-retry`, optional `rand`, `rocksdb`) into `collab/Cargo.toml`.
5151
- [x] Update `build.rs` or initialization hooks if plugins require runtime

collab/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub mod error;
2323
pub mod folder;
2424
pub mod importer;
2525
pub mod lock;
26+
#[cfg(feature = "plugins")]
2627
pub mod plugins;
2728
pub mod user;
2829
pub mod util;

collab/src/plugins/cloud_storage/channel.rs

Lines changed: 0 additions & 39 deletions
This file was deleted.

collab/src/plugins/cloud_storage/error.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

collab/src/plugins/cloud_storage/mod.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

collab/src/plugins/cloud_storage/msg.rs

Lines changed: 0 additions & 170 deletions
This file was deleted.

collab/src/plugins/cloud_storage/postgres/mod.rs

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)