Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Remove knowledge of fbjs from the packager #5084

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@

# Ignore react and fbjs where there are overlaps, but don't ignore
# anything that react-native relies on
.*/node_modules/fbjs/lib/Map.js
.*/node_modules/fbjs/lib/Promise.js
.*/node_modules/fbjs/lib/fetch.js
.*/node_modules/fbjs/lib/ExecutionEnvironment.js
.*/node_modules/fbjs/lib/isEmpty.js
.*/node_modules/fbjs/lib/crc32.js
.*/node_modules/fbjs/lib/ErrorUtils.js

# Flow has a built-in definition for the 'react' module which we prefer to use
Expand Down
1 change: 1 addition & 0 deletions Libraries/Interaction/__tests__/InteractionManager-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

jest
.autoMockOff()
.mock('ErrorUtils')
.mock('BatchedBridge');

function expectToBeCalledOnce(fn) {
Expand Down
36 changes: 8 additions & 28 deletions Libraries/Promise.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
/**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* Copyright 2013-2014 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule Promise
*
* This module wraps and augments the minimally ES6-compliant Promise
* implementation provided by the promise npm package.
* @flow
*/

'use strict';

global.setImmediate = require('setImmediate');
var Promise = require('promise/setimmediate/es6-extensions');
require('promise/setimmediate/done');
const Promise = require('fbjs/lib/Promise'); // this will require Promise.native.js

if (__DEV__) {
require('promise/setimmediate/rejection-tracking').enable({
allRejections: true,
Expand All @@ -46,12 +34,4 @@ if (__DEV__) {
});
}

/**
* Handle either fulfillment or rejection with the same callback.
*/
Promise.prototype.finally = function(onSettled) {
return this.then(onSettled, onSettled);
};


module.exports = Promise;
Loading