Skip to content

Commit

Permalink
release 1.8
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Scherf <[email protected]>
  • Loading branch information
fscherf committed Nov 11, 2021
1 parent 64941fb commit 3db0828
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 10 deletions.
70 changes: 70 additions & 0 deletions doc/content/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,76 @@ search_index_weight: -10
Changelog
=========

.. changelog-header:: 1.8 (2021-11-11)


Breaking Changes
~~~~~~~~~~~~~~~~

* ``LonaView.on_shutdown`` was removed

* ``LonaView.on_shutdown`` is deprecated and got replaced by
``LonaView.on_stop`` and ``LonaView.on_cleanup``

* ``LonaView.iter_objects`` was removed

* ``LonaView.iter_objects`` is deprecated and got replaced by
view events

* ``LonaView.embed_shell`` and ``server.embed_shell`` were removed

* ``embed_shell`` never worked like an end-user would expect, because it
always runs in it's own scope, and not in the scope of the caller of the
method. The better way to do this is to use rlpython directly


Changes
~~~~~~~

* HTML

* ``lona.html.NumberInput`` was added
* ``lona.html.NodeList.index`` was added
* ``lona.html.NodeList.extend`` was added
* ``lona.html.HTML.index`` was added
* ``lona.html.HTML.extend`` was added

* Routing

* Route names are unique now. If a name gets reused a warning gets logged

* Views

* Support for binary responses was added to non-interactive views
* Support for custom HTTP headers was added to non-interactive views


Bugfixes
~~~~~~~~

* Client

* Scrolling issues were fixed

* Previously when the HTML of a view was scrolled down and a new view
started, the HTML of the new view started scrolled to the previous scroll
position. This only happened if a ``height`` CSS role was applied to the
body or the Lona window.

* Routing

* Handling of optional trailing slashes was fixed

* Previously routes that ended with an argument and an optional slash
(``Route('/foo/<bar>(/)')``) couldn't be routed or reverse matched

* The first argument of ``Server.reverse`` was changed from ``name`` to
``route_name``

* Previously routes with an argument named ``name`` couldn't be reverse
matched because of this naming clash


.. changelog-header:: 1.7.6 (2021-11-01)


Expand Down
4 changes: 4 additions & 0 deletions doc/content/end-user-documentation/debugging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ gets handled.
Lona Shell
----------

.. note::

``LonaView.embed_shell`` and ``server.embed_shell`` were removed in 1.8.

The Lona shell is based on `rlpython <https://pypi.org/project/rlpython/>`_ and
can be started directly from the server process using ``--shell``, when using
script using ``app.run(shell=True)`` and a shell server and can be embedded
Expand Down
4 changes: 4 additions & 0 deletions doc/content/end-user-documentation/html.rst
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,10 @@ in reactive programming.
NumberInput
+++++++++++
.. note::
Added in 1.8
.. code-block:: python
from lona.html import NumberInput
Expand Down
42 changes: 33 additions & 9 deletions doc/content/end-user-documentation/views.rst
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ Binary Responses

.. note::

Binary responses are only available in non interactive views
* Binary responses are only available in non interactive views
* Added in 1.8

.. code-block:: python
Expand All @@ -366,7 +367,8 @@ Custom Headers

.. note::

Custom headers are only available in non interactive views
* Custom headers are only available in non interactive views
* Added in 1.8

.. code-block:: python
Expand All @@ -390,6 +392,7 @@ View Hooks

* ``LonaView.on_stop()`` was added in 1.7.4
* ``LonaView.on_cleanup()`` was added in 1.7.4
* ``LonaView.on_shutdown()`` was removed in 1.8

All entry points for user code in Lona views are callbacks in the ``LonaView``
class. If a hook name starts with ``handle_`` it means that the view can stop
Expand Down Expand Up @@ -433,6 +436,8 @@ browser URL.
pass
def on_shutdown(self, reason):
# this hook got removed in 1.8
pass
Expand Down Expand Up @@ -505,10 +510,9 @@ the server.
LonaView.on_shutdown\(reason\)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. warning::
.. note::

``LonaView.on_shutdown()`` is deprecated and will be removed in 1.8.
Use `LonaView.on_stop() <#lonaview-on-stop-reason>`_ instead.
Removed in 1.8

This hook gets called after the view is stopped. The stop reason is ``None``
if the view finished normally or contains a ``lona.exceptions.ServerStop`` or
Expand Down Expand Up @@ -995,11 +999,9 @@ LonaView.daemonize\(\)
LonaView.iter_objects\(\)
~~~~~~~~~~~~~~~~~~~~~~~~~

.. warning::

``LonaView.iter_objects()`` is deprecated and will be removed in 1.8.
Use `view events <#view-events>`_ instead.
.. note::

Removed in 1.8

Returns a generator over all objects of the view class. This is useful
to build multi user views.
Expand Down Expand Up @@ -1089,6 +1091,15 @@ LonaView.await_sync\(awaitable\)
LonaView.embed_shell\(\)
~~~~~~~~~~~~~~~~~~~~~~~~

.. note::

Removed in 1.8. Use rlpython directly instead.

.. code-block:: python
import rlpython
rlpython.embed()
Embeds a `rlpython <https://pypi.org/project/rlpython/>`_ based shell.
More info on shells:
`Debugging </end-user-documentation/debugging.html>`_.
Expand Down Expand Up @@ -1151,6 +1162,10 @@ Server.get_view_class\(route=None, import_string=None, url=None\)
Server.reverse\(route_name, \*\*url_args\)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. note::

The argument ``name`` was renamed to ``route_name`` in 1.8

Returns a routing reverse match as string.


Expand Down Expand Up @@ -1186,6 +1201,15 @@ Server.fire_view_event\(name, data=None, view_classes=None\)
Server.embed_shell\(\)
~~~~~~~~~~~~~~~~~~~~~~

.. note::

Removed in 1.8. Use rlpython directly instead.

.. code-block:: python
import rlpython
rlpython.embed()
Embeds a `rlpython <https://pypi.org/project/rlpython/>`_ based shell in
the server context.
More info on shells:
Expand Down
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 @@

pass

VERSION = (1, 7, 6)
VERSION = (1, 8)
VERSION_STRING = '.'.join(str(i) for i in VERSION)

0 comments on commit 3db0828

Please sign in to comment.