aurelia-contrib / aurelia-knockout

Adds support for Knockout binding syntax to make transition from Durandal and Knockout to Aurelia simpler.
MIT License
22 stars 4 forks source link

Using aurelia to replace knockout library #40

Open Dmitri-Sintsov opened 2 years ago

Dmitri-Sintsov commented 2 years ago

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() ?

ckotzbauer commented 2 years ago

There is a script cdn available with different variants (including an esm build) https://cdn.jsdelivr.net/npm/aurelia-script@1.5.2/dist/ Yes enhance() is similar, but normally you don't need to call it directly.

Dmitri-Sintsov commented 2 years ago

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.

ckotzbauer commented 2 years ago

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.

Dmitri-Sintsov commented 2 years ago

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.