Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback on Group for unknown Views #1482

Draft
wants to merge 1 commit into
base: core-file-upload
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ struct BuiltinRegistryGenerator: ParsableCommand {
let generated = """
import SwiftUI
import LiveViewNativeStylesheet
import OSLog

private let logger = Logger(subsystem: "LiveViewNative", category: "BuiltinRegistry")

// This switch can't be inlined into BuiltinRegistry.lookup because it results in that method's return type
// being a massive pile of nested _ConditionalContents. Instead, lift it out into a separate View type
Expand All @@ -82,7 +85,8 @@ struct BuiltinRegistryGenerator: ParsableCommand {
\(Self.additionalViews.map(additionalViewCase(name:initializer:)).joined(separator: "\n"))
default:
// log here that view type cannot be found
EmptyView()
let _ = logger.error("'<\\(name)>' is not a known element.")
Group<R>()
}
}
}
Expand Down
Loading