TokamakUI / Tokamak

SwiftUI-compatible framework for building browser apps with WebAssembly and native apps for other platforms
Apache License 2.0
2.62k stars 111 forks source link

fiber reconciler add support for application lifecycle events #547

Open shial4 opened 1 year ago

shial4 commented 1 year ago

Describe the bug

Missing triggers for below app lifecycle calls, breaks many modifier or views which depends on this functionality, internally inside TokamakCore as externally inside TokamakDOM and so on.

To Reproduce

Use fiber

static let _configuration: _AppConfiguration = .init(
    reconciler: .fiber(useDynamicLayout: true)
  )

Observe, a lot of functionality isn't working due to missing calls for

._onMount {
    print("🟡 _onMount")
}
._onUpdate {
    print("🟡 _onUpdate")
}
.onAppear {
    print("🟡 onAppear")
}
.onDisappear {
    print("🟡 onDisappear")
}

Expected behaviour

Calls work as expected.