mirror of
https://github.com/AdrianKuta/Tree-Data-Structure.git
synced 2026-06-19 19:00:14 +02:00
- PUBLISH_VERSION 4.1.1 -> 4.2.0 - CHANGELOG: promote [Unreleased] -> [4.2.0] (2026-06-08) + compare link - README: bump install snippets to 4.2.0 Adds the Android target for tree-structure and tree-structure-compose, the default TreeNodeRow composable + LazyTree(label=...) overload, and a runnable Android sample. All additive, no breaking changes.
6.3 KiB
6.3 KiB
Changelog
All notable changes to this project are documented here. The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
4.2.0 - 2026-06-08
Added
- Android target. The core
tree-structuremodule andtree-structure-composenow publish an-androidvariant (minSdk21), so both can be consumed directly in Android projects. tree-structure-compose: a foundation-onlyTreeNodeRowcomposable — a sensible default node row (clickable, indented, with a▾/▸marker and no Material dependency) — plus a no-contentLazyTree(root, label = …)overload that renders each node with it. The existing lambda overload is unchanged.- A runnable Android sample app in the new
samplesmodule, with@Previewcomposables.
Changed
- Upgraded the Gradle wrapper to 8.10.2 and introduced Android Gradle Plugin 8.7.2 (
compileSdk35). No source or behavior changes to existing targets.
4.1.1 - 2026-06-08
Fixed
- Restored the Apple/iOS artifacts (
iosArm64,iosX64,iosSimulatorArm64) for the core and every module. The release workflow published from a Linux runner, which cannot build Kotlin/Native Apple targets, so they were silently omitted from 3.1.5–4.1.0; publishing now runs on macOS. No API or behavior changes from 4.1.0 — this is a packaging fix only.
4.1.0 - 2026-06-07
Added
- Structural mutation helpers on
TreeNode:insertChild,removeChildAt,replaceChild,moveChild,addChildren, andsortChildren. - Tree query extensions:
lowestCommonAncestor,distance,pathBetween, andcontainsfor finding common ancestors, edge distances, the path between two nodes, and value membership. - Customizable
prettyString(connectors, render)extension: choose connector glyphs viaTreeConnectors(Defaultbox-drawing orAscii) and supply a per-node renderer that receives the value, its depth and whether it is its parent's last child. The all-defaults call is byte-identical to the existing no-argprettyString(). - New
tree-structure-immutablemodule: a persistentImmutableTreeNodewith structural sharing (addChild/removeChild/mapValuesreturn new roots; pre/post/level-order traversals,nodeCount, andheight).
Changed
- Rewrote the README for clarity: one consistent example tree, task-oriented sections (building, traversal, navigation, functional, utilities, mutating), per-module usage, and a condensed maintainer "Releasing" section.
4.0.0
A breaking release that cleans up the core API and enforces an explicit public surface.
Changed (breaking)
TreeNode.treeIteratoris now a read-onlyval(set it via the constructor). Useiterator(order)orasSequence(order)to traverse in a different order per call.removeChild(child)now only removes a direct child of the receiver (previously it removed the node from its actual parent regardless). Usechild.detach()to unhook a node from wherever it lives.addChild(child)now throwsTreeNodeExceptionifchildalready has a parent or if the attachment would create a cycle. Calldetach()first to move a node.clear()no longer detaches the receiver from its own parent; it only removes its descendants.path(descendant)now returnsList<TreeNode<T>>?(nullwhendescendantis the root or not a descendant) instead of throwingTreeNodeException.
Added
TreeNode.detach()— removes a node from its parent.TreeNode.iterator(order)— a one-shot iterator in a specific order.- Strict
explicitApi()mode across all modules. - New
tree-structure-composemodule: aLazyTreecomposable for Compose Multiplatform.
Migration
node.treeIterator = PostOrder; for (n in node) { … }→for (n in node.asSequence(PostOrder)) { … }root.removeChild(deepNode)→deepNode.detach()try { node.path(x) } catch (e: TreeNodeException) { … }→node.path(x)?.let { … }
3.4.0
Added
- Lazy
Sequencetraversal:asSequence(order),preOrderSequence(),postOrderSequence(),levelOrderSequence()— composes with the Kotlin stdlib and short-circuits. - Navigation extensions:
isLeaf,degree,root(),ancestors(),siblings(),leaves(),descendants(). - Functional extensions:
findNode,filterNodes,anyNode,allNodes,countNodes,foldNodes,mapValues,deepCopy,structurallyEquals(all stack-safe). - New optional modules published as separate artifacts:
tree-structure-serialization—kotlinx.serializationsupport via aTreeNodeDto.tree-structure-coroutines—Flowtraversal (asFlow,preOrderFlow, …).
CHANGELOG.md, expanded README examples, and class-level KDoc (thread-safety / complexity).
Changed
nodeCount(),height(),clear()and the post-order iterator are now iterative — deep or degenerate (linear) trees no longer throwStackOverflowError.- Migrated to Kotlin 2.x (K2 compiler) and introduced a Gradle version catalog.
- Build now uses
binary-compatibility-validator(committed.apibaselines) and Kover.
3.1.5
Fixed
- Removed a stray
printlninTreeNode.removeChild()that printed to stdout on every removal.
Removed
- Deleted the
Example.ws.ktsworksheet and thekotlin("script-runtime")dependency from the published JVM artifact, plus the leftoverExampleUnitTesttemplate test.
Changed
- Bumped
actions/checkoutv2 → v4 in CI workflows.
3.1.4
- Updated Kotlin and JS dependencies; added the
wasmJstarget.
3.1.3
- iOS targets and Maven Central (Sonatype Central Portal) publishing.