Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce API to build Single Page Applications (SPAs) #2811

Draft
wants to merge 96 commits into
base: main
Choose a base branch
from

Commits on Apr 3, 2024

  1. Per client data

    Michael Ikemann authored and Alyxion committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    d3b35ae View commit details
    Browse the repository at this point in the history
  2. Per client data

    Michael Ikemann authored and Alyxion committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    ef97d2e View commit details
    Browse the repository at this point in the history
  3. Backup single page routing

    Michael Ikemann authored and Alyxion committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    91887a1 View commit details
    Browse the repository at this point in the history
  4. Removed <div> nesting from sample app

    Michael Ikemann authored and Alyxion committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    3307281 View commit details
    Browse the repository at this point in the history
  5. Intermediate backup, per-session user-auth

    Michael Ikemann authored and Alyxion committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    2c7f680 View commit details
    Browse the repository at this point in the history
  6. Functional single page app login screen.

    Integrated single page app into Client.open so navigation to SPA pages is redirected.
    Fixed bug with forward and backwards navigation between SPA pages.
    Collecting data from original pages to able to apply the original page title.
    Michael Ikemann authored and Alyxion committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    7ff4728 View commit details
    Browse the repository at this point in the history
  7. Functional single page app login screen.

    Integrated single page app into Client.open so navigation to SPA pages is redirected.
    Fixed bug with forward and backwards navigation between SPA pages.
    Collecting data from original pages to able to apply the original page title.
    Michael Ikemann authored and Alyxion committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    969a2d2 View commit details
    Browse the repository at this point in the history
  8. Added additional pages to the session_storage demo

    Fixed a bug which could occur when open was called before the UI was set up
    Michael Ikemann authored and Alyxion committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    b9005ee View commit details
    Browse the repository at this point in the history
  9. Reverting PyCharm formatting

    Michael Ikemann authored and Alyxion committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    b3d73f1 View commit details
    Browse the repository at this point in the history
  10. Made single-page multi-user rdy

    Michael Ikemann authored and Alyxion committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    241215a View commit details
    Browse the repository at this point in the history
  11. Removed method decoration and replaced it with additional page_config…

    …s registry in Client.
    
    General clean-up
    Added titles to sample app
    Added docu to SPA
    Alyxion committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    13f29ac View commit details
    Browse the repository at this point in the history
  12. * Refactored the SinglePageRouter to give the user more control over …

    …the structure of the root page, the possibility to override the class and implement custom routing and to react to the creation of sessions.
    
    * Added samples for the single page router
    * Refactored the Login sample with the new possibilities and making use of Pydantic as an example for a cleaner code base
    Alyxion committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    21005e1 View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2024

  1. Implemented app.storage.session which enables the user to store data …

    …in the current Client instance - which in practice means "per browser tab".
    Alyxion committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    db6b065 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d9403b4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    eabe01a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1ed5620 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e2e2006 View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2024

  1. Replaced Client.state by ObservableDict

    Moved context import to top of the file
    Alyxion committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    3fedd36 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8fc9208 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8ecb6f5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a39e54c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    89a39d4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    664a25d View commit details
    Browse the repository at this point in the history
  7. Fixed doc.

    Allowed the Single Page App content root as parent for top level elements such as header, footer etc.
    Alyxion committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    ab67606 View commit details
    Browse the repository at this point in the history
  8. Added page not found handling, still needs a bit more love though to …

    …show the real 404 page.
    Alyxion committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    fac0356 View commit details
    Browse the repository at this point in the history
  9. Added more fine granular definition of which pages are included in th…

    …e SPA with inclusion and exclusion masks.
    
    Added the possibility to disable the browser history completely for the SPA if desired.
    Added a sample to the advanced spa demo which excludes onw page from the SPA but shares the same layout.
    Alyxion committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    0c72d16 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a4fe9cc View commit details
    Browse the repository at this point in the history

