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

Use Static Functions #39

Merged
merged 1 commit into from
Feb 14, 2019
Merged

Use Static Functions #39

merged 1 commit into from
Feb 14, 2019

Conversation

stephencelis
Copy link
Member

Here's a preliminary PR for what we talked about!

Right now I use attributes: […] consistently everywhere, but functions with no content could use _ attributes: Attribute... instead.

.link(attributes: [.href("blob"), .rel(.alternate)])
// vs.
.link(.href("blob"), .rel(.alternate))

We could also add overloads to accept .async wherever booleans like .async(true) work.

let doc: Node = .document(
.html(
.head(
.style(safe: stylesheet)
Copy link
Member Author

Choose a reason for hiding this comment

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

One weird concession was without making safe vs. unsafe explicit, I'd get ambiguous errors that required as StaticString even on string literals. Was strange and maybe worth filing a bug for!

Copy link
Member

Choose a reason for hiding this comment

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

oh dang strange

img(base64: "ZnVuY3Rpb25z", type: .image(.svg), alt: "", [Html.class("hide-d")])
.body(
.header(
attributes: [.class("bg-purple150 d-pt4 d-pb4 m-pl2 m-pr2 m-pt2 m-pb2")],
Copy link
Member Author

Choose a reason for hiding this comment

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

.class is feelin nicer than Html.class or backticks!

@@ -1,136 +1,79 @@
<a>
foo1
Copy link
Member

Choose a reason for hiding this comment

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

are all the deletions in this file intended?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think so but will audit. We were testing each overload before.

Copy link
Member

@mbrandonw mbrandonw left a comment

Choose a reason for hiding this comment

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

niiiice

@stephencelis
Copy link
Member Author

Gonna merge for now! Can make future adjustments before any official release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants