An idea to help developers avoid using prefixed api’s which are deprecated yet still implemented in browsers.
I’ll be using
indexedDB/webkitIndexedDB as the example in the following.
webkitIndexedDB show’s up in the console if you start to type
webkit. So the idea is to make the deprecated
webkit apis the same as a
global Element Id.
I only use chrome so I’m not really sure about other browsers if
global Element Ids exist, I believe they do.
In chrome if an element has an Id
fooBar an there’s no variable declared
foo into the console won’t show
fooBar as an auto-suggestion, yet if you were to type
fooBar and press enter the element with id
fooBar will be returned.
So what if we were to do this with deprecated prefixed features where they don’t show up as auto-suggestions yet if you were to type it and press enter it’ll still return the same thing, and still work when used in code.
This will help avoid beginners who are learning from old references which use the deprecated prefixed features and are typing this in the console.
So the reason it still works it’s simply to avoid compatibility issues not breaking anything, yet helping developers avoid using the deprecated prefixed variable.
Also as of right now when typing
webkitIndexedDB a deprecated warning shows up only saying to use
indexedDB instead, how about doing it each time. Yes this will be annoying, annoying enough for them to use the proper (api? or variable?)
Please let me know what you guys think?