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

Add DefaultApp type to simplify DOMRenderer.init #217

Merged
merged 2 commits into from
Jul 29, 2020

Conversation

MaxDesiatov
Copy link
Collaborator

@MaxDesiatov MaxDesiatov commented Jul 27, 2020

This means that the View initializer of DOMRenderer now can delegate to the App initializer by creating a wrapping DefaultApp. It would simplify #136 for me, where I no longer need to implement color scheme observation for these two different codepaths separately.

@MaxDesiatov MaxDesiatov requested review from carson-katri and j-f1 July 27, 2020 16:44
@MaxDesiatov MaxDesiatov added the refactor No user-visible functionality change label Jul 27, 2020
@MaxDesiatov MaxDesiatov changed the title Add DefaultApp type to simplify DOMRenderer.init Add DefaultApp type to simplify DOMRenderer.init Jul 27, 2020
@carson-katri
Copy link
Member

The only concern I have is that the body tag will have its styles overridden when you’re just rendering a View. Before this wasn’t the case, so you could embed tokamak in an existing project w/o it affecting any of your existing styles.

Maybe add a flag to check in launch if the body styles should be added or not?

let body = TokamakDOM.body
if body.style == .undefined {
body.style = "margin: 0;"
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carson-katri what do you think about this check?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should do it 👍

@MaxDesiatov MaxDesiatov merged commit 7c6b181 into main Jul 29, 2020
@MaxDesiatov MaxDesiatov deleted the domrenderer-defaultapp branch July 29, 2020 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor No user-visible functionality change
Development

Successfully merging this pull request may close these issues.

3 participants