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

New: Complex Keys (cls, rel, textContent, etc.) #43

Merged
merged 2 commits into from
Sep 9, 2018
Merged

Conversation

raquo
Copy link
Owner

@raquo raquo commented Aug 26, 2018

This PR provides a way for consuming libraries to define custom interfaces for some composite or otherwise special keys.

The attributes I chose are: cls, className, rel, dataAttr, styleAttr, textContent.

I was thinking of also adding role attribute to the list – it's also a composite attribute (space-separated strings), but I've never used it and I'm not sure what kind of usage patterns it has. Does it even make sense to have special APIs for it...

Fixes #32.

TODO

  • Change v0.9 date from Aug to Sep

cornerman
cornerman previously approved these changes Aug 26, 2018
Copy link
Contributor

@cornerman cornerman left a comment

Choose a reason for hiding this comment

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

Not entirely sure whether cls and className really need different types, but otherwise looks good to me.

@raquo
Copy link
Owner Author

raquo commented Aug 26, 2018

Agreed, I think I'll change className to be an alias for cls. Can't really imagine libraries wanting those exact names but different implementations.

I think I'll add the role attribute in there after all, for the sake of consistency.

What do you think about removing textContent from this trait (and SDT) for reasons I mentioned in #41?

In contrast to these fringe properties, ComplexHtmlKeys is supposed to have keys that every library would want to implement, but perhaps differently. TBH I'm still second guessing even adding textContent to it, I might actually remove it from there because I'm not sure how universally supported its behaviour – modifying the tree of elements – would be in consuming libraries.

@cornerman
Copy link
Contributor

Yep, then better remove textContent as it falls into the same class as innerHTML

@raquo raquo merged commit 94c2cb9 into master Sep 9, 2018
@raquo raquo deleted the complex-keys branch September 9, 2018 06:03
@raquo raquo restored the complex-keys branch March 2, 2020 08:03
@raquo raquo deleted the complex-keys branch March 2, 2020 08:03
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