tomaka / rouille

Web framework in Rust
Apache License 2.0
1.09k stars 105 forks source link

introduce more optional features to slim down required dependency graph #254

Closed HookedBehemoth closed 1 year ago

HookedBehemoth commented 2 years ago

This introduces the feature flags: logging, assets, post, session.

The goal was to slim down required dependencies in my application and the categories were chosen to make an impact on that. Updated tiny_http to get rid of a hard chrono requirement.

A simple hello world with default-features = false goes from 96 to 44 dependencies and total build time in release from 30s to 15s.

HookedBehemoth commented 1 year ago

Rebased the PR to resolve conflicts. Updating tiny_http also replaces the time dependency but leads to some complication with backwards compatibility.

bradfier commented 1 year ago

Thanks Hooked, I have a partially complete branch updating us to tiny-http 0.12, the breaking change (which I merged, so I have no excuse not to know about it) is part of supporting Unix sockets - the existing library makes a bunch of assumptions which need to be refactored into Options, and the consuming code needs updated to handle that.

CryZe commented 1 year ago

Moving code behind features that were previously included in default-features = false is a breaking change. There's an RFC to resolve this, but at least at the moment 3.6.0 probably shouldn't have been released like this.