From 2c20b02e59b98f2cb3645e36a77f0da7e306ee8e Mon Sep 17 00:00:00 2001 From: Joshua Parmenter Date: Wed, 23 Sep 2026 21:21:45 -0700 Subject: [PATCH] =?UTF-8?q?docs:=20consumer=20migration=20guide=20for=20Ly?= =?UTF-8?q?rebird=201.x=20=E2=86=92=202.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirror of the dev-repo docs commit: add docs/migrating-to-2.0.md (module rename + @UIParam/UIParamNode move into core LyrebirdSynth, with the fix) and the cross-reference from DEVELOPMENT_AND_RELEASE.md. Docs-only; will be reconciled by the next full release sync. Co-Authored-By: Claude Opus 4.8 --- docs/DEVELOPMENT_AND_RELEASE.md | 4 ++ docs/migrating-to-2.0.md | 84 +++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 docs/migrating-to-2.0.md diff --git a/docs/DEVELOPMENT_AND_RELEASE.md b/docs/DEVELOPMENT_AND_RELEASE.md index 7d61d83..51c1163 100644 --- a/docs/DEVELOPMENT_AND_RELEASE.md +++ b/docs/DEVELOPMENT_AND_RELEASE.md @@ -165,6 +165,10 @@ Tag format: `vX.Y.Z` (the `v` is conventional; SwiftPM strips it). > (`import Lyrebird` → `import LyrebirdSynth`). Because 1.0.0 was never > distributed before the rename, it shipped *as* 1.0.0. A comparable rename > after a public release would be a major bump. +> +> The consumer-facing 1.x → 2.0 upgrade steps (the module rename plus the +> `@UIParam` / `UIParamNode` move into the core module) are in +> `docs/migrating-to-2.0.md`. --- diff --git a/docs/migrating-to-2.0.md b/docs/migrating-to-2.0.md new file mode 100644 index 0000000..9362a70 --- /dev/null +++ b/docs/migrating-to-2.0.md @@ -0,0 +1,84 @@ + + +# Migrating to Lyrebird 2.0 + +Lyrebird 2.0 is a major (source-breaking) release. Two changes affect existing +consumers. Both are quick, mechanical fixes. + +## 1. Module rename: `Lyrebird` → `LyrebirdSynth` + +The core module was renamed. The **product** you add in `Package.swift` is still +`Lyrebird`, but the **module** you import is now `LyrebirdSynth`. + +```swift +// Before (1.x) +import Lyrebird + +// After (2.0) +import LyrebirdSynth +``` + +Your `Package.swift` dependency is unchanged: + +```swift +.product(name: "Lyrebird", package: "Lyrebird") // still correct +``` + +## 2. `@UIParam` / `UIParamNode` moved to the core module + +In 1.x, the `@UIParam` property wrapper and its projected `UIParamNode` lived in +**`LyrebirdUI`**. In 2.0 they moved into the core **`LyrebirdSynth`** module, so +the parameter model is independent of any UI framework (this is what lets +`LyrebirdUI` be a single cross-platform module — real SwiftUI on Apple, +SwiftOpenUI/GTK4 on Linux). + +`LyrebirdUI` does **not** re-export `LyrebirdSynth`, so two things must change in +any code that uses `@UIParam` / `UIParamNode`: + +**a. Import `LyrebirdSynth`.** A file that previously got these types via +`import LyrebirdUI` alone now needs: + +```swift +import LyrebirdSynth // @UIParam, UIParamNode +import LyrebirdUI // ParameterKnob, ParameterSlider, … (the controls) +``` + +**b. Depend on the `Lyrebird` product.** Any *target* that touches `@UIParam` / +`UIParamNode` must depend on the `Lyrebird` product, not only `LyrebirdUI` — +otherwise `import LyrebirdSynth` will not resolve its types (Swift's explicit +module maps only expose declared dependencies): + +```swift +.target( + name: "MyUI", + dependencies: [ + .product(name: "Lyrebird", package: "Lyrebird"), // ← add this + .product(name: "LyrebirdUI", package: "Lyrebird"), + ] +) +``` + +### Symptom + +If you miss either, you'll see: + +``` +error: cannot find type 'UIParamNode' in scope +``` + +— even in a file that already `import LyrebirdUI`s, and even (for the +missing-target-dependency case) in a file that already `import LyrebirdSynth`s. +Add the import **and** the product dependency and it resolves. + +## Not breaking, but new + +`LyrebirdUI` is now one cross-platform module. On Apple it compiles against real +SwiftUI exactly as before; on Linux it renders through SwiftOpenUI/GTK4. Apple +consumers need no change for this — the control names (`ParameterKnob`, +`ParameterSlider`, `ParameterXY`, `ParameterButton`, `ParameterLabel`, the scope +/ envelope / status views) and their initializers are unchanged.