Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Kat Marchán 🐈
@zkat@toot.cat  ·  activity timestamp 3 weeks ago

So over at @conjured_ink, we've been seeing some annoying compilation times issue on the webapp we're working on (Axum based), and we're looking at trying to split it into crates and see if that helps with the issue.

The problem is, we're not really sure how to split it: should it be by feature? By function? Should each view+model+controller combo have its own crate? Or should all views go in a single crate, then all models, then all controllers? Or maybe every one of those should get an individual crate to themselves (since we actually have TWO webapps and they're gonna reuse code from one another)?

Do y'all have experience doing this kind of split? Are there any examples or wisdom you can share?

#Rust #RustLang #Axum

  • Copy link
  • Flag this post
  • Block
Matthias
@matthias_kraus@muenchen.social replied  ·  activity timestamp 3 weeks ago

@zkat @conjured_ink
I've some kind of model control split in my OpenCloudMesh implementation, I don't know if something similar might work for you.

https://codeberg.org/OpenGeoMesh/OpenCloudMesh-rs

This is still (very much) work in progress, but the goal is for the ocm-axum crate to only contain glue code

  • Copy link
  • Flag this comment
  • Block
Chris Dickinson
@isntitvacant@hachyderm.io replied  ·  activity timestamp 3 weeks ago

@zkat I think my M.O. would be “package things together that change at the same rate” — so probably a view+model+controller at a time. Having to work across package/crate boundaries adds friction, so I’d tend to put that friction at the edges of feature work, as opposed to “layered inside each feature”

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.3.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login