mirror of
https://github.com/kusti8/proton-native.git
synced 2026-05-15 14:15:50 -06:00
[GH-ISSUE #9] Use React event naming conventions #5
Labels
No labels
bug
documentation
enhancement
libui issue
pull-request
question
wait for libui implementation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/proton-native#5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gaearon on GitHub (Feb 17, 2018).
Original GitHub issue: https://github.com/kusti8/proton-native/issues/9
In React, events are typically called
onChangeandonClickrather thanonChangedandonClicked. How do you feel about changing this? Great project btw!@kusti8 commented on GitHub (Feb 18, 2018):
I would rather keep it closer to libui-node, since that simplifies it a lot. If you want to, you can map them, but I think it's too much work and would make the code more confusing.
@gaearon commented on GitHub (Feb 18, 2018):
I see. In that case it would make sense to provide a helpful error message. Currently if you pass
onClickit just fails somewhere in internals.@kusti8 commented on GitHub (Feb 18, 2018):
Yeah one of my goals is to add error messages
@zaguiini commented on GitHub (Feb 18, 2018):
I don't think you should keep it closer to libui-node since you're implementing React and you know, there are a lot of conventions... Doesn't make sense to me. In the whole React world (DOM, Native, etcetera), we are used to things like
onClick,onPressand so forth.@joaoeffting commented on GitHub (Feb 20, 2018):
I thougth the same when I saw onClicked :D
But the library is so cool that I didn't mind :p
@kusti8 commented on GitHub (Feb 20, 2018):
Yeah I've decided that I'll do it when I get a chance.
@benwiley4000 commented on GitHub (Feb 22, 2018):
Here's a regex you can use to search for all the instances where this is happening:
onChanged->onChangeonClosing->onCloseonClicked->onClickonToggled->onToggleonSelected->onSelectonContentSizeChanged->onContentSizeChangeonPositionChanged->onPositionChangeProbably a good idea to deprecate those props in this version (but still accept them and emit warning messages) and remove them for good in version 2, whenever that gets released.
@kusti8 commented on GitHub (Feb 22, 2018):
Yeah I'm going to create a mapping for all of the callbacks, and it should
be very simple. Just an object of all the functions in DesktopComponent.js
and then change it in update and initialProps. I just need to find the time
to do it.
On Thu, Feb 22, 2018, 1:17 PM Ben Wiley notifications@github.com wrote:
@kusti8 commented on GitHub (Feb 23, 2018):
I've decided to just replace them instead of deprecate them, because this is pretty beta, and I want to fix it quickly, and not cause more confusion
@benwiley4000 commented on GitHub (Feb 23, 2018):
@kusti8 Thanks for the update! It could be good to document that breaking changes can be expected. Since the package.json is past 1.0, I was assuming 1.x.x shouldn't introduce any breaking changes, and I suspect others might think the same.
@haltcase commented on GitHub (Feb 27, 2018):
I'm with @benwiley4000 here. Obviously the ship has sailed on doing
0.xreleases, so since you're already over 1.x this is a pretty overt semver violation. I would definitely not expect upgrading from1.0.11to1.0.12to introduce this kind of breaking change.@kusti8 commented on GitHub (Mar 2, 2018):
Yeah I forgot about semvar. I won't change anything now, but i'll keep it in mind for the future.