From 67ca99b05f98e4de1f3ac2e4b757068437e873f7 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 14:21:13 +0100 Subject: [PATCH 01/20] Update for JSKit 0.11.0, add async `task` modifier --- Package.resolved | 8 +-- Package.swift | 44 ++++++++----- .../TokamakCore/Modifiers/TaskModifier.swift | 32 ++++++++++ .../TokamakCore/Shapes/Path/PathLayout.swift | 2 +- Sources/TokamakDOM/DOMNode.swift | 4 +- Sources/TokamakDOM/DOMRenderer.swift | 8 +++ Sources/TokamakDOM/Views/Canvas/Canvas.swift | 16 ++--- .../{ => Buttons}/ButtonStyleDemo.swift | 6 +- .../TokamakDemo/{ => Buttons}/Counter.swift | 0 .../{ => Containers}/ForEachDemo.swift | 0 .../{ => Containers}/ListDemo.swift | 0 .../{ => Containers}/OutlineGroupDemo.swift | 0 .../{ => Containers}/SidebarDemo.swift | 0 .../TokamakDemo/{ => DOM}/DOMRefDemo.swift | 0 .../TokamakDemo/{ => DOM}/URLHashDemo.swift | 2 + .../{ => Drawing}/CanvasDemo.swift | 0 .../TokamakDemo/{ => Drawing}/ColorDemo.swift | 0 .../TokamakDemo/{ => Drawing}/PathDemo.swift | 0 .../{ => Drawing}/ShapeStyleDemo.swift | 0 .../{ => Layout}/GeometryReaderDemo.swift | 0 .../TokamakDemo/{ => Layout}/GridDemo.swift | 0 .../TokamakDemo/{ => Layout}/SpacerDemo.swift | 0 .../TokamakDemo/{ => Layout}/StackDemo.swift | 0 .../{ => Misc}/AnimationDemo.swift | 0 .../{ => Misc}/AppStorageDemo.swift | 0 .../{ => Misc}/EnvironmentDemo.swift | 0 .../{ => Misc}/PreferenceKeyDemo.swift | 0 .../{ => Misc}/ProgressViewDemo.swift | 0 .../TokamakDemo/{ => Misc}/RedactDemo.swift | 0 .../{ => Misc}/TransitionDemo.swift | 0 .../TokamakDemo/Modifiers/ShadowDemo.swift | 22 +++++++ Sources/TokamakDemo/Modifiers/TaskDemo.swift | 61 +++++++++++++++++++ .../{ => Selectors}/DatePickerDemo.swift | 0 .../{ => Selectors}/PickerDemo.swift | 0 .../{ => Selectors}/SliderDemo.swift | 0 .../{ => Selectors}/ToggleDemo.swift | 0 Sources/TokamakDemo/ShadowDemo.swift | 8 --- Sources/TokamakDemo/{ => Text}/TextDemo.swift | 4 +- .../{ => Text}/TextEditorDemo.swift | 0 .../{ => Text}/TextFieldDemo.swift | 0 Sources/TokamakDemo/TokamakDemo.swift | 3 + Sources/TokamakGTK/GSignal.swift | 4 +- .../Modifiers/LayoutModifiers.swift | 2 +- Sources/TokamakStaticHTML/Views/HTML.swift | 2 +- 44 files changed, 181 insertions(+), 47 deletions(-) create mode 100644 Sources/TokamakCore/Modifiers/TaskModifier.swift rename Sources/TokamakDemo/{ => Buttons}/ButtonStyleDemo.swift (97%) rename Sources/TokamakDemo/{ => Buttons}/Counter.swift (100%) rename Sources/TokamakDemo/{ => Containers}/ForEachDemo.swift (100%) rename Sources/TokamakDemo/{ => Containers}/ListDemo.swift (100%) rename Sources/TokamakDemo/{ => Containers}/OutlineGroupDemo.swift (100%) rename Sources/TokamakDemo/{ => Containers}/SidebarDemo.swift (100%) rename Sources/TokamakDemo/{ => DOM}/DOMRefDemo.swift (100%) rename Sources/TokamakDemo/{ => DOM}/URLHashDemo.swift (96%) rename Sources/TokamakDemo/{ => Drawing}/CanvasDemo.swift (100%) rename Sources/TokamakDemo/{ => Drawing}/ColorDemo.swift (100%) rename Sources/TokamakDemo/{ => Drawing}/PathDemo.swift (100%) rename Sources/TokamakDemo/{ => Drawing}/ShapeStyleDemo.swift (100%) rename Sources/TokamakDemo/{ => Layout}/GeometryReaderDemo.swift (100%) rename Sources/TokamakDemo/{ => Layout}/GridDemo.swift (100%) rename Sources/TokamakDemo/{ => Layout}/SpacerDemo.swift (100%) rename Sources/TokamakDemo/{ => Layout}/StackDemo.swift (100%) rename Sources/TokamakDemo/{ => Misc}/AnimationDemo.swift (100%) rename Sources/TokamakDemo/{ => Misc}/AppStorageDemo.swift (100%) rename Sources/TokamakDemo/{ => Misc}/EnvironmentDemo.swift (100%) rename Sources/TokamakDemo/{ => Misc}/PreferenceKeyDemo.swift (100%) rename Sources/TokamakDemo/{ => Misc}/ProgressViewDemo.swift (100%) rename Sources/TokamakDemo/{ => Misc}/RedactDemo.swift (100%) rename Sources/TokamakDemo/{ => Misc}/TransitionDemo.swift (100%) create mode 100644 Sources/TokamakDemo/Modifiers/ShadowDemo.swift create mode 100644 Sources/TokamakDemo/Modifiers/TaskDemo.swift rename Sources/TokamakDemo/{ => Selectors}/DatePickerDemo.swift (100%) rename Sources/TokamakDemo/{ => Selectors}/PickerDemo.swift (100%) rename Sources/TokamakDemo/{ => Selectors}/SliderDemo.swift (100%) rename Sources/TokamakDemo/{ => Selectors}/ToggleDemo.swift (100%) delete mode 100644 Sources/TokamakDemo/ShadowDemo.swift rename Sources/TokamakDemo/{ => Text}/TextDemo.swift (97%) rename Sources/TokamakDemo/{ => Text}/TextEditorDemo.swift (100%) rename Sources/TokamakDemo/{ => Text}/TextFieldDemo.swift (100%) diff --git a/Package.resolved b/Package.resolved index cab685ee7..027034f65 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/swiftwasm/JavaScriptKit.git", "state": { "branch": null, - "revision": "b19e7c8b10a2750ed47753e31ed13613171f3294", - "version": "0.10.1" + "revision": "40b1614b4ed12c3741b5fadc47f07dcc55a1ac82", + "version": "0.11.0" } }, { @@ -24,8 +24,8 @@ "repositoryURL": "https://github.com/swiftwasm/OpenCombineJS.git", "state": { "branch": null, - "revision": "eaf324ce78710f53b52fb82e9a8de4693633e33a", - "version": "0.1.1" + "revision": "f1f1799ddbb9876a0ef8c5700a3b78d352d0b969", + "version": "0.1.2" } }, { diff --git a/Package.swift b/Package.swift index 704ee7598..428c72cbb 100644 --- a/Package.swift +++ b/Package.swift @@ -4,6 +4,31 @@ import PackageDescription +var tokamakDOMDependencies: [Target.Dependency] = [ + "TokamakCore", + "TokamakStaticHTML", + .product( + name: "OpenCombineShim", + package: "OpenCombine" + ), + .product( + name: "JavaScriptKit", + package: "JavaScriptKit", + condition: .when(platforms: [.wasi]) + ), + "OpenCombineJS", +] + +#if compiler(>=5.5) +tokamakDOMDependencies.append( + .product( + name: "JavaScriptEventLoop", + package: "JavaScriptKit", + condition: .when(platforms: [.wasi]) + ) +) +#endif + let package = Package( name: "Tokamak", platforms: [ @@ -51,7 +76,7 @@ let package = Package( // .package(url: /* package url */, from: "1.0.0"), .package( url: "https://github.com/swiftwasm/JavaScriptKit.git", - .upToNextMinor(from: "0.10.0") + .upToNextMinor(from: "0.11.0") ), .package( url: "https://github.com/OpenCombine/OpenCombine.git", @@ -59,7 +84,7 @@ let package = Package( ), .package( url: "https://github.com/swiftwasm/OpenCombineJS.git", - .upToNextMinor(from: "0.1.1") + .upToNextMinor(from: "0.1.2") ), .package( name: "Benchmark", @@ -152,20 +177,7 @@ let package = Package( ), .target( name: "TokamakDOM", - dependencies: [ - "TokamakCore", - "TokamakStaticHTML", - .product( - name: "OpenCombineShim", - package: "OpenCombine" - ), - .product( - name: "JavaScriptKit", - package: "JavaScriptKit", - condition: .when(platforms: [.wasi]) - ), - "OpenCombineJS", - ] + dependencies: tokamakDOMDependencies ), .executableTarget( name: "TokamakDemo", diff --git a/Sources/TokamakCore/Modifiers/TaskModifier.swift b/Sources/TokamakCore/Modifiers/TaskModifier.swift new file mode 100644 index 000000000..0b6efea3f --- /dev/null +++ b/Sources/TokamakCore/Modifiers/TaskModifier.swift @@ -0,0 +1,32 @@ +// Copyright 2021 Tokamak contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#if compiler(>=5.5) + +public extension View { + func task( + priority: TaskPriority = .userInitiated, + _ action: @escaping @Sendable () async -> () + ) -> some View { + var task: Task<(), Never>? + return onAppear { + task = Task(priority: priority, operation: action) + } + .onDisappear { + task?.cancel() + } + } +} + +#endif diff --git a/Sources/TokamakCore/Shapes/Path/PathLayout.swift b/Sources/TokamakCore/Shapes/Path/PathLayout.swift index 72fc48a0d..efea4f1b8 100644 --- a/Sources/TokamakCore/Shapes/Path/PathLayout.swift +++ b/Sources/TokamakCore/Shapes/Path/PathLayout.swift @@ -223,7 +223,7 @@ public extension Path { func applying(_ transform: CGAffineTransform) -> Path { guard transform != .identity else { return self } - let elements = self.elements.map { transform.transform(element: $0) } + let elements = elements.map { transform.transform(element: $0) } let box = _PathBox(elements: elements) return Path(storage: .path(box), sizing: .fixed) } diff --git a/Sources/TokamakDOM/DOMNode.swift b/Sources/TokamakDOM/DOMNode.swift index e0b1a3486..fbe2b9d75 100644 --- a/Sources/TokamakDOM/DOMNode.swift +++ b/Sources/TokamakDOM/DOMNode.swift @@ -60,7 +60,7 @@ extension AnyHTML { additionalAttributes: [HTMLAttribute: String], transaction: Transaction ) { - let attributes = self.attributes.merging(additionalAttributes, uniquingKeysWith: +) + let attributes = attributes.merging(additionalAttributes, uniquingKeysWith: +) dom.applyAttributes(attributes, with: transaction) @@ -109,7 +109,9 @@ final class DOMNode: Target { func reinstall(_ listeners: [String: Listener]) { for (event, jsClosure) in self.listeners { _ = ref.removeEventListener!(event, jsClosure) + #if JAVASCRIPTKIT_WITHOUT_WEAKREFS jsClosure.release() + #endif } self.listeners = [:] diff --git a/Sources/TokamakDOM/DOMRenderer.swift b/Sources/TokamakDOM/DOMRenderer.swift index 78d4b9a70..28b7ab237 100644 --- a/Sources/TokamakDOM/DOMRenderer.swift +++ b/Sources/TokamakDOM/DOMRenderer.swift @@ -20,6 +20,10 @@ import OpenCombineJS @_spi(TokamakCore) import TokamakCore import TokamakStaticHTML +#if compiler(>=5.5) +import JavaScriptEventLoop +#endif + public typealias Sanitizers = TokamakStaticHTML.Sanitizers extension EnvironmentValues { @@ -87,6 +91,10 @@ final class DOMRenderer: Renderer { rootRef = ref appendRootStyle(ref) + #if compiler(>=5.5) + JavaScriptEventLoop.installGlobalExecutor() + #endif + let scheduler = JSScheduler() self.scheduler = scheduler reconciler = StackReconciler( diff --git a/Sources/TokamakDOM/Views/Canvas/Canvas.swift b/Sources/TokamakDOM/Views/Canvas/Canvas.swift index ebcb53f54..a6f10c85c 100644 --- a/Sources/TokamakDOM/Views/Canvas/Canvas.swift +++ b/Sources/TokamakDOM/Views/Canvas/Canvas.swift @@ -62,15 +62,15 @@ struct _Canvas: View { HTML("canvas", [ "style": "width: 100%; height: 100%;", ]) - ._domRef($coordinator.canvas) - .onAppear { draw(in: proxy.size) } - ._onUpdate { - // Cancel the previous animation loop. - if let currentDrawLoop = coordinator.currentDrawLoop { - _ = JSObject.global.cancelAnimationFrame!(currentDrawLoop) - } - draw(in: proxy.size) + ._domRef($coordinator.canvas) + .onAppear { draw(in: proxy.size) } + ._onUpdate { + // Cancel the previous animation loop. + if let currentDrawLoop = coordinator.currentDrawLoop { + _ = JSObject.global.cancelAnimationFrame!(currentDrawLoop) } + draw(in: proxy.size) + } } } diff --git a/Sources/TokamakDemo/ButtonStyleDemo.swift b/Sources/TokamakDemo/Buttons/ButtonStyleDemo.swift similarity index 97% rename from Sources/TokamakDemo/ButtonStyleDemo.swift rename to Sources/TokamakDemo/Buttons/ButtonStyleDemo.swift index 6a49b8fab..6b353403a 100644 --- a/Sources/TokamakDemo/ButtonStyleDemo.swift +++ b/Sources/TokamakDemo/Buttons/ButtonStyleDemo.swift @@ -75,9 +75,9 @@ public struct ButtonStyleDemo: View { Text("Label").padding(.leading, 5) } }) - .buttonStyle( - PressedButtonStyle(pressedColor: Color.red) - ) + .buttonStyle( + PressedButtonStyle(pressedColor: Color.red) + ) if #available(iOS 15.0, macOS 12.0, *) { Button("Prominent") {} .buttonStyle(BorderedProminentButtonStyle()) diff --git a/Sources/TokamakDemo/Counter.swift b/Sources/TokamakDemo/Buttons/Counter.swift similarity index 100% rename from Sources/TokamakDemo/Counter.swift rename to Sources/TokamakDemo/Buttons/Counter.swift diff --git a/Sources/TokamakDemo/ForEachDemo.swift b/Sources/TokamakDemo/Containers/ForEachDemo.swift similarity index 100% rename from Sources/TokamakDemo/ForEachDemo.swift rename to Sources/TokamakDemo/Containers/ForEachDemo.swift diff --git a/Sources/TokamakDemo/ListDemo.swift b/Sources/TokamakDemo/Containers/ListDemo.swift similarity index 100% rename from Sources/TokamakDemo/ListDemo.swift rename to Sources/TokamakDemo/Containers/ListDemo.swift diff --git a/Sources/TokamakDemo/OutlineGroupDemo.swift b/Sources/TokamakDemo/Containers/OutlineGroupDemo.swift similarity index 100% rename from Sources/TokamakDemo/OutlineGroupDemo.swift rename to Sources/TokamakDemo/Containers/OutlineGroupDemo.swift diff --git a/Sources/TokamakDemo/SidebarDemo.swift b/Sources/TokamakDemo/Containers/SidebarDemo.swift similarity index 100% rename from Sources/TokamakDemo/SidebarDemo.swift rename to Sources/TokamakDemo/Containers/SidebarDemo.swift diff --git a/Sources/TokamakDemo/DOMRefDemo.swift b/Sources/TokamakDemo/DOM/DOMRefDemo.swift similarity index 100% rename from Sources/TokamakDemo/DOMRefDemo.swift rename to Sources/TokamakDemo/DOM/DOMRefDemo.swift diff --git a/Sources/TokamakDemo/URLHashDemo.swift b/Sources/TokamakDemo/DOM/URLHashDemo.swift similarity index 96% rename from Sources/TokamakDemo/URLHashDemo.swift rename to Sources/TokamakDemo/DOM/URLHashDemo.swift index 6345d9fc0..39dcb8a03 100644 --- a/Sources/TokamakDemo/URLHashDemo.swift +++ b/Sources/TokamakDemo/DOM/URLHashDemo.swift @@ -36,7 +36,9 @@ private final class HashState: ObservableObject { deinit { window.onhashchange = .undefined + #if JAVASCRIPTKIT_WITHOUT_WEAKREFS onHashChange.release() + #endif } } diff --git a/Sources/TokamakDemo/CanvasDemo.swift b/Sources/TokamakDemo/Drawing/CanvasDemo.swift similarity index 100% rename from Sources/TokamakDemo/CanvasDemo.swift rename to Sources/TokamakDemo/Drawing/CanvasDemo.swift diff --git a/Sources/TokamakDemo/ColorDemo.swift b/Sources/TokamakDemo/Drawing/ColorDemo.swift similarity index 100% rename from Sources/TokamakDemo/ColorDemo.swift rename to Sources/TokamakDemo/Drawing/ColorDemo.swift diff --git a/Sources/TokamakDemo/PathDemo.swift b/Sources/TokamakDemo/Drawing/PathDemo.swift similarity index 100% rename from Sources/TokamakDemo/PathDemo.swift rename to Sources/TokamakDemo/Drawing/PathDemo.swift diff --git a/Sources/TokamakDemo/ShapeStyleDemo.swift b/Sources/TokamakDemo/Drawing/ShapeStyleDemo.swift similarity index 100% rename from Sources/TokamakDemo/ShapeStyleDemo.swift rename to Sources/TokamakDemo/Drawing/ShapeStyleDemo.swift diff --git a/Sources/TokamakDemo/GeometryReaderDemo.swift b/Sources/TokamakDemo/Layout/GeometryReaderDemo.swift similarity index 100% rename from Sources/TokamakDemo/GeometryReaderDemo.swift rename to Sources/TokamakDemo/Layout/GeometryReaderDemo.swift diff --git a/Sources/TokamakDemo/GridDemo.swift b/Sources/TokamakDemo/Layout/GridDemo.swift similarity index 100% rename from Sources/TokamakDemo/GridDemo.swift rename to Sources/TokamakDemo/Layout/GridDemo.swift diff --git a/Sources/TokamakDemo/SpacerDemo.swift b/Sources/TokamakDemo/Layout/SpacerDemo.swift similarity index 100% rename from Sources/TokamakDemo/SpacerDemo.swift rename to Sources/TokamakDemo/Layout/SpacerDemo.swift diff --git a/Sources/TokamakDemo/StackDemo.swift b/Sources/TokamakDemo/Layout/StackDemo.swift similarity index 100% rename from Sources/TokamakDemo/StackDemo.swift rename to Sources/TokamakDemo/Layout/StackDemo.swift diff --git a/Sources/TokamakDemo/AnimationDemo.swift b/Sources/TokamakDemo/Misc/AnimationDemo.swift similarity index 100% rename from Sources/TokamakDemo/AnimationDemo.swift rename to Sources/TokamakDemo/Misc/AnimationDemo.swift diff --git a/Sources/TokamakDemo/AppStorageDemo.swift b/Sources/TokamakDemo/Misc/AppStorageDemo.swift similarity index 100% rename from Sources/TokamakDemo/AppStorageDemo.swift rename to Sources/TokamakDemo/Misc/AppStorageDemo.swift diff --git a/Sources/TokamakDemo/EnvironmentDemo.swift b/Sources/TokamakDemo/Misc/EnvironmentDemo.swift similarity index 100% rename from Sources/TokamakDemo/EnvironmentDemo.swift rename to Sources/TokamakDemo/Misc/EnvironmentDemo.swift diff --git a/Sources/TokamakDemo/PreferenceKeyDemo.swift b/Sources/TokamakDemo/Misc/PreferenceKeyDemo.swift similarity index 100% rename from Sources/TokamakDemo/PreferenceKeyDemo.swift rename to Sources/TokamakDemo/Misc/PreferenceKeyDemo.swift diff --git a/Sources/TokamakDemo/ProgressViewDemo.swift b/Sources/TokamakDemo/Misc/ProgressViewDemo.swift similarity index 100% rename from Sources/TokamakDemo/ProgressViewDemo.swift rename to Sources/TokamakDemo/Misc/ProgressViewDemo.swift diff --git a/Sources/TokamakDemo/RedactDemo.swift b/Sources/TokamakDemo/Misc/RedactDemo.swift similarity index 100% rename from Sources/TokamakDemo/RedactDemo.swift rename to Sources/TokamakDemo/Misc/RedactDemo.swift diff --git a/Sources/TokamakDemo/TransitionDemo.swift b/Sources/TokamakDemo/Misc/TransitionDemo.swift similarity index 100% rename from Sources/TokamakDemo/TransitionDemo.swift rename to Sources/TokamakDemo/Misc/TransitionDemo.swift diff --git a/Sources/TokamakDemo/Modifiers/ShadowDemo.swift b/Sources/TokamakDemo/Modifiers/ShadowDemo.swift new file mode 100644 index 000000000..786db721c --- /dev/null +++ b/Sources/TokamakDemo/Modifiers/ShadowDemo.swift @@ -0,0 +1,22 @@ +// Copyright 2021 Tokamak contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import TokamakShim + +struct ShadowDemo: View { + var body: some View { + Color.red.frame(width: 60, height: 60, alignment: .center) + .shadow(color: .black, radius: 5, x: 0, y: 10) + } +} diff --git a/Sources/TokamakDemo/Modifiers/TaskDemo.swift b/Sources/TokamakDemo/Modifiers/TaskDemo.swift new file mode 100644 index 000000000..978aa0f1b --- /dev/null +++ b/Sources/TokamakDemo/Modifiers/TaskDemo.swift @@ -0,0 +1,61 @@ +// Copyright 2021 Tokamak contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#if os(WASI) +import JavaScriptKit +import TokamakDOM + +private let jsFetch = JSObject.global.fetch.function! +private func fetch(_ url: String) -> JSPromise { + JSPromise(jsFetch(url).object!)! +} + +private struct Response: Decodable { + let uuid: String +} + +struct TaskDemo: View { + @State private var response: Result? + + var body: some View { + VStack { + switch response { + case let .success(response): + Text("Fetched UUID is \(response.uuid)") + case let .failure(error): + Text("Error is \(error)") + default: + Text("Response not available yet") + } + + Button("Fetch new UUID asynchronously") { + response = nil + Task { await fetchResponse() } + } + }.task { + await fetchResponse() + } + } + + func fetchResponse() async { + do { + let fetchResult = try await fetch("https://httpbin.org/uuid").value + let json = try await JSPromise(fetchResult.json().object!)!.value + response = Result { try JSValueDecoder().decode(Response.self, from: json) } + } catch { + response = .failure(error) + } + } +} +#endif diff --git a/Sources/TokamakDemo/DatePickerDemo.swift b/Sources/TokamakDemo/Selectors/DatePickerDemo.swift similarity index 100% rename from Sources/TokamakDemo/DatePickerDemo.swift rename to Sources/TokamakDemo/Selectors/DatePickerDemo.swift diff --git a/Sources/TokamakDemo/PickerDemo.swift b/Sources/TokamakDemo/Selectors/PickerDemo.swift similarity index 100% rename from Sources/TokamakDemo/PickerDemo.swift rename to Sources/TokamakDemo/Selectors/PickerDemo.swift diff --git a/Sources/TokamakDemo/SliderDemo.swift b/Sources/TokamakDemo/Selectors/SliderDemo.swift similarity index 100% rename from Sources/TokamakDemo/SliderDemo.swift rename to Sources/TokamakDemo/Selectors/SliderDemo.swift diff --git a/Sources/TokamakDemo/ToggleDemo.swift b/Sources/TokamakDemo/Selectors/ToggleDemo.swift similarity index 100% rename from Sources/TokamakDemo/ToggleDemo.swift rename to Sources/TokamakDemo/Selectors/ToggleDemo.swift diff --git a/Sources/TokamakDemo/ShadowDemo.swift b/Sources/TokamakDemo/ShadowDemo.swift deleted file mode 100644 index d328a6a33..000000000 --- a/Sources/TokamakDemo/ShadowDemo.swift +++ /dev/null @@ -1,8 +0,0 @@ -import TokamakShim - -struct ShadowDemo: View { - var body: some View { - Color.red.frame(width: 60, height: 60, alignment: .center) - .shadow(color: .black, radius: 5, x: 0, y: 10) - } -} diff --git a/Sources/TokamakDemo/TextDemo.swift b/Sources/TokamakDemo/Text/TextDemo.swift similarity index 97% rename from Sources/TokamakDemo/TextDemo.swift rename to Sources/TokamakDemo/Text/TextDemo.swift index 71b9c0784..d39353465 100644 --- a/Sources/TokamakDemo/TextDemo.swift +++ b/Sources/TokamakDemo/Text/TextDemo.swift @@ -53,8 +53,8 @@ struct TextDemo: View { .heavy, .black, ], id: \.self) { weight in - Text("a") - .fontWeight(weight) + Text("a") + .fontWeight(weight) } } VStack { diff --git a/Sources/TokamakDemo/TextEditorDemo.swift b/Sources/TokamakDemo/Text/TextEditorDemo.swift similarity index 100% rename from Sources/TokamakDemo/TextEditorDemo.swift rename to Sources/TokamakDemo/Text/TextEditorDemo.swift diff --git a/Sources/TokamakDemo/TextFieldDemo.swift b/Sources/TokamakDemo/Text/TextFieldDemo.swift similarity index 100% rename from Sources/TokamakDemo/TextFieldDemo.swift rename to Sources/TokamakDemo/Text/TextFieldDemo.swift diff --git a/Sources/TokamakDemo/TokamakDemo.swift b/Sources/TokamakDemo/TokamakDemo.swift index 4f72b85af..5ad4b6270 100644 --- a/Sources/TokamakDemo/TokamakDemo.swift +++ b/Sources/TokamakDemo/TokamakDemo.swift @@ -133,6 +133,9 @@ struct TokamakDemoView: View { } Section(header: Text("Modifiers")) { NavItem("Shadow", destination: ShadowDemo()) + #if os(WASI) + NavItem("Task", destination: TaskDemo()) + #endif } Section(header: Text("Selectors")) { NavItem("DatePicker", destination: DatePickerDemo()) diff --git a/Sources/TokamakGTK/GSignal.swift b/Sources/TokamakGTK/GSignal.swift index 7e6b7cf2a..397c3a0a5 100644 --- a/Sources/TokamakGTK/GSignal.swift +++ b/Sources/TokamakGTK/GSignal.swift @@ -114,7 +114,7 @@ extension UnsafeMutablePointer where Pointee == GtkWidget { OpaquePointer, () >> - .fromOpaque(closureBox) + .fromOpaque(closureBox) if let widget = widget { unpackedAction.takeUnretainedValue().closure(widget, context) } @@ -125,7 +125,7 @@ extension UnsafeMutablePointer where Pointee == GtkWidget { OpaquePointer, () >> - .fromOpaque(closureBox) + .fromOpaque(closureBox) unpackedAction.release() }) } diff --git a/Sources/TokamakStaticHTML/Modifiers/LayoutModifiers.swift b/Sources/TokamakStaticHTML/Modifiers/LayoutModifiers.swift index cdf904751..4a2f1c067 100644 --- a/Sources/TokamakStaticHTML/Modifiers/LayoutModifiers.swift +++ b/Sources/TokamakStaticHTML/Modifiers/LayoutModifiers.swift @@ -119,7 +119,7 @@ extension _PaddingLayout: DOMViewModifier { public var isOrderDependent: Bool { true } public var attributes: [HTMLAttribute: String] { var padding = [(String, CGFloat)]() - let insets = self.insets ?? .init(_all: 10) + let insets = insets ?? .init(_all: 10) for edge in Edge.allCases { if edges.contains(.init(edge)) { padding.append((edge.cssValue, insets.inset(for: edge))) diff --git a/Sources/TokamakStaticHTML/Views/HTML.swift b/Sources/TokamakStaticHTML/Views/HTML.swift index db2df39fc..916e4c4c8 100644 --- a/Sources/TokamakStaticHTML/Views/HTML.swift +++ b/Sources/TokamakStaticHTML/Views/HTML.swift @@ -58,7 +58,7 @@ public extension AnyHTML { additonalAttributes: [HTMLAttribute: String] = [:], children: [HTMLTarget] ) -> String { - let attributes = self.attributes.merging(additonalAttributes, uniquingKeysWith: +) + let attributes = attributes.merging(additonalAttributes, uniquingKeysWith: +) let renderedAttributes: String if attributes.isEmpty { renderedAttributes = "" From d0bff4baaa6c4e17ec7a07febf31095921b1d317 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 14:26:33 +0100 Subject: [PATCH 02/20] Add back new file locations to `NativeDemo` --- .../TokamakDemo.xcodeproj/project.pbxproj | 418 ++++++++++-------- 1 file changed, 244 insertions(+), 174 deletions(-) diff --git a/NativeDemo/TokamakDemo.xcodeproj/project.pbxproj b/NativeDemo/TokamakDemo.xcodeproj/project.pbxproj index 8590c37b6..433b6c6fa 100644 --- a/NativeDemo/TokamakDemo.xcodeproj/project.pbxproj +++ b/NativeDemo/TokamakDemo.xcodeproj/project.pbxproj @@ -7,73 +7,75 @@ objects = { /* Begin PBXBuildFile section */ - 207C05702610E16E00BBBE54 /* DatePickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 207C056F2610E16E00BBBE54 /* DatePickerDemo.swift */; }; - 207C05712610E16E00BBBE54 /* DatePickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 207C056F2610E16E00BBBE54 /* DatePickerDemo.swift */; }; - 26136823269E8EB5006F372E /* TransitionDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26136822269E8EB5006F372E /* TransitionDemo.swift */; }; - 26136824269E8EB5006F372E /* TransitionDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26136822269E8EB5006F372E /* TransitionDemo.swift */; }; - 262DA7B32695D99500CABEAE /* ShapeStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 262DA7B22695D99500CABEAE /* ShapeStyleDemo.swift */; }; - 262DA7B42695D99500CABEAE /* ShapeStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 262DA7B22695D99500CABEAE /* ShapeStyleDemo.swift */; }; - 2681096D26F7715400078F4E /* CanvasDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2681096C26F7715400078F4E /* CanvasDemo.swift */; }; - 2681096E26F7715400078F4E /* CanvasDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2681096C26F7715400078F4E /* CanvasDemo.swift */; }; - 26A3BFB0269BD18A0004DA16 /* AnimationDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26A3BFAF269BD18A0004DA16 /* AnimationDemo.swift */; }; - 26A3BFB1269BD18A0004DA16 /* AnimationDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26A3BFAF269BD18A0004DA16 /* AnimationDemo.swift */; }; - 26AC04B62698D33A0057784E /* ProgressViewDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26AC04B52698D33A0057784E /* ProgressViewDemo.swift */; }; - 26AC04B72698D33A0057784E /* ProgressViewDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26AC04B52698D33A0057784E /* ProgressViewDemo.swift */; }; - 3DCDE44424CA6AD400910F17 /* SidebarDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DCDE44324CA6AD400910F17 /* SidebarDemo.swift */; }; - 3DCDE44524CA6AD400910F17 /* SidebarDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DCDE44324CA6AD400910F17 /* SidebarDemo.swift */; }; - 4550BD5225B642B80088F4EA /* ShadowDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4550BD5125B642B80088F4EA /* ShadowDemo.swift */; }; - 4550BD5325B642B80088F4EA /* ShadowDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4550BD5125B642B80088F4EA /* ShadowDemo.swift */; }; - 8500293F24D2FF3E001A2E84 /* SliderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8500293E24D2FF3E001A2E84 /* SliderDemo.swift */; }; - 8500294024D2FF3E001A2E84 /* SliderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8500293E24D2FF3E001A2E84 /* SliderDemo.swift */; }; - 854A1A9124B3E3630027BC32 /* ToggleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85CBD5DE24B3BF090066468A /* ToggleDemo.swift */; }; - 854A1A9324B3F28F0027BC32 /* ToggleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85CBD5DE24B3BF090066468A /* ToggleDemo.swift */; }; 85ED186A24AD38F20085DFA0 /* UIAppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED186924AD38F20085DFA0 /* UIAppDelegate.swift */; }; 85ED188A24AD3CD60085DFA0 /* macOS.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 85ED188724AD3CC30085DFA0 /* macOS.storyboard */; }; 85ED188C24AD3CF10085DFA0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 85ED188B24AD3CF10085DFA0 /* LaunchScreen.storyboard */; }; - 85ED18A324AD425E0085DFA0 /* SpacerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189A24AD425E0085DFA0 /* SpacerDemo.swift */; }; - 85ED18A424AD425E0085DFA0 /* SpacerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189A24AD425E0085DFA0 /* SpacerDemo.swift */; }; - 85ED18A524AD425E0085DFA0 /* TextDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189B24AD425E0085DFA0 /* TextDemo.swift */; }; - 85ED18A624AD425E0085DFA0 /* TextDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189B24AD425E0085DFA0 /* TextDemo.swift */; }; - 85ED18A724AD425E0085DFA0 /* ForEachDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189C24AD425E0085DFA0 /* ForEachDemo.swift */; }; - 85ED18A824AD425E0085DFA0 /* ForEachDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189C24AD425E0085DFA0 /* ForEachDemo.swift */; }; 85ED18A924AD425E0085DFA0 /* TokamakDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189D24AD425E0085DFA0 /* TokamakDemo.swift */; }; 85ED18AA24AD425E0085DFA0 /* TokamakDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189D24AD425E0085DFA0 /* TokamakDemo.swift */; }; - 85ED18AB24AD425E0085DFA0 /* Counter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189E24AD425E0085DFA0 /* Counter.swift */; }; - 85ED18AC24AD425E0085DFA0 /* Counter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189E24AD425E0085DFA0 /* Counter.swift */; }; - 85ED18AD24AD425E0085DFA0 /* TextFieldDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189F24AD425E0085DFA0 /* TextFieldDemo.swift */; }; - 85ED18AE24AD425E0085DFA0 /* TextFieldDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189F24AD425E0085DFA0 /* TextFieldDemo.swift */; }; - 85ED18AF24AD425E0085DFA0 /* EnvironmentDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED18A024AD425E0085DFA0 /* EnvironmentDemo.swift */; }; - 85ED18B024AD425E0085DFA0 /* EnvironmentDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED18A024AD425E0085DFA0 /* EnvironmentDemo.swift */; }; 85ED18B624AD42D70085DFA0 /* NSAppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189424AD41B90085DFA0 /* NSAppDelegate.swift */; }; - B51F215024B920B400CF2583 /* PathDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51F214F24B920B400CF2583 /* PathDemo.swift */; }; - B51F215124B920B400CF2583 /* PathDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51F214F24B920B400CF2583 /* PathDemo.swift */; }; - B56F22E024BC89FD001738DF /* ColorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56F22DF24BC89FD001738DF /* ColorDemo.swift */; }; - B56F22E124BC89FD001738DF /* ColorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56F22DF24BC89FD001738DF /* ColorDemo.swift */; }; - B56F22E324BD1C26001738DF /* GridDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56F22E224BD1C26001738DF /* GridDemo.swift */; }; - B56F22E424BD1C26001738DF /* GridDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56F22E224BD1C26001738DF /* GridDemo.swift */; }; - B5C76E4A24C73ED5003EABB2 /* AppStorageDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5C76E4924C73ED4003EABB2 /* AppStorageDemo.swift */; }; - B5C76E4B24C73ED5003EABB2 /* AppStorageDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5C76E4924C73ED4003EABB2 /* AppStorageDemo.swift */; }; - B5DBA22B24D509B4003D3347 /* RedactDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DBA22A24D509B4003D3347 /* RedactDemo.swift */; }; - B5DBA22C24D509B4003D3347 /* RedactDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DBA22A24D509B4003D3347 /* RedactDemo.swift */; }; - B5F2BE032571443D00FB3653 /* PreferenceKeyDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F2BE022571443D00FB3653 /* PreferenceKeyDemo.swift */; }; - B5F2BE042571443D00FB3653 /* PreferenceKeyDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F2BE022571443D00FB3653 /* PreferenceKeyDemo.swift */; }; - D120FDDB257E7145008FFBAD /* TextEditorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D120FDDA257E7145008FFBAD /* TextEditorDemo.swift */; }; - D120FDDC257E7145008FFBAD /* TextEditorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D120FDDA257E7145008FFBAD /* TextEditorDemo.swift */; }; - D1316F202500352200224A67 /* StackDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1316F1F2500352200224A67 /* StackDemo.swift */; }; - D1316F212500352200224A67 /* StackDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1316F1F2500352200224A67 /* StackDemo.swift */; }; - D1B4229024B3B9BB00682F74 /* ListDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B4228E24B3B9BB00682F74 /* ListDemo.swift */; }; - D1B4229124B3B9BB00682F74 /* ListDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B4228E24B3B9BB00682F74 /* ListDemo.swift */; }; - D1B4229224B3B9BB00682F74 /* OutlineGroupDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B4228F24B3B9BB00682F74 /* OutlineGroupDemo.swift */; }; - D1B4229324B3B9BB00682F74 /* OutlineGroupDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B4228F24B3B9BB00682F74 /* OutlineGroupDemo.swift */; }; - D1C726F324CB63C6003B576D /* ButtonStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1C726F224CB63C6003B576D /* ButtonStyleDemo.swift */; }; - D1C726F424CB63C6003B576D /* ButtonStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1C726F224CB63C6003B576D /* ButtonStyleDemo.swift */; }; - D1D6B62324D817350041E1D9 /* GeometryReaderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1D6B62224D817350041E1D9 /* GeometryReaderDemo.swift */; }; - D1D6B62424D817350041E1D9 /* GeometryReaderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1D6B62224D817350041E1D9 /* GeometryReaderDemo.swift */; }; + D107874E274BD1E5003E787B /* SpacerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078726274BD1E5003E787B /* SpacerDemo.swift */; }; + D107874F274BD1E5003E787B /* SpacerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078726274BD1E5003E787B /* SpacerDemo.swift */; }; + D1078750274BD1E5003E787B /* GeometryReaderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078727274BD1E5003E787B /* GeometryReaderDemo.swift */; }; + D1078751274BD1E5003E787B /* GeometryReaderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078727274BD1E5003E787B /* GeometryReaderDemo.swift */; }; + D1078752274BD1E5003E787B /* GridDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078728274BD1E5003E787B /* GridDemo.swift */; }; + D1078753274BD1E5003E787B /* GridDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078728274BD1E5003E787B /* GridDemo.swift */; }; + D1078754274BD1E5003E787B /* StackDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078729274BD1E5003E787B /* StackDemo.swift */; }; + D1078755274BD1E5003E787B /* StackDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078729274BD1E5003E787B /* StackDemo.swift */; }; + D1078756274BD1E5003E787B /* DatePickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872B274BD1E5003E787B /* DatePickerDemo.swift */; }; + D1078757274BD1E5003E787B /* DatePickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872B274BD1E5003E787B /* DatePickerDemo.swift */; }; + D1078758274BD1E5003E787B /* SliderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872C274BD1E5003E787B /* SliderDemo.swift */; }; + D1078759274BD1E5003E787B /* SliderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872C274BD1E5003E787B /* SliderDemo.swift */; }; + D107875A274BD1E5003E787B /* PickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872D274BD1E5003E787B /* PickerDemo.swift */; }; + D107875B274BD1E5003E787B /* PickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872D274BD1E5003E787B /* PickerDemo.swift */; }; + D107875C274BD1E5003E787B /* ToggleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872E274BD1E5003E787B /* ToggleDemo.swift */; }; + D107875D274BD1E5003E787B /* ToggleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872E274BD1E5003E787B /* ToggleDemo.swift */; }; + D107875E274BD1E5003E787B /* OutlineGroupDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078730274BD1E5003E787B /* OutlineGroupDemo.swift */; }; + D107875F274BD1E5003E787B /* OutlineGroupDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078730274BD1E5003E787B /* OutlineGroupDemo.swift */; }; + D1078760274BD1E5003E787B /* ForEachDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078731274BD1E5003E787B /* ForEachDemo.swift */; }; + D1078761274BD1E5003E787B /* ForEachDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078731274BD1E5003E787B /* ForEachDemo.swift */; }; + D1078762274BD1E5003E787B /* ListDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078732274BD1E5003E787B /* ListDemo.swift */; }; + D1078763274BD1E5003E787B /* ListDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078732274BD1E5003E787B /* ListDemo.swift */; }; + D1078764274BD1E5003E787B /* SidebarDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078733274BD1E5003E787B /* SidebarDemo.swift */; }; + D1078765274BD1E5003E787B /* SidebarDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078733274BD1E5003E787B /* SidebarDemo.swift */; }; + D1078766274BD1E5003E787B /* TaskDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078735274BD1E5003E787B /* TaskDemo.swift */; }; + D1078767274BD1E5003E787B /* TaskDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078735274BD1E5003E787B /* TaskDemo.swift */; }; + D1078768274BD1E5003E787B /* ShadowDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078736274BD1E5003E787B /* ShadowDemo.swift */; }; + D1078769274BD1E5003E787B /* ShadowDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078736274BD1E5003E787B /* ShadowDemo.swift */; }; + D107876E274BD1E5003E787B /* PathDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873B274BD1E5003E787B /* PathDemo.swift */; }; + D107876F274BD1E5003E787B /* PathDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873B274BD1E5003E787B /* PathDemo.swift */; }; + D1078770274BD1E5003E787B /* CanvasDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873C274BD1E5003E787B /* CanvasDemo.swift */; }; + D1078771274BD1E5003E787B /* CanvasDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873C274BD1E5003E787B /* CanvasDemo.swift */; }; + D1078772274BD1E5003E787B /* ColorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873D274BD1E5003E787B /* ColorDemo.swift */; }; + D1078773274BD1E5003E787B /* ColorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873D274BD1E5003E787B /* ColorDemo.swift */; }; + D1078774274BD1E5003E787B /* ShapeStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873E274BD1E5003E787B /* ShapeStyleDemo.swift */; }; + D1078775274BD1E5003E787B /* ShapeStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873E274BD1E5003E787B /* ShapeStyleDemo.swift */; }; + D1078776274BD1E5003E787B /* AnimationDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078740274BD1E5003E787B /* AnimationDemo.swift */; }; + D1078777274BD1E5003E787B /* AnimationDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078740274BD1E5003E787B /* AnimationDemo.swift */; }; + D1078778274BD1E5003E787B /* PreferenceKeyDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078741274BD1E5003E787B /* PreferenceKeyDemo.swift */; }; + D1078779274BD1E5003E787B /* PreferenceKeyDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078741274BD1E5003E787B /* PreferenceKeyDemo.swift */; }; + D107877A274BD1E5003E787B /* TransitionDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078742274BD1E5003E787B /* TransitionDemo.swift */; }; + D107877B274BD1E5003E787B /* TransitionDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078742274BD1E5003E787B /* TransitionDemo.swift */; }; + D107877C274BD1E5003E787B /* ProgressViewDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078743274BD1E5003E787B /* ProgressViewDemo.swift */; }; + D107877D274BD1E5003E787B /* ProgressViewDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078743274BD1E5003E787B /* ProgressViewDemo.swift */; }; + D107877E274BD1E5003E787B /* AppStorageDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078744274BD1E5003E787B /* AppStorageDemo.swift */; }; + D107877F274BD1E5003E787B /* AppStorageDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078744274BD1E5003E787B /* AppStorageDemo.swift */; }; + D1078780274BD1E5003E787B /* EnvironmentDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078745274BD1E5003E787B /* EnvironmentDemo.swift */; }; + D1078781274BD1E5003E787B /* EnvironmentDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078745274BD1E5003E787B /* EnvironmentDemo.swift */; }; + D1078782274BD1E5003E787B /* RedactDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078746274BD1E5003E787B /* RedactDemo.swift */; }; + D1078783274BD1E5003E787B /* RedactDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078746274BD1E5003E787B /* RedactDemo.swift */; }; + D1078784274BD1E5003E787B /* TextDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078748274BD1E5003E787B /* TextDemo.swift */; }; + D1078785274BD1E5003E787B /* TextDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078748274BD1E5003E787B /* TextDemo.swift */; }; + D1078786274BD1E5003E787B /* TextEditorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078749274BD1E5003E787B /* TextEditorDemo.swift */; }; + D1078787274BD1E5003E787B /* TextEditorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078749274BD1E5003E787B /* TextEditorDemo.swift */; }; + D1078788274BD1E5003E787B /* TextFieldDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107874A274BD1E5003E787B /* TextFieldDemo.swift */; }; + D1078789274BD1E5003E787B /* TextFieldDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107874A274BD1E5003E787B /* TextFieldDemo.swift */; }; + D107878A274BD1E5003E787B /* Counter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107874C274BD1E5003E787B /* Counter.swift */; }; + D107878B274BD1E5003E787B /* Counter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107874C274BD1E5003E787B /* Counter.swift */; }; + D107878C274BD1E5003E787B /* ButtonStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107874D274BD1E5003E787B /* ButtonStyleDemo.swift */; }; + D107878D274BD1E5003E787B /* ButtonStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107874D274BD1E5003E787B /* ButtonStyleDemo.swift */; }; D1E5FDAD24C1D57000E7485E /* TokamakShim.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1E5FDAC24C1D57000E7485E /* TokamakShim.swift */; }; D1E5FDAF24C1D58E00E7485E /* libTokamakShim.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D1E5FDA424C1D54B00E7485E /* libTokamakShim.a */; }; D1E5FDB224C1D59400E7485E /* libTokamakShim.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D1E5FDA424C1D54B00E7485E /* libTokamakShim.a */; }; - D1EE7EA724C0DD2100C0D127 /* PickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1EE7EA624C0DD2100C0D127 /* PickerDemo.swift */; }; - D1EE7EA824C0DD2100C0D127 /* PickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1EE7EA624C0DD2100C0D127 /* PickerDemo.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -106,47 +108,48 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 207C056F2610E16E00BBBE54 /* DatePickerDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatePickerDemo.swift; sourceTree = ""; }; - 26136822269E8EB5006F372E /* TransitionDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransitionDemo.swift; sourceTree = ""; }; - 262DA7B22695D99500CABEAE /* ShapeStyleDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShapeStyleDemo.swift; sourceTree = ""; }; - 2681096C26F7715400078F4E /* CanvasDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CanvasDemo.swift; sourceTree = ""; }; - 26A3BFAF269BD18A0004DA16 /* AnimationDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimationDemo.swift; sourceTree = ""; }; - 26AC04B52698D33A0057784E /* ProgressViewDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProgressViewDemo.swift; sourceTree = ""; }; - 3DCDE44324CA6AD400910F17 /* SidebarDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SidebarDemo.swift; sourceTree = ""; }; - 4550BD5125B642B80088F4EA /* ShadowDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShadowDemo.swift; sourceTree = ""; }; - 8500293E24D2FF3E001A2E84 /* SliderDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SliderDemo.swift; sourceTree = ""; }; 8587DF5524D4B9A40033EF43 /* TokamakDemo Native.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "TokamakDemo Native.entitlements"; sourceTree = ""; }; - 85CBD5DE24B3BF090066468A /* ToggleDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToggleDemo.swift; sourceTree = ""; }; 85ED184A24AD379A0085DFA0 /* TokamakDemo Native.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "TokamakDemo Native.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 85ED185224AD379A0085DFA0 /* TokamakDemo Native.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "TokamakDemo Native.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 85ED186924AD38F20085DFA0 /* UIAppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIAppDelegate.swift; sourceTree = ""; }; 85ED188724AD3CC30085DFA0 /* macOS.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = macOS.storyboard; sourceTree = ""; }; 85ED188B24AD3CF10085DFA0 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; 85ED189424AD41B90085DFA0 /* NSAppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSAppDelegate.swift; sourceTree = ""; }; - 85ED189A24AD425E0085DFA0 /* SpacerDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpacerDemo.swift; sourceTree = ""; }; - 85ED189B24AD425E0085DFA0 /* TextDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextDemo.swift; sourceTree = ""; }; - 85ED189C24AD425E0085DFA0 /* ForEachDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ForEachDemo.swift; sourceTree = ""; }; 85ED189D24AD425E0085DFA0 /* TokamakDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = TokamakDemo.swift; sourceTree = ""; tabWidth = 2; }; - 85ED189E24AD425E0085DFA0 /* Counter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Counter.swift; sourceTree = ""; }; - 85ED189F24AD425E0085DFA0 /* TextFieldDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextFieldDemo.swift; sourceTree = ""; }; - 85ED18A024AD425E0085DFA0 /* EnvironmentDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EnvironmentDemo.swift; sourceTree = ""; }; 85ED18BD24AD46340085DFA0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 85ED18BF24AD464B0085DFA0 /* iOS Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "iOS Info.plist"; sourceTree = ""; }; - B51F214F24B920B400CF2583 /* PathDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PathDemo.swift; sourceTree = ""; }; - B56F22DF24BC89FD001738DF /* ColorDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = ColorDemo.swift; sourceTree = ""; tabWidth = 2; }; - B56F22E224BD1C26001738DF /* GridDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GridDemo.swift; sourceTree = ""; }; - B5C76E4924C73ED4003EABB2 /* AppStorageDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppStorageDemo.swift; sourceTree = ""; }; - B5DBA22A24D509B4003D3347 /* RedactDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RedactDemo.swift; sourceTree = ""; }; - B5F2BE022571443D00FB3653 /* PreferenceKeyDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreferenceKeyDemo.swift; sourceTree = ""; }; - D120FDDA257E7145008FFBAD /* TextEditorDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextEditorDemo.swift; sourceTree = ""; }; - D1316F1F2500352200224A67 /* StackDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StackDemo.swift; sourceTree = ""; }; - D1B4228E24B3B9BB00682F74 /* ListDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListDemo.swift; sourceTree = ""; }; - D1B4228F24B3B9BB00682F74 /* OutlineGroupDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OutlineGroupDemo.swift; sourceTree = ""; }; - D1C726F224CB63C6003B576D /* ButtonStyleDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = ButtonStyleDemo.swift; sourceTree = ""; tabWidth = 2; }; - D1D6B62224D817350041E1D9 /* GeometryReaderDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeometryReaderDemo.swift; sourceTree = ""; }; + D1078726274BD1E5003E787B /* SpacerDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpacerDemo.swift; sourceTree = ""; }; + D1078727274BD1E5003E787B /* GeometryReaderDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeometryReaderDemo.swift; sourceTree = ""; }; + D1078728274BD1E5003E787B /* GridDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GridDemo.swift; sourceTree = ""; }; + D1078729274BD1E5003E787B /* StackDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StackDemo.swift; sourceTree = ""; }; + D107872B274BD1E5003E787B /* DatePickerDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatePickerDemo.swift; sourceTree = ""; }; + D107872C274BD1E5003E787B /* SliderDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SliderDemo.swift; sourceTree = ""; }; + D107872D274BD1E5003E787B /* PickerDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PickerDemo.swift; sourceTree = ""; }; + D107872E274BD1E5003E787B /* ToggleDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToggleDemo.swift; sourceTree = ""; }; + D1078730274BD1E5003E787B /* OutlineGroupDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OutlineGroupDemo.swift; sourceTree = ""; }; + D1078731274BD1E5003E787B /* ForEachDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ForEachDemo.swift; sourceTree = ""; }; + D1078732274BD1E5003E787B /* ListDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListDemo.swift; sourceTree = ""; }; + D1078733274BD1E5003E787B /* SidebarDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SidebarDemo.swift; sourceTree = ""; }; + D1078735274BD1E5003E787B /* TaskDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TaskDemo.swift; sourceTree = ""; }; + D1078736274BD1E5003E787B /* ShadowDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShadowDemo.swift; sourceTree = ""; }; + D107873B274BD1E5003E787B /* PathDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PathDemo.swift; sourceTree = ""; }; + D107873C274BD1E5003E787B /* CanvasDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CanvasDemo.swift; sourceTree = ""; }; + D107873D274BD1E5003E787B /* ColorDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorDemo.swift; sourceTree = ""; }; + D107873E274BD1E5003E787B /* ShapeStyleDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShapeStyleDemo.swift; sourceTree = ""; }; + D1078740274BD1E5003E787B /* AnimationDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimationDemo.swift; sourceTree = ""; }; + D1078741274BD1E5003E787B /* PreferenceKeyDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreferenceKeyDemo.swift; sourceTree = ""; }; + D1078742274BD1E5003E787B /* TransitionDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransitionDemo.swift; sourceTree = ""; }; + D1078743274BD1E5003E787B /* ProgressViewDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProgressViewDemo.swift; sourceTree = ""; }; + D1078744274BD1E5003E787B /* AppStorageDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppStorageDemo.swift; sourceTree = ""; }; + D1078745274BD1E5003E787B /* EnvironmentDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EnvironmentDemo.swift; sourceTree = ""; }; + D1078746274BD1E5003E787B /* RedactDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RedactDemo.swift; sourceTree = ""; }; + D1078748274BD1E5003E787B /* TextDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextDemo.swift; sourceTree = ""; }; + D1078749274BD1E5003E787B /* TextEditorDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextEditorDemo.swift; sourceTree = ""; }; + D107874A274BD1E5003E787B /* TextFieldDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextFieldDemo.swift; sourceTree = ""; }; + D107874C274BD1E5003E787B /* Counter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Counter.swift; sourceTree = ""; }; + D107874D274BD1E5003E787B /* ButtonStyleDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ButtonStyleDemo.swift; sourceTree = ""; }; D1E5FDA424C1D54B00E7485E /* libTokamakShim.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libTokamakShim.a; sourceTree = BUILT_PRODUCTS_DIR; }; D1E5FDAC24C1D57000E7485E /* TokamakShim.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokamakShim.swift; sourceTree = ""; }; - D1EE7EA624C0DD2100C0D127 /* PickerDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PickerDemo.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -206,41 +209,106 @@ 85ED189924AD425E0085DFA0 /* TokamakDemo */ = { isa = PBXGroup; children = ( - 26136822269E8EB5006F372E /* TransitionDemo.swift */, - 26A3BFAF269BD18A0004DA16 /* AnimationDemo.swift */, - 262DA7B22695D99500CABEAE /* ShapeStyleDemo.swift */, - D120FDDA257E7145008FFBAD /* TextEditorDemo.swift */, - B5C76E4924C73ED4003EABB2 /* AppStorageDemo.swift */, - D1C726F224CB63C6003B576D /* ButtonStyleDemo.swift */, - 2681096C26F7715400078F4E /* CanvasDemo.swift */, - B56F22DF24BC89FD001738DF /* ColorDemo.swift */, - 85ED189E24AD425E0085DFA0 /* Counter.swift */, - 207C056F2610E16E00BBBE54 /* DatePickerDemo.swift */, - 85ED18A024AD425E0085DFA0 /* EnvironmentDemo.swift */, - 85ED189C24AD425E0085DFA0 /* ForEachDemo.swift */, - D1D6B62224D817350041E1D9 /* GeometryReaderDemo.swift */, - B56F22E224BD1C26001738DF /* GridDemo.swift */, - D1B4228E24B3B9BB00682F74 /* ListDemo.swift */, - D1B4228F24B3B9BB00682F74 /* OutlineGroupDemo.swift */, - B51F214F24B920B400CF2583 /* PathDemo.swift */, - D1EE7EA624C0DD2100C0D127 /* PickerDemo.swift */, - B5F2BE022571443D00FB3653 /* PreferenceKeyDemo.swift */, - 26AC04B52698D33A0057784E /* ProgressViewDemo.swift */, - B5DBA22A24D509B4003D3347 /* RedactDemo.swift */, - 3DCDE44324CA6AD400910F17 /* SidebarDemo.swift */, - 8500293E24D2FF3E001A2E84 /* SliderDemo.swift */, - 85ED189A24AD425E0085DFA0 /* SpacerDemo.swift */, - D1316F1F2500352200224A67 /* StackDemo.swift */, - 85ED189B24AD425E0085DFA0 /* TextDemo.swift */, - 85ED189F24AD425E0085DFA0 /* TextFieldDemo.swift */, - 85CBD5DE24B3BF090066468A /* ToggleDemo.swift */, + D107874B274BD1E5003E787B /* Buttons */, + D107872F274BD1E5003E787B /* Containers */, + D107873A274BD1E5003E787B /* Drawing */, + D1078725274BD1E5003E787B /* Layout */, + D107873F274BD1E5003E787B /* Misc */, + D1078734274BD1E5003E787B /* Modifiers */, + D107872A274BD1E5003E787B /* Selectors */, + D1078747274BD1E5003E787B /* Text */, 85ED189D24AD425E0085DFA0 /* TokamakDemo.swift */, - 4550BD5125B642B80088F4EA /* ShadowDemo.swift */, ); name = TokamakDemo; path = ../Sources/TokamakDemo; sourceTree = ""; }; + D1078725274BD1E5003E787B /* Layout */ = { + isa = PBXGroup; + children = ( + D1078726274BD1E5003E787B /* SpacerDemo.swift */, + D1078727274BD1E5003E787B /* GeometryReaderDemo.swift */, + D1078728274BD1E5003E787B /* GridDemo.swift */, + D1078729274BD1E5003E787B /* StackDemo.swift */, + ); + path = Layout; + sourceTree = ""; + }; + D107872A274BD1E5003E787B /* Selectors */ = { + isa = PBXGroup; + children = ( + D107872B274BD1E5003E787B /* DatePickerDemo.swift */, + D107872C274BD1E5003E787B /* SliderDemo.swift */, + D107872D274BD1E5003E787B /* PickerDemo.swift */, + D107872E274BD1E5003E787B /* ToggleDemo.swift */, + ); + path = Selectors; + sourceTree = ""; + }; + D107872F274BD1E5003E787B /* Containers */ = { + isa = PBXGroup; + children = ( + D1078730274BD1E5003E787B /* OutlineGroupDemo.swift */, + D1078731274BD1E5003E787B /* ForEachDemo.swift */, + D1078732274BD1E5003E787B /* ListDemo.swift */, + D1078733274BD1E5003E787B /* SidebarDemo.swift */, + ); + path = Containers; + sourceTree = ""; + }; + D1078734274BD1E5003E787B /* Modifiers */ = { + isa = PBXGroup; + children = ( + D1078735274BD1E5003E787B /* TaskDemo.swift */, + D1078736274BD1E5003E787B /* ShadowDemo.swift */, + ); + path = Modifiers; + sourceTree = ""; + }; + D107873A274BD1E5003E787B /* Drawing */ = { + isa = PBXGroup; + children = ( + D107873B274BD1E5003E787B /* PathDemo.swift */, + D107873C274BD1E5003E787B /* CanvasDemo.swift */, + D107873D274BD1E5003E787B /* ColorDemo.swift */, + D107873E274BD1E5003E787B /* ShapeStyleDemo.swift */, + ); + path = Drawing; + sourceTree = ""; + }; + D107873F274BD1E5003E787B /* Misc */ = { + isa = PBXGroup; + children = ( + D1078740274BD1E5003E787B /* AnimationDemo.swift */, + D1078741274BD1E5003E787B /* PreferenceKeyDemo.swift */, + D1078742274BD1E5003E787B /* TransitionDemo.swift */, + D1078743274BD1E5003E787B /* ProgressViewDemo.swift */, + D1078744274BD1E5003E787B /* AppStorageDemo.swift */, + D1078745274BD1E5003E787B /* EnvironmentDemo.swift */, + D1078746274BD1E5003E787B /* RedactDemo.swift */, + ); + path = Misc; + sourceTree = ""; + }; + D1078747274BD1E5003E787B /* Text */ = { + isa = PBXGroup; + children = ( + D1078748274BD1E5003E787B /* TextDemo.swift */, + D1078749274BD1E5003E787B /* TextEditorDemo.swift */, + D107874A274BD1E5003E787B /* TextFieldDemo.swift */, + ); + path = Text; + sourceTree = ""; + }; + D107874B274BD1E5003E787B /* Buttons */ = { + isa = PBXGroup; + children = ( + D107874C274BD1E5003E787B /* Counter.swift */, + D107874D274BD1E5003E787B /* ButtonStyleDemo.swift */, + ); + path = Buttons; + sourceTree = ""; + }; D1E5FDAB24C1D57000E7485E /* TokamakShim */ = { isa = PBXGroup; children = ( @@ -379,37 +447,38 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + D107875C274BD1E5003E787B /* ToggleDemo.swift in Sources */, + D1078784274BD1E5003E787B /* TextDemo.swift in Sources */, + D107878A274BD1E5003E787B /* Counter.swift in Sources */, + D1078752274BD1E5003E787B /* GridDemo.swift in Sources */, + D1078774274BD1E5003E787B /* ShapeStyleDemo.swift in Sources */, 85ED186A24AD38F20085DFA0 /* UIAppDelegate.swift in Sources */, - 207C05702610E16E00BBBE54 /* DatePickerDemo.swift in Sources */, - B56F22E324BD1C26001738DF /* GridDemo.swift in Sources */, - D1B4229224B3B9BB00682F74 /* OutlineGroupDemo.swift in Sources */, - D1D6B62324D817350041E1D9 /* GeometryReaderDemo.swift in Sources */, - B5DBA22B24D509B4003D3347 /* RedactDemo.swift in Sources */, - B56F22E024BC89FD001738DF /* ColorDemo.swift in Sources */, - 26A3BFB0269BD18A0004DA16 /* AnimationDemo.swift in Sources */, - 26136823269E8EB5006F372E /* TransitionDemo.swift in Sources */, - B51F215024B920B400CF2583 /* PathDemo.swift in Sources */, - 85ED18AF24AD425E0085DFA0 /* EnvironmentDemo.swift in Sources */, - 85ED18A324AD425E0085DFA0 /* SpacerDemo.swift in Sources */, - D1B4229024B3B9BB00682F74 /* ListDemo.swift in Sources */, - D1EE7EA724C0DD2100C0D127 /* PickerDemo.swift in Sources */, - D120FDDB257E7145008FFBAD /* TextEditorDemo.swift in Sources */, - B5F2BE032571443D00FB3653 /* PreferenceKeyDemo.swift in Sources */, - D1316F202500352200224A67 /* StackDemo.swift in Sources */, - 8500293F24D2FF3E001A2E84 /* SliderDemo.swift in Sources */, - 4550BD5225B642B80088F4EA /* ShadowDemo.swift in Sources */, - 2681096D26F7715400078F4E /* CanvasDemo.swift in Sources */, + D107875E274BD1E5003E787B /* OutlineGroupDemo.swift in Sources */, + D1078770274BD1E5003E787B /* CanvasDemo.swift in Sources */, 85ED18A924AD425E0085DFA0 /* TokamakDemo.swift in Sources */, - B5C76E4A24C73ED5003EABB2 /* AppStorageDemo.swift in Sources */, - 3DCDE44424CA6AD400910F17 /* SidebarDemo.swift in Sources */, - 85ED18AD24AD425E0085DFA0 /* TextFieldDemo.swift in Sources */, - 262DA7B32695D99500CABEAE /* ShapeStyleDemo.swift in Sources */, - 85ED18A724AD425E0085DFA0 /* ForEachDemo.swift in Sources */, - D1C726F324CB63C6003B576D /* ButtonStyleDemo.swift in Sources */, - 854A1A9124B3E3630027BC32 /* ToggleDemo.swift in Sources */, - 85ED18A524AD425E0085DFA0 /* TextDemo.swift in Sources */, - 26AC04B62698D33A0057784E /* ProgressViewDemo.swift in Sources */, - 85ED18AB24AD425E0085DFA0 /* Counter.swift in Sources */, + D1078758274BD1E5003E787B /* SliderDemo.swift in Sources */, + D107877A274BD1E5003E787B /* TransitionDemo.swift in Sources */, + D1078768274BD1E5003E787B /* ShadowDemo.swift in Sources */, + D107877E274BD1E5003E787B /* AppStorageDemo.swift in Sources */, + D1078782274BD1E5003E787B /* RedactDemo.swift in Sources */, + D1078786274BD1E5003E787B /* TextEditorDemo.swift in Sources */, + D1078772274BD1E5003E787B /* ColorDemo.swift in Sources */, + D1078776274BD1E5003E787B /* AnimationDemo.swift in Sources */, + D1078756274BD1E5003E787B /* DatePickerDemo.swift in Sources */, + D1078780274BD1E5003E787B /* EnvironmentDemo.swift in Sources */, + D107876E274BD1E5003E787B /* PathDemo.swift in Sources */, + D1078764274BD1E5003E787B /* SidebarDemo.swift in Sources */, + D1078754274BD1E5003E787B /* StackDemo.swift in Sources */, + D1078778274BD1E5003E787B /* PreferenceKeyDemo.swift in Sources */, + D107874E274BD1E5003E787B /* SpacerDemo.swift in Sources */, + D1078766274BD1E5003E787B /* TaskDemo.swift in Sources */, + D1078760274BD1E5003E787B /* ForEachDemo.swift in Sources */, + D1078750274BD1E5003E787B /* GeometryReaderDemo.swift in Sources */, + D107875A274BD1E5003E787B /* PickerDemo.swift in Sources */, + D1078788274BD1E5003E787B /* TextFieldDemo.swift in Sources */, + D107878C274BD1E5003E787B /* ButtonStyleDemo.swift in Sources */, + D1078762274BD1E5003E787B /* ListDemo.swift in Sources */, + D107877C274BD1E5003E787B /* ProgressViewDemo.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -417,37 +486,38 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + D107875D274BD1E5003E787B /* ToggleDemo.swift in Sources */, + D1078785274BD1E5003E787B /* TextDemo.swift in Sources */, + D107878B274BD1E5003E787B /* Counter.swift in Sources */, + D1078753274BD1E5003E787B /* GridDemo.swift in Sources */, + D1078775274BD1E5003E787B /* ShapeStyleDemo.swift in Sources */, 85ED18AA24AD425E0085DFA0 /* TokamakDemo.swift in Sources */, - 207C05712610E16E00BBBE54 /* DatePickerDemo.swift in Sources */, - D1316F212500352200224A67 /* StackDemo.swift in Sources */, - B56F22E424BD1C26001738DF /* GridDemo.swift in Sources */, - D1B4229324B3B9BB00682F74 /* OutlineGroupDemo.swift in Sources */, - D1D6B62424D817350041E1D9 /* GeometryReaderDemo.swift in Sources */, - B5DBA22C24D509B4003D3347 /* RedactDemo.swift in Sources */, - 26A3BFB1269BD18A0004DA16 /* AnimationDemo.swift in Sources */, - 26136824269E8EB5006F372E /* TransitionDemo.swift in Sources */, - B56F22E124BC89FD001738DF /* ColorDemo.swift in Sources */, - B51F215124B920B400CF2583 /* PathDemo.swift in Sources */, - 85ED18A424AD425E0085DFA0 /* SpacerDemo.swift in Sources */, - 85ED18B024AD425E0085DFA0 /* EnvironmentDemo.swift in Sources */, - D1B4229124B3B9BB00682F74 /* ListDemo.swift in Sources */, - D1EE7EA824C0DD2100C0D127 /* PickerDemo.swift in Sources */, - D120FDDC257E7145008FFBAD /* TextEditorDemo.swift in Sources */, - B5F2BE042571443D00FB3653 /* PreferenceKeyDemo.swift in Sources */, - 8500294024D2FF3E001A2E84 /* SliderDemo.swift in Sources */, - 4550BD5325B642B80088F4EA /* ShadowDemo.swift in Sources */, - 2681096E26F7715400078F4E /* CanvasDemo.swift in Sources */, + D107875F274BD1E5003E787B /* OutlineGroupDemo.swift in Sources */, + D1078771274BD1E5003E787B /* CanvasDemo.swift in Sources */, 85ED18B624AD42D70085DFA0 /* NSAppDelegate.swift in Sources */, - B5C76E4B24C73ED5003EABB2 /* AppStorageDemo.swift in Sources */, - 3DCDE44524CA6AD400910F17 /* SidebarDemo.swift in Sources */, - 85ED18AC24AD425E0085DFA0 /* Counter.swift in Sources */, - 262DA7B42695D99500CABEAE /* ShapeStyleDemo.swift in Sources */, - 85ED18A824AD425E0085DFA0 /* ForEachDemo.swift in Sources */, - D1C726F424CB63C6003B576D /* ButtonStyleDemo.swift in Sources */, - 854A1A9324B3F28F0027BC32 /* ToggleDemo.swift in Sources */, - 85ED18AE24AD425E0085DFA0 /* TextFieldDemo.swift in Sources */, - 26AC04B72698D33A0057784E /* ProgressViewDemo.swift in Sources */, - 85ED18A624AD425E0085DFA0 /* TextDemo.swift in Sources */, + D1078759274BD1E5003E787B /* SliderDemo.swift in Sources */, + D107877B274BD1E5003E787B /* TransitionDemo.swift in Sources */, + D1078769274BD1E5003E787B /* ShadowDemo.swift in Sources */, + D107877F274BD1E5003E787B /* AppStorageDemo.swift in Sources */, + D1078783274BD1E5003E787B /* RedactDemo.swift in Sources */, + D1078787274BD1E5003E787B /* TextEditorDemo.swift in Sources */, + D1078773274BD1E5003E787B /* ColorDemo.swift in Sources */, + D1078777274BD1E5003E787B /* AnimationDemo.swift in Sources */, + D1078757274BD1E5003E787B /* DatePickerDemo.swift in Sources */, + D1078781274BD1E5003E787B /* EnvironmentDemo.swift in Sources */, + D107876F274BD1E5003E787B /* PathDemo.swift in Sources */, + D1078765274BD1E5003E787B /* SidebarDemo.swift in Sources */, + D1078755274BD1E5003E787B /* StackDemo.swift in Sources */, + D1078779274BD1E5003E787B /* PreferenceKeyDemo.swift in Sources */, + D107874F274BD1E5003E787B /* SpacerDemo.swift in Sources */, + D1078767274BD1E5003E787B /* TaskDemo.swift in Sources */, + D1078761274BD1E5003E787B /* ForEachDemo.swift in Sources */, + D1078751274BD1E5003E787B /* GeometryReaderDemo.swift in Sources */, + D107875B274BD1E5003E787B /* PickerDemo.swift in Sources */, + D1078789274BD1E5003E787B /* TextFieldDemo.swift in Sources */, + D107878D274BD1E5003E787B /* ButtonStyleDemo.swift in Sources */, + D1078763274BD1E5003E787B /* ListDemo.swift in Sources */, + D107877D274BD1E5003E787B /* ProgressViewDemo.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From 8932bd0f9b2fba684b8e0db2bb034557ff2ec9cd Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 14:38:33 +0100 Subject: [PATCH 03/20] Add compiler `#if` check to `TaskDemo` --- Sources/TokamakDemo/Modifiers/TaskDemo.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/TokamakDemo/Modifiers/TaskDemo.swift b/Sources/TokamakDemo/Modifiers/TaskDemo.swift index 978aa0f1b..1a159a4be 100644 --- a/Sources/TokamakDemo/Modifiers/TaskDemo.swift +++ b/Sources/TokamakDemo/Modifiers/TaskDemo.swift @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if os(WASI) +#if os(WASI) && compiler(>=5.5) import JavaScriptKit import TokamakDOM From b65300f09de6bb43abc9b44e6a3df24d8aa28fe0 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 18:52:29 +0100 Subject: [PATCH 04/20] Update to JavaScriptKit 0.11.1 --- Package.resolved | 4 ++-- Package.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Package.resolved b/Package.resolved index 027034f65..284a7af55 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/swiftwasm/JavaScriptKit.git", "state": { "branch": null, - "revision": "40b1614b4ed12c3741b5fadc47f07dcc55a1ac82", - "version": "0.11.0" + "revision": "309e63c03d8116210ad0437f5d1f09a26d4de48b", + "version": "0.11.1" } }, { diff --git a/Package.swift b/Package.swift index 428c72cbb..0e68794e1 100644 --- a/Package.swift +++ b/Package.swift @@ -76,7 +76,7 @@ let package = Package( // .package(url: /* package url */, from: "1.0.0"), .package( url: "https://github.com/swiftwasm/JavaScriptKit.git", - .upToNextMinor(from: "0.11.0") + .upToNextMinor(from: "0.11.1") ), .package( url: "https://github.com/OpenCombine/OpenCombine.git", From 2ee9fc5434c1dc1ee7df9fdae643aa3dd2eadf1f Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 18:57:03 +0100 Subject: [PATCH 05/20] Restrict `TaskDemo` with `compiler(>=5.5)` check --- Sources/TokamakDemo/TokamakDemo.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/TokamakDemo/TokamakDemo.swift b/Sources/TokamakDemo/TokamakDemo.swift index 5ad4b6270..5db47d9bd 100644 --- a/Sources/TokamakDemo/TokamakDemo.swift +++ b/Sources/TokamakDemo/TokamakDemo.swift @@ -133,7 +133,7 @@ struct TokamakDemoView: View { } Section(header: Text("Modifiers")) { NavItem("Shadow", destination: ShadowDemo()) - #if os(WASI) + #if os(WASI) && compiler(>=5.5) NavItem("Task", destination: TaskDemo()) #endif } From 534784ca7bf73b5116567edb761b779126f45c62 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 19:03:09 +0100 Subject: [PATCH 06/20] Replace `compiler` with `swift` in some places --- Sources/TokamakCore/Modifiers/TaskModifier.swift | 2 +- Sources/TokamakDemo/Modifiers/TaskDemo.swift | 2 +- Sources/TokamakDemo/TokamakDemo.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/TokamakCore/Modifiers/TaskModifier.swift b/Sources/TokamakCore/Modifiers/TaskModifier.swift index 0b6efea3f..0c3151d70 100644 --- a/Sources/TokamakCore/Modifiers/TaskModifier.swift +++ b/Sources/TokamakCore/Modifiers/TaskModifier.swift @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if compiler(>=5.5) +#if swift(>=5.5) public extension View { func task( diff --git a/Sources/TokamakDemo/Modifiers/TaskDemo.swift b/Sources/TokamakDemo/Modifiers/TaskDemo.swift index 1a159a4be..0392d0b1a 100644 --- a/Sources/TokamakDemo/Modifiers/TaskDemo.swift +++ b/Sources/TokamakDemo/Modifiers/TaskDemo.swift @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if os(WASI) && compiler(>=5.5) +#if os(WASI) && swift(>=5.5) import JavaScriptKit import TokamakDOM diff --git a/Sources/TokamakDemo/TokamakDemo.swift b/Sources/TokamakDemo/TokamakDemo.swift index 5db47d9bd..2851acf7b 100644 --- a/Sources/TokamakDemo/TokamakDemo.swift +++ b/Sources/TokamakDemo/TokamakDemo.swift @@ -133,7 +133,7 @@ struct TokamakDemoView: View { } Section(header: Text("Modifiers")) { NavItem("Shadow", destination: ShadowDemo()) - #if os(WASI) && compiler(>=5.5) + #if os(WASI) && swift(>=5.5) NavItem("Task", destination: TaskDemo()) #endif } From 7382291613287aff17a5906e207239e1e7feb042 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 19:07:42 +0100 Subject: [PATCH 07/20] Revert "Replace `compiler` with `swift` in some places" This reverts commit 534784ca7bf73b5116567edb761b779126f45c62. --- Sources/TokamakCore/Modifiers/TaskModifier.swift | 2 +- Sources/TokamakDemo/Modifiers/TaskDemo.swift | 2 +- Sources/TokamakDemo/TokamakDemo.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/TokamakCore/Modifiers/TaskModifier.swift b/Sources/TokamakCore/Modifiers/TaskModifier.swift index 0c3151d70..0b6efea3f 100644 --- a/Sources/TokamakCore/Modifiers/TaskModifier.swift +++ b/Sources/TokamakCore/Modifiers/TaskModifier.swift @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if swift(>=5.5) +#if compiler(>=5.5) public extension View { func task( diff --git a/Sources/TokamakDemo/Modifiers/TaskDemo.swift b/Sources/TokamakDemo/Modifiers/TaskDemo.swift index 0392d0b1a..1a159a4be 100644 --- a/Sources/TokamakDemo/Modifiers/TaskDemo.swift +++ b/Sources/TokamakDemo/Modifiers/TaskDemo.swift @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if os(WASI) && swift(>=5.5) +#if os(WASI) && compiler(>=5.5) import JavaScriptKit import TokamakDOM diff --git a/Sources/TokamakDemo/TokamakDemo.swift b/Sources/TokamakDemo/TokamakDemo.swift index 2851acf7b..5db47d9bd 100644 --- a/Sources/TokamakDemo/TokamakDemo.swift +++ b/Sources/TokamakDemo/TokamakDemo.swift @@ -133,7 +133,7 @@ struct TokamakDemoView: View { } Section(header: Text("Modifiers")) { NavItem("Shadow", destination: ShadowDemo()) - #if os(WASI) && swift(>=5.5) + #if os(WASI) && compiler(>=5.5) NavItem("Task", destination: TaskDemo()) #endif } From 63d044f2d54a74bf1a916e5b2e1cffdd16e41759 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 19:08:16 +0100 Subject: [PATCH 08/20] Use Xcode 13.2 on GitHub Actions hosts --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa912975f..7ee2d2064 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: shell: bash run: | set -ex - sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer/ + sudo xcode-select --switch /Applications/Xcode_13.2.app/Contents/Developer/ # avoid building unrelated products for testing by specifying the test product explicitly swift build --product TokamakPackageTests `xcrun --find xctest` .build/debug/TokamakPackageTests.xctest || @@ -73,7 +73,7 @@ jobs: shell: bash run: | set -ex - sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer/ + sudo xcode-select --switch /Applications/Xcode_13.2.app/Contents/Developer/ brew install gtk+3 From 68c845bc1917dd4a734ec89813bf40395f090320 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 19:22:07 +0100 Subject: [PATCH 09/20] Find `TokamakPackageTests` in the build directory --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ee2d2064..184a583ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,7 @@ jobs: sudo xcode-select --switch /Applications/Xcode_13.2.app/Contents/Developer/ # avoid building unrelated products for testing by specifying the test product explicitly swift build --product TokamakPackageTests + find .build -iname 'TokamakPackageTests*' `xcrun --find xctest` .build/debug/TokamakPackageTests.xctest || (cp -r /var/folders/*/*/*/*Tests . ; exit 1) From 3ccbc98a2d70f3ea7d4e3a4e9a4d7aa2ccb49e6e Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 19:25:03 +0100 Subject: [PATCH 10/20] Fix macOS tests bundle path --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 184a583ba..92dd1713e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: # avoid building unrelated products for testing by specifying the test product explicitly swift build --product TokamakPackageTests find .build -iname 'TokamakPackageTests*' - `xcrun --find xctest` .build/debug/TokamakPackageTests.xctest || + `xcrun --find xctest` .build/*/debug/TokamakPackageTests.xctest || (cp -r /var/folders/*/*/*/*Tests . ; exit 1) rm -rf Sources/TokamakGTKCHelpers/*.c From bac82ce909ccb90babd8262c9eabfc2fb5d7fc3d Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 19:31:55 +0100 Subject: [PATCH 11/20] Make `task` modifier available only on macOS Monterey --- Sources/TokamakCore/Modifiers/TaskModifier.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/TokamakCore/Modifiers/TaskModifier.swift b/Sources/TokamakCore/Modifiers/TaskModifier.swift index 0b6efea3f..240c2db85 100644 --- a/Sources/TokamakCore/Modifiers/TaskModifier.swift +++ b/Sources/TokamakCore/Modifiers/TaskModifier.swift @@ -14,6 +14,7 @@ #if compiler(>=5.5) +@available(macOS 12.0, *) public extension View { func task( priority: TaskPriority = .userInitiated, From 4d25ff484a04f764a752e23a0ad4ec8fc8ce0863 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 19:32:07 +0100 Subject: [PATCH 12/20] Revert "Use Xcode 13.2 on GitHub Actions hosts" This reverts commit 63d044f2d54a74bf1a916e5b2e1cffdd16e41759. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92dd1713e..622aa4451 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: shell: bash run: | set -ex - sudo xcode-select --switch /Applications/Xcode_13.2.app/Contents/Developer/ + sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer/ # avoid building unrelated products for testing by specifying the test product explicitly swift build --product TokamakPackageTests find .build -iname 'TokamakPackageTests*' @@ -74,7 +74,7 @@ jobs: shell: bash run: | set -ex - sudo xcode-select --switch /Applications/Xcode_13.2.app/Contents/Developer/ + sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer/ brew install gtk+3 From 2fa2e3e5276b15819cc5840b765e9a6b986dc259 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 19:32:24 +0100 Subject: [PATCH 13/20] Revert "Fix macOS tests bundle path" This reverts commit 3ccbc98a2d70f3ea7d4e3a4e9a4d7aa2ccb49e6e. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 622aa4451..127fb67a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: # avoid building unrelated products for testing by specifying the test product explicitly swift build --product TokamakPackageTests find .build -iname 'TokamakPackageTests*' - `xcrun --find xctest` .build/*/debug/TokamakPackageTests.xctest || + `xcrun --find xctest` .build/debug/TokamakPackageTests.xctest || (cp -r /var/folders/*/*/*/*Tests . ; exit 1) rm -rf Sources/TokamakGTKCHelpers/*.c From 55001d2038249c1b093544995d1b234a31c5c9f9 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 19:32:28 +0100 Subject: [PATCH 14/20] Revert "Find `TokamakPackageTests` in the build directory" This reverts commit 68c845bc1917dd4a734ec89813bf40395f090320. --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 127fb67a3..fa912975f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,6 @@ jobs: sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer/ # avoid building unrelated products for testing by specifying the test product explicitly swift build --product TokamakPackageTests - find .build -iname 'TokamakPackageTests*' `xcrun --find xctest` .build/debug/TokamakPackageTests.xctest || (cp -r /var/folders/*/*/*/*Tests . ; exit 1) From 05728f503cbcd3fe1d178306a7794e3f9ad8f845 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 19:40:35 +0100 Subject: [PATCH 15/20] Use `canImport(Concurrency)` as an ultimate check --- Package.swift | 2 +- Sources/TokamakCore/Modifiers/TaskModifier.swift | 3 +-- Sources/TokamakDOM/DOMRenderer.swift | 4 ++-- Sources/TokamakDemo/Modifiers/TaskDemo.swift | 2 +- Sources/TokamakDemo/TokamakDemo.swift | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Package.swift b/Package.swift index 0e68794e1..c697d63e4 100644 --- a/Package.swift +++ b/Package.swift @@ -19,7 +19,7 @@ var tokamakDOMDependencies: [Target.Dependency] = [ "OpenCombineJS", ] -#if compiler(>=5.5) +#if canImport(Concurrency) tokamakDOMDependencies.append( .product( name: "JavaScriptEventLoop", diff --git a/Sources/TokamakCore/Modifiers/TaskModifier.swift b/Sources/TokamakCore/Modifiers/TaskModifier.swift index 240c2db85..9118bb671 100644 --- a/Sources/TokamakCore/Modifiers/TaskModifier.swift +++ b/Sources/TokamakCore/Modifiers/TaskModifier.swift @@ -12,9 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if compiler(>=5.5) +#if canImport(Concurrency) -@available(macOS 12.0, *) public extension View { func task( priority: TaskPriority = .userInitiated, diff --git a/Sources/TokamakDOM/DOMRenderer.swift b/Sources/TokamakDOM/DOMRenderer.swift index 28b7ab237..59f6f640f 100644 --- a/Sources/TokamakDOM/DOMRenderer.swift +++ b/Sources/TokamakDOM/DOMRenderer.swift @@ -20,7 +20,7 @@ import OpenCombineJS @_spi(TokamakCore) import TokamakCore import TokamakStaticHTML -#if compiler(>=5.5) +#if canImport(Concurrency) import JavaScriptEventLoop #endif @@ -91,7 +91,7 @@ final class DOMRenderer: Renderer { rootRef = ref appendRootStyle(ref) - #if compiler(>=5.5) + #if canImport(Concurrency) JavaScriptEventLoop.installGlobalExecutor() #endif diff --git a/Sources/TokamakDemo/Modifiers/TaskDemo.swift b/Sources/TokamakDemo/Modifiers/TaskDemo.swift index 1a159a4be..86e230cb6 100644 --- a/Sources/TokamakDemo/Modifiers/TaskDemo.swift +++ b/Sources/TokamakDemo/Modifiers/TaskDemo.swift @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if os(WASI) && compiler(>=5.5) +#if os(WASI) && canImport(Concurrency) import JavaScriptKit import TokamakDOM diff --git a/Sources/TokamakDemo/TokamakDemo.swift b/Sources/TokamakDemo/TokamakDemo.swift index 5db47d9bd..ab4a0f1f4 100644 --- a/Sources/TokamakDemo/TokamakDemo.swift +++ b/Sources/TokamakDemo/TokamakDemo.swift @@ -133,7 +133,7 @@ struct TokamakDemoView: View { } Section(header: Text("Modifiers")) { NavItem("Shadow", destination: ShadowDemo()) - #if os(WASI) && compiler(>=5.5) + #if os(WASI) && canImport(Concurrency) NavItem("Task", destination: TaskDemo()) #endif } From 226fce60f0c526c9d50a345999013d3de7d5dec0 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 19:45:24 +0100 Subject: [PATCH 16/20] Use `compiler(>=5.5) && canImport(Concurrency)` --- Package.swift | 2 +- Sources/TokamakCore/Modifiers/TaskModifier.swift | 2 +- Sources/TokamakDOM/DOMRenderer.swift | 4 ++-- Sources/TokamakDemo/Modifiers/TaskDemo.swift | 2 +- Sources/TokamakDemo/TokamakDemo.swift | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Package.swift b/Package.swift index c697d63e4..b5691e043 100644 --- a/Package.swift +++ b/Package.swift @@ -19,7 +19,7 @@ var tokamakDOMDependencies: [Target.Dependency] = [ "OpenCombineJS", ] -#if canImport(Concurrency) +#if compiler(>=5.5) && canImport(Concurrency) tokamakDOMDependencies.append( .product( name: "JavaScriptEventLoop", diff --git a/Sources/TokamakCore/Modifiers/TaskModifier.swift b/Sources/TokamakCore/Modifiers/TaskModifier.swift index 9118bb671..a210df8de 100644 --- a/Sources/TokamakCore/Modifiers/TaskModifier.swift +++ b/Sources/TokamakCore/Modifiers/TaskModifier.swift @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if canImport(Concurrency) +#if compiler(>=5.5) && canImport(Concurrency) public extension View { func task( diff --git a/Sources/TokamakDOM/DOMRenderer.swift b/Sources/TokamakDOM/DOMRenderer.swift index 59f6f640f..4459a9555 100644 --- a/Sources/TokamakDOM/DOMRenderer.swift +++ b/Sources/TokamakDOM/DOMRenderer.swift @@ -20,7 +20,7 @@ import OpenCombineJS @_spi(TokamakCore) import TokamakCore import TokamakStaticHTML -#if canImport(Concurrency) +#if compiler(>=5.5) && canImport(Concurrency) import JavaScriptEventLoop #endif @@ -91,7 +91,7 @@ final class DOMRenderer: Renderer { rootRef = ref appendRootStyle(ref) - #if canImport(Concurrency) + #if compiler(>=5.5) && canImport(Concurrency) JavaScriptEventLoop.installGlobalExecutor() #endif diff --git a/Sources/TokamakDemo/Modifiers/TaskDemo.swift b/Sources/TokamakDemo/Modifiers/TaskDemo.swift index 86e230cb6..e6108fc5d 100644 --- a/Sources/TokamakDemo/Modifiers/TaskDemo.swift +++ b/Sources/TokamakDemo/Modifiers/TaskDemo.swift @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if os(WASI) && canImport(Concurrency) +#if os(WASI) && compiler(>=5.5) && canImport(Concurrency) import JavaScriptKit import TokamakDOM diff --git a/Sources/TokamakDemo/TokamakDemo.swift b/Sources/TokamakDemo/TokamakDemo.swift index ab4a0f1f4..2851e5ebf 100644 --- a/Sources/TokamakDemo/TokamakDemo.swift +++ b/Sources/TokamakDemo/TokamakDemo.swift @@ -133,7 +133,7 @@ struct TokamakDemoView: View { } Section(header: Text("Modifiers")) { NavItem("Shadow", destination: ShadowDemo()) - #if os(WASI) && canImport(Concurrency) + #if os(WASI) && compiler(>=5.5) && canImport(Concurrency) NavItem("Task", destination: TaskDemo()) #endif } From a9bbf1907ad0619ac87503442fc8b848dc4c5dea Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 22 Nov 2021 19:57:48 +0100 Subject: [PATCH 17/20] Clarify new browser version requirements in `README.md` --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7264d7bc7..69616139f 100644 --- a/README.md +++ b/README.md @@ -119,14 +119,25 @@ app. ## Requirements for app users -Any browser that [supports WebAssembly](https://caniuse.com/#feat=wasm) should work, which currently includes: +Any recent browser that [supports WebAssembly](https://caniuse.com/#feat=wasm) and [required +JavaScript features](https://caniuse.com/?search=finalizationregistry) should work, which currently includes: + +- Edge 84+ +- Firefox 79+ +- Chrome 84+ +- Desktop Safari 14.1+ +- Mobile Safari 14.8+ + +If you need to support older browser versions, you'll have to build with +`JAVASCRIPTKIT_WITHOUT_WEAKREFS` flag, passing `-Xswiftc -DJAVASCRIPTKIT_WITHOUT_WEAKREFS` flags +when compiling. This should lower browser requirements to these versions: - Edge 16+ - Firefox 61+ - Chrome 66+ - (Mobile) Safari 12+ -Not all of these were tested though, compatibility reports are very welcome! +Not all of these versions are tested on regular basis though, compatibility reports are very welcome! ## Getting started From d23a296d6766e3abfcc90ae155c19ec70f5e9ee0 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 23 Nov 2021 13:26:02 +0100 Subject: [PATCH 18/20] Account for `_Concurrency` naming --- Package.swift | 2 +- Sources/TokamakCore/Modifiers/TaskModifier.swift | 2 +- Sources/TokamakDOM/DOMRenderer.swift | 4 ++-- Sources/TokamakDemo/Modifiers/TaskDemo.swift | 2 +- Sources/TokamakDemo/TokamakDemo.swift | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Package.swift b/Package.swift index b5691e043..65f4064bc 100644 --- a/Package.swift +++ b/Package.swift @@ -19,7 +19,7 @@ var tokamakDOMDependencies: [Target.Dependency] = [ "OpenCombineJS", ] -#if compiler(>=5.5) && canImport(Concurrency) +#if compiler(>=5.5) && (canImport(Concurrency) || canImport(_Concurrency)) tokamakDOMDependencies.append( .product( name: "JavaScriptEventLoop", diff --git a/Sources/TokamakCore/Modifiers/TaskModifier.swift b/Sources/TokamakCore/Modifiers/TaskModifier.swift index a210df8de..304203eb1 100644 --- a/Sources/TokamakCore/Modifiers/TaskModifier.swift +++ b/Sources/TokamakCore/Modifiers/TaskModifier.swift @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if compiler(>=5.5) && canImport(Concurrency) +#if compiler(>=5.5) && (canImport(Concurrency) || canImport(_Concurrency)) public extension View { func task( diff --git a/Sources/TokamakDOM/DOMRenderer.swift b/Sources/TokamakDOM/DOMRenderer.swift index 4459a9555..c57f745e0 100644 --- a/Sources/TokamakDOM/DOMRenderer.swift +++ b/Sources/TokamakDOM/DOMRenderer.swift @@ -20,7 +20,7 @@ import OpenCombineJS @_spi(TokamakCore) import TokamakCore import TokamakStaticHTML -#if compiler(>=5.5) && canImport(Concurrency) +#if compiler(>=5.5) && (canImport(Concurrency) || canImport(_Concurrency)) import JavaScriptEventLoop #endif @@ -91,7 +91,7 @@ final class DOMRenderer: Renderer { rootRef = ref appendRootStyle(ref) - #if compiler(>=5.5) && canImport(Concurrency) + #if compiler(>=5.5) && (canImport(Concurrency) || canImport(_Concurrency)) JavaScriptEventLoop.installGlobalExecutor() #endif diff --git a/Sources/TokamakDemo/Modifiers/TaskDemo.swift b/Sources/TokamakDemo/Modifiers/TaskDemo.swift index e6108fc5d..c37784d85 100644 --- a/Sources/TokamakDemo/Modifiers/TaskDemo.swift +++ b/Sources/TokamakDemo/Modifiers/TaskDemo.swift @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if os(WASI) && compiler(>=5.5) && canImport(Concurrency) +#if os(WASI) && compiler(>=5.5) && (canImport(Concurrency) || canImport(_Concurrency)) import JavaScriptKit import TokamakDOM diff --git a/Sources/TokamakDemo/TokamakDemo.swift b/Sources/TokamakDemo/TokamakDemo.swift index 2851e5ebf..2a6452acd 100644 --- a/Sources/TokamakDemo/TokamakDemo.swift +++ b/Sources/TokamakDemo/TokamakDemo.swift @@ -133,7 +133,7 @@ struct TokamakDemoView: View { } Section(header: Text("Modifiers")) { NavItem("Shadow", destination: ShadowDemo()) - #if os(WASI) && compiler(>=5.5) && canImport(Concurrency) + #if os(WASI) && compiler(>=5.5) && (canImport(Concurrency) || canImport(_Concurrency)) NavItem("Task", destination: TaskDemo()) #endif } From 14ace4204fed8f28abd4c88aaf64fd7c3f88b266 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 23 Nov 2021 15:16:44 +0100 Subject: [PATCH 19/20] Update `README.md` --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 69616139f..2cca089f3 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,9 @@ app. ## Requirements for app developers -- macOS 11 and Xcode 13.0. *Xcode 13.1 is currently not supported.* +- macOS 11 and Xcode 13.0 or later. Xcode 13.2 or later are recommended if you're developing +multi-platform apps that target WebAssembly and macOS at the same time, as these versions support +Swift concurrency back-deployment. - [Swift 5.4 or later](https://swift.org/download/) and Ubuntu 18.04 if you'd like to use Linux. Other Linux distributions are currently not supported. @@ -152,7 +154,7 @@ app by following these steps: brew install swiftwasm/tap/carton ``` -If you had `carton` installed before this, make sure you have version 0.11.0 or greater: +If you had `carton` installed before this, make sure you have version 0.12.0 or greater: ``` carton --version From cf0ad8391235695597019cd2aef3a6e1c8f88740 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 23 Nov 2021 15:25:02 +0100 Subject: [PATCH 20/20] Update README.md Co-authored-by: ezraberch <49635435+ezraberch@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2cca089f3..9fd3358c6 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ app. ## Requirements for app developers -- macOS 11 and Xcode 13.0 or later. Xcode 13.2 or later are recommended if you're developing +- macOS 11 and Xcode 13.0 or later. Xcode 13.2 or later is recommended if you're developing multi-platform apps that target WebAssembly and macOS at the same time, as these versions support Swift concurrency back-deployment. - [Swift 5.4 or later](https://swift.org/download/) and Ubuntu 18.04 if you'd like to use Linux.