aurelia-knockout
aurelia-knockout copied to clipboard
Using aurelia to replace knockout library
Is it possible to use Aurelia core with modern es6 browsers (not IE11) as the library, not having to install node.js chain with Babel? I see there is aurelia-core.js at cdn sites, however it's exports looks like UMD define, not es6 exports modern browsers use.
Knockout allows to be included just as the client-side browser script, no tooling is required, Vue also has such possible use without node.js chain. Can Aurelia be used in similar way?
AFAIK aurelia.enhance()
is similar to ko.applyBindings()
?
There is a script cdn available with different variants (including an esm build) https://cdn.jsdelivr.net/npm/[email protected]/dist/
Yes enhance()
is similar, but normally you don't need to call it directly.
Thanks for the link, I'll try it later.
normally you don't need to call it directly
Does it means the bindings are applied automatically? That is not always the desired behavior, some pages may need some kind of pre-processing, before adding the bindings.
Does it means the bindings are applied automatically?
Yes.
That is not always the desired behavior, some pages may need some kind of pre-processing, before adding the bindings.
I don't know your app, but DOM-manipulations should be done with Aurelia and data-preprocessing can be done via the desired hook-methods.
That is very strange, even modern Vue does not apply the bindings automatically to the document by default - see Vue.$mount()
.
Sometimes there is no choice but the third-party DOM manipulations when there is existing Bootstrap app or d3.js app and so on.
Knockout works fine in such case. Vue has troubles with third-party DOM libraries because it uses virtual DOM.
I hoped that Aurelia can be "modern Knockout" for my apps however maybe that is not the case.