Skip to content

4.0.0

Choose a tag to compare

@dotaeva dotaeva released this 04 Dec 14:48
· 3 commits to main since this release

Scaffolding 4.0.0 makes routes explicit, returns typed child coordinators from navigation calls, and removes everything 3.x deprecated.

Route generation

  • Declare routes with @Route. A class-body function is a route only when it carries the attribute; nothing is inferred from its return type.
  • Return the concrete coordinator from a child route, alone or as a tab tuple's first element. @Route on any Coordinatable is a compile error that asks for the concrete type.
  • Report one error for a coordinator that declares no routes, and reject @Route on customize(_:) or on an unsupported return type.
  • Make a typed call as visible as its route function, capped at the coordinator's access, so a public coordinator can route to an internal child.
  • Remove @ScaffoldingIgnored and @Scaffoldable(injectsCoordinator:). Unmarked functions are never routes, and every coordinator is injected into its views' environment.

Navigation

  • Return the child from every call that reaches one: route, present, setRoot, popToFirst, popToLast, selectFirstTab, selectLastTab, appendTab, insertTab, setDetail, setContent, and setSidebar. A deep link chains without casts or type arguments.
  • Return nil from a child route call when the request is skipped or nothing matches. View routes, and child routes inside #if or marked @available, still return Self.
  • Add a tuple form of awaiting: that hands back the child synchronously before the result is awaited.
  • Run a child route's factory when its destination is created instead of on first use. Tab and column children exist as soon as their container resolves.

Removed APIs

  • Remove expecting: and typed trailing closures from route-based calls. select(index:expecting:) and select(id:expecting:) are unchanged.
  • Remove the onDismiss: overloads, presentAndWait, and routeAndWait in favor of awaiting:.
  • Remove the configured .sheet(...) factory, SheetConfiguration, and destination.modalConfiguration. ModalPresentationType is .sheet or .fullScreenCover; apply the native presentation modifiers to the presented view.
  • Remove replaceLast(with:), setRootTransitionAnimation(_:), the mode-less restoreNavigationState(from:), waitUntil(_:iterations:), resolveMeta(_:), environmentCoordinatable(_:), and the public coordinator and container wiring methods.

Package

  • Resolve the DocC plugin only when SCAFFOLDING_BUILD_DOCS is set, so consumers never download it.
  • Accept swift-syntax from 600 up to, but not including, 605.

Documentation and validation

  • Added a 3.x to 4.0 migration guide and updated the DocC articles, agent guide, and skills for @Route and typed child routes.
  • Migrated the Checklist, Stinsen Parity, and Atlas examples. Routes that built either a tab shell or a split shell are now one route per shell.
  • Added typed-route tests, macro expansion tests, and compile fixtures, and renamed the regression suites after their subject.

Migration

  • Follow Migrating from 3.x to 4.0: mark every route, delete @ScaffoldingIgnored, return concrete coordinators, then replace expecting:, the closure overloads, and the remaining removed calls.
  • Mark all routes of a coordinator in one pass. A half-migrated coordinator silently loses its unmarked routes, and the first sign is a missing Destinations case at a call site.
  • Split a route that built different coordinators into one route per coordinator and choose the route at the call site.
  • Mark a route public to chain into its child from another module.
  • Keep route factories free of side effects, since they now run when the destination is created.
  • Requirements and the snapshot schema are unchanged: Swift 6.2 / Xcode 26 and iOS 18, macOS 15, Mac Catalyst 18, tvOS 18, or watchOS 11. A route renamed during migration no longer decodes and is skipped with its children.

Full changelog