Skip to content

Commit 6bd5f5e

Browse files
CopilotTuntii
andcommitted
Document dependency reduction plan
Co-authored-by: Tuntii <121901995+Tuntii@users.noreply.github.com>
1 parent db683c0 commit 6bd5f5e

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

docs/PHILOSOPHY.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,23 @@ validator = "0.16"
105105
2. We bump `rustapi-rs` to `0.2.0`
106106
3. **Your code stays exactly the same** — just update the version
107107

108+
### External Dependency Reduction (Dış Bağımlılıkları Azaltma)
109+
110+
RustAPI already hides external crates behind internal adapters. To reduce dependency debt, we focus on components with a stable spec and a small surface area, while keeping the public API unchanged. The playbook is:
111+
112+
1. Wrap dependencies with internal traits/types so behavior is defined by RustAPI.
113+
2. Add contract tests to lock in behavior before replacing internals.
114+
3. Ship replacements behind feature flags, then flip defaults.
115+
116+
Good candidates for in-house implementations:
117+
- Validation (`validator`) → native validation engine (already planned).
118+
- Router (`matchit`) → internal radix tree with RustAPI-specific optimizations.
119+
- OpenAPI (`utoipa`) → native schema generator to control outputs.
120+
- TOON format (`toon-format`) → move core format logic into `rustapi-toon`.
121+
- Template engine (`tera`) → minimal renderer for basic HTML views.
122+
123+
Not near-term targets: `tokio`, `hyper`, `tower` — large, security-sensitive, and foundational crates best kept upstream for now.
124+
108125
### 4. 🎁 Batteries Included (But Optional)
109126

110127
**Everything you need, nothing you don't.**

docs/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ RustAPI is an ergonomic web framework for Rust, inspired by FastAPI's developer
2828
2929
RustAPI provides a stable, ergonomic public API. Internal dependencies (`hyper`, `tokio`, `validator`) are implementation details that can be upgraded without breaking your code.
3030

31+
### External Dependency Plan
32+
33+
To reduce external dependency debt (dış borç), we prioritize replacing crates with stable specs and small surfaces while keeping the public API unchanged. Candidate areas for RustAPI-owned implementations are validation, routing, OpenAPI generation, and the TOON format. Foundational runtime and HTTP crates (`tokio`, `hyper`, `tower`) remain external for stability and security.
34+
3135
## Getting Started
3236

3337
```toml

0 commit comments

Comments
 (0)