Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Planning: Breaking changes for trillium 0.3 #565

Open
11 of 16 tasks
jbr opened this issue Feb 9, 2024 · 1 comment · May be fixed by #611
Open
11 of 16 tasks

Planning: Breaking changes for trillium 0.3 #565

jbr opened this issue Feb 9, 2024 · 1 comment · May be fixed by #611
Milestone

Comments

@jbr
Copy link
Contributor

jbr commented Feb 9, 2024

Breaking Changes

Note

This is non-exhaustive and none of these are certain, so please provide feedback and suggest further breaking changes

Checkboxes indicate merge to the 0.3.x staging branch

trillium

  • remove impl Handler for Arc<Handler> -- the primary use case for this is internal to trillium, and should be implemented for a newtype wrapper, as we can ensure that we call init prior to cloning. There is no implementation of init that will avoid a sharp edge for someone

  • remove Conn::headers and Conn::headers_mut -- it's better for callers to be explicit about whether they want request headers or response headers #610

  • remove trillium::Init for now #609

  • make Info not Clone #608

  • pare Info down, lean on StateSet (add a StateSet to trillium::Info #398)

  • consider making Handler not object-safe by returning impl Future instead of using async_trait and instead introducing a BoxedHandler; this would be worth only worth it if it represents a performance improvement.

  • use Swansong instead of Stopper + CloneCounter + CloneCounterObserver

  • Introduce IntoHandler and require all Handler implementations to #[derive(IntoHandler)] or impl IntoHandler for Whatever { type Handler = Self; fn into_handler(self) -> Self { self } }

  • figure out if there's a way to avoid trillium reexports trillium-http types from locking server-minor versions; ideally trillium-http could make breaking changes that only require a trillium patch change as long as the reexported types aren't breaking

trillium-http

@jbr jbr added the enhancement label Feb 9, 2024
@jbr jbr pinned this issue Feb 9, 2024
@jbr jbr added this to the 0.3 milestone Feb 13, 2024
@joshtriplett
Copy link
Collaborator

  • consider making Handler not object-safe by returning impl Future instead of using async_trait and instead introducing a BoxedHandler; this would be worth only worth it if it represents a performance improvement.

It would also be worth it if it's performance-neutral, since it would substantially improve the quality of the documentation, and eliminate the need to append (and maintain) "here's the actual async fn signature".

@jbr jbr linked a pull request Apr 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants