tween.js icon indicating copy to clipboard operation
tween.js copied to clipboard

Minimum browser versions? (i.e. minimum IE version?)

Open trusktr opened this issue 8 years ago • 11 comments

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.

trusktr avatar Mar 19 '17 17:03 trusktr

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

dalisoft avatar Mar 19 '17 18:03 dalisoft

Can you share idea for class? Maybe i am implement it in ES6 version. Thanks

dalisoft avatar Mar 19 '17 18:03 dalisoft

@dalisoft I'll make a PR soon, so you can see what it looks like.

trusktr avatar Mar 19 '17 18:03 trusktr

@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.

trusktr avatar Mar 19 '17 19:03 trusktr

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

trusktr avatar Mar 19 '17 19:03 trusktr

How do you feel about just using the underscore convention?

trusktr avatar Mar 19 '17 19:03 trusktr

Here's another PR that uses the underscore convention: https://github.com/tweenjs/tween.js/pull/326

trusktr avatar Mar 19 '17 19:03 trusktr

There we go, removed Object.assign in both PRs, so the underscore-convention PR works in IE9.

trusktr avatar Mar 19 '17 20:03 trusktr

I am fine with the underscore convention for private variables.

mikebolt avatar Mar 20 '17 07:03 mikebolt

Closing, let's eventually add a transpile step that can support older browsers.

trusktr avatar Sep 16 '17 22:09 trusktr

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.

trusktr avatar Apr 27 '20 02:04 trusktr