Skip to content

Commit

Permalink
Changing to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbanes committed Nov 5, 2024
1 parent 5059c43 commit 6e43880
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 23 deletions.
6 changes: 3 additions & 3 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Ignoring that though...

## Are the blur implementations the same across different platforms?

In v0.9 onwards, all platforms use the same implementation (mostly).
In v1.0 onwards, all platforms use the same implementation (mostly).

In older versions of Haze (older than v0.9), the Android implementation was always built upon [RenderNode][rendernode] and [RenderEffect][rendereffect]. In Compose 1.7.0, we now have access to new GraphicsLayer APIs, which are similar to [RenderNode][rendernode], but available in `commonMain` in Compose Multiplatform.
In older versions of Haze (older than v1.0), the Android implementation was always built upon [RenderNode][rendernode] and [RenderEffect][rendereffect]. In Compose 1.7.0, we now have access to new GraphicsLayer APIs, which are similar to [RenderNode][rendernode], but available in `commonMain` in Compose Multiplatform.

The migration to [GraphicsLayer][graphicslayer] has resulted in Haze now having a single implementation across all platforms, based on the previous Android implementation. This will help minimize platform differences, and bugs.

It goes further though. In v0.7.x and older, Haze is all 'smoke and mirrors'. It draws all of the blurred areas in the `haze` layout node. The `hazeChild` nodes just updates the size, shape, etc, which the `haze` modifier reads, to know where to draw blurred.

With the adoption of [GraphicsLayer][graphicslayer]s, we now have a way to pass 'drawn' content around, meaning that we are no longer bound by the previous restrictions. v0.9 contains a re-written drawing pipeline, where the blurred content is drawn by the `hazeChild`, not the parent. The parent `haze` is now only responsible for drawing the background content into a graphics layer, and putting it somewhere for the children to access.
With the adoption of [GraphicsLayer][graphicslayer]s, we now have a way to pass 'drawn' content around, meaning that we are no longer bound by the previous restrictions. v1.0 contains a re-written drawing pipeline, where the blurred content is drawn by the `hazeChild`, not the parent. The parent `haze` is now only responsible for drawing the background content into a graphics layer, and putting it somewhere for the children to access.

