Skip to content

Commit

Permalink
create release 0.14.1 (#380)
Browse files Browse the repository at this point in the history
PR-URL: #380
  • Loading branch information
RBusarow authored Nov 6, 2021
1 parent e08f683 commit 967e9d5
Show file tree
Hide file tree
Showing 20 changed files with 1,393 additions and 30 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# 0.14.1

### 🐛 Bug Fixes

- update Anvil to 2.3.8 ([#379](https://github.com/rbusarow/Tangle/pull/379))
- remove inferred nullability for `TangleViewModelFactory.create` ([#378](https://github.com/rbusarow/Tangle/pull/378))

### 🧰 Maintenance

- Bump activity-ktx from 1.3.1 to 1.4.0 ([#372](https://github.com/rbusarow/Tangle/pull/372))
- Bump navigation-ui-ktx from 2.4.0-alpha10 to 2.4.0-beta01 ([#371](https://github.com/rbusarow/Tangle/pull/371))
- Bump auto-common from 1.1.2 to 1.2 ([#364](https://github.com/rbusarow/Tangle/pull/364))
- Bump room-compiler from 2.4.0-alpha04 to 2.4.0-alpha05 ([#357](https://github.com/rbusarow/Tangle/pull/357))
- Bump prismjs from 1.24.1 to 1.25.0 in /website ([#363](https://github.com/rbusarow/Tangle/pull/363))
- Bump axios from 0.21.1 to 0.21.4 in /website ([#362](https://github.com/rbusarow/Tangle/pull/362))

# 0.14.0

### 🐛 Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ kotlin.incremental=true

# Maven
GROUP=com.rickbusarow.tangle
VERSION_NAME=0.14.0
VERSION_NAME=0.14.1
POM_DESCRIPTION=Android dependency injection using Anvil
POM_INCEPTION_YEAR=2021
POM_URL=https://github.com/rbusarow/Tangle
Expand Down
36 changes: 18 additions & 18 deletions website/docs/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ plugins {
dependencies {

// Fragments
api("com.rickbusarow.tangle:tangle-fragment-api:0.14.0")
anvil("com.rickbusarow.tangle:tangle-fragment-compiler:0.14.0")
api("com.rickbusarow.tangle:tangle-fragment-api:0.14.1")
anvil("com.rickbusarow.tangle:tangle-fragment-compiler:0.14.1")

// ViewModels
api("com.rickbusarow.tangle:tangle-viewmodel-api:0.14.0")
anvil("com.rickbusarow.tangle:tangle-viewmodel-compiler:0.14.0")
api("com.rickbusarow.tangle:tangle-viewmodel-api:0.14.1")
anvil("com.rickbusarow.tangle:tangle-viewmodel-compiler:0.14.1")

// optional Activity ViewModel support
implementation("com.rickbusarow.tangle:tangle-viewmodel-activity:0.14.0")
implementation("com.rickbusarow.tangle:tangle-viewmodel-activity:0.14.1")

// optional Compose ViewModel support
implementation("com.rickbusarow.tangle:tangle-viewmodel-compose:0.14.0")
implementation("com.rickbusarow.tangle:tangle-viewmodel-compose:0.14.1")

// optional Fragment ViewModel support
implementation("com.rickbusarow.tangle:tangle-viewmodel-fragment:0.14.0")
implementation("com.rickbusarow.tangle:tangle-viewmodel-fragment:0.14.1")

// WorkManager
api("com.rickbusarow.tangle:tangle-work-api:0.14.0")
anvil("com.rickbusarow.tangle:tangle-work-compiler:0.14.0")
api("com.rickbusarow.tangle:tangle-work-api:0.14.1")
anvil("com.rickbusarow.tangle:tangle-work-compiler:0.14.1")
}
```

Expand All @@ -73,25 +73,25 @@ plugins {
dependencies {
// Fragments
api 'com.rickbusarow.tangle:tangle-fragment-api:0.14.0'
anvil 'com.rickbusarow.tangle:tangle-fragment-compiler:0.14.0'
api 'com.rickbusarow.tangle:tangle-fragment-api:0.14.1'
anvil 'com.rickbusarow.tangle:tangle-fragment-compiler:0.14.1'
// ViewModels
api 'com.rickbusarow.tangle:tangle-viewmodel-api:0.14.0'
anvil 'com.rickbusarow.tangle:tangle-viewmodel-compiler:0.14.0'
api 'com.rickbusarow.tangle:tangle-viewmodel-api:0.14.1'
anvil 'com.rickbusarow.tangle:tangle-viewmodel-compiler:0.14.1'
// optional Activity ViewModel support
implementation 'com.rickbusarow.tangle:tangle-viewmodel-activity:0.14.0'
implementation 'com.rickbusarow.tangle:tangle-viewmodel-activity:0.14.1'
// optional Compose ViewModel support
implementation 'com.rickbusarow.tangle:tangle-viewmodel-compose:0.14.0'
implementation 'com.rickbusarow.tangle:tangle-viewmodel-compose:0.14.1'
// optional Fragment ViewModel support
implementation 'com.rickbusarow.tangle:tangle-viewmodel-fragment:0.14.0'
implementation 'com.rickbusarow.tangle:tangle-viewmodel-fragment:0.14.1'
// WorkManager
api 'com.rickbusarow.tangle:tangle-work-api:0.14.0'
anvil 'com.rickbusarow.tangle:tangle-work-compiler:0.14.0'
api 'com.rickbusarow.tangle:tangle-work-api:0.14.1'
anvil 'com.rickbusarow.tangle:tangle-work-compiler:0.14.1'
}
```
</TabItem>
Expand Down
8 changes: 4 additions & 4 deletions website/docs/fragments/fragments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ plugins {
}

dependencies {
api("com.rickbusarow.tangle:tangle-fragment-api:0.14.0")
anvil("com.rickbusarow.tangle:tangle-fragment-compiler:0.14.0")
api("com.rickbusarow.tangle:tangle-fragment-api:0.14.1")
anvil("com.rickbusarow.tangle:tangle-fragment-compiler:0.14.1")
}
```

Expand All @@ -86,8 +86,8 @@ plugins {
}
dependencies {
api 'com.rickbusarow.tangle:tangle-fragment-api:0.14.0'
anvil 'com.rickbusarow.tangle:tangle-fragment-compiler:0.14.0'
api 'com.rickbusarow.tangle:tangle-fragment-api:0.14.1'
anvil 'com.rickbusarow.tangle:tangle-fragment-compiler:0.14.1'
}
```

Expand Down
12 changes: 6 additions & 6 deletions website/docs/gradle-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ dependencies {
```

Then Tangle will add the tangle-fragment dependencies:
- com.rickbusarow.tangle:tangle-fragment-api:0.14.0
- com.rickbusarow.tangle:tangle-fragment-compiler:0.14.0
- com.rickbusarow.tangle:tangle-fragment-api:0.14.1
- com.rickbusarow.tangle:tangle-fragment-compiler:0.14.1


<Tabs groupId="language"
Expand Down Expand Up @@ -52,7 +52,7 @@ pluginManagement {
plugins {
// add Tangle and Anvil versions to the project's classpath
id("com.squareup.anvil") version <anvil_version> apply false
id("com.rickbusarow.tangle") version "0.14.0" apply false
id("com.rickbusarow.tangle") version "0.14.1" apply false
}
```

Expand All @@ -62,7 +62,7 @@ plugins {
plugins {
id("android-library") // or application, etc.
kotlin("android")
id("com.rickbusarow.tangle") version "0.14.0"
id("com.rickbusarow.tangle") version "0.14.1"
}
```

Expand All @@ -86,7 +86,7 @@ pluginManagement {
plugins {
// add Tangle and Anvil versions to the project's classpath
id 'com.squareup.anvil' version <anvil_version> apply false
id 'com.rickbusarow.tangle' version "0.14.0" apply false
id 'com.rickbusarow.tangle' version "0.14.1" apply false
}
```

Expand Down Expand Up @@ -128,7 +128,7 @@ Tangle functionality.
plugins {
id("android-library") // or application, etc.
kotlin("android")
id("com.rickbusarow.tangle") version "0.14.0"
id("com.rickbusarow.tangle") version "0.14.1"
}

// optional
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tangle",
"version": "0.14.0",
"version": "0.14.1",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand Down
16 changes: 16 additions & 0 deletions website/src/pages/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 0.14.1

#### 🐛 Bug Fixes

- update Anvil to 2.3.8 ([#379](https://github.com/rbusarow/Tangle/pull/379))
- remove inferred nullability for `TangleViewModelFactory.create` ([#378](https://github.com/rbusarow/Tangle/pull/378))

#### 🧰 Maintenance

- Bump activity-ktx from 1.3.1 to 1.4.0 ([#372](https://github.com/rbusarow/Tangle/pull/372))
- Bump navigation-ui-ktx from 2.4.0-alpha10 to 2.4.0-beta01 ([#371](https://github.com/rbusarow/Tangle/pull/371))
- Bump auto-common from 1.1.2 to 1.2 ([#364](https://github.com/rbusarow/Tangle/pull/364))
- Bump room-compiler from 2.4.0-alpha04 to 2.4.0-alpha05 ([#357](https://github.com/rbusarow/Tangle/pull/357))
- Bump prismjs from 1.24.1 to 1.25.0 in /website ([#363](https://github.com/rbusarow/Tangle/pull/363))
- Bump axios from 0.21.1 to 0.21.4 in /website ([#362](https://github.com/rbusarow/Tangle/pull/362))

## 0.14.0

#### 🐛 Bug Fixes
Expand Down
55 changes: 55 additions & 0 deletions website/versioned_docs/version-0.14.1/benchmarks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
id: benchmarks

sidebar_label: Benchmarks

title: Benchmarks
---

The Tangle project has the ability to generate test projects and run synthetic benchmarks against
it, using [Gradle-Profiler](https://github.com/gradle/gradle-profiler).

For the time being, the intent of these benchmarks is to provide a hermetic comparison between Hilt
and Tangle's build times, with as few variables as possible.

The generated test projects represent best-case scenarios, in that no library module depends upon
any other library module, and each library module only has a single empty `Fragment` and
empty `ViewModel`. The build speed percentage gain from using Tangle is most likely higher than
anything which could be observed in a real world application.

To run these tests yourself, [check out the Tangle project](https://github.com/RBusarow/tangle) and
run `./gradlew profile`. The generated code is in `$rootDir/build/benchmark-project`.

The generated benchmark project is also hosted on
GitHub [here](https://github.com/RBusarow/tangle-benchmark-project), with different branches for
different project sizes.

## The results

These tests were all run on a water-cooled 12-core 4.3GHz hackintosh with 32GB of ram. I chose that
machine because it has excellent cooling. A MacBook Pro will start overheating and thermal
throttling during prolonged benchmarking, skewing the results.

### 100 modules

Tangle's mean execution time was a 20.23% reduction from Hilt's mean.

[full results from Gradle Profile here](@site/static/benchmark/benchmark_100.html)

![Hilt vs Tangle results, 100 modules](/img/benchmark_100.png "Hilt vs Tangle results, 100 modules")

### 10 modules

Tangle's mean execution time was an 11.67% reduction from Hilt's mean. This is less significant
because the Tangle test project still needs to generate a Component using Kapt/Dagger, and that cost
is relatively static regardless of benchmark size. It's also comparable to the static cost of
component generation in a Hilt project. In a real world project with a much more complicated Dagger
graph, component generation should take longer.

It's also worth noting that an "11.67% reduction" in this case really just means that the build took
18 seconds instead of 20 seconds. For a project of this size, it's safe to say that the decision
should be made based upon API surface rather than build performance.

[full results from Gradle Profile here](@site/static/benchmark/benchmark_10.html)

![Hilt vs Tangle results, 10 modules](/img/benchmark_10.png "Hilt vs Tangle results, 100 modules")
129 changes: 129 additions & 0 deletions website/versioned_docs/version-0.14.1/configuration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
---
id: configuration
sidebar_label: Configuration
title: Configuration

---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

## Gradle

The simple way to apply Tangle is to just [apply the Gradle plugin](gradle-plugin).

You can also just add dependencies yourself, without applying the plugin:

<Tabs groupId="language"
defaultValue="Kotlin Dependencies"
values={[
{label: 'Kotlin Dependencies', value: 'Kotlin Dependencies'},
{label: 'Groovy Dependencies', value: 'Groovy Dependencies'},
]}>

<TabItem value="Kotlin Dependencies">

```kotlin
// any Android module's build.gradle.kts

plugins {
id("android-library") // or application, etc.
kotlin("android")
id("com.squareup.anvil")
}

dependencies {

// Fragments
api("com.rickbusarow.tangle:tangle-fragment-api:0.14.1")
anvil("com.rickbusarow.tangle:tangle-fragment-compiler:0.14.1")

// ViewModels
api("com.rickbusarow.tangle:tangle-viewmodel-api:0.14.1")
anvil("com.rickbusarow.tangle:tangle-viewmodel-compiler:0.14.1")

// optional Activity ViewModel support
implementation("com.rickbusarow.tangle:tangle-viewmodel-activity:0.14.1")

// optional Compose ViewModel support
implementation("com.rickbusarow.tangle:tangle-viewmodel-compose:0.14.1")

// optional Fragment ViewModel support
implementation("com.rickbusarow.tangle:tangle-viewmodel-fragment:0.14.1")

// WorkManager
api("com.rickbusarow.tangle:tangle-work-api:0.14.1")
anvil("com.rickbusarow.tangle:tangle-work-compiler:0.14.1")
}
```

</TabItem>

<TabItem value="Groovy Dependencies">

```groovy
// any Android module's build.gradle
plugins {
id 'android-library' // or application, etc.
kotlin("android")
id 'com.squareup.anvil'
}
dependencies {
// Fragments
api 'com.rickbusarow.tangle:tangle-fragment-api:0.14.1'
anvil 'com.rickbusarow.tangle:tangle-fragment-compiler:0.14.1'
// ViewModels
api 'com.rickbusarow.tangle:tangle-viewmodel-api:0.14.1'
anvil 'com.rickbusarow.tangle:tangle-viewmodel-compiler:0.14.1'
// optional Activity ViewModel support
implementation 'com.rickbusarow.tangle:tangle-viewmodel-activity:0.14.1'
// optional Compose ViewModel support
implementation 'com.rickbusarow.tangle:tangle-viewmodel-compose:0.14.1'
// optional Fragment ViewModel support
implementation 'com.rickbusarow.tangle:tangle-viewmodel-fragment:0.14.1'
// WorkManager
api 'com.rickbusarow.tangle:tangle-work-api:0.14.1'
anvil 'com.rickbusarow.tangle:tangle-work-compiler:0.14.1'
}
```
</TabItem>

</Tabs>

## Setting up the Tangle graph

In order to connect Tangle to your application-scoped Dagger component,
call `TangleGraph.add(...)` immediately after creating the component.

```kotlin
import android.app.Application
import tangle.inject.TangleGraph

class MyApplication : Application() {

override fun onCreate() {
super.onCreate()

val myAppComponent = DaggerMyAppComponent.factory()
.create(this)

TangleGraph.add(myAppComponent)
}
}
```
## Next steps

Tangle is now able to generate its code and hook in to Dagger.

Check out these features to start using Tangle in your project:
- [Fragments](fragments/fragments.mdx)
- [ViewModels](viewModels/viewModels.md)
- [WorkManager](workManager/workManager.md)
Loading

0 comments on commit 967e9d5

Please sign in to comment.