Переглянути джерело

Remove the es6-promise polyfill.

Amber requires a native Promise and no longer ships the polyfill; the
AMD path this package declared for it was what put
helios/es6-promise/auto into every config.js generated around it. The
polyfills module that loaded it, its path, the popup page's detour
through it, the test-runner wrapper and the dependency all go.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Herby Vojčík 4 днів тому
батько
коміт
01905de6b5
6 змінених файлів з 14 додано та 25 видалено
  1. 3 4
      Gruntfile.js
  2. 0 5
      es6-promise.amd.json
  3. 11 13
      index.html
  4. 0 1
      local.amd.json
  5. 0 1
      package.json
  6. 0 1
      polyfills.js

+ 3 - 4
Gruntfile.js

@@ -30,9 +30,8 @@ module.exports = function (grunt) {
     grunt.registerTask('test', ['amdconfig:app', 'requirejs:test_runner', 'exec:test_runner', 'clean:test_runner']);
     grunt.registerTask('devel', ['amdconfig:app']);
 
-    var polyfillThenPromiseApp = function () {
-        define(["require", "amber/es6-promise"], function (require, promiseLib) {
-            promiseLib.polyfill();
+    var promiseApp = function () {
+        define(["require"], function (require) {
             return new Promise(function (resolve, reject) {
                 require(["__app__"], resolve, reject);
             });
@@ -99,7 +98,7 @@ module.exports = function (grunt) {
                                 });
                             });
                         } + "());",
-                        "app": "(" + polyfillThenPromiseApp + "());"
+                        "app": "(" + promiseApp + "());"
                     },
                     paths: {"amber_devkit": helpers.libPath},
                     pragmas: {

+ 0 - 5
es6-promise.amd.json

@@ -1,5 +0,0 @@
-{
-  "paths": {
-    "helios/es6-promise/auto": "./dist/es6-promise.auto"
-  }
-}

+ 11 - 13
index.html

@@ -24,19 +24,17 @@
                 clearInterval(__interval);
                 require.baseUrl = base;
                 require.callback = function () {
-                    require(["helios/polyfills"], function () {
-                        require(["helios/app", "amber/core/Platform-Browser"], function (amber) {
-                            var options;
-                            if (window.opener) {
-                                // Slave: use master's settings
-                                amber.globals.SmalltalkSettings = window.opener.require('amber/helpers').globals.SmalltalkSettings;
-                            } else {
-                                // Standalone: set default amd namespace
-                                options = {'transport.defaultAmdNamespace': "helios"};
-                            }
-                            amber.initialize(options).then(function () {
-                                amber.globals.HLManager._setup();
-                            });
+                    require(["helios/app", "amber/core/Platform-Browser"], function (amber) {
+                        var options;
+                        if (window.opener) {
+                            // Slave: use master's settings
+                            amber.globals.SmalltalkSettings = window.opener.require('amber/helpers').globals.SmalltalkSettings;
+                        } else {
+                            // Standalone: set default amd namespace
+                            options = {'transport.defaultAmdNamespace': "helios"};
+                        }
+                        amber.initialize(options).then(function () {
+                            amber.globals.HLManager._setup();
                         });
                     });
                 };

+ 0 - 1
local.amd.json

@@ -3,7 +3,6 @@
     "helios": "src",
     "helios/resources": "resources",
     "helios/app": "app",
-    "helios/polyfills": "polyfills",
     "helios/index": "index"
   }
 }

+ 0 - 1
package.json

@@ -31,7 +31,6 @@
     "@ambers/lang": ">0.29.1",
     "bootstrap": "^3.3.7",
     "codemirror": "^5.44.0",
-    "es6-promise": "^4.2.4",
     "jquery-ui-dist": ">=1.9.2",
     "require-css": "^0.1.10",
     "showdown": "^0.5.0",

+ 0 - 1
polyfills.js

@@ -1 +0,0 @@
-define(['helios/es6-promise/auto']);