8000 babel-polyfill replaces existing Promise implementation · Issue #510 · feathersjs/feathers · GitHub
[go: up one dir, main page]

Skip to content

babel-polyfill replaces existing Promise implementation #510

@bisubus

Description

@bisubus

This is caused by the fact that core-js/shim (which is used by babel-polyfill) aggressively applies polyfills to global objects if it thinks that they aren't good enough, almost every non-native Promise falls into this category.

Steps to reproduce

const NativePromise = global.Promise;
const Bluebird = global.Promise = require('bluebird');
require('feathers');
console.log(Promise !== NativePromise, Promise !== Bluebird);

Expected behavior

require('feathers') keeps globals intact. If there is another Promise implementation (i.e Bluebird which was installed globally as global.Promise), it isn't replaced with a polyfill.

If Promise or other JS feature should exist in supported Node versions but is missing in user Node version, the user is responsible for providing polyfills for them (falls into 'unsupported' category).

Actual behavior

require('feathers') loads babel-polyfill which replaces existing non-native Promise implementation with a polyfill.

System configuration

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working): feathers@2.0.3

NodeJS version: 7.2.0 x64

Operating System: Windows 7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0