Commit Graph
7102 Commits
Author SHA1 Message Date
Christopher ChedeauandGitHub fa9869b5a0 Type ReactOwner (#7587)
Incrementally type ReactInstance by adding the types of attach/detachRef.

I moved isValidOwner as a function inside of the file since it's never used externally.
2016-08-28 10:31:49 -07:00
Christopher ChedeauandGitHub c9e03f0a85 Type ReactMultiChildUpdateTypes (#7589)
As mentioned in https://www.facebook.com/groups/2003630259862046/permalink/2097088000516271/ I'm going to kill this instance of keyMirror and use a plain string instead with a type union.

The current type union is unused right now but when I type ReactMultiChild I will use it.
2016-08-28 10:31:30 -07:00
Christopher ChedeauandGitHub e3b2c6e650 Remove keyMirror in SpecPolicy (#7590)
As discussed in my RFC: https://www.facebook.com/groups/2003630259862046/permalink/2097088000516271/
2016-08-28 10:30:59 -07:00
Christopher ChedeauandGitHub a35387c030 Remove keyMirror in ComponentLifeCycle (#7591)
See rationale in https://www.facebook.com/groups/2003630259862046/permalink/2097088000516271/
2016-08-28 10:30:33 -07:00
Christopher ChedeauandGitHub 84084153ed Remove keyMirror in ReactPropTypeLocations (#7592)
This one involves a bit more work as I added "phantom" flow types to a bunch of places where the type is a ReactPropTypeLocations even though those files are not `@flow` yet.

A good side effect is that `ReactPropTypeLocationNames` keys are now correctly typed, this means that they cannot go out of sync without breaking flow :)
2016-08-28 10:30:15 -07:00
Christopher ChedeauandGitHub 0d927844fb Type ReactDebugTool (#7586)
Flow doesn't really support the concept of variables that are non-null but only inside of a `__DEV__` block. There's an internal post about it ( https://www.facebook.com/groups/flowtype/permalink/1132437726804841/ ) and the conclusion is that we should force it to be non-null and trust the developer to put the proper DEV checks in place.
2016-08-27 14:13:18 -07:00
Christopher ChedeauandGitHub 2fb5eae372 Type ReactPerf (#7585)
We need to export FlushHistory type and I submitted a PR on flow to fix the type of console.table which is too restrictive.

I'm already starting to see the benefits of flow, I can look at random variables in the code and flow knows what shape the objects are! It's really useful to try and understand what's going on :)
2016-08-27 14:12:54 -07:00
Christophe HurpeauandBrandon Dail 517a0dc051 doc: npm ls react is a better advice (#7513)
Refs Must Have Owner Warning
`npm ls react` is a better advice than `npm ls | grep react`
2016-08-26 23:04:00 -07:00
Christopher ChedeauandGitHub c086e5f94e Type ReactDebugTool (#7576) 2016-08-26 14:47:59 -07:00
Christopher ChedeauandGitHub 09887e0311 Type ReactInvalidSetStateWarningHook (#7572) 2016-08-26 14:47:15 -07:00
Christopher ChedeauandGitHub e2ddbac35e Type ReactChildrenMutationWarningHook (#7571) 2016-08-26 14:46:57 -07:00
Christopher ChedeauandGitHub b977cf13c4 Remove unneeded declare (#7570)
It turns out that we don't need it, flow is smart enough to realize that the function is declared in the two branches :)
2016-08-26 08:42:03 -07:00
Christopher ChedeauandGitHub f784a2d50a Type ReactComponentEnvironment (#7566) 2016-08-25 20:08:20 -07:00
Christopher ChedeauandGitHub 66e77f696a Fix lint errors (#7568)
In Type ReactComponentTreeHook #7504, I merged even though travis didn't report green (travis for all the fb repos has been backlogged like crazy since this morning) by manually doing `npm test` and `npm run flow` but I didn't ensure that lint was all green.

@millermedeiros pinged me about it so here's a quick fix
2016-08-25 19:16:34 -07:00
Miller MedeirosandBen Alpert 38f74bcaf4 Support error boundaries on ReactTestRenderer (#7558) 2016-08-25 16:35:55 -06:00
Christopher ChedeauandGitHub ea494a2c10 Type ReactComponentTreeHook (#7504)
For this one, I wanted to type a non-trivial piece of the codebase and ran into the fact that we do not have types for ReactElement nor ReactInstance, so I had to create them.

I'll add comments inline
2016-08-25 15:27:03 -07:00
Christopher ChedeauandGitHub 563f3bbab4 Type ReactPropTypesSecret (#7501) 2016-08-25 15:26:38 -07:00
Christopher ChedeauandGitHub a72a156f58 Type ReactElementSymbol (#7564) 2016-08-25 15:23:29 -07:00
Christopher ChedeauandGitHub 03e8c0eb75 Type ReactErrorUtils (#7565) 2016-08-25 15:23:13 -07:00
Christopher ChedeauandGitHub 18003578b1 Type canDefineProperty (#7500) 2016-08-25 10:46:49 -07:00
Christopher ChedeauandGitHub ad3c65186e Type ReactPropTypeLocations (#7502) 2016-08-25 10:46:26 -07:00
Christopher ChedeauandGitHub 7f64baad78 Type ReactPropTypeLocationNames (#7503) 2016-08-25 10:46:15 -07:00
Christopher ChedeauandGitHub 08614db025 Update flow to 0.31 (#7557) 2016-08-25 09:43:28 -07:00
Dan AbramovandGitHub a229cdba7f Ensure lifecycle timers are stopped on errors (#7548)
* Ensure lifecycle timers are stopped on errors

Fixes #7349

* Address review feedback and add an extra test
2016-08-24 19:18:32 +01:00
Dan AbramovandGitHub 0a248ee7b9 Show React events in the timeline when ReactPerf is active (#7549)
* Show React events in the timeline when ReactPerf is active

This currently only seems to work on Chrome.

* Address Chrome issue
2016-08-24 18:40:16 +01:00
Paul KehrerandPaul O’Shannessy 7b11aa9450 Add playsInline as an allowed HTML property (#7519)
The WHATWG has unprefixed `-webkit-playsinline` as `playsinline` (see: https://github.com/whatwg/html/pull/1444) and iOS 10 intends to use it (https://webkit.org/blog/6784/new-video-policies-for-ios/).
2016-08-23 10:47:51 -07:00
NestorTejeroandJim 32e60fecdc add explicit link to http://bower.io/ (#7546) 2016-08-23 09:30:12 -07:00
LucasandBrandon Dail 56e20b4ab5 Fix minor typo in README.md (#7540) 2016-08-21 18:36:54 -07:00
LucasandBen Alpert 869cb05b76 Add missing KeyUp eventType (#7533)
Fixes #7222.
2016-08-19 18:03:35 -07:00
Paul O’Shannessy 077d32cebb Update website for 15.3.1
(cherry picked from commit 199056cf1b)
2016-08-19 14:20:02 -07:00
Paul O’Shannessy e10f83de12 Update readme for 15.3.1
(cherry picked from commit cc41ec258f)
2016-08-19 14:20:02 -07:00
Paul O’Shannessy 9af8be654b Update changelog for 15.3.1
(cherry picked from commit 3c0906ca24)
2016-08-19 14:20:01 -07:00
Greg PalmerandBrandon Dail a8741963dc Avoid "Member not found" error in IE (#7411)
Explanation, discussion, and similar change as #7343

Addresses #7320
2016-08-19 14:43:34 -06:00
Ben AlpertandGitHub 6a65960641 Improve validateDOMNesting message for whitespace (#7515)
For #5071.
2016-08-19 11:45:14 -07:00
Paul O’ShannessyandGitHub 944be18357 Upgrade to fbjs v0.8.4 (#7532) 2016-08-19 10:40:03 -07:00
Alex ZherdevandPaul O’Shannessy 11c0adcc95 Fix header link generation for non-English docs (#7497) 2016-08-18 14:55:50 -07:00
Alexandre KirszenbergandBen Alpert 9f5b009f05 Fix ReactTestInstance::toJSON() with empty top-level components (#7523) 2016-08-18 13:02:09 -07:00
龙海燕andBrandon Dail db6f36bdce Update 09.2-package-management.md (#7520) 2016-08-18 08:52:07 -06:00
ventunoandBen Alpert a9e681a828 Warn if using React.unmountComponentAtNode on a different React instance's tree. (#7456)
* Warn when using React.unmountComponentAtNode on a different React instance's tree

https://github.com/facebook/react/issues/3787

* Adding tests.

* Implementing recommended changes.

https://github.com/facebook/react/issues/3787
2016-08-17 17:20:36 -07:00
Ben AlpertandGitHub 921d8c151b Update onlyChild invariant message (#7514) 2016-08-17 13:03:31 -07:00
Dan AbramovandGitHub 680685bec4 Fix slow performance of PropTypes.oneOfType() on misses (#7510)
It used to be slow whenever a type miss occurred because expensive `Error` objects were being created. For example, with `oneOfType([number, data])`, passing a date would create an `Error` object in `number` typechecker for every item.

The savings depend on how much commonly you used `oneOfType()`, and how often it had “misses”. If you used it heavily, you might see 1.5x to 2x performance improvements in `__DEV__` after this fix.
2016-08-17 10:04:56 +01:00
Jess TelfordandBen Alpert aa48c82b0d React.Children.toArray() changes keys (#7495)
As noted by @spicyj in #5541
2016-08-15 23:43:33 -07:00
Troy DeMonbreunandBrandon Dail 3013afe2d5 Fix for #7170 (#7486)
* Write failing test

* Ensure .min and .max are set before .value

* Adjusting test for false negative

* Revert test adjustment (apparently it was only failing locally)
2016-08-15 13:38:53 -05:00
Christopher ChedeauandDan Abramov 9a48b5ca7b Fix flow (#7499)
ReactElement requires a generic argument now and the return function of render is a ReactTestInstance and not a ReactElement.
2016-08-15 18:04:22 +01:00
Dan AbramovandGitHub 48475787b4 Avoid indexOf() during unmounting a root in the hook (#7496)
* Avoid indexOf() during unmounting a root in the hook

* Check for (Map|Set).prototype.keys
2016-08-15 15:47:54 +01:00
Tanase HagiandBrandon Dail 09f0a06b8a Add propsTypes and defaultProps example for stateless functions (#7458)
* Add propsTypes and defaultProps example for stateless functions

* Update 05-reusable-components.md

* Update 05-reusable-components.md
2016-08-14 12:04:47 -05:00
Andres SuarezandChristopher Chedeau 8d1e416d9a Remove last use of mapObject (#7494) 2016-08-13 20:13:56 -07:00
Andres SuarezandBen Alpert e5f9ae2705 Avoid object iteration when creating DOM factories (#7493) 2016-08-13 19:30:06 -07:00
Dan AbramovandGitHub db452bd20b Use ES6 Map in ReactComponentTreeHook if available (#7491)
* Use ES6 Map in ReactComponentTreeHook if available

* Make getRootIDs fast again

* Only use native Map
2016-08-13 21:43:18 +01:00
jaabergandBrandon Dail fdc91e016f Fix typo in changelog (#7468) 2016-08-13 13:45:04 -05:00