Skip to content

Commit

Permalink
Release (version 1.2.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamsbrar committed Aug 5, 2022
1 parent db6a475 commit d209b05
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 12 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
## 1.2.0

**RenderEvents**, *a event system for RenderElements*.

RenderEvents are the events that framework will emit when it interacts with a RenderElement. Just like we can add event listeners for user interactions on DOM elements, we can now add event listeners for framework interactions on RenderElements. Similar to DOM events, we've different types of RenderEvents for different types of interactions which are listed below:

- `didRender` is a event that's emitted after framework finishes rendering the output of [render](https://pub.dev/documentation/rad/latest/rad/RenderElement/render.html) to the DOM.
- `didUpdate` is a event that's emitted after framework finishes rendering the output of [update](https://pub.dev/documentation/rad/latest/rad/RenderElement/update.html) to the DOM.
- `willUnMount` is a event that's emitted when framework is about to remove the widget from the DOM.
- `didUnMount` is a event that's emitted after framework finishes removing the widget from the DOM.

RenderElements can decide to listen to a particular or all render events by adding event listeners.

Comparing RenderEvents with DOM events, there are few differences & restrictions:

- RenderEvents do not have capture/bubble phase.
- RenderEvents are meant to be listened internally inside RenderElements.
- Listeners for RenderEvents can be attached only during initial render, and cannot be updated.

These restrictions are temporary and we'll lift them when needed.

RenderEvents are meant to solve the problem of limited control over lifecycle in RenderElements. Previously we were providing a sub-class `WatchfulRenderElement` with hardcoded lifecycle. Now, using the new RenderEvents API, you can add as much or as little lifecycle as you want, to any RenderElement(widget). This new API effectively makes `WatchfulRenderElement` obsolete but we'll keep it for backward compatibility at zero-cost(it's also using the new RenderEvents API from now on).

#### Bug fixes

- (Fixed) Renderer reconciling all sibling widgets on dependent updates(sometime disposing siblings because of that).

## 1.1.0

#### Added following lifecycle methods to [`State`](https://pub.dev/documentation/rad/latest/rad/State-class.html):
Expand Down
2 changes: 1 addition & 1 deletion doc/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- Open `pubspec.yaml` in newly created app folder and add `rad` to your dependencies:
```yaml
dependencies:
rad: '>=1.1.0 <2.0.0'
rad: '>=1.2.0 <2.0.0'
```
3. Import Rad widgets in your `main.dart`
Expand Down
30 changes: 28 additions & 2 deletions packages/rad/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
## 1.2.0

**RenderEvents**, *a event system for RenderElements*.

RenderEvents are the events that framework will emit when it interacts with a RenderElement. Just like we can add event listeners for user interactions on DOM elements, we can now add event listeners for framework interactions on RenderElements. Similar to DOM events, we've different types of RenderEvents for different types of interactions which are listed below:

- `didRender` is a event that's emitted after framework finishes rendering the output of [render](https://pub.dev/documentation/rad/latest/rad/RenderElement/render.html) to the DOM.
- `didUpdate` is a event that's emitted after framework finishes rendering the output of [update](https://pub.dev/documentation/rad/latest/rad/RenderElement/update.html) to the DOM.
- `willUnMount` is a event that's emitted when framework is about to remove the widget from the DOM.
- `didUnMount` is a event that's emitted after framework finishes removing the widget from the DOM.

RenderElements can decide to listen to a particular or all render events by adding event listeners.

Comparing RenderEvents with DOM events, there are few differences & restrictions:

- RenderEvents do not have capture/bubble phase.
- RenderEvents are meant to be listened internally inside RenderElements.
- Listeners for RenderEvents can be attached only during initial render, and cannot be updated.

These restrictions are temporary and we'll lift them when needed.

RenderEvents are meant to solve the problem of limited control over lifecycle in RenderElements. Previously we were providing a sub-class `WatchfulRenderElement` with hardcoded lifecycle. Now, using the new RenderEvents API, you can add as much or as little lifecycle as you want, to any RenderElement(widget). This new API effectively makes `WatchfulRenderElement` obsolete but we'll keep it for backward compatibility at zero-cost(it's also using the new RenderEvents API from now on).

#### Bug fixes

- (Fixed) Renderer reconciling all sibling widgets on dependent updates(sometime disposing siblings because of that).

## 1.1.0

#### Added following lifecycle methods to [`State`](https://pub.dev/documentation/rad/latest/rad/State-class.html):
Expand Down Expand Up @@ -28,5 +55,4 @@
## 1.0.1

- Stable release.

See pre-releases prior to this version for changelog entries.
- If curious, you can checkout development [change log here](https://github.com/erlage/rad/blob/main/CHANGELOG.md).
2 changes: 1 addition & 1 deletion packages/rad/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: rad
version: 1.1.0
version: 1.2.0
description: >
A zero-dependency frontend framework for creating high-performant web apps using Dart.
Expand Down
19 changes: 11 additions & 8 deletions tool/pkg-gen-html-widgets/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# This file is kept in sync with main repo so it may not be compatible with
# published version of rad. So you've to checkout to a particular point for generating
# compatible widgets:
#
# - git checkout tags/v1.2.0 -b new-branch | for widgets compatible with Rad v1.2 & above
# - git checkout tags/v1.1.0 -b new-branch | for widgets compatible with Rad v1.1 & above
#
# - git checkout ab08947e327dabec7dcbc91f9a39ed97556df002 for widgets compatible with Rad v1.x
# - git checkout 35958c12f1abac32f299df85f1294d61abdd553e for widgets compatible with Rad v.0.10.0
#

#!/usr/bin/env python3

from fileinput import filename
Expand All @@ -16,14 +27,6 @@
__package_name__ = 'rad_custom_html_widgets'
__package_description__ = 'Custom HTML widgets for using with Rad'

# This file is kept in sync with main repo so it may not be compatible with
# published version of rad.
#
# For generating compatible HTML widgets:
#
# - git checkout ab08947e327dabec7dcbc91f9a39ed97556df002 for Rad v1.x
# - git checkout 35958c12f1abac32f299df85f1294d61abdd553e for Rad v.0.10.0
#

generator_dir = os.path.abspath(os.path.dirname(__file__))
tool_dir = os.path.abspath(os.path.join(generator_dir, os.path.pardir))
Expand Down

0 comments on commit d209b05

Please sign in to comment.