Releases: litestar-org/litestar-vite
v0.12.0
What's Changed
** Note ** This adds experimental support for deferring the rendering of props until the request is rendered. This allows you to use the partial data component of inertia to optional request/refresh data.
The function is titled lazy
and accepts 2 parameters: A string based "key" and the value or function (sync or async) to defer:
async def basic_example_of_lazy_rendering() -> None:
def simulated_expensive_sync_function() -> str:
sleep(0.5)
return "callable_result"
async def simulated_expensive_async_function() -> str:
await asyncio.sleep(0.5)
return "async_result"
lazy_future_for_sync_method = lazy("test_prop_1", simulated_expensive_sync_function)
assert lazy_future_for_sync_method.render(portal) == "callable_result"
lazy_future_for_async_method = lazy("test_prop_2", simulated_expensive_async_function)
assert lazy_future_for_async_method.render(portal) == "async_result"
Full Changelog: v0.11.1...v0.12.0
v0.11.1
This is a minor change to use the subprocess directly instead of through a thread.
Full Changelog: v0.11.0...v0.11.1
v0.11.0
v0.10.0
This is a breaking change.
This change removes the customized template config and prefers to patch the built in one.
Instead of:
vite = VitePlugin(config=ViteConfig(template_dir='templates/'))
app = Litestar(plugins=[vite], route_handlers=[WebController])
use:
template_config = TemplateConfig(engine=JinjaTemplateEngine(directory='templates/'))
vite = VitePlugin(config=ViteConfig())
app = Litestar(plugins=[vite], template_config=template_config, route_handlers=[WebController])
What's Changed
Full Changelog: v0.9.0...v0.10.0
v0.9.0
v0.8.3
Sorry for the back-to-back releases. There were still a few publishing issues remaining in the build pipeline for the NPM package.
Full Changelog: v0.8.2...v0.8.3
v0.8.2
What's Changed
- fix: modified --root-path option behavior when CLI init by @maintain0404 in #48
New Contributors
- @maintain0404 made their first contribution in #48
Full Changelog: v0.8.1...v0.8.2
v0.8.1
This is a minor release that corrects an issue with the generated wheel file.
The litestar_vite
module is now correctly included with the wheel contents.
Full Changelog: v0.8.0...v0.8.1