Skip to content

Commit

Permalink
Decrease download size by removing promise polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
eweitz committed Apr 14, 2018
1 parent 095c757 commit 2aa69dc
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 53 deletions.
9 changes: 1 addition & 8 deletions dist/js/ideogram.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/ideogram.min.js.map

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
"d3-request": "^1.0.6",
"d3-scale": "^1.0.6",
"d3-selection": "^1.1.0",
"d3.promise": "^2.0.0",
"es6-promise": "^4.1.1"
"d3.promise": "^2.0.0"
},
"devDependencies": {
"babel-core": "^6.26.0",
Expand Down
1 change: 0 additions & 1 deletion src/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import * as d3request from 'd3-request';
import * as d3selection from 'd3-selection';
import {Promise} from 'es6-promise';

import {Ploidy} from './ploidy';
import {Layout} from './layouts/layout';
Expand Down
36 changes: 0 additions & 36 deletions src/js/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,6 @@ import * as d3selection from 'd3-selection';
import {ModelAdapter} from './model-adapter';
import {Chromosome} from './views/chromosome';

/**
* Polyfill for Object.assign, to enable usage in IE 10.
*
* This is a lightly modified version of
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill
*/
if (typeof Object.assign !== 'function') {
// Must be writable: true, enumerable: false, configurable: true
Object.defineProperty(Object, "assign", {
value: function assign(target, varArgs) { // .length of function is 2
'use strict';
if (target === null) { // TypeError if undefined or null
throw new TypeError('Cannot convert undefined or null to object');
}

var to = Object(target);

for (var index = 1; index < arguments.length; index++) {
var nextSource = arguments[index];

if (nextSource !== null) { // Skip over if undefined or null
for (var nextKey in nextSource) {
// Avoid bugs when hasOwnProperty is shadowed
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
to[nextKey] = nextSource[nextKey];
}
}
}
}
return to;
},
writable: true,
configurable: true
});
}

var d3 = Object.assign({}, d3selection);

/**
Expand Down
1 change: 0 additions & 1 deletion src/js/services.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as d3request from 'd3-request';
import * as d3dispatch from 'd3-dispatch';
import * as d3promise from 'd3.promise';
import {Promise} from 'es6-promise';

import {Object} from './lib.js';

Expand Down
4 changes: 0 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1897,10 +1897,6 @@ es6-map@^0.1.3:
es6-symbol "~3.1.1"
event-emitter "~0.3.5"

es6-promise@^4.1.1:
version "4.2.4"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29"

es6-set@~0.1.5:
version "0.1.5"
resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1"
Expand Down

0 comments on commit 2aa69dc

Please sign in to comment.