fastapi-vue-setup 1.4.2 upgrade

This commit is contained in:
2026-09-03 17:40:55 +00:00
parent 4c6ab3dde6
commit 792b9e7aa9
3 changed files with 14 additions and 11 deletions
+12 -2
View File
@@ -30,18 +30,28 @@ walking the tree (``resolve``), moves are slot detach/attach
import asyncio import asyncio
import logging import logging
from collections.abc import AsyncGenerator
from contextlib import asynccontextmanager from contextlib import asynccontextmanager
from pathlib import Path
from fastapi import FastAPI, Request from fastapi import FastAPI, Request
from fastapi.responses import Response from fastapi.responses import Response
from fastapi_vue import Frontend
from pagerite import api, files, pages, tracking from pagerite import api, files, pages, tracking
from pagerite.__main__ import DEVMODE from pagerite.__main__ import DEVMODE
from pagerite.files import file_store from pagerite.files import file_store
from pagerite.state import analytics_store, config, frontend, kanta from pagerite.state import analytics_store, config, kanta
from collections.abc import AsyncGenerator
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
# Vue build served at the site root, no SPA catch-all (assets only). The
# build mirrors the URL space: hashed, immutable files live under
# /_assets/ (assetsDir: '_/assets'), the favicon at /favicon.ico.
frontend = Frontend(
Path(__file__).with_name("frontend-build"), spa=False, cached="/_assets/"
)
@asynccontextmanager @asynccontextmanager
async def lifespan(_app: FastAPI) -> AsyncGenerator: async def lifespan(_app: FastAPI) -> AsyncGenerator:
+1 -8
View File
@@ -3,7 +3,7 @@
Everything the route modules (files, api, tracking, pages) need that is not Everything the route modules (files, api, tracking, pages) need that is not
a route itself: environment-derived paths and tunables, the ``Data`` root a route itself: environment-derived paths and tunables, the ``Data`` root
with its ``Kanta`` handle (migrations in pagerite.migrations), the analytics with its ``Kanta`` handle (migrations in pagerite.migrations), the analytics
store, the fastapi-vue ``Frontend``, the page render cache store, the page render cache
(``_render_html``/``_cached_body``/``_html_response`` plus the (``_render_html``/``_cached_body``/``_html_response`` plus the
``_render_gen`` ETag generation, bumped by ``_invalidate_pages`` on every ``_render_gen`` ETag generation, bumped by ``_invalidate_pages`` on every
content/settings write), the translator ``dispatcher``, the slug charset content/settings write), the translator ``dispatcher``, the slug charset
@@ -22,7 +22,6 @@ from pathlib import Path
import blake3 import blake3
from fastapi import HTTPException, Request from fastapi import HTTPException, Request
from fastapi.responses import Response from fastapi.responses import Response
from fastapi_vue import Frontend
from kanta import Kanta from kanta import Kanta
from zstandard import ZstdCompressor from zstandard import ZstdCompressor
@@ -80,12 +79,6 @@ FAVICON_MAXSIZE = 192
data = Data() data = Data()
kanta = Kanta(DB_PATH, data, migrations="pagerite.migrations") kanta = Kanta(DB_PATH, data, migrations="pagerite.migrations")
# Vue build served at the site root, no SPA catch-all (assets only). The
# build mirrors the URL space: hashed, immutable files live under
# /_assets/ (assetsDir: '_/assets'), the favicon at /favicon.ico.
BUILD_DIR = Path(__file__).with_name("frontend-build")
frontend = Frontend(BUILD_DIR, spa=False, cached="/_assets/")
# Dynamic HTML is compressed per request at level 9 (static assets are # Dynamic HTML is compressed per request at level 9 (static assets are
# already pre-compressed by fastapi-vue's Frontend). # already pre-compressed by fastapi-vue's Frontend).
_zstd = ZstdCompressor(9) _zstd = ZstdCompressor(9)
+1 -1
View File
@@ -17,7 +17,7 @@ readme = "README.md"
requires-python = ">=3.14" requires-python = ">=3.14"
dependencies = [ dependencies = [
"blake3>=1.0.9", "blake3>=1.0.9",
"fastapi-vue~=1.4.0", "fastapi-vue~=1.4.2",
"fastapi[standard]>=0.141.1", "fastapi[standard]>=0.141.1",
"html5tagger>=2.0.0", "html5tagger>=2.0.0",
"httpx>=0.28.1", "httpx>=0.28.1",