Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
events: add initEvent to Event#46069
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
events: add initEvent to Event #46069
Uh oh!
There was an error while loading. Please reload this page.
Conversation
anonrig commented Jan 3, 2023
Mdn states that; Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. |
deokjinkim commented Jan 4, 2023
@anonrig Thank you for checking. BTW, I have one question. mdn states that Refs: https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelBubble |
anonrig commented Jan 4, 2023
I believe it will be a breaking change. We should deprecate them, if it’s not, through documentation. |
deokjinkim commented Jan 4, 2023
Thank you for feedback. I'll close this PR soon. |
benjamingr commented Jan 6, 2023
I actually disagree with @anonrig here. If the spec defines initEvent on EventTarget we have to implement it in order to be spec compliant. And indeed we fail the relevant WPT tests. |
benjamingr commented Jan 6, 2023
annevk commented Jan 6, 2023
Browsers definitely have to keep supporting it and I think what MDN states is stretching reality. It's probably easier for web developers if Node.js supports it as well so they don't have to adapt code, but I could see an argument for not implementing it. |
benjamingr commented Jan 6, 2023
@deokjinkim feel free to reopen then :) |
initEvent to EventinitEvent to Event95c95d5 to f5974f6Compare
benjamingr left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to add more tests, thanks
initEvent to EventinitEvent to Eventdeokjinkim commented Jan 9, 2023
@benjamingr Thank you for review. Added description of |
anonrig left a comment • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not in favor of adding a deprecated API to Node.js without any request from a user, just for the goal of spec compliance.
I couldn't find a past example of adding a deprecated API to Node.js. It's not a blocker, but I want to ask @nodejs/tsc opinion about this before merging.
benjamingr commented Jan 9, 2023
With web standards I feel that you either implement the standard or you don't. This isn't an API like EventEmitter where we get to do as we please - with EventTarget I feel strongly that changes to the API need to be reflected by changes to the spec. I can definitely see an argument for amending the WHATWG DOM spec (which project members have done in the past) to make initEvent optional (by adding it to an annex clients may implement or making it an extension e.g.). |
mcollina left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
nodejs-github-bot commented Jan 10, 2023
fa88cdb to 7fdc27dComparedeokjinkim commented Jan 11, 2023
Rebased this PR to fix conflict and squashed to 1 commit. |
aduh95 commented Jan 13, 2023
We've added |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Antoine du Hamel <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Antoine du Hamel <[email protected]>
nodejs-github-bot commented Jan 16, 2023
nodejs-github-bot commented Jan 19, 2023
Landed in 2ff8c50 |
Refs: https://dom.spec.whatwg.org/#dom-event-initevent PR-URL: #46069 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
juanarbol commented Jan 26, 2023
This is not landing cleanly in v18.x |
Refs: https://dom.spec.whatwg.org/#dom-event-initevent