Skip to content

feat: Builder-style API for App - #367

Merged
spencewenski merged 1 commit into
mainfrom
gh-339-builder-api
Sep 11, 2024
Merged

feat: Builder-style API for App#367
spencewenski merged 1 commit into
mainfrom
gh-339-builder-api

Conversation

@spencewenski

@spencewenski spencewenski commented Sep 11, 2024

Copy link
Copy Markdown
Member

Builder-style APIs are common in rust libs. For example, see axum's Router or poem's Route. This is often a more ergonomic approach to building an object as it allows creating state in local variables and passing them to the builder methods.

To add a builder-style API will still supporting our App trait, we provide a default App implementation (RoadsterApp) that can be configured via a builder-style API. This allows consumers to choose which approach they prefer.

Closes #339

@spencewenski spencewenski reopened this Sep 11, 2024
@spencewenski spencewenski changed the title Gh 339 builder api feat: Builder-style API for App Sep 11, 2024
@codecov

codecov Bot commented Sep 11, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 226 lines in your changes missing coverage. Please review.

Project coverage is 43.80%. Comparing base (819bad3) to head (c4f4ed8).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/app/roadster_app.rs 0.00% 221 Missing ⚠️
src/app/mod.rs 0.00% 4 Missing ⚠️
src/service/http/builder.rs 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/service/runner.rs 0.00% <ø> (ø)
src/service/http/builder.rs 26.92% <0.00%> (+0.50%) ⬆️
src/app/mod.rs 0.00% <0.00%> (ø)
src/app/roadster_app.rs 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 819bad3...c4f4ed8. Read the comment docs.

@spencewenski
spencewenski force-pushed the gh-339-builder-api branch 9 times, most recently from 555c2f7 to 00855b0 Compare September 11, 2024 14:58
@spencewenski
spencewenski merged commit c07f57f into main Sep 11, 2024
@spencewenski
spencewenski deleted the gh-339-builder-api branch September 11, 2024 15:37
spencewenski added a commit that referenced this pull request Sep 15, 2024
## 🤖 New release
* `roadster`: 0.6.2 -> 0.6.3

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.6.3](roadster-v0.6.2...roadster-v0.6.3)
- 2024-09-15

### Added

- Add more builder methods for `RoadsterApp`
([#370](#370))
- Builder-style API for `App`
([#367](#367))

### Other

- Fix CI build step name
([#372](#372))
- Add logs for successful health checks
([#371](#371))
- Restructure configs for leptos-ssr example
([#364](#364))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Spencer Ferris <3319370+spencewenski@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Builder-style API to configure the App

1 participant