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

fix(rxjs): no longer requires dom lib #3566

Merged
merged 1 commit into from
Apr 13, 2018

Conversation

benlesh
Copy link
Member

@benlesh benlesh commented Apr 13, 2018

Adds interfaces to cover what is used from DOM in fromEvent so that types are carried through, but dom lib isn not required by default even if you are not using fromEvent

fixes: #3558

Adds interfaces to cover what is used from DOM in `fromEvent` so that types are carried through, but `dom` lib isn not required by default even if you are not using `fromEvent`

fixes: ReactiveX#3558
@benlesh benlesh merged commit 8b33ee2 into ReactiveX:master Apr 13, 2018
options?: EventListenerOptions) {
let unsubscribe: () => void;
if (isNodeList(sourceObj) || isHTMLCollection(sourceObj)) {
for (let i = 0, len = sourceObj.length; i < len; i++) {
if (sourceObj && (sourceObj as any).length) {
Copy link

Choose a reason for hiding this comment

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

@kherock
Copy link

kherock commented Apr 17, 2018

Hey, this has some major issues when you want to do fromEvent(window, 'message'). window isn't a NodeList or HTMLCollection but it does have a .length property which refers to the number of frames in the window. As-is, this will attempt to add event listeners to all sub-frames on the window and cause an error of the form

Uncaught DOMException: Blocked a frame with origin "..." from accessing a cross-origin frame.

when subscribing.

@cartant
Copy link
Collaborator

cartant commented Apr 17, 2018

@specialkk Thanks for pointing out a problem.

Could you please create an issue and, from it, reference this PR?

I'm not a maintainer of this particular repo, but I think I speak for all maintainers in saying that it's preferable to have new issues opened, than to have comments made on closed issues or merged PRs.

@lock
Copy link

lock bot commented Jun 5, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RxJS 6 requires "dom" lib when using TypeScript
5 participants