-
Notifications
You must be signed in to change notification settings - Fork 329
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
feat(html): bind function only once #921
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 53fcbcd:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call on the single binding 👍
@@ -37,4 +37,4 @@ export type AutocompleteRenderer = { | |||
Fragment: PragmaFrag; | |||
}; | |||
|
|||
export type HTMLToJSX = typeof htm; | |||
export type HTMLTemplate = typeof htm; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better naming indeed, however this isn't really a "template" compared to the existing Template
type in Autocomplete, it's more of a template transformer or such. So maybe HTMLTemplateTransformer
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the distinction is required. It's a "tagged template" which allows the user to write html, so HTMLTemplate describes that enough IMO. Similarly how we call it a widget, and not a widget factory
The few extra bytes are caused by |
* feat(html): create binding only once * rename to HTMLTemplate * format document * update size
* feat(html): create binding only once * rename to HTMLTemplate * format document * update size
* feat(html): create binding only once * rename to HTMLTemplate * format document * update size
* feat(html): create binding only once * rename to HTMLTemplate * format document * update size
also renamed HTMLToJSX to HTMLTemplate, as the JSX part is an implementation detail IMO