Yew: Rename `kind` (used as alias for `type`)

Created on 16 Jun 2020  路  6Comments  路  Source: yewstack/yew

Describe the feature you'd like
I find kind as alias for type, which conflicts with Rust's type keyword, confusing
and propose to change it to type
and to use type_ as alias where type conflicts with the keyword.

I'm of course open for other suggestions how to prevent the conflict,
it's just that kind seems too different to make a good candidate.

Is your feature request related to a problem? Please describe. _(Optional)_
See the discussion in
https://github.com/yewstack/yew/pull/1298
It's not obvious that kind stands for type and it would need to be well documented, probably on all locations where it appears in public API.

In private APIs it might still confuse contributors.

Describe alternatives you've considered _(Optional)_
Improve documentation
https://github.com/yewstack/yew/pull/1298#issuecomment-643712228

Additional context _(Optional)_
Add any other context or screenshots about the feature request here.

Questionnaire

  • [x] I'm interested in implementing this myself but don't know where to start
  • [ ] I would like to add this feature
  • [ ] I don't have time to add this right now, but maybe later

I'd try to fix this after a consensus is found what should be used instead of type where it causes a syntax error because of the conflict with the type keyword.

feature

All 6 comments

@zoechi how about input_type?

Discoverability is probably not great if it does not start with type

@zoechi I don't think discoverability is an issue, can you elaborate which API you are concerned about?

Right, we could still use VTag::set_type() and have the struct field named input_type.

1322 should make this field obsolete anyway.

True, what do you think about pursuing #1322 instead?

@jstarry see https://github.com/yewstack/yew/issues/1322#issuecomment-647017110
I need to improve my Rust-Fu to better understand Yew code first, but otherwise I'm interested.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FrontMage picture FrontMage  路  4Comments

thienpow picture thienpow  路  3Comments

sackery picture sackery  路  3Comments

Boscop picture Boscop  路  4Comments

wldcordeiro picture wldcordeiro  路  4Comments