This fixes a number of long-known issues on Haze, where all were caused by the fact that the blurred area wasn't drawn by the child.

Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ You can also see it in action in the [Tivi app](https://github.com/chrisbanes/ti

## Versions

There are currently 2 different versions available: 0.7.x (stable) and 0.9.x (pre-release).
There are currently 2 different versions available: 0.7.x (stable) and 1.0.x (pre-release).

The 0.9.x release depends on Compose Multiplatform 1.7.0, currently pre-release, meaning that we need to wait for that to go
stable before Haze can go stable. The 0.9.x release also contains a near full re-write of how Haze works underneath. More information can be found on the [Migrating to 0.9](migrating-0.9.md) page.
The 1.0.x release depends on Compose Multiplatform 1.7.0, currently pre-release, meaning that we need to wait for that to go
stable before Haze can go stable. The 1.0.x release also contains a near full re-write of how Haze works underneath. More information can be found on the [Migrating to 1.0](migrating-1.0.md) page.

## Download

Expand Down
16 changes: 4 additions & 12 deletions docs/migrating-0.9.md → docs/migrating-1.0.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
The 0.9 version contains a full re-write (actually more of a refactor) of Haze. It uses Compose Mutliplatform 1.7.0 (currently pre-release), meaning that we now have access to some new and exciting APIs.

!!! warning "Should I use v0.9 pre-release?"

I think that all depends on your appetite for prerelease software. Haze itself is now much simpler than ever before, and most of the complexity is now in GraphicsLayer. On Android, we're using the latest Jetpack Compose 1.7.x stable versions. If you're only using Haze on Android, go for it.

On other platforms, Compose Multiplatform is at 1.7.0-rc01, so not stable, but nearly there.

## Changes

Here's a list of known changes in v0.9.x. There may be others, so please file issues if you encounter other unexpected changes.
Here's a list of known changes in v1.0.x. There may be others, so please file issues if you encounter other unexpected changes.

### Functional changes

Expand Down Expand Up @@ -38,7 +30,7 @@ As we're now using a common implementation on all platforms, the Skia-backed pla

#### Default style functionality on Modifier.haze has been moved

- **What:** In previous versions, there was a `style` parameter on `Modifier.haze`, which has been moved in v0.9.
- **What:** In previous versions, there was a `style` parameter on `Modifier.haze`, which has been moved in v1.0.
- **Migration:** Use the new [LocalHazeStyle](api/haze/dev.chrisbanes.haze/-local-haze-style.html) composition local instead.
- **Why:** Composition locals are used throughout styling frameworks, so this is a better API going forward.

Expand All @@ -50,7 +42,7 @@ As we're now using a common implementation on all platforms, the Skia-backed pla

## Why have these changes been made?

Below we'll go through some of the background of the changes in v0.9. You don't need to know this stuff, but it might be interesting for some.
Below we'll go through some of the background of the changes in v1.0. You don't need to know this stuff, but it might be interesting for some.

### GraphicsLayers

Expand All @@ -62,6 +54,6 @@ This has resulted in Haze now having a single implementation across all platform

In v0.7 and older, Haze is all 'smoke and mirrors'. It draws all of the blurred areas in the `haze` layout node. The `hazeChild` nodes just update the size, shape, etc, which the `haze` modifier reads, to know where to draw.

With the adoption of GraphicsLayers, we now have a way to pass 'drawn' content around, meaning that we are no longer bound by the restraints of before. v0.9 contains a re-written drawing pipeline, where the blurred content is drawn by the `hazeChild`, not the parent. The parent `haze` is now only responsible for drawing the background content into a graphics layer, and putting it somewhere for the children to access.
With the adoption of GraphicsLayers, we now have a way to pass 'drawn' content around, meaning that we are no longer bound by the restraints of before. v1.0 contains a re-written drawing pipeline, where the blurred content is drawn by the `hazeChild`, not the parent. The parent `haze` is now only responsible for drawing the background content into a graphics layer, and putting it somewhere for the children to access.

This fixes a number of long-known issues on Haze, where all were caused by the fact that the blurred area wasn't drawn by the child.
8 changes: 4 additions & 4 deletions docs/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ We currently have 4 benchmark scenarios, each of them is one of the samples in t

As with all benchmark tests, the results are only true for the exact things being tested. Using Haze in your own applications may result in different performance characteristics, so it is wise to write your own performance tests to validate the impact to your apps.

#### 0.7.3 vs 0.9.0
#### 0.7.3 vs 1.0.0

| Test | 0.7.3 | 0.9.0 | Difference |
| Test | 0.7.3 | 1.0.0 | Difference |
| ------------- | ---------- | -----------| ------------ |
| Scaffold | 6.9 ms | 6.4 ms | :material-trending-down: -7% |
| Scaffold (progressive) (SDK 32) | - | 14.8 ms | - |
| Scaffold (progressive) (SDK 34) | - | 7.9 ms | - |
| Images List | 6.9 ms | 6.8 ms | :material-trending-down: -1% |
| Credit Card | 4.9 ms | 4.7 ms | :material-trending-down: -4% |

#### 0.9.0 vs baseline
#### 1.0.0 vs baseline

We can also measure the rough cost of using Haze in the same samples. Here we've ran the same tests, but with Haze being disabled:

| Test | 0.9.0 (disabled) | 0.9.0 | Difference |
| Test | 1.0.0 (disabled) | 1.0.0 | Difference |
| ------------- | ------------------| -----------| ------------ |
| Scaffold | 4.9 ms | 6.4 ms | +31% |
| Images List | 4.6 ms | 6.8 ms | +48% |
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ SONATYPE_HOST=DEFAULT
RELEASE_SIGNING_ENABLED=true

GROUP=dev.chrisbanes.haze
VERSION_NAME=0.9.0-SNAPSHOT
VERSION_NAME=1.0.0-SNAPSHOT

POM_DESCRIPTION=Haze
POM_URL=https://github.com/chrisbanes/haze/
Expand Down

0 comments on commit 6e43880

Please sign in to comment.