Aurelia-binding and event.path deprecation

The aurelia-binding package makes use of event.path which is marked as deprecated.

Event.path is deprecated and will be removed. Please use Event.composedPath() instead.

Are there any plans to address this? If not, what is the recommended course of action?

Cheers!

1 Like

Not only the aurelia-binding package, but also aurelia-templating-resources and aurelia-validation.

For the time being, I would like to add a polyfill, but where to ?

if (!Event.prototype.path) {
  Object.defineProperty(Event.prototype, 'path', {
    get() { return this.composedPath(); }
  });
}
1 Like

I have tried downloading the latest version of those three packages from GitHub.

In aurelia-binding:

This already uses composedPath.

In aurelia-templating-resources:

This appears to be the same function, and it does not use composedPath.

In aurelia-validation:
I could not find any usage of path.

Overall this problem seems to affect only the self binding behaviour which is a very limited scope, if it even does cause problems.

I guess a good spot for a polyfill would be in the main entry point of the application (aurelia-bootstrapper looks for a main.ts/js) before Aurelia is configured.