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

videojs.bind gone in 5.0 #2322

Closed
dmlap opened this issue Jul 8, 2015 · 6 comments
Closed

videojs.bind gone in 5.0 #2322

dmlap opened this issue Jul 8, 2015 · 6 comments
Milestone

Comments

@dmlap
Copy link
Member

dmlap commented Jul 8, 2015

videojs.bind is no longer exported so the native Function.prototype.bind() gets picked up by 4.x code that relied on this method.

@dmlap dmlap added this to the v5.0.0 milestone Jul 8, 2015
@dmlap
Copy link
Member Author

dmlap commented Jul 8, 2015

I see this has been sort of relegated to IE8 support. I'll make a note in the migration wiki.

@dmlap dmlap closed this as completed Jul 8, 2015
@gkatsev
Copy link
Member

gkatsev commented Jul 8, 2015

Has it? I think it still makes sense to expose it because videojs's bind has some extra functionality regular bind doesn't have.

@heff
Copy link
Member

heff commented Jul 8, 2015

Yeah, we should export it. You can use our bind for sharing listener ids.

@heff heff reopened this Jul 8, 2015
gkatsev added a commit to gkatsev/video.js that referenced this issue Jul 9, 2015
@dmlap
Copy link
Member Author

dmlap commented Jul 10, 2015

Where do we share listener ids? Are you sure it's worthwhile having a custom version of bind()?

@heff
Copy link
Member

heff commented Jul 10, 2015

Anywhere we do something like...

// ...in one function
something.addEventListener('foo', Fn.bind(this, this.someInstanceHandlerMethod));
// ...in another function
something.removeEventlistener('foo', this.someInstanceHandlerMethod);

With the native bind that wouldn't work.

I don't think we could have component.on() automatically bind the component as context for the listener, and still have the original listener be use in component.off, without a system like this.

If you're not benefitting from that feature in the external code that uses videojs.bind(), then you should just use the native bind now. And then maybe we don't need to export this? We should probably either export it or throw a warning when it's used in 5.0.

@heff
Copy link
Member

heff commented Jul 10, 2015

I'm gonna merge in the PR. If we want to discourage using this I think we should deprecate it first.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants