Skip to content

Commit

Permalink
release 1.14
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Scherf <[email protected]>
  • Loading branch information
fscherf committed May 22, 2023
1 parent 6c52b54 commit 93688b2
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 4 deletions.
4 changes: 4 additions & 0 deletions doc/content/api-reference/channels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Channels
========

.. note::

Added in 1.14

Lona channels facilitate soft real-time communication between different
components of the server side of your application by implementing a
straightforward publish/subscribe system. They provide a means to exchange
Expand Down
4 changes: 4 additions & 0 deletions doc/content/api-reference/server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ Server.reverse()
Server.fire_view_event()
~~~~~~~~~~~~~~~~~~~~~~~~

.. note::

Deprecated since 1.14. Use Channels instead

.. note::

Added in 1.7.3
Expand Down
11 changes: 11 additions & 0 deletions doc/content/api-reference/views.rst
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,9 @@ browser URL.
return input_event
def on_view_event(self, view_event):
# deprecated since 1.14
# use Channels instead
pass
def on_stop(self, reason):
Expand Down Expand Up @@ -673,6 +676,10 @@ This hook is gets called for every input event that is not awaited in
LonaView.on_view_event\(view_event\)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. note::

View events are deprecated since 1.14. Use Channels instead.

This hook gets called for every incoming `view event <#view-events>`_.


Expand Down Expand Up @@ -1431,6 +1438,10 @@ LonaView.iter_objects\(\)
LonaView.fire_view_event\(name, data=None\)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. note::

View events are deprecated since 1.14. Use Channels instead.

.. note::

Added in 1.7.3
Expand Down
95 changes: 94 additions & 1 deletion doc/content/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,99 @@ is_template: False
Changelog
=========

.. changelog-header:: 1.14 (2023-05-22)

Changes
~~~~~~~

* Templates

* Support for favicons was added to the default frontend template
``lona/frontend.html``

* HTML

* Performance of ``Node.append()`` was improved

* Previously, ``Node.append()`` used ``NodeList.index()`` internally,
which called ``Node._serialize()`` which is an expensive operation.

``Node.append()`` now calculates the index of the appended node itself,
which is much faster.

* Performance of ``Node.__eq__()`` was improved

* Previously, ``Node.__eq__()`` used ``Node._serialize()`` which is an
expensive operation. Now ``Node.__eq__()`` checks all attributes of two
nodes individually, trying to find a difference as soon as possible.

* ``Node.tag_name`` and ``Node.widget`` are read-only now

* Re-writing of these properties was never supported, so it should not be
possible to write them, to prevent confusion.

* State

* ``State.to_json()`` was added

* Sessions

* ``SESSIONS_REUSE`` setting was added

* When set to ``False`` the session middleware will create a random session
key for every new connection. This is useful for debugging multi-user
views.

* Client 1&2

* Support for reconnecting without creating a window was added

* Previously, when implementing auto-reconnect, the client would reopen the
websocket connection, and in the case of success reload the tab. This
reload is crucial to ensure a connect and a reconnect result in the same
user experience, but has the side effect of accessing the same view
twice. This created problems when debugging or reading the server logs.

To account for that, the option ``create_window`` was added to
``LonaContext.reconnect()``, which is set to ``true`` by default.

* Channels

* Channels were added

* Channels are the successor to View Events, and are the new mechanism for
soft real-time communication and multi-user features.

* Views

* View Events are deprecated now in favor of Channels


Bugfixes
~~~~~~~~

* Client 1&2

* Index of inserted nodes was fixed

* Previously, the rendering engine used ``Element.children`` to insert
newly rendered nodes. This only works correctly when the target node only
contains elements and no text nodes, because ``Element.children`` only
contains references to child elements, in contrast to
``Element.childNodes`` which contains child elements and child text
nodes. The usage of only this subset of nodes lead to incorrect indices,
and nodes ending up in wrong order, in some cases.

* Client 2

* Crashes while rendering node list slices were fixed

* Previously, the rendering engine could crash when a slice of
``Node.nodes`` was re-rendered. This was due incorrect node cache
cleaning on the client, and was fixed by cleaning the cache after every
node-reset-operation.


.. changelog-header:: 1.13 (2023-04-01)

Changes
Expand Down Expand Up @@ -1568,4 +1661,4 @@ Bugfixes

.. changelog-header:: 1.0 (2021-08-09)

Initial stable release
Initial stable release
2 changes: 1 addition & 1 deletion doc/content/demos/daemonized-view/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ Source code
-----------

.. code-block:: python
:include: daemonized-view.py
:include: daemonized-view.py
2 changes: 1 addition & 1 deletion lona/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
from .view import View
from .app import App

VERSION = (1, 13)
VERSION = (1, 14)
VERSION_STRING = '.'.join(str(i) for i in VERSION)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"


[project]
version = "1.13"
version = "1.14"
name = "lona"
description = "Write responsive web apps in full python"

Expand Down

0 comments on commit 93688b2

Please sign in to comment.