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

Using aurelia to replace knockout library #40

Open
Dmitri-Sintsov opened this issue Feb 19, 2022 · 4 comments
Open

Using aurelia to replace knockout library #40

Dmitri-Sintsov opened this issue Feb 19, 2022 · 4 comments
Labels

Comments

@Dmitri-Sintsov
Copy link

Dmitri-Sintsov commented Feb 19, 2022

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
Copy link
Member

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.

@Dmitri-Sintsov
Copy link
Author

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
Copy link
Member

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants