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
feat: add window removeMenu() method #16570
Conversation
@codebytere I don't like this change much. In many frameworks, you would have a property |
@miniak JS frameworks, & modern ones? Using I think explicit functions for removal should be preferred over some of our current patterns, with the end goal being getters and setters |
@codebytere how would the API look like with getters/setters? you won't be able to assign |
@miniak This is an API improvement we can do in a non-breaking way to better support modern styles of JS. Calling This isn't a final "this is the best API we can build", this is a "this is the best API we can build without changing our entire API". Discussions around future API design like setters and getters instead of methods are a much wider discussion and something that I believe is on the list of proposed topics for summit. For now, this PR is a noticeable API improvement and reduces confusion around usage. |
10dbbb1
to
abfbc8d
Compare
🤔 i don't even change that file in this PR |
c94c2f6
to
d9f1170
Compare
Release Notes Persisted
|
I have automatically backported this PR to "5-0-x", please check out #16657 |
Description of Change
This PR adds
win.removeMenu()
as a replacement forwin.setMenu(null)
, which is less intuitive and a bit of an antipattern for modern JS. We can most likely backport the additional method into5-0-x
and only remove the original inmaster
.cc @MarshallOfSound @ckerr
Checklist
npm test
passesRelease Notes
Notes: Added
win.removeMenu()
to remove application menus instead of usingwin.setMenu(null)
.