Skip to content

Commit

Permalink
[RN] Drop no longer needed polyfills
Browse files Browse the repository at this point in the history
They were required only on Android because of its old JSC version. With the JSC
version bump they are no longer required.
  • Loading branch information
saghul authored and lyubomir committed Aug 5, 2018
1 parent 8d3ceca commit a1cc9bc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 39 deletions.
24 changes: 0 additions & 24 deletions index.android.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,2 @@
// The type field of react-native application loader's React Element is created
// as number and not Symbol, because it's not been defined by the polyfill yet.
// We import the application renderer, before Symbol is defined, in order to use
// number types as well. Otherwise this will result in the invariant exception,
// because fiber thingy will not recognise root react-native component as React
// Element, but as an Object.
//
// See node_modules/react-native/Libraries/polyfills/babelHelpers.js
// :babelHelpers.createRawReactElement - that's where first react-native element
// is created (super early - it's the app loader).
//
// See node_modules/react-native/Libraries/Renderer/ReactNativeFiber-dev.js
// and look for REACT_ELEMENT_TYPE definition - it's defined later when Symbol
// has been defined and type will not match.
//
// As an alternative solution we could stop using/polyfilling Symbols and
// replace with classpath string constants or some kind of a wrapper around
// that.

import 'react-native/Libraries/ReactNative/renderApplication';

// Android doesn't provide Symbol
import 'es6-symbol/implement';

import './react/index.native';

4 changes: 4 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
"@atlaskit/tooltip": "9.1.1",
"@webcomponents/url": "0.7.1",
"autosize": "1.18.13",
"es6-iterator": "2.0.3",
"es6-symbol": "3.1.1",
"i18next": "8.4.3",
"i18next-browser-languagedetector": "2.0.0",
"i18next-xhr-backend": "1.4.2",
Expand Down
13 changes: 0 additions & 13 deletions react/features/base/lib-jitsi-meet/native/polyfills-browser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Iterator from 'es6-iterator';
import BackgroundTimer from 'react-native-background-timer';
import '@webcomponents/url'; // Polyfill for URL constructor

Expand Down Expand Up @@ -123,18 +122,6 @@ function _visitNode(node, callback) {
global.removeEventListener = () => {};
}

// Array.prototype[@@iterator]
//
// Required by:
// - for...of statement use(s) in lib-jitsi-meet
const arrayPrototype = Array.prototype;

if (typeof arrayPrototype['@@iterator'] === 'undefined') {
arrayPrototype['@@iterator'] = function() {
return new Iterator(this);
};
}

// document
//
// Required by:
Expand Down

0 comments on commit a1cc9bc

Please sign in to comment.