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

Expose EventTarget and Event by default? #35495

Closed
addaleax opened this issue Oct 4, 2020 · 3 comments
Closed

Expose EventTarget and Event by default? #35495

addaleax opened this issue Oct 4, 2020 · 3 comments
Labels
eventtarget Issues and PRs related to the EventTarget implementation.

Comments

@addaleax
Copy link
Member

addaleax commented Oct 4, 2020

I think it might make sense to expose the EventTarget and Event classes on the global object. We usually do this in semver-major changes only, so it might make sense to do this in Node v15.0.0 with an exception from the @nodejs/tsc, so that these classes are available for features that we add.

@addaleax addaleax added the eventtarget Issues and PRs related to the EventTarget implementation. label Oct 4, 2020
@noseratio
Copy link

That'd be perfect! E.g., I have a module that could work unmodified in both browser and Node.js if EventTarget and Event were present on the global object.

@mcollina
Copy link
Member

mcollina commented Oct 4, 2020

Let's go for it. Node v15 seems about a good time to do this.

addaleax added a commit to addaleax/node that referenced this issue Oct 4, 2020
Add

- Event
- EventTarget
- MessagePort
- MessageChannel
- MessageEvent

to the set of global objects, since they are available now and behave
like they do in the browser.

Fixes: nodejs#35495
@jasnell
Copy link
Member

jasnell commented Oct 4, 2020

Works for me!

nodejs-github-bot pushed a commit that referenced this issue Oct 11, 2020
Add

- Event
- EventTarget
- MessagePort
- MessageChannel
- MessageEvent

to the set of global objects, since they are available now and behave
like they do in the browser.

Fixes: #35495

PR-URL: #35496
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
joesepi pushed a commit to joesepi/node that referenced this issue Jan 8, 2021
PR-URL: nodejs#35496
Fixes: nodejs#35495
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
joesepi pushed a commit to joesepi/node that referenced this issue Jan 8, 2021
Add

- Event
- EventTarget
- MessagePort
- MessageChannel
- MessageEvent

to the set of global objects, since they are available now and behave
like they do in the browser.

Fixes: nodejs#35495

PR-URL: nodejs#35496
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eventtarget Issues and PRs related to the EventTarget implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@mcollina @jasnell @addaleax @noseratio and others