Commits on Apr 6, 2024

  1. Renamed app.storage.session to app.storage.client.

    Adjusted documentation of app.storage.client.
    Alyxion committed Apr 6, 2024
    Configuration menu
    Copy the full SHA
    ea8dad5 View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'origin/feature/per_session_data' into f…

    …eature/per_session_data
    Alyxion committed Apr 6, 2024
    Configuration menu
    Copy the full SHA
    e627934 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cf21786 View commit details
    Browse the repository at this point in the history
  4. Added support for fragments / hashes. Further refinements

    * Added support for "jump marks" / fragments / hashes in single page application. You can now follow references within a single page and also open a SPA page directly at a passed hash.
    * Refactored the URL parsing to make it more flexible for real URL and callable targets
    * Added a dedicated single_page_content property to the Client class
    * Fixed a bug which was triggered when moving from a non SPA page to an SPA page
    Alyxion committed Apr 6, 2024
    Configuration menu
    Copy the full SHA
    84bc6ce View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    36f3b80 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6699041 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    30a87e3 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a923f34 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    efcee63 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f50f469 View commit details
    Browse the repository at this point in the history
  11. Cleaned client and storage class

    Refactored naming and doc in single_page.py
    Alyxion committed Apr 6, 2024
    Configuration menu
    Copy the full SHA
    87e83b5 View commit details
    Browse the repository at this point in the history
  12. Fixed double quotes

    Alyxion committed Apr 6, 2024
    Configuration menu
    Copy the full SHA
    2cf5058 View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2024

  1. Merge remote-tracking branch 'nicegui/main' into feature/client_data

    # Conflicts:
    #	nicegui/client.py
    Alyxion committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    f4698f9 View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2024

  1. Splitting reload functionality into separate RouterFrame class respon…

    …sible for async building
    
    Added outlet and outlet view class
    Alyxion committed Apr 14, 2024
    Configuration menu
    Copy the full SHA
    215e493 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3167521 View commit details
    Browse the repository at this point in the history
  3. Preparing nested outlets

    Alyxion committed Apr 14, 2024
    Configuration menu
    Copy the full SHA
    75a5e53 View commit details
    Browse the repository at this point in the history
  4. Preparing nested outlets

    Alyxion committed Apr 14, 2024
    Configuration menu
    Copy the full SHA
    4b989d9 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2024

  1. Nested outlets are working in general now.

    Parent SPRs and parent RouteFrames know now about active children and can respect their sub routes accordingly.
    Open bug: Both the main and the sub routers react to / routes, only one of both should though.
    Alyxion committed May 1, 2024
    Configuration menu
    Copy the full SHA
    9f685fa View commit details
    Browse the repository at this point in the history

Commits on May 3, 2024

  1. router_Frame.js event handlers are now removed upon unmount - this fi…

    …xed the bug that the state was pushed to the history twice.
    
    TODO: If two outlets share the same root path, e.g. / and /spa2, the rf / will still intercept navigation to /spa2.
    Alyxion committed May 3, 2024
    Configuration menu
    Copy the full SHA
    d5a9009 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ef5ab9d View commit details
    Browse the repository at this point in the history
  3. Fixed SinglePageApp and advanced demo to also allow the upgrade of cl…

    …assical, page based apps to SPAs
    
    Added OutletViews as possible targets of the link class
    RoutingFrame can now also explicitly ignore certain paths
    Bugfix: Title is now changed again on SPA navigation
    WIP: Recursive URL target resolving upon first load
    Alyxion committed May 3, 2024
    Configuration menu
    Copy the full SHA
    07d9a3a View commit details
    Browse the repository at this point in the history
  4. Fixed support for fragment targets

    Made it possible to directly jump into nested pages
    Added the possibility to pass the FastAPI request data into the builder function
    Alyxion committed May 3, 2024
    Configuration menu
    Copy the full SHA
    ab5dad5 View commit details
    Browse the repository at this point in the history

Commits on May 4, 2024

  1. Added Page Not Found fallback if an invalid SPA route is taken

    The initial page build is now synchronous with the integration of the RouterFrame to prevent ugly progressive page updates on the initial site visit.
    Alyxion committed May 4, 2024
    Configuration menu
    Copy the full SHA
    4f54ce1 View commit details
    Browse the repository at this point in the history

Commits on May 10, 2024

  1. Parameterizable outlets

    * Created enhanced outlet demo
    * Made it possible to yield variables from outlets and to pass them to nested views and outlets
    * Fixed bug which caused complex hyperlinks affecting a whole div not being catched by the SPA link handler
    * It is now possible to make use of path variables in outlets and views
    * Type correctness for variables passed via path is now only
    enforced if the user defined a type at all
    Alyxion committed May 10, 2024
    Configuration menu
    Copy the full SHA
    b4dd186 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cb28497 View commit details
    Browse the repository at this point in the history
  3. Enhanced Outlet demo

    Added the possibility to access the current RouterFrame from every view and nested outlet builder method
    Passed url_path to outlet builder methods
    Alyxion committed May 10, 2024
    Configuration menu
    Copy the full SHA
    33193fe View commit details
    Browse the repository at this point in the history
  4. Cleaned outlet demo

    Alyxion committed May 10, 2024
    Configuration menu
    Copy the full SHA
    e2bccee View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    aa81849 View commit details
    Browse the repository at this point in the history
  6. Clean up.

    Fixed SinglePageApp demos.
    Alyxion committed May 10, 2024
    Configuration menu
    Copy the full SHA
    04be96a View commit details
    Browse the repository at this point in the history
  7. Fixed quotes.

    Alyxion committed May 10, 2024
    Configuration menu
    Copy the full SHA
    a112465 View commit details
    Browse the repository at this point in the history

Commits on May 11, 2024

  1. Renamed the SinglePageRouter to SinglePageRouterConfig to emphasize i…

    …t is a singleton, static object created and configured once.
    Alyxion committed May 11, 2024
    Configuration menu
    Copy the full SHA
    3e5f2c2 View commit details
    Browse the repository at this point in the history
  2. Massive refactoring:

    * Split the functionality of the RouterFrame into RouterFrame (just element related UI update logic) and SinglePageRouter (a per page/per user instance managing the actual routing)
    * Renamed the old SinglePageRouter to SinglePageRouterConfig
    * Removed router specific elements from the SinglePageTarget to also make it usable purely with a target builder function and a title (and later favicon etc)
    Alyxion committed May 11, 2024
    Configuration menu
    Copy the full SHA
    36875ac View commit details
    Browse the repository at this point in the history
  3. Added on_resolve to outlet.view which is called when ever a view is s…

    …elected.
    
    The on_resolve method allows overriding the selected target parge and changing it's title.
    Alyxion committed May 11, 2024
    Configuration menu
    Copy the full SHA
    b49d0c0 View commit details
    Browse the repository at this point in the history
  4. * Added completely served side handled browser history

    * Preparation for more detailed event handling on resolving and navigating to SPA pages
    Alyxion committed May 11, 2024
    Configuration menu
    Copy the full SHA
    1fe8a96 View commit details
    Browse the repository at this point in the history

Commits on May 12, 2024

  1. * Added post- and pre-update callback in SinglePageTarget to execute …

    …specific commands when an SPA content as exchanged
    
    * Added on_resolve, on_navigate and on_open events to the Outlet class to enable it to intercept and/or redirect or update certain pages change
    * Add on_resolve, on_navigate and on_open to SinglePageRouter, allowing the user to define these events just for specific instances
    * Bugfix: Title updated twice on an SPA page change sometimes. It is ensured now that the title is only update by views changes.
    * BugFix: For Outlets with path variables always the whole hierarchy was rebuilt on ever page change. This is fixed now.
    Alyxion committed May 12, 2024
    Configuration menu
    Copy the full SHA
    1823110 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cfd6478 View commit details
    Browse the repository at this point in the history
  3. * Added focus to Input class

    * Added Login outlet demo
    Alyxion committed May 12, 2024
    Configuration menu
    Copy the full SHA
    4c8eb01 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    70660e5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c3a3edb View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2024

  1. Configuration menu
    Copy the full SHA
    e44edaa View commit details
    Browse the repository at this point in the history
  2. Removed SinglePageApp class and associated examples

    Renamed Cloud demo to single_page_app_complex
    Alyxion committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    94eed81 View commit details
    Browse the repository at this point in the history
  3. * Removed on_resolve and on_open events from outlet and SinglePageRou…

    …terConfig
    
    * Extended on_navigate so it can also return SinglePageTargets
    Alyxion committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    8f61006 View commit details
    Browse the repository at this point in the history
  4. Updated authentication demo

    Alyxion committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    bb786f0 View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2024

  1. Enhanced SinglePageRouter by the possibility to define dynamic views …

    …as object methods to enable to user to develop object oriented NiceGUI apps.
    Alyxion committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    4a49846 View commit details
    Browse the repository at this point in the history
  2. Refined OOP example

    Alyxion committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    76cf840 View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2024

  1. Refactoring

    Alyxion committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    8a6c805 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    80cdb09 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2024

  1. Configuration menu
    Copy the full SHA
    b679a58 View commit details
    Browse the repository at this point in the history
  2. organized imports

    rodja committed Jun 22, 2024
    Configuration menu
    Copy the full SHA
    1e71e65 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    36a8a8f View commit details
    Browse the repository at this point in the history
  4. fixed storage access

    rodja committed Jun 22, 2024
    Configuration menu
    Copy the full SHA
    a83e14f View commit details
    Browse the repository at this point in the history
  5. cleanup and better titles

    rodja committed Jun 22, 2024
    Configuration menu
    Copy the full SHA
    ce92506 View commit details
    Browse the repository at this point in the history
  6. organized imports

    rodja committed Jun 22, 2024
    Configuration menu
    Copy the full SHA
    3344bf0 View commit details
    Browse the repository at this point in the history
  7. fix indentation

    rodja committed Jun 22, 2024
    Configuration menu
    Copy the full SHA
    baea9e1 View commit details
    Browse the repository at this point in the history
  8. clear whole storage

    rodja committed Jun 22, 2024
    Configuration menu
    Copy the full SHA
    3471c1c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    c1d700d View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2024

  1. formatting

    rodja committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    64d948b View commit details
    Browse the repository at this point in the history
  2. renaming and clarification

    rodja committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    aa0226a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3bfd3c8 View commit details
    Browse the repository at this point in the history
  4. improve naming and typing

    rodja committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    9c4526f View commit details
    Browse the repository at this point in the history
  5. docstring

    rodja committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    d40c984 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9678c89 View commit details
    Browse the repository at this point in the history
  7. better naming

    rodja committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    ae71e4b View commit details
    Browse the repository at this point in the history
  8. resolve cyclic dependencies

    rodja committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    d9ee01f View commit details
    Browse the repository at this point in the history
  9. improve naming and typing

    rodja committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    d3c901f View commit details
    Browse the repository at this point in the history
  10. fix docstring

    rodja committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    e710c50 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    b16d992 View commit details
    Browse the repository at this point in the history
  12. clarification

    rodja committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    340bfd1 View commit details
    Browse the repository at this point in the history
  13. renaming

    rodja committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    d1b955c View commit details
    Browse the repository at this point in the history