From d209b054988091495e18058323e382e8bba4d21e Mon Sep 17 00:00:00 2001 From: erlage Date: Fri, 5 Aug 2022 09:11:46 +0530 Subject: [PATCH] Release (version 1.2.0) --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ doc/getting_started.md | 2 +- packages/rad/CHANGELOG.md | 30 ++++++++++++++++++++++++++++-- packages/rad/pubspec.yaml | 2 +- tool/pkg-gen-html-widgets/gen.py | 19 +++++++++++-------- 5 files changed, 68 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1595100f..72ff461a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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): diff --git a/doc/getting_started.md b/doc/getting_started.md index 045c193b..21050a7f 100644 --- a/doc/getting_started.md +++ b/doc/getting_started.md @@ -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` diff --git a/packages/rad/CHANGELOG.md b/packages/rad/CHANGELOG.md index 544d1502..de1fed15 100644 --- a/packages/rad/CHANGELOG.md +++ b/packages/rad/CHANGELOG.md @@ -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): @@ -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). diff --git a/packages/rad/pubspec.yaml b/packages/rad/pubspec.yaml index fd9413f7..67de9925 100644 --- a/packages/rad/pubspec.yaml +++ b/packages/rad/pubspec.yaml @@ -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. diff --git a/tool/pkg-gen-html-widgets/gen.py b/tool/pkg-gen-html-widgets/gen.py index 1fcf005d..d8752ccf 100644 --- a/tool/pkg-gen-html-widgets/gen.py +++ b/tool/pkg-gen-html-widgets/gen.py @@ -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 @@ -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))