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

Use correct name for setProperty #114

Merged
merged 1 commit into from
Nov 3, 2022
Merged

Use correct name for setProperty #114

merged 1 commit into from
Nov 3, 2022

Conversation

pbiggar
Copy link
Contributor

@pbiggar pbiggar commented Oct 31, 2022

I'm not certain this is right, as I'm not as familiar with the current incarnation of Rescripts externals.

My read of this code is that setProperty is intended to call
setProperty with 2 arguments, and setPropertyValue is supposed to call setProperty with 3 arguments.

There are related functions getProperty and getPropertyValue, but there isn't a setPropertyValue, so my guess is there was a typo here.

@TheSpyder
Copy link
Owner

I'm not certain either - much of this code was inherited from a previous project, and some of it was written when the standards were still in draft. When in doubt, consult the current standard - there is no setPropertyValue.
https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration

setProperty can take 2 or 3 arguments, so I guess the intent is the setProperty binding is the full one that also sets the priority and setPropertyValue just sets the value but not the priority.

Either way this PR is wrong sorry :) maybe just add some doc comments instead?

@pbiggar
Copy link
Contributor Author

pbiggar commented Nov 3, 2022

setProperty can take 2 or 3 arguments, so I guess the intent is the setProperty binding is the full one that also sets the priority and setPropertyValue just sets the value but not the priority.

Isn't this what this PR does?

@TheSpyder
Copy link
Owner

TheSpyder commented Nov 3, 2022

No, because you changed the emitted function call. There is no setPropertyValue in the standard.

This would be clearer if we had a wider range of tests, which is on my list of things to do but that's quite a lot of work 😅

@TheSpyder
Copy link
Owner

Oh. I'm reading the diff backwards. Sorry, I've had a long week 😞

Copy link
Owner

@TheSpyder TheSpyder left a comment

Choose a reason for hiding this comment

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

I'm still tempted to change the setPropertyValue name but it's debatable whether that would have any benefit. I'll also add a changelog later.

Thanks!

@TheSpyder TheSpyder merged commit 1a64769 into TheSpyder:main Nov 3, 2022
TheSpyder added a commit that referenced this pull request Nov 3, 2022
@pbiggar
Copy link
Contributor Author

pbiggar commented Nov 3, 2022

Thanks!

@TheSpyder
Copy link
Owner

I was planning to publish it immediately but hit a compile error in another merge. Hopefully I can resolve that soon.

@TheSpyder
Copy link
Owner

Published as 0.7.0

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