tween.js
tween.js copied to clipboard
Minimum browser versions? (i.e. minimum IE version?)
Hi all, what are your thoughts on, f.e., supporting only IE11+?
This would allow us to use WeakMap for private properties on the Tween class, and then we can store public methods on the prototype.
Minimum browser support still is important as some of peoples (including me) uses starts at (see below):
Currently in my country statistic for browser/device usage, that matters:
- [x] iOS9+ (superr)
- [x] Chrome 35+ (very nice)
- [x] Firefox 35+ (nice)
- [ ] Android 4+ (good, *)
- [ ] IE9+ (almost good, *)
* - WeakMap polyfill requires, but can be made via smaller size
Can you share idea for class? Maybe i am implement it in ES6 version. Thanks
@dalisoft I'll make a PR soon, so you can see what it looks like.
@dalisoft Alright, here's a PR: https://github.com/tweenjs/tween.js/pull/325, all tests passing.
Instead of a private WeakMap and doing _(this).privateMember to access, we could just store things on this with the underscore convention and access like this._privateMember, but then the functionality is different in that the end user can access private variables if they aren't following conventions. But the underscore method would make this continue to work in older IE.
Oh, wait, Object.assign support starts in Edge. According to this, IE 11 has WeakMap: https://docs.microsoft.com/en-us/scripting/javascript/reference/weakmap-object-javascript
How do you feel about just using the underscore convention?
Here's another PR that uses the underscore convention: https://github.com/tweenjs/tween.js/pull/326
There we go, removed Object.assign in both PRs, so the underscore-convention PR works in IE9.
I am fine with the underscore convention for private variables.
Closing, let's eventually add a transpile step that can support older browsers.
Hey ya'll! I'm circling back to this, and would like to make some improvements and also fix some long-standing bugs.
What are the oldest browsers we need to support nowadays?
(Personally I wish we could support Edge/Chrome/Firefox/Safari, and just drop IE). But maybe we can have a "legacy" build just for the ancient browsers anyways, like tween.ancient.js and tween.ancient.min.js for fun file naming.