-
Notifications
You must be signed in to change notification settings - Fork 43
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
Proposal: instead of not rendering unknown views, fall back to View and continue to render children #1413
Comments
I would do this by using We should probably still log the error. It could be something like this: <nonexistent style="foregroundStyle(.orange);">
<Text>Hello, world!</Text>
</nonexistent> would render as: Group {
Text("Hello, world!")
}
.foregroundStyle(.orange)
.task {
logger.log(.warning, "...")
} with a message like this:
It would be nice if we had some debug information passed on all elements. I think LiveView does this for a jump-to-definition feature. It could use this info to log the file/line number of the unknown element. |
That works
…----------------------
Brian Cardarella
Founder, DockYard
On Tue, Aug 20, 2024 at 1:43 PM Carson Katri ***@***.***> wrote:
I would do this by using Group when the element doesn't exist. Group
automatically applies its modifiers to each child.
We should probably still log the error. It could be something like this:
<nonexistent style="foregroundStyle(.orange);">
<Text>Hello, world!</Text></nonexistent>
would render as:
Group {
Text("Hello, world!")}.foregroundStyle(.orange).task {
logger.log(.warning, "...")}
with a message like this:
Unknown element `<nonexistent>`. The app may not render as expected.
It would be nice if we had some debug information passed on all elements.
I think LiveView does this for a jump-to-definition feature. It could use
this info to log the file/line number of the unknown element.
—
Reply to this email directly, view it on GitHub
<#1413 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAEQXAPOZXCJWBATNXRAJLZSN55NAVCNFSM6AAAAABMYYBC4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJZGQYDOMBWGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
I suspect we'll need to split between HEAD and BODY here to really manage this concern properly. Thoughts? |
Yeah, that makes sense to me. The |
I can change the plug to inject into whatever part of the docuemnt we want, it's really only in |
I think our approach to not render unknown views and not rendering children is the wrong. I believe instead we should convert to a
View
or some other generic view, still apply modifiers, and continue rendering children.This of course is a post v0.3 thing but let's discuss if this is in fact a better approach.
This would be consistent with the web:
The text was updated successfully, but these errors were encountered: