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

Supply custom bindings with actual observables #15

Closed
wants to merge 1 commit into from

Conversation

CraigCav
Copy link

As discussed in issue #2, when using the es5 plugin, bindings aren't provided with the observable, only with the value of the property.

@rniemeyer suggested an approach to using a custom binding provider to supply bindings with actual observables. This approach should in theory support any existing two-way custom bindings developers may have written for knockout before applying the es5 plugin.

This PR is an attempt at implementing such a provider.

@SteveSanderson
Copy link
Owner

Thanks for suggesting this. Sorry it's literally taken a year for me to get back to maintaining this repo - I'm currently adding some new committers so the repo can progress independently of me.

About this new binding provider - is it something you're still using? Unlike the rest of knockout-es5, this binding provider ties in with quite a lot of KO binding internals, so it's going to require ongoing attention as KO changes or gains new binding features. It won't stay maintained on its own. I don't know whether it's currently up-to-date with the latest KO (3.2.0). So if it's still a going concern for you, then I propose two possible ways of going forwards:

  • If you're keen to maintain this binding provider, I'm happy for it to get merged into knockout-es5, and I'll add you as a committer so you can keep it up-to-date
  • If you don't want to maintain it (and that's totally understandable) then it would be better kept in its own separate plugin

Let me know what you prefer. Thanks!

@CraigCav
Copy link
Author

About this new binding provider - is it something you're still using?

Unfortunately my usage of the es5 plugin never really got off the ground, and in turn, I never got to put this binding provider through its paces.

I don't know whether it's currently up-to-date with the latest KO (3.2.0).

The only piece i'm not sure about is that there was some discussion about making a public property writers API. As far as I'm aware, there still isn't an officially supported API for this. If there were, I guess this Binding Provider wouldn't be needed (although all our existing custom two-way bindings would need to be updated accordingly).

Let me know what you prefer. Thanks!

I'm happy to keep maintaining this binding provider, either as part of the core plugin or as a separate one.

In my perspective, I think it makes sense for this behavior to be part of the es5 plugin itself; I personally couldn't get too far with the es5 plugin on it's own (i.e without this change) due to the extensive usage of custom two-way bindings in my knockout-based projects.

@CraigCav CraigCav closed this Sep 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants