Browse Source

Stop using compat-es2015.

Use es6-promise directly.
Compatibility / polyfilling is moving sand,
let it be done explicitly
and changeable easily.
Herby Vojčík 3 years ago
parent
commit
f4772341d9
4 changed files with 10 additions and 3 deletions
  1. 2 1
      Gruntfile.js
  2. 5 0
      es6-promise.amd.json
  3. 2 1
      index.html
  4. 1 1
      package.json

+ 2 - 1
Gruntfile.js

@@ -18,7 +18,8 @@ module.exports = function (grunt) {
     grunt.registerTask('devel', ['amdconfig']);
 
     var polyfillThenPromiseApp = function () {
-        define(["require", "amber/es2015-polyfills"], function (require) {
+        define(["require", "amber/es6-promise"], function (require, promiseLib) {
+            promiseLib.polyfill();
             return new Promise(function (resolve, reject) {
                 require(["__app__"], resolve, reject);
             });

+ 5 - 0
es6-promise.amd.json

@@ -0,0 +1,5 @@
+{
+  "paths": {
+    "amber/es6-promise": ["./es6-promise", "./dist/es6-promise", "./promise"]
+  }
+}

+ 2 - 1
index.html

@@ -19,7 +19,8 @@
     var startHelios = document.getElementById("starthelios");
     startHelios.parentNode.removeChild(startHelios);
     var global = typeof global === "undefined" ? window : global || window;
-    require(["require", "amber/es2015-polyfills"], function (require) {
+    require(["require", "amber/es6-promise"], function (require, promiseLib) {
+        promiseLib.polyfill();
         var loadHelpers = new Promise(function (resolve, reject) {
             setTimeout(function () {
                 require(["amber/legacy/IDE", "amber/web/Web", "amber/legacy/Benchfib", "helios/all", "amber_cli/AmberCli"], resolve, reject);

+ 1 - 1
package.json

@@ -30,7 +30,7 @@
     "test:e2e": "(cd cli && npm test)"
   },
   "devDependencies": {
-    "amber-compat-es2015": "^0.1.4",
+    "es6-promise": "^4.2.4",
     "grunt": "1.0.1",
     "grunt-contrib-clean": "^1.1.0",
     "grunt-contrib-jshint": "^1.1.0",