flet-web 0.70.0.dev5319__py3-none-any.whl → 0.70.0.dev5347__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- flet_web/fastapi/flet_app.py +4 -3
- flet_web/fastapi/flet_fastapi.py +6 -6
- flet_web/fastapi/serve_fastapi_web_app.py +8 -9
- flet_web/version.py +1 -1
- flet_web/web/flutter_bootstrap.js +1 -1
- flet_web/web/flutter_service_worker.js +4 -4
- flet_web/web/main.dart.js +118744 -118033
- flet_web/web/main.dart.mjs +126 -75
- flet_web/web/main.dart.wasm +0 -0
- flet_web/web/pyodide/micropip-0.8.0-py3-none-any.whl +2 -2
- {flet_web-0.70.0.dev5319.dist-info → flet_web-0.70.0.dev5347.dist-info}/METADATA +2 -2
- {flet_web-0.70.0.dev5319.dist-info → flet_web-0.70.0.dev5347.dist-info}/RECORD +14 -14
- {flet_web-0.70.0.dev5319.dist-info → flet_web-0.70.0.dev5347.dist-info}/WHEEL +0 -0
- {flet_web-0.70.0.dev5319.dist-info → flet_web-0.70.0.dev5347.dist-info}/top_level.txt +0 -0
flet_web/fastapi/flet_app.py
CHANGED
|
@@ -11,7 +11,8 @@ from typing import Any, Optional
|
|
|
11
11
|
import msgpack
|
|
12
12
|
from fastapi import WebSocket, WebSocketDisconnect
|
|
13
13
|
from flet.controls.base_control import BaseControl
|
|
14
|
-
from flet.controls.
|
|
14
|
+
from flet.controls.context import _context_page
|
|
15
|
+
from flet.controls.exceptions import FletPageDisconnectedException
|
|
15
16
|
from flet.controls.update_behavior import UpdateBehavior
|
|
16
17
|
from flet.messaging.connection import Connection
|
|
17
18
|
from flet.messaging.protocol import (
|
|
@@ -138,7 +139,7 @@ class FletApp(Connection):
|
|
|
138
139
|
logger.info(f"Start session: {self.__session.id}")
|
|
139
140
|
try:
|
|
140
141
|
assert self.__main is not None
|
|
141
|
-
|
|
142
|
+
_context_page.set(self.__session.page)
|
|
142
143
|
UpdateBehavior.reset()
|
|
143
144
|
|
|
144
145
|
if asyncio.iscoroutinefunction(self.__main):
|
|
@@ -158,7 +159,7 @@ class FletApp(Connection):
|
|
|
158
159
|
|
|
159
160
|
if UpdateBehavior.auto_update_enabled():
|
|
160
161
|
await self.__session.auto_update(self.__session.page)
|
|
161
|
-
except
|
|
162
|
+
except FletPageDisconnectedException:
|
|
162
163
|
logger.debug(
|
|
163
164
|
"Session handler attempted to update disconnected page: "
|
|
164
165
|
f"{self.__session.id}"
|
flet_web/fastapi/flet_fastapi.py
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
-
from
|
|
2
|
+
from collections.abc import Awaitable, Coroutine, Sequence
|
|
3
|
+
from contextlib import asynccontextmanager, suppress
|
|
3
4
|
from typing import (
|
|
4
5
|
Any,
|
|
5
|
-
Awaitable,
|
|
6
6
|
Callable,
|
|
7
|
-
Coroutine,
|
|
8
7
|
Dict,
|
|
9
8
|
List,
|
|
10
9
|
Optional,
|
|
11
|
-
Sequence,
|
|
12
10
|
Type,
|
|
13
11
|
Union,
|
|
14
12
|
)
|
|
15
13
|
|
|
16
14
|
import fastapi
|
|
17
|
-
import flet_web.fastapi
|
|
18
15
|
from fastapi.datastructures import Default
|
|
19
16
|
from fastapi.params import Depends
|
|
20
17
|
from fastapi.utils import generate_unique_id
|
|
@@ -23,6 +20,8 @@ from starlette.requests import Request
|
|
|
23
20
|
from starlette.responses import JSONResponse, Response
|
|
24
21
|
from starlette.routing import BaseRoute
|
|
25
22
|
|
|
23
|
+
import flet_web.fastapi
|
|
24
|
+
|
|
26
25
|
|
|
27
26
|
class FastAPI(fastapi.FastAPI):
|
|
28
27
|
def __init__(
|
|
@@ -80,7 +79,8 @@ class FastAPI(fastapi.FastAPI):
|
|
|
80
79
|
else:
|
|
81
80
|
h()
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
with suppress(asyncio.CancelledError):
|
|
83
|
+
yield
|
|
84
84
|
if on_shutdown:
|
|
85
85
|
for h in on_shutdown:
|
|
86
86
|
if asyncio.iscoroutinefunction(h):
|
|
@@ -12,9 +12,12 @@ logger = logging.getLogger(flet_fastapi.__name__)
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class WebServerHandle:
|
|
15
|
-
def __init__(
|
|
15
|
+
def __init__(
|
|
16
|
+
self, page_url: str, server: uvicorn.Server, serve_task: asyncio.Task
|
|
17
|
+
) -> None:
|
|
16
18
|
self.page_url = page_url
|
|
17
19
|
self.server = server
|
|
20
|
+
self.serve_task = serve_task
|
|
18
21
|
|
|
19
22
|
async def close(self):
|
|
20
23
|
logger.info("Closing Flet web server...")
|
|
@@ -61,10 +64,9 @@ async def serve_fastapi_web_app(
|
|
|
61
64
|
web_renderer: WebRenderer = WebRenderer.AUTO,
|
|
62
65
|
route_url_strategy: RouteUrlStrategy = RouteUrlStrategy.PATH,
|
|
63
66
|
no_cdn: bool = False,
|
|
64
|
-
blocking: bool = False,
|
|
65
67
|
on_startup: Optional[Any] = None,
|
|
66
68
|
log_level: Optional[Union[str, int]] = None,
|
|
67
|
-
):
|
|
69
|
+
) -> WebServerHandle:
|
|
68
70
|
web_path = f"/{page_name.strip('/')}"
|
|
69
71
|
page_url = f"http://{url_host}:{port}{web_path if web_path != '/' else ''}"
|
|
70
72
|
|
|
@@ -91,9 +93,6 @@ async def serve_fastapi_web_app(
|
|
|
91
93
|
)
|
|
92
94
|
server = uvicorn.Server(config)
|
|
93
95
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
asyncio.create_task(server.serve())
|
|
98
|
-
|
|
99
|
-
return WebServerHandle(page_url=page_url, server=server)
|
|
96
|
+
return WebServerHandle(
|
|
97
|
+
page_url=page_url, server=server, serve_task=asyncio.create_task(server.serve())
|
|
98
|
+
)
|
flet_web/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = "0.70.0.
|
|
1
|
+
version = "0.70.0.dev5347"
|
|
@@ -54,7 +54,7 @@ if (flet.noCdn) {
|
|
|
54
54
|
_flutter.loader.load({
|
|
55
55
|
config: flutterConfig,
|
|
56
56
|
serviceWorkerSettings: {
|
|
57
|
-
serviceWorkerVersion: "
|
|
57
|
+
serviceWorkerVersion: "3258490229",
|
|
58
58
|
},
|
|
59
59
|
onEntrypointLoaded: async function (engineInitializer) {
|
|
60
60
|
loading.classList.add('main_done');
|
|
@@ -3,7 +3,7 @@ const MANIFEST = 'flutter-app-manifest';
|
|
|
3
3
|
const TEMP = 'flutter-temp-cache';
|
|
4
4
|
const CACHE_NAME = 'flutter-app-cache';
|
|
5
5
|
|
|
6
|
-
const RESOURCES = {"main.dart.js": "
|
|
6
|
+
const RESOURCES = {"main.dart.js": "9124a0753f364dd1c56c25b99f1858e5",
|
|
7
7
|
"manifest.json": "58765f937ba0d0c40a3a714c5c1adb87",
|
|
8
8
|
"python-worker.js": "26eb131f3acb5ce232fea72da957e8ce",
|
|
9
9
|
"canvaskit/skwasm.wasm": "39dd80367a4e71582d234948adc521c0",
|
|
@@ -15,8 +15,8 @@ const RESOURCES = {"main.dart.js": "fc019fe7228983fd2f9f7bc257c16a8b",
|
|
|
15
15
|
"canvaskit/skwasm.js.symbols": "e72c79950c8a8483d826a7f0560573a1",
|
|
16
16
|
"canvaskit/canvaskit.js": "728b2d477d9b8c14593d4f9b82b484f3",
|
|
17
17
|
"canvaskit/canvaskit.wasm": "7a3f4ae7d65fc1de6a6e7ddd3224bc93",
|
|
18
|
-
"flutter_bootstrap.js": "
|
|
19
|
-
"main.dart.wasm": "
|
|
18
|
+
"flutter_bootstrap.js": "0b0944abe70be9327f672e6497e8b05e",
|
|
19
|
+
"main.dart.wasm": "c5171795a7d5724e44f823873fb82c5c",
|
|
20
20
|
"favicon.png": "302ac04c14db027d016d1fe74c6a80a0",
|
|
21
21
|
"flutter.js": "83d881c1dbb6d6bcd6b42e274605b69c",
|
|
22
22
|
"index.html": "55e4a5140b3c5f98b694331a15299630",
|
|
@@ -41,7 +41,7 @@ const RESOURCES = {"main.dart.js": "fc019fe7228983fd2f9f7bc257c16a8b",
|
|
|
41
41
|
"icons/icon-maskable-192.png": "c1c2210feeb444cf800a5ce0d06eff16",
|
|
42
42
|
"icons/loading-animation.png": "41a96047dbd2463a50c46ad3bf6ff158",
|
|
43
43
|
"icons/icon-maskable-512.png": "aa798e6d780ff109da17c3a98d5f2619",
|
|
44
|
-
"main.dart.mjs": "
|
|
44
|
+
"main.dart.mjs": "44b4c76f7cb2aea74da37ee8aa60446c",
|
|
45
45
|
"python.js": "352c5261eadd3cc73ac082984266c0fc",
|
|
46
46
|
"version.json": "3fea9d9c7b4ca6955aa03e762e0d2e13"};
|
|
47
47
|
// The application shell files that are downloaded before a service worker can
|