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

Initial work to support advanced compilation of UMD bundles using GCC #11967

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
081c0da
Initial work to support advanced compilation of UMD bundles using GCC
Jan 5, 2018
acbf6ae
Allow building node bundles
Jan 5, 2018
706e247
Add more missing externs
Jan 5, 2018
8f6eb00
Switch to BROWSER env and don't process commonjs modules
Jan 5, 2018
0edde2d
Move common externs to react.ext.js
Jan 6, 2018
1ec3e29
Fix some "duplicate name" errors from GCC
Jan 6, 2018
ca08db9
Remove externs obviated by BROWSER
Jan 6, 2018
d828f31
Move plugins to react-dom.ext.js
Jan 6, 2018
9a43caf
Add more externs to get more tests to work
Jan 6, 2018
0f6dca5
Add externs for names used from fbjs
Jan 6, 2018
5d89dff
Add externs to get remaining bundles to compile
Jan 6, 2018
923dc07
Check-in compilation results
Jan 6, 2018
8508a5e
run prettier
Jan 6, 2018
7d50185
Prevent GCC from emptying RESERVED_PROPS
Jan 6, 2018
c8a14d3
Add externs for FiberNode
Jan 6, 2018
0aca7a7
Add missing extern for Component.defaultProps
Jan 6, 2018
2b23c2b
Decouple forcePrettyOutput from shouldStayReadable
Jan 6, 2018
d0b197b
run prettier
Jan 6, 2018
1930287
Add a missing extern on ReactDOM
Jan 6, 2018
7b01e20
Add more fiber externs
Jan 6, 2018
67b2f3b
Add externs for react-call-return
Jan 6, 2018
ed620f2
Add externs for ReactDOMServer and stream.Readable
Jan 6, 2018
505945b
Fix test failures because of suppressReactErrorLogging getting renamed
Jan 6, 2018
9146ac4
Update externs for SyntheticEvent
Jan 6, 2018
1b98ddd
Add complete externs for __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE…
Jan 6, 2018
8bfc5e4
Fix externs for BrowserEventConstants
Jan 6, 2018
4ddec66
Add missing fbjs extern for ExecutionEnvironment.canUseDOM
Jan 7, 2018
af16528
Avoid duplicating react-dom externs
Jan 7, 2018
4b2234f
Add debug-test-build and debug-test-build-prod
Jan 7, 2018
6fb8cce
Clean-up ReactDOM externs
Jan 7, 2018
436c08c
Make ReactInstanceMap work correctly
Jan 7, 2018
629dbc2
Stop renaming mockImplementation for tests
Jan 7, 2018
f14d054
Add externs for CSSProperty
Jan 7, 2018
23ef5a6
Add externs for test-renderer
Jan 7, 2018
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
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ scripts/bench/benchmarks/**/*.js

# React repository clone
scripts/bench/remote-repo/

# Externs
externs/
30 changes: 30 additions & 0 deletions externs/fbjs.ext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/** @suppress {duplicate} */
var ExecutionEnvironment;
ExecutionEnvironment.canUseDOM;
/** @suppress {duplicate} */
var TouchEventUtils;
/** @suppress {duplicate} */
var camelizeStyleName;
/** @suppress {duplicate} */
var containsNode;
/** @suppress {duplicate} */
var emptyFunction;
emptyFunction.thatReturns;
emptyFunction.thatReturnsNull;
emptyFunction.thatReturnsTrue;
emptyFunction.thatReturnsFalse;
emptyFunction.thatReturnsArgument;
/** @suppress {duplicate} */
var emptyObject;
/** @suppress {duplicate} */
var getActiveElement;
/** @suppress {duplicate} */
var hyphenateStyleName;
/** @suppress {duplicate} */
var invariant;
/** @suppress {duplicate} */
var memoizeStringOnly;
/** @suppress {duplicate} */
var shallowEqual;
/** @suppress {duplicate} */
var warning;
1 change: 1 addition & 0 deletions externs/react-art-UMD_PROD.ext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var global;
2 changes: 2 additions & 0 deletions externs/react-art.ext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var requestIdleCallback;
var cancelIdleCallback;
8 changes: 8 additions & 0 deletions externs/react-call-return.ext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @suppress {duplicate} */
var unstable_createCall;
/** @suppress {duplicate} */
var unstable_createReturn;
/** @suppress {duplicate} */
var unstable_isCall;
/** @suppress {duplicate} */
var unstable_isReturn;
41 changes: 41 additions & 0 deletions externs/react-dom-NODE_PROD.ext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/** @suppress {duplicate} */
var ReactTestUtils;
ReactTestUtils.Simulate;
ReactTestUtils.Simulate.change;
ReactTestUtils.Simulate.click;
ReactTestUtils.Simulate.keyDown;
ReactTestUtils.Simulate.mouseEnter;
ReactTestUtils.Simulate.mouseMove;
ReactTestUtils.SimulateNative;
ReactTestUtils.SimulateNative.blur;
ReactTestUtils.SimulateNative.click;
ReactTestUtils.SimulateNative.mouseIn;
ReactTestUtils.SimulateNative.mouseMove;
ReactTestUtils.SimulateNative.mouseOut;
ReactTestUtils.SimulateNative.touchEnd;
ReactTestUtils.SimulateNative.touchStart;
ReactTestUtils.default;
ReactTestUtils.findAllInRenderedTree;
ReactTestUtils.findRenderedDOMComponentWithClass;
ReactTestUtils.findRenderedDOMComponentWithTag;
ReactTestUtils.isCompositeComponent;
ReactTestUtils.isCompositeComponentWithType;
ReactTestUtils.isDOMComponent;
ReactTestUtils.mockComponent;
ReactTestUtils.nativeTouchData;
ReactTestUtils.renderIntoDocument;
ReactTestUtils.scryRenderedComponentsWithType;
ReactTestUtils.scryRenderedDOMComponentsWithClass;
ReactTestUtils.scryRenderedDOMComponentsWithTag;
ReactTestUtils.simulateNativeEventOnDOMComponent;
ReactTestUtils.simulateNativeEventOnNode;

/** @suppress {duplicate} */
var stream;
stream.Readable;
stream.Readable._read;

Error.prototype.suppressReactErrorLogging;

var MockComponent;
MockComponent.prototype.render.mockImplementation;
166 changes: 166 additions & 0 deletions externs/react-dom.ext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
/** @suppress {duplicate} */
var ReactDOM = {};
ReactDOM.version;
ReactDOM.findDOMNode;
ReactDOM.hydrate;
ReactDOM.render;
ReactDOM.unstable_renderSubtreeIntoContainer;
ReactDOM.unmountComponentAtNode;
ReactDOM.createPortal;
ReactDOM.unstable_createPortal;
ReactDOM.unstable_batchedUpdates;
ReactDOM.unstable_deferredUpdates;
ReactDOM.flushSync;
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

/** @suppress {duplicate} */
var ReactDOMServer = {};
ReactDOMServer.renderToString;
ReactDOMServer.renderToStaticMarkup;
ReactDOMServer.renderToNodeStream;
ReactDOMServer.renderToStaticNodeStream;

/* Used by ReactInstanceMap */
var _reactInternalFiber;

/**
* React event system creates plugins and event properties dynamically.
* These externs are needed when consuming React as a JavaScript module
* in light of new ClojureScript compiler additions (as of version 1.9.456).
* See the following link for an example.
* https://github.com/facebook/react/blob/c7129c/src/renderers/dom/shared/eventPlugins/SimpleEventPlugin.js#L43
*/
/** @suppress {duplicate} */
var ResponderEventPlugin;
/** @suppress {duplicate} */
var SimpleEventPlugin;
/** @suppress {duplicate} */
var TapEventPlugin;
/** @suppress {duplicate} */
var EnterLeaveEventPlugin;
/** @suppress {duplicate} */
var ChangeEventPlugin;
/** @suppress {duplicate} */
var SelectEventPlugin;
/** @suppress {duplicate} */
var BeforeInputEventPlugin;

var bubbled;
var captured;
/* Keep in sync with BrowserEventConstants */
var topAbort;
var topAnimationEnd;
var topAnimationIteration;
var topAnimationStart;
var topBlur;
var topCancel;
var topCanPlay;
var topCanPlayThrough;
var topChange;
var topClick;
var topClose;
var topCompositionEnd;
var topCompositionStart;
var topCompositionUpdate;
var topContextMenu;
var topCopy;
var topCut;
var topDoubleClick;
var topDrag;
var topDragEnd;
var topDragEnter;
var topDragExit;
var topDragLeave;
var topDragOver;
var topDragStart;
var topDrop;
var topDurationChange;
var topEmptied;
var topEncrypted;
var topEnded;
var topError;
var topFocus;
var topInput;
var topKeyDown;
var topKeyPress;
var topKeyUp;
var topLoadedData;
var topLoad;
var topLoadedMetadata;
var topLoadStart;
var topMouseDown;
var topMouseMove;
var topMouseOut;
var topMouseOver;
var topMouseUp;
var topPaste;
var topPause;
var topPlay;
var topPlaying;
var topProgress;
var topRateChange;
var topScroll;
var topSeeked;
var topSeeking;
var topSelectionChange;
var topStalled;
var topSuspend;
var topTextInput;
var topTimeUpdate;
var topToggle;
var topTouchCancel;
var topTouchEnd;
var topTouchMove;
var topTouchStart;
var topTransitionEnd;
var topVolumeChange;
var topWaiting;
var topWheel;

/* Keep in sync with CSSProperty */
var animationIterationCount;
var borderImageOutset;
var borderImageSlice;
var borderImageWidth;
var boxFlex;
var boxFlexGroup;
var boxOrdinalGroup;
var columnCount;
var columns;
var flex;
var flexGrow;
var flexPositive;
var flexShrink;
var flexNegative;
var flexOrder;
var gridRow;
var gridRowEnd;
var gridRowSpan;
var gridRowStart;
var gridColumn;
var gridColumnEnd;
var gridColumnSpan;
var gridColumnStart;
var fontWeight;
var lineClamp;
var lineHeight;
var opacity;
var order;
var orphans;
var tabSize;
var widows;
var zIndex;
var zoom;
var fillOpacity;
var floodOpacity;
var stopOpacity;
var strokeDasharray;
var strokeDashoffset;
var strokeMiterlimit;
var strokeOpacity;
var strokeWidth;

/* Globals not provided by the BROWSER environment */
var requestIdleCallback;
var cancelIdleCallback;
var MSApp;
1 change: 1 addition & 0 deletions externs/react-noop-renderer.ext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var regeneratorRuntime;
12 changes: 12 additions & 0 deletions externs/react-test-renderer.ext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @suppress {duplicate} */
var ReactShallowRenderer;
ReactShallowRenderer.createRenderer;
ReactShallowRenderer.prototype.getMountedInstance;
ReactShallowRenderer.prototype.getRenderedOutput;
ReactShallowRenderer.prototype.render;
ReactShallowRenderer.prototype.unmount;

/** @suppress {duplicate} */
var ReactTestRendererFiber;
ReactTestRendererFiber.prototype.create;
ReactTestRendererFiber.prototype.unstable_batchedUpdates;
Loading