greggman / tdl

A low-level WebGL library
283 stars 39 forks source link

var ai = ... :( #9

Open dataf3l opened 2 months ago

dataf3l commented 2 months ago

https://github.com/greggman/tdl/blob/6b633052599e8ee95245b6bfa17c645a935e16ae/tdl/math.js#L483

so this "var ai=" thing or using window.ai or setting this value, may have a problem with upcoming changes on the chrome browser and possibly also nodejs as it usually mimics browser apis precisely, as it hides window.ai maybe it should be renamed to prevent future potential conflicts to another name.

this is just speculation. but I think maybe google will want window.ai for itself. so this code may break when interacting with other code in the future perhaps. specially if done globally.

see this link for details. https://developer.chrome.com/docs/ai/built-in

right now it's behind a flag but in the future this may change.

not clear on the timeline tho.

have an awesome day!

greggman commented 2 months ago

Thanks for the heads up.

It seems unlikely that browsers are going to add window.ai vs say window.navigator.ai if they were going to add an API api.

Any case case, AFAIK this library is not used anymore. And anything that is using it is probably abandoned.