Skip to content

Releases: hxjo/fastapi-inertia

1.0.3

04 Oct 17:09
53b7f55
Compare
Choose a tag to compare

What's Changed

  • Unpin FastAPI and Jinja2 deps to allow to install with latest versions by @holandes22 in #28

Full Changelog: 1.0.2...1.0.3

1.0.2

19 Jul 15:04
ae17f38
Compare
Choose a tag to compare

What's Changed

  • Feat: Handle serialization of lists of Pydantic model by @hxjo in #25

Full Changelog: 1.0.1...1.0.2

1.0.1

18 Jul 14:12
6c75289
Compare
Choose a tag to compare

What's Changed

  • Fix and examples/add examples for vue and fix faulty ssr by @hxjo in #24

Full Changelog: 1.0.0...1.0.1

1.0.0

18 Jul 13:31
0f422ca
Compare
Choose a tag to compare

Here comes version 1.0.0 !

Thanks to proposals from @ndilsou, and by taking great inspiration from the code he provided in a fork, the following improvements have been made over the past few days:

  • Leverage Jinja2 templating instead of raw HTML, allowing for easier customization of the template by library users
  • Rework InertiaConfig options to allow for easier configuration, mainly on:
    • webapp file entrypoint
    • root webapp directory
    • assets prefix
  • Make testing easier by leveraging BeautifulSoup
  • Improve performances by:
    • Caching vite manifest
    • Using HTTPX instead of requests to make async request and avoid blocking the thread

Thanks again for the proposals @ndilsou !

What's Changed

Full Changelog: 0.1.7...1.0.0

0.1.7

18 Jul 09:03
4a98c1e
Compare
Choose a tag to compare

What's Changed

  • Feat: introduce HTTPX and deprecate requests by @hxjo in #22

Full Changelog: 0.1.6...0.1.7

0.1.6

17 Jul 21:24
b868a29
Compare
Choose a tag to compare

What's Changed

  • Chore: Use Beautifulsoup instead of manual HTML parsing in test by @hxjo in #20
  • Feat/improve vite manifest handling by @hxjo in #21

Full Changelog: 0.1.4...0.1.6

Fix: Better JSONification of pydantic models

31 May 12:53
b6e2186
Compare
Choose a tag to compare

Context

When building props, Pydantic models were converted to dict using Pydantic's model_dump method, which converts the model to a dict.
When an Inertia call was made, a simple JSONResponse (FastAPI's one) was returned, with the props.
However, JSONResponse does not handle some fields, such as datetime, and would require either:

  • Handling those prior to passing the models to the render method of inertia
  • Overriding the render method of inertia in order to use a custom JSONResponse which would handle those cases

This is very unoptimal.

Solution

  • Instead of using Pydantic's model_dump method, use its model_dump_json method which handles much more types, and use json.loads to convert it back to a dict.

  • Expose a _render_json method so it can be easily overridden, without having to override the whole render method.