-
Notifications
You must be signed in to change notification settings - Fork 35
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
Status of knockout.es5 #58
Comments
@jfrank14 The plan is to use https://github.com/knockout/tko/blob/master/packages/tko.computed/docs/proxy.md Based on browser support Proxy is the correct solution, long term, but it's not as broadly supported as ES5 The plan is for proxy to work with whatever validation scheme we come up with. |
@brianmhunt Is tko.proxy intended to be opt-in? I really enjoy the syntax, but the inability to polyfill means it will be un-useable in any of our apps that need to target IE. |
@caseyWebb the plan is for proxy to be in tko but not knockout 4. On the spectrum of an app to dynamic Web page the Proxy is deep in Web app territory. Ko 4 will be backwards compatible to ie9. |
Wait, what's the difference between tko and knockout 4. I thought they were the same thing! I can't see a solution being viable that doesn't support IE at all. Even now it still has something like 9% market share and many app developers wouldn't be willing to tell users that their browser of choice just isn't supported. Can we not just continue to use |
@jfrank14 Among other benefits, the Proxy solution offers dynamics after initialization i.e. observable properties can be assigned after the object is created. Properly speaking, Knockout will continue to be as backwards compatible as is feasible (incl. IE 9+), so Proxy will be excluded. |
Is it safe to assume that this will be exposed in the api for tko.builder? If that's the case I see no issue. That said, the issue of backwards compatibility does leave a clear distinction between knockout-es5 and tko.proxy. I'm not sure if having support for both is worthwhile, but I do feel like proxies should come with a warning label; I've gotten bitten before because I assumed (as I hope I'm not alone), that I'd be able to polyfill for older browsers, and when this turned out not to be the case had to rewrite quite a bit of code. |
@brianmhunt can the Proxy solution do the same as this from knockout es5 doc?
My concern with transparent observable wrapping is that it may create a lot of useless observables. It's definitely not reasonable to wrap every attribute of every item of a huge collection. In my team, I always recommend to manage collection elements as immutable objects with the minimum amount of observables for a given purpose. |
@caseyWebb Agree; we want to be clear on the distinction between tko and ko — highlighting backwards compatibility. @miellaby I've nothing against knockout-es5 or equivalent being in ko proper, but it's not a pain point for me and the drawbacks (that Proxy overcomes) give me pause about it. |
I use knockout es5 because I prefer the syntax (
this.price = 3
vsthis.price = ko.observable(3)
, etc.)Is the plan for tko to include this syntax natively, or via plugin? In either case, will it be a first class citizen, so that other plugins, e.g. validation, will play nicely with it? (Currently, es5 and validation require some considerable hacking to make them work well together.)
The text was updated successfully, but these errors were encountered: