Meteor 1.2 & Promise pollyfill

Does Meteor 1.2 (via ecmascript) comes with a polyfill for Promise?

is a promise package https://github.com/meteor/meteor/tree/devel/packages/promise

Seems like that’s only for the server.

I think so, at least in 1.3, because it compiles async/await, which uses promises, and Meteor must work on IE 8.

it is. Only for server. On client I make a try some months ago using this https://github.com/grigio/meteor-babel who include @benjamn regenerator runtime.

I don´t remember well but I rip some files from griglio:meteor-babel. For promise support you need ‘lib/runtime.js’ (regenerator runtime)

Look at test file: https://github.com/grigio/meteor-babel/blob/master/tests/basic_test.es6.js

this is the runtime: https://facebook.github.io/regenerator/

@bysabi even though somehow, seems like Meteor is working on the polyfill.

(function () {

/* Imports */
var Meteor = Package.meteor.Meteor;
var ECMAScript = Package.ecmascript.ECMAScript;
var check = Package.check.check;
var Match = Package.check.Match;
var _ = Package.underscore._;
var Picker = Package['meteorhacks:picker'].Picker;
var babelHelpers = Package['babel-runtime'].babelHelpers;
var Symbol = Package['ecmascript-runtime'].Symbol;
var Map = Package['ecmascript-runtime'].Map;
var Set = Package['ecmascript-runtime'].Set;
var Promise = Package.promise.Promise;

In Meteor 1.2, the ecmascript package implies the promise package, which provides a Promise polyfill on both the client and the server. In 1.2.1, the polyfill reuses the native Promise constructor, if globally defined.

4 Likes