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

Status of knockout #2587

Open
dpservis opened this issue Feb 1, 2022 · 5 comments
Open

Status of knockout #2587

dpservis opened this issue Feb 1, 2022 · 5 comments

Comments

@dpservis
Copy link

dpservis commented Feb 1, 2022

Hello

in my current job we used knockout in a project that was cancelled a couple of years ago but now we would like to resurrect it. Looking at the repository and the releases it seems that the project is in a stale state. So I wanted to ask, is there any activity actually going on, are there any planned future releases, bug fixes, security fixes in the pipeline?

Thanks a lot

Dimitris

@brianmhunt
Copy link
Member

There is active work on TKO which is backwards compatible with knockout but it's not readily consumable right now (ie you have to figure it out). That said tko has been used with millions of page views across thousands of users, so it's pretty solid.

@webketje
Copy link

webketje commented Feb 1, 2022

The lead maintainer's commit activity may give you some insight.

@dpservis
Copy link
Author

dpservis commented Feb 2, 2022

There is active work on TKO which is backwards compatible with knockout but it's not readily consumable right now (ie you have to figure it out). That said tko has been used with millions of page views across thousands of users, so it's pretty solid.

Hi Brian,

thanks for your response. What do you mean it's not readily consumable right now? Can I use it as a drop-in replacement and deliver a quality product to my users? Or is it in some α/β/ state that is not yet to be released with industrial strength software? What do I need to figure out myself? Apologies if I am a bit direct, I just want to know our technical options to take decisions and by no means do I try to underestimate your work.

@brianmhunt
Copy link
Member

Hi @dpservis There's a bit of DIY with figuring out how to consume the library. But other than that setup that folks have had good luck with it as a straight-up replacement for Knockout. The one area that's been an issue is that TKO compiles inline functions without needing unsafe-eval in your Content Security Policy, but the lambda parser is not a full javascript parser so for some inline functions it misses the mark (e.g. { x: function () { return 123 } } type arguments, when more complex than that, may not work).

@danieldickison I'd be curious if you had any thoughts on your experience moving from knockout to TKO that might help @dpservis .

@danieldickison
Copy link

@dpservis As Brian mentioned, we recently migrated our entire site from knockout 3.5.1 to tko. We ended up fixing some compatibility issues in tko itself that haven't been released yet so you'll want to build from source against the current main branch. After running make, the builds/knockout/dist/browser.min.js file will be mostly a drop-in replacement for knockout.

It's not 100% a drop-in replacement, though. I'm hoping to write this up properly in the near future but here are my notes from our internal wiki:

  • tko requires ES6. This required upgrading our (admittedly ancient) js pipeline.
  • We needed to update some custom bindings to work with tko, notably the switch-case plugin and the sortable plugin.
  • The ko-compat build of tko automatically handles converting single-statement function bindings into lambda forms, but doesn’t do so for multi-statement functions. We manually refactored multi-statement functions in bindings, which were hard to read anyways.
  • The foreach binding no longer creates a child binding context when using the foreach: {data: myArray, as: 'foo'} form. That means anywhere we used that form and referenced $parent or $parents inside of the loop would end up broken. I refactored these to avoid the use of as so that the code worked under both ko and tko during our transition period.

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

No branches or pull requests

4 participants