Commit Graph
8893 Commits
Author SHA1 Message Date
Andrew ClarkandGitHub 253fc199aa Update Flow to 0.52 (#10417)
For opaque types
2017-08-08 19:02:10 -07:00
Brian Vaughn f6fdcbca36 16 beta 5 version bump and results JSON 2017-08-08 10:25:25 -07:00
Brian VaughnandGitHub 9eac30cd39 Enable new fiber ReactTestRenderer API methods (#10410)
Enable new fiber ReactTestRenderer API methods
2017-08-08 10:17:59 -07:00
Andrew ClarkandGitHub 2b4026bd23 Fix bugs related to unmounting error boundaries (#10403)
* Don't warn about setState on unmounted when scheduling error recovery

We shouldn't schedule an update on unmounted error boundaries, but we
don't know if a boundary is unmounted until we traverse its parents.
Added an additional argument to scheduleUpdate so we know not to warn
about setState on unmounted components.

* Should be able to unmount an error boundary before it is handled

Fixes the case where an error boundary captures an error, but its
parent is unmounted before we can re-render it. componentDidCatch is
never called, and we don't remove the boundary from our set of
unhandled error boundaries.

We should not assume that if capturedErrors is non-null that we still
have unhandled errors.
2017-08-08 10:09:43 -07:00
Brian Vaughn 97c55f7618 Updated packages and results JSON for 16 beta 4 2017-08-08 09:08:17 -07:00
Rodrigo PomboandDan Abramov 85baf525ef Fiber debugger enhancements (#10393)
* Add effect tag

* Add graph settings (direction and trackActive)

* Support multiple effect tags
2017-08-08 11:31:48 +01:00
Ben AlpertandGitHub 11cdef9fcc Add traversal for Fiber test renderer (#10377)
Not clear the path to shipping this but this gives us a migration path internally that we need right now (replaces https://fburl.com/udq9ksvk).
2017-08-07 16:47:22 -07:00
Dan AbramovandGitHub dcadb1508b Remove data-reactid and data-reactchecksum from whitelist (#10402) 2017-08-07 21:28:26 +01:00
Dan AbramovandGitHub 8d6ba33602 Rewrite DOMPropertyOperations-test in terms of public API (#10281)
* Rewrite DOMPropertyOperations-test in terms of public API

* Add more assertions

I don't understand what the jsdom comments are about since they pass.

* Address review feedback
2017-08-07 20:12:13 +01:00
Ben AlpertandGitHub 1d5d20f09e Update installation.md 2017-08-04 17:10:50 -07:00
Rodrigo PomboandDan Abramov c2fa0acec5 [fiber-debugger] Support undefined progressedPriority (#10375)
[fiber-debugger] Fix the debugger to match changes to Fiber
2017-08-04 19:45:20 +01:00
Dan AbramovandGitHub 6ad4592346 Compile spread to Object.assign calls (#10387) 2017-08-04 19:12:12 +01: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
Dan AbramovandGitHub b2274a3149 Warn about unresolved function as a child (#10376)
* Warn about unresolved function as a child

* Oops
2017-08-04 15:51:47 +01:00
Nathan HunzakerandDan Abramov 6deef4e13f Fix incorrect reference to undefined diffValueForAttribute (#10235)
* Fix incorrect reference to undefined diffValueForAttribute

* Remove custom attribute branch in getValueForProperty
2017-08-04 14:47:28 +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
Brian VaughnandGitHub f3a3924064 Log captured errors sooner (#10373)
This prevents the captured error from becoming separated from the component stack if other errors (or console.error calls) are made between them, eg a component errors during unmount.
2017-08-03 15:51:09 -07:00
Dan AbramovandGitHub 7432987f3f Don't call componentDidUpdate() in shallow renderer (#10372)
* Don't call componentDidUpdate() in shallow renderer

* Lint

Sent from my iPhone haha

* Consistent comments
2017-08-03 22:49:29 +01:00
Dan AbramovandGitHub e9d4bd47fa Remove hidden functional shouldComponentUpdate API (#10371) 2017-08-03 20:24:09 +01:00
Andrew ClarkandDan Abramov da48734b35 Cross-origin error handling in DEV (#10353)
* Add DOM fixture for cross-origin errors

* Use a custom error object in place of cross-origin errors

Cross-origin errors aren't accessible by React in DEV mode because we
catch errors using a global error handler, in order to preserve the
"Pause on exceptions" behavior of the DevTools. When this happens, we
should use a custom error object that explains what happened.

For uncaught errors, the actual error message is logged to the console
by the browser, so React should skip logging the message again.

* Add test case that demonstrates errors are logged even if they're caught

* Don't double log error messages in DEV

In DEV, the browser always logs errors thrown inside React components,
even if the originating update is wrapped in a try-catch, because of the
dispatchEvent trick used by invokeGuardedCallback. So the error logger
should not log the message again.

* Fix tests

* Change how error is printed in DEV and PROD

In DEV, we don't want to print the stack trace because the browser already always prints it.
We'll just print the component stack now.

In PROD, we used to omit the JS error message. However we *do* want to show it because
if the application swallows the error, the browser will *not* print it. In DEV it works
only because of the fake event trick. So in PROD we will always print the underlying error
by logging the error object directly. This will show both the message and the JS stack.

* Make the wording tighter and emphasize the real error is above

There's a few goals in the rewording:

* Make it tighter using line breaks between sentences.
* Make it slightly less patronizing ("You should fix it" => "You can find its details in an earlier log")
* ^^ This also helps highlight that the real error message and stack is above
* Group subsections: intro (there's an error), component stack, and final addendum about error boundaries
* ^^ Otherwise people might think error boundaries are part of the reason they have an error
* Make it clear "located at" is not the stacktrace. Otherwise it feels confusing. This makes it clearer you should still look for stack trace (with other details) above and introduces the concept of component stack.

* Make the message shorter

* Unused variables

* Fix an error caused by fixing lint

* One more bikeshed

* Fix fixture

* Remove unused file

* Concise wording

* Unused variables
2017-08-03 18:25:53 +01:00
Brian VaughnandDan Abramov 7dfb41e477 Fix lint error in DOM fixtures (#10369) 2017-08-03 17:32:04 +01:00
Dan AbramovandGitHub c4276007ba Add documentation about <script crossorigin> for React CDN usage (#10368) 2017-08-03 16:13:13 +01:00
Jason QuenseandDan Abramov 0889a91856 Remove old IE polyfill code (#10238)
* Upgrade DOM Fixtures

Upgrade to react-scripts v1 and include required polyfills for older
browsers

* Remove ChangeEvent polyfills for unsupported browsers
2017-08-03 13:45:41 +01: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
Dan AbramovandGitHub 976de84431 Don't suggest downloading React DevTools inside Chrome extension (#10359) 2017-08-02 20:04:49 +01:00
Dan AbramovandGitHub e1a1c170eb Upsell React DevTools in 16 (#10351)
* Upsell React DevTools

* Fix Flow

* Upsell message nits

* Avoid extra checks in onCommitRoot and onCommitUnmount
2017-08-02 18:56:24 +01:00
Dan AbramovandGitHub 7fc284400f Warn on missing Set/Map polyfills (#10356)
* Crash on missing Set/Map polyfills

* Change Map/Set to emit warnings instead

* Change rAF polyfill check to also be a warning

* Liiiiiint
2017-08-02 18:55:18 +01:00
Toru KobayashiandDan Abramov 8ea972de71 Remove an unnecessary __DEV__ condition (#10350) 2017-08-02 17:57:41 +01:00
Brian VaughnandGitHub 93a5845580 Shallow renderer passes context to componentWillReceiveProps (#10342)
This parameter was accidentally omitted before. Leland reported it because it impacts Enzyme.
I also added a basic lifecycle parameter test for shallow renderer.
2017-08-02 08:18:46 -07:00
Andrew ClarkandGitHub 87aff0fdec Remove rAF export from ReactDOMFrameScheduling (#10337)
Fiber doesn't schedule animation callbacks anymore (though it does use
the browser's requestAnimationFrame to polyfill requestIdleCallback).

This removes the rAF export from ReactDOMFrameScheduling, since it's not
being used.
2017-08-02 19:56:37 +05:30
Nathan HunzakerandDan Abramov b088308060 Remove event namespace check from react-partial-renderer (#10344) 2017-08-02 11:30:44 +01:00
Toru KobayashiandDan Abramov a87bafd125 Fix a typo (#10349) 2017-08-02 11:09:09 +01: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
Greg HurrellandDan Abramov f3c26f31c2 Grammar fixes for a code comment (#10343) 2017-08-02 01:20:53 +01:00
Dan AbramovandGitHub 2fbde1644d Remove hydrate() warning about empty container (#10345)
* Remove hydrate() warning about empty container

It used to have false positives for cases where we legitimately don't render anything.

* Use existing constant

* Test empty string case using its parent
2017-08-02 01:05:56 +01:00
Dan AbramovandGitHub 8d45680695 Add an extra test for arrays and strings from composites (#10346) 2017-08-02 01:05:42 +01:00
Dan AbramovandGitHub b4d8151b1e Add ReactDOM.hydrate() as explicit SSR hydration API (#10339)
* Add ReactDOM.hydrate()

* Deprecate ReactDOM.render() hydration in favor of ReactDOM.hydrate()

* Downgrade the warning level to console.warn()

* Warn when hydrate() is called with empty container
2017-08-01 21:17:24 +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
Brian VaughnandGitHub 56c910ba87 Context improvements (#10334)
Refactored fiber context to fix a nested updates bug
2017-08-01 08:38:54 -07:00
Dan AbramovandGitHub 459589fa09 Test for specific SSR warning (#10340)
* Test for specific SSR warning

* Same in another place
2017-08-01 14:38:17 +01:00
Jack FordandDan Abramov a882b522cb Remove trapBubbledEventsLocal (#10258)
* Inline trapBubbledEventsLocal

* Revert "Inline trapBubbledEventsLocal"

This reverts commit 0ee65ff491deeec70223c2e39d04ef0aeda95d73.

* Merge remove-local-trap-bubbled-events branch
2017-08-01 08:37:26 +01:00
Toru KobayashiandDan Abramov e4b1678875 Move ShallowRenderer tests (#10184) 2017-08-01 08:27:28 +01:00
Toru KobayashiandDan Abramov 8ba7e3bf45 Add tests that ShallowRenderer supports string and fragment (#10241) 2017-08-01 00:39:43 +01:00
Dan AbramovandGitHub aaa0f72328 Fix invariant parity for SSR (#10333) 2017-07-31 21:13:50 +01:00
Dan AbramovandGitHub 889fbf8b7b Fix SSR integration test swallowing lack of expected error (#10331)
* Don't catch the assertion about missing errors

Previously, even if an error was not thrown, the assertion about this was ignored.

This fix exposes two failing cases in new SSR that weren't failing in Stack.

* Add child context validation to new SSR

This fixes the error cases that were silently failing before but are now exposed.
2017-07-31 17:57:05 +01:00