Commit Graph
570 Commits
Author SHA1 Message Date
François ChalifourandSophie Alpert ffb6033611 Fix test names in ReactDOMComponent-test (#10113)
* Fix test names in ReactDOMComponent-test

* Run record-tests script for Fiber
2017-09-10 14:52:09 -07:00
Nikoloz BuliginiandSophie Alpert ad46337f32 adds missing else clause (#10660) 2017-09-10 12:42:53 -07:00
guoyong yiandDan Abramov 8122a633b1 Add license headers on build bundles (#10490)
* Add license headers on build bundles

* Add the filename IMO to header

* Preserve headers in production bundles

* Use ECMASCRIPT5_STRICT to preserve "use strict"
2017-09-07 19:38:16 +01:00
Flarnie MarchanandGitHub f53c3453a7 16.0.0-rc.1 (#10630) 2017-09-06 15:43:22 -07:00
Flarnie MarchanandGitHub eb8ca666e9 Update error codes and results.json (#10619)
* Update results.json

**what is the change?:**
Ran the build after updating Yarn lockfile and recorded latest build
size results.

**why make this change?:**
Let's get an idea of bundle size at this point, when we are preparing
the 16.0 RC.

**test plan:**
NA

**issue:**
https://github.com/facebook/react/issues/8854

* Update error codes

https://github.com/facebook/react/tree/master/scripts/release-manager#update-the-error-codes
2017-09-06 11:11:19 -07:00
Nikita LebedevandAndrew Clark db952e53f9 Fix typo in script function name (#10611) 2017-09-05 10:28:34 -07:00
Dan Abramov 6f2d7be6fd Update sizes 2017-08-31 22:35:42 -07:00
Brian VaughnandGitHub 49e2856681 Embed ReactNative event types in JavaScript (#10567)
* ReactNative doesn't query UIManager for native event types
This is a pre-req to unblock Prepack optimiations for ReactNative apps
* Replaced mock ReactNativeEventTypes with mock Platform
* Added Platform.OS to RN host hooks Flow types
2017-08-31 15:27:54 -07:00
Brian VaughnandGitHub 14cd5765be Add --sync-www flag to build script (#10571) 2017-08-30 09:38:14 -07:00
Brian VaughnandGitHub 2cd0b21595 Lint command fails if there are any warnings (#10572)
You get a lint failure! You get a lint failure! Eeeeverybody gets a lint failure!
2017-08-30 08:03:17 -07:00
Andrew ClarkandGitHub 78c9c1036a Remove UMD builds from fixture directory (#10547) 2017-08-25 17:17:31 -07:00
Andrew Clark 8ff26f3664 Update eslintignore and prettier config to ignore UMD builds of React 2017-08-25 11:35:43 -07:00
Andrew Clark 723742dbf1 Move attribite-behavior to fixtures 2017-08-25 10:40:09 -07:00
Andrew Clark 62f8f8d8d1 Use monospace font-family 2017-08-25 10:37:46 -07:00
Andrew Clark 853ef73962 Wrap string values in quotes
All other types are formatted as as <type: param>
2017-08-25 10:37:46 -07:00
Andrew ClarkandFlarnie Marchan 55263b96ed Add table of attribute behavior (#10536)
* [WIP] Table of attribute behavior

* getAttribute helper

* add getters for attributes V-Z

* More special cases

* Add getters for more attributes

* Add tagName to attribute config

* Switch default accessor to getProperty instead of getAttribute

* Add containerTagName and tagName config

* Compare result to default value

* Add overrideStringValue config option

* add section for Sebastian and update a couple more attributes

* 'array with string' should use string override, too

* Add additional value types

Strings on, off, true, false

* more attribute updates

* More attributes

* Remove old directory

* add more attribute configs

* More attributes

* just a couple more attribute updates

* More attributes

* Fix the seb parts

* Fix the seb parts

# Conflicts:
#	scripts/attribute-behavior/src/App.js

* More attributes

* Prettier

* More attributes

* More attributes

* Fix some bugs in seb's set

* Fix the rest of flarnie's section

* More attributes

* Prettier

* Finish my section (Andrew)

* Compare against UMD build of master

Once we get past MVP stage we can hook this up to the build system so
these files are automatically copied over.

* Fix attributes that don't have compatible properties

Avoid all undefined reads.

* Test multiple input types

Tests different input types and valueAsNumber property. This value is often
NaN. To compare that we also need to switch to Object.is.

* Ignore checked in copies of React 15 bundles in attribute fixture

**what is the change?:**
We checked in bundles of React v15 to run comparisons of attribute
behavior on DOM elements between 15 and 16.

This commit tells prettier and eslint to ignore those files, and fixes a
prettier lint in one other file from that fixture.

**why make this change?:**
To get CI passing.

**test plan:**
`yarn prettier` doesn't change anything, eslint passes

**issue:**

* update README for attribute table fixture

* run prettier again
2017-08-25 10:03:30 -07:00
Brian VaughnandGitHub 4c5caae5b6 Delete ReactNativeStack 🎉 🎉 🎉 (#10511)
* Removed createReactNativeComponentClassStack and renamed createReactNativeComponentClassFiber => createReactNativeComponentClass

* Removed findNumericNodeHandleStack and renamed findNumericNodeHandleFiber => findNumericNodeHandle

* Renamed ReactNativeFiberEntry => ReactNativeEntry

* Removed all references to ReactNativeFeatureFlags and RN stack

* Removed severl RN modules that are no longer used

* Renamed ReactNativeEntry => ReactNativeFiberEntry for now. We'll probably remove 'fiber' references later

* Update build results json

* Deleted snapshot

* Re-add accidentally deleted test

* Remove now-unnecessary hack in test

* Fix lint

* RN findNodeHandle no longer adds props directly to read-only owner (#10520)

* Added ReactNativeMount-test snapshot for 'renders and reorders children' test
2017-08-23 15:53:55 -07:00
Brian VaughnandGitHub 305b4d15f2 Removed ReactNativeFeatureFlag shim from RN bundle (#10472) 2017-08-18 08:26:11 -07:00
Ian SutherlandandDan Abramov a44ed6808d Added unit tests for creating an element with a ref in a constructor. Only set ReactCurrentOwner.current in dev mode when the component has no constructor. (#10025) 2017-08-15 11:21:49 +02:00
Brandon DailandGitHub f928e5cb4b Add explicit invariant when ReactDOM is loaded w/o React (#10449) 2017-08-13 13:16:13 -05:00
Sasha AickinandGitHub ff74e73de2 Fix for #10388. Renames renderToStream to renderToNodeStream. (#10425) 2017-08-10 12:23:00 -07:00
Brian VaughnandGitHub 3aa1bdc2ae Wrap warning() calls in a DEV check for RN_* builds too (#10428)
* Wrap warning() calls in a DEV check for RN_* builds too.
* Wrapped several warning() imports and calls in if-DEV checks.
* Removed a useless variable (allTypesByEventName) and loop from ReactNativeBridgeEventPlugin.
2017-08-10 08:41:51 -07:00
Dominic GannawayandGitHub 49531ba898 Use Closure Compiler for UMD/Node bundles instead of Uglify (#10236)
* Use GCC instead of Uglify for UMD/NODE bundles

* Prettier run

* Fixes fixtures that were alterated by Pretter and trailing function commas

* prettier on prettier

* updated prettier config

* altered prettier config slightly

* Reverted prettier changes

* updated results.json
2017-08-10 11:12:29 +01:00
Dominic GannawayandGitHub 944f3c891e Moved around package dependencies fixes #10335 (#10424) 2017-08-09 18:47:52 +01:00
Mateusz BurzyńskiandBrandon Dail ebbe0dd17d Add test for duplicate events with nested dispatch 2017-08-09 09:30:08 -05:00
Brian Vaughn f6fdcbca36 16 beta 5 version bump and results JSON 2017-08-08 10:25:25 -07:00
Brian Vaughn 97c55f7618 Updated packages and results JSON for 16 beta 4 2017-08-08 09:08:17 -07:00
Dan AbramovandGitHub c94d3b9451 Move PooledClass to Stack folder (#10386) 2017-08-04 19:10:07 +01:00
Brandon DailandDan Abramov 66cf394790 Implement event-specific pooling for SyntheticEvent (#10237)
* Remove PooledClass from FallbackCompositionState

The only module that uses FallbackCompositonState is BeforeInputEventPlugin. The way its structured means there can only be a single instance of FallbackCompositionState at any given time (stored in a local variable at the top-level) so we don't really need pooling here at all. Instead, a single object is now stored in FallbackCompositionState, and access (initializing, reseting, getting data) is gaurded by the exported helper object.

* Use new FallbackCompositionState API in BeforeInputEventPlugin

* Implement event-specific pooling in SyntheticEvent

* Remove PooledClass from TopLevelCallbackBookKeeping

* Update results.json

* Add pooled event test fixtures (#1)

* Fix fixture lint
2017-08-04 18:24:48 +01:00
DevedseandDan Abramov f8d87a5ade Wop optimized this repository (#10374)
The Web Optimization Project optimized this repository. This commit contains the optimized files in this repository.
2017-08-04 14:41:38 +01:00
Brian Vaughn 6405ded1ea Built 16.0.0 beta 3. Updated versions, results.json, and error codes 2017-08-03 16:05:28 -07:00
Dan AbramovandGitHub dfc40ab669 Fix CI maybe 2017-08-03 00:59:40 +01:00
Dan AbramovandGitHub b4cb1e90d6 Use single entry point for SSR via browser field (#10362)
* Use single entry point for SSR via browser field

* Add server.browser entry point and smoke tests

* Tweak bundle naming

* Fix import

* Re-record

* Fix the robot nits

* Add resetModules for some extra isolation
2017-08-03 00:41:09 +01:00
Brian VaughnandGitHub a9086b6a57 Wrap contents of if-DEV condition in an IIFE (#10361)
This avoids strict mode conflicts for certain browsers wrt functions being defined within an if-block.
Also re-added the if-DEV condition for the ReactNative renderer since it was removed for this reason.
2017-08-02 14:24:43 -07:00
Brian VaughnandGitHub 0e91b484b1 FB bundles wrap warning() calls in __DEV__ (#10314)
FB bundles wrap warning() calls in __DEV__

Split dev-mode transforms into separate parts:
1) umd+cjs+fb: Wrap warning calls with process.env checks
2) umd+cjs: Replace error messages with minified codes

Also updated transforms to use __DEV__ since it transforms to smaller code after stripEnvVariables is run.

Also renamed 'scripts/error-codes/dev-expression-with-codes.js' -> 'scripts/error-codes/replace-invariant-error-codes.js'
2017-08-02 14:14:26 -07:00
Michał PierzchałaandDan Abramov 7dcc560060 Fix error-codes not updating correctly (#10348)
* Fix error-codes not updating correctly

* Revert changes to codes.json
2017-08-02 10:38:27 +01:00
Dan AbramovandGitHub e954616919 Make unexpected console.warn() calls fail tests (#10341)
* Make console.warn() calls fail tests

* Replace matchers with a more straightforward cleanup
2017-08-01 19:53:37 +01:00
Dominic GannawayandGitHub 6d50537009 Move line to within DEV block (#10316)
* move line to within DEV block

* addressed code review feedback
2017-07-27 17:31:34 -07:00
Dan Abramov b7b7e33a1b 16.0.0-beta.2 2017-07-27 18:06:26 +01:00
Keyan ZhangandDan Abramov f3a15877af Fix ReactPartialRenderer in production (#10300) 2017-07-27 10:19:05 +01:00
Brian Vaughn 36a21342a6 Updated package versions and Rollup results 2017-07-26 12:55:31 -07:00
Brian VaughnandGitHub 8b99ae86bc Updated error codes (after merging in missing code from 15 stable) (#10290) 2017-07-26 12:18:02 -07:00
Brian VaughnandGitHub b7fb73ae6d Regenerate error codes and update bundle size stats (#10287) 2017-07-26 11:21:43 -07:00
Brian VaughnandGitHub 7e0a0030ef Update pre-release instructions for generating error-codes (#10286) 2017-07-26 11:18:32 -07:00
Andrew ClarkandBrian Vaughn 23fe281c1a Remove feature test from invokeGuardedCallbackDev (#10283)
The critical semantics are resilient to browser flakiness, so we don't
need this feature test.

Also added comments explaining how invokeGuardedCallback dev works.
2017-07-26 10:01:31 -07:00
Dan Abramov d62824a362 Update sizes 2017-07-26 12:27:29 +01:00
Andrew ClarkandGitHub 5f32ec96aa [invokeGuardedCallback] Handle nested errors across separate renderers (#10270)
invokeGuardedCallback is a function we use in place of try-catch
statement. It accepts a function, and if the function throws, it
captures the error. In production, the implementation is a normal try-
catch. In development, we swap out the prod implementation for a special
version designed to preserve "Pause on all exceptions" behavior of the
browser DevTools.

invokeGuardedCallbackDev works by dispatching an event to a dummy DOM
node and calling the provided function inside a handler for that event.
We also attach an error event handler to the window object. If the
function throws, the global event handler is called and we can access
the error.

The global event handler is added and removed right before and after the
fake event is dispatched. But if invokeGuardedCallbackDev is nested --
 that is, if it's invoked inside the body of another
invokeGuardedCallbackDev -- multiple error event handlers will attached
simultaneously. We only want the handler that corresponds to the deepest
level to handle the error. So we keep track of a depth counter, and
within the event handler, we only handle the error if the current depth
matches the depth at the time the function was invoked.

The problem that we discovered, and that this PR fixes, is that the
depth counter is local to each renderer. So if you nest separate copies
of invokeGuardedCallback from separate renderers, each renderer will
have its own depth counter, and multiple error handlers will fire for a
single, nested error.
2017-07-25 09:44:43 -07:00
Brian VaughnandGitHub b153514f80 Fix failing Prettier command (#10268)
* Ran prettier over non-modified files to change them
* Fixed output of failing Prettier message to show invalid files
* Failing Prettier command now suggests 'yarn prettier-all'
2017-07-24 13:59:16 -07:00
Brian VaughnandGitHub 00a9c26d07 Don't add dangling commas to functions for packaging fixtures (#10264) 2017-07-24 09:09:40 -07:00
Andrew ClarkandGitHub dec5233db3 Support throwing null (#10213)
* Support throwing null

In JavaScript, you can throw values of any type, not just errors. That
includes null. We currently rely on null checks to determine if a user-
provided function has thrown. This refactors our error handling code to
keep track of an explicit boolean flag instead.

* Add DOM fixture test case for break on exception behavior

* preventDefault error events during feature test

We call invokeGuardedCallbackDev at startup as part of a feature test.
But we don't want those errors to log to the console.

* Add throwing null test case

* Use ReactFeatureFlags instead of ReactDOMFeatureFlags

React ART uses this, too.

* Non-errors in error logger

If a non-error is thrown, we'll coerce the value to a string and use
that as the message.
2017-07-21 15:34:41 -07:00