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

Merge attr and props #54

Closed
dy opened this issue Aug 12, 2019 · 2 comments
Closed

Merge attr and props #54

dy opened this issue Aug 12, 2019 · 2 comments
Labels
research Decision-making, arguments, discussion, comparison, design

Comments

@dy
Copy link
Owner

dy commented Aug 12, 2019

attr use-cases are limited - reflecting something in DOM, like, in markup. That is needed for hydration, selecting something via CSS (styling from outside). There's almost no sense deserializing internal component props - they should be always real props, not some fake attributes.

Note: not all attributes are reflected to props: aria-, dataset (not necessarily), itemset, class, style, data-* attributes etc. Ideally these are handled by appropriate domains.

One possible solution - fall back to incremental-dom way: primitives are reflected to attrs, fns and objects are not.

The other possible (svelte) solution - detect which props are defined on elements as props and reflect them as attrs, otherwise use props.

Considering #48 as well - what strategy is the most favorable for K.?

@dy
Copy link
Owner Author

dy commented Aug 12, 2019

. <div attr="..." /> is a meta-effect, similar to <div children="..." />

@dy
Copy link
Owner Author

dy commented Aug 12, 2019

See #48. Different domains are actually more useful. If elements internally map props to atts and vv - not framework concern.

@dy dy closed this as completed Aug 12, 2019
@dy dy added the research Decision-making, arguments, discussion, comparison, design label Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
research Decision-making, arguments, discussion, comparison, design
Projects
None yet
Development

No branches or pull requests

1 participant