Flet-Easy changelog¶
v0.3.0.dev26 (../05/26)¶
Package Reorganization: Restructured the
flet-easypackage into logical subpackages (core/,security/,ui/) to improve maintainability, while preserving 100% backward compatibility for existing imports.Core Refactoring: Refactored
fletEasy.pyintocore/app.py, extracting route-building logic, removing duplicate execution paths, and simplifying middleware handling.compatibility with
flet >= 0.27.*(see flet-easy/issues/51)compatibility with
flet >= 0.80.*witch change the api. (see flet-easy/issues/51)Optimize routes loading and middleware execution (#40)
Fix for compatibility with Python 3.9 (#47)
Improved and fixed error response when JWT libraries are not installed.
Improved error handling for
login,login_async,decode, anddecode_asyncmethods inDatasy. (#50)
New features¶
Support for rendering new Flet Declarative UI Components (
@ft.component) as native routes, bridging URL parameters andDatasyseamlessly into declarative objects. (see #51) [Docs] - [Docs]Add support for using
@ft.componentgracefully directly on thebuild()method of class-based views.Flet-Easywill automatically instantiate the class and inject theself.dataproperty, removing the need for an explicit__init__(self, data: fs.Datasy). [Docs]Backwards Compatibility: Class-based views can now optionally define parameters in their
buildmethod, such asdef build(self, data: fs.Datasy):. The router will dynamically inspect the signature and passdataand URL parameters if expected, makingdatatruly optional while preserving compatibility with older codebases.Add support for the middleware class in the add_middleware method of
FletEasy. (#38) [Docs]Add support for the middleware class in the add_middleware method of
AddPagesy. (#38) [Docs]Enhanced Page Return Support: Greatly expanded the range of supported return types from
@app.page-decorated functions and classes. Whileft.Viewremains recommended,flet-easynow automatically manages and wraps the following:ft.Textlist[ft.Control]str(automatically wrapped inft.Text)Classwith abuild()methodDeclarative Flet Components (
@ft.component)Flexible Page Signatures: The
data: fs.Datasyparameter is now optional in all page functions and classbuild()methods.
Pagesy¶
index: Define the index of the page, use in controls likeft.NavigationBarandft.CupertinoNavigationBar. (#41) [Docs]cache: Boolean that preserves page state when navigating. Controls retain their values instead of resetting. (Optional) (#39) [Docs]
Datasy (data)¶
New methods¶
page_reload(): Use this method to reload the page, restores the default values of the page. (#49) [Docs]dynamic_control(): Adds dynamic control to the page, allowing real-time updates when caching is enabled on the page. (#41) [Docs]go_navigation_bar(): Handles navigation bar changes. Use this method in the on_change event of 'ft.NavigationBar' or 'ft.CupertinoNavigationBar' controls. (#41) [Docs]go_route(route: str): Use this method to navigate to a specific route. It executes directly, unlike thedata.go()method, which returns a lambda function. (#50) [Docs]decode_jwt(key): Decode JWT synchronously fromDatasy(Replacesfs.decode()). (#50) [Docs]decode_jwt_async(key): Decode JWT asynchronously — preferred inasynclogin decorators (Replacesfs.decode_async()). (#50) [Docs]login_async(key: str, value: Any, next_route: str): Use this method to create a login session asynchronously. It registers the key and value in the client's storage.confirm_pop(e: ViewPopEvent): Use this method to confirm a pop view event and seamlessly go back to the previous route in the history.
Changes in the api¶
login(key: str, value: Any, next_route: str): Thenext_routeparameter is now mandatory. This ensures an immediate and safe redirection to the specified route (e.g., dashboard) right after registering the session.go_back(): Use this method to return to the previous path. The method is executed directly without returning a lambda function. (#50) [Docs]logout(key: str, next_route: str = None): Use this method to close all sessions on all devices or on the device currently in use, which was previously configured with theloginmethod. The method executes directly without returning a lambda function. A new parameter,next_route, has also been included to redirect to a router other than the login router. (#50) [Docs]data.redirect(route: str): Use this method to redirect to a specific route. It executes directly, unlike thedata.go()method. Method added available in functions decorated with@page(...). (#50) [Docs]go(route: str): Use this method to navigate to a specific route. It returns an asynchronous lambda function, unlikego_route(), which executes directly. This method is available in functions decorated with@page(...). (#50) [Docs]data.share.set(): Starting from version0.80.*, theawaitkeyword is required as it now utilizesSharedPreferencesby default.cache: Currently supported in imperative routing; declarative routing support is not yet available.
Other changes¶
- PEP 585 Modernization: Standardized the entire codebase to use Python 3.9+ built-in generics (
dict,list,tuple), eliminating deprecation warnings and future-proofing the library. - Core Logic Consolidation: Deduplicated mission-critical methods in
router.pyand flattened the package structure for improved performance and maintainability. - Enhanced Compatibility: Implemented robust fallback mechanisms for
RouteUrlStrategy,CupertinoAppBar, andCupertinoNavigationBarto ensure 100% compatibility with Flet versions as old as 0.27.*. - Bug Fixes: Resolved critical type errors, Flet version compatibility issues,
on_errorevent logic, and declarative rendering bugs while adding safety guards for parameters and messages.
Build & Testing¶
- CI/CD Automation: Refactored
noxfile.pyto use robust native parametrization instead of error-prone runtime combinations, improving pipeline stability and test coverage granularity across different environments. - Router Tests Expansion: Created a robust test suite using Pytest covering key core functionalities:
- Routing: Route handling and view generation for both imperative functions and declarative components (
@ft.component). - Sub-routers: Proper registration and URL parameter inheritance using
AddPagesy. - Middlewares: Execution, validation, and interception logic at both global and sub-router levels.
- Datasy & SharedPreferences: Mocking and validation of session data, login flows, and shared preference interactions.
- Class-based Views: Validation of optional
dataparameter injections andbuild()method behaviors.
v0.2.9 (25/01/25)¶
Bug fixes¶
- Fix error when using login() method in async function (#34)
- Fix and improve error message in fs.decode (async) (#35)
v0.2.8 (21/12/24)¶
- Support for
Flet>=0.25.*. - Switching to
uvas package manager. - New methods to initialize and obtain by the application. (#33) [Docs]
- Update of the tests code for flet 0.25.*
v0.2.7 (29/10/24)¶
- Fix error in non-dynamic routing. (#30) [Docs]
- Add page without creating an instance of
AddPagesyclass. (#31)
0.2.6 (19/10/24)¶
0.2.4 (03/09/24)¶
⚡The speed of the router is improved to more than twice as fast. (#20)
Ruff configuration update (>=0.4.4) (#22)
Bug fixes found in previous changes.
Changes in the api:¶
New method added in Datasy (data) [Doc]
history_routes: Get the history of the routes.go_back: Method to go back to the previous route.
Note¶
- Now
page.go()anddata.go()work similarly to go to a page (View), the only difference is thatdata.go()checks for url redirects when usingdata.redirect(). - The 'clear' parameter of
Pagesyand thepagedecorator is deprecated, it will be removed in future versions.
0.2.2 (04/05/24)¶
- Fix sensitivity in url with capital letters (#15)
- Fix 'back' button in dashboard page app bar not working (#18)
- Fix error caused by
Timeout waiting invokeMethod(#19)
0.2.1 (25/04/24)¶
- Fix page loading twice (#14)
0.2.0 (17/04/24)¶
Optimize code for flet >0.21 (#4)
Fix async.
Add
JWTsupport for authentication sessions in the data parameter (#6) DocsAdd a
Clito create a project structure based on the MVC design pattern (#7) DocsAdd more simplified Ref control (commit)
Enhanced Documentation (commit)
Ruff Integration (commit)
Changes in the api:
The
asyncmethods have been removed, as they are not necessary.Change
update_loginmethod tologinof Datasy. (Docs)Change
logautmethod tologoutof Datasy. (Docs)Changed function parameter decorated on
login|(page:ft.Page -> data:fs:Datasy)(Docs)Changed function parameter decorated on
config_event_handler|(page:ft.Page -> data:fs:Datasy)(Docs)
0.1.3 (11/03/2024)¶
- Flet installation is required to use Flet-Easy.
- Fixed error when running the application with flet 0.21 (#3).
- Fixed packing when compiling an apk (#2).
0.1.1 (31/01/2024)¶
- Small improvements in the code and documentation.
- Parameter
proctect_routechanged toprotected_routeofpagedecorator (Docs) - Added functionality to share data between pages in a more controlled way (Docs)
- Added a more ordered documentation (Docs)
0.1.0¶
Initial commit