Commit Graph

10544 Commits

Author SHA1 Message Date
Dan Abramov 41367d334a Add test coverage for memo(fn.defaultProps).propTypes 2018-11-28 17:00:38 +00:00
Dan Abramov f613134659 Remove unnecessary case (it is handled by function code path) 2018-11-28 17:00:38 +00:00
Dan Abramov 08776d7452 Undo unintentional formatting changes 2018-11-28 17:00:38 +00:00
Dan Abramov ea567be388 Fix Flow and lint 2018-11-28 17:00:38 +00:00
Dan Abramov bb75beb413 Add comments for why we're calling checkPropTypes 2018-11-28 17:00:38 +00:00
Dan Abramov 62208ce3b2 Validate propTypes for memo in the reconciler when necessary 2018-11-28 17:00:38 +00:00
Dan Abramov 40d016a5d6 Improve error message for nested lazy() and add tests 2018-11-28 17:00:38 +00:00
Dan Abramov 403d2ca028 Change error wording to remove "Promise elements" 2018-11-28 17:00:38 +00:00
Dan Abramov 7af78282f1 Add test verifying nested lazy is unsupported 2018-11-28 17:00:38 +00:00
Dan Abramov 6dc78114ec Validate memo() inner propTypes and warn about shadowing 2018-11-28 17:00:38 +00:00
Dan Abramov 908526e428 Add a test for lazy(forwardRef()) propTypes check 2018-11-28 17:00:38 +00:00
Dan Abramov 77f24e849d Validate propTypes for resolved lazy types
Note this only works for elements created after resolving. So it's not ideal. But it provides the best stack trace for those cases.
2018-11-28 17:00:38 +00:00
Dan Abramov d23c82e472 Remove redundant async 2018-11-28 17:00:38 +00:00
Dan Abramov 9111508981 Warn about setting propTypes too 2018-11-28 17:00:38 +00:00
Dan Abramov 1c64922e3f Add a warning against definining defaultProps on the outer wrapper 2018-11-28 17:00:38 +00:00
Dan Abramov 7c66e3d049 Add a test for current defaultProps behavior in lazy 2018-11-28 17:00:38 +00:00
Sophie Alpert c2a2d8a539 Remove useMutationEffect (#14336)
useMutationEffect has problems (namely, refs aren't attached at the time that it runs) and we're not positive it's necessary. useLayoutEffect runs at the same time as componentDidMount/Update so it's sufficient for all existing use cases; it can be used in any case that useEffect happens too late. Until we figure out what we want to do, let's delete it.
2018-11-27 13:05:13 -08:00
chun shang 48f1e5b3ce Add a null type test for memo (#14325) 2018-11-27 13:25:24 +00:00
Dan Abramov f93f3402f7 Make useEffect(async) warning more verbose (#14327)
* Make useEffect(async) warning more verbose

* Nit
2018-11-27 13:05:10 +00:00
Pelle Wessman ee3ef3a079 Fix regression: Errors not emitted in streams (#14314)
Regression introduced in #14182 resulted in errors no longer being emitted on streams, breaking many consumers.

Co-authored-by: Elliot Jalgard <elliot.j@live.se>
2018-11-27 13:00:46 +00:00
Christoph Nakazawa 33f6f5e532 Remove usage of fbjs/lib/invariant in ReactNativeViewConfigRegistry. (#14330) 2018-11-26 21:48:08 +00:00
Brian Vaughn 409066a0a1 Add progress bars to longer running async release tasks (#14322)
* Add progress bars to longer running async release tasks
* Updated to 0.2 progress estimator version
2018-11-26 09:28:37 -08:00
Sunil Pai a7f270c550 update fixtures/packaging/README.md (#14320)
I had some confusion yesterday with this, figured this reads a little better.  Ran these steps locally to verify they work.
2018-11-24 21:40:56 +00:00
Brian Vaughn ed4c4a51cd Add basic release script snapshot test (#14280)
Added regression test for release scripts
2018-11-23 12:53:39 -08:00
Brian Vaughn 686f1060ad Publish a local release (canary or stable) to NPM (#14260)
New release scripts.

Learn more at https://github.com/facebook/react/blob/master/scripts/release/README.md
2018-11-23 12:37:18 -08:00
Dan Abramov 7475120ce7 Prevent deopts from modifying exports object in stable builds (#14309) 2018-11-23 14:10:57 +00:00
Dan Abramov 0c7189d923 Fix resolution of outer props with React.memo() (#14312)
* Add failing test for defaultProps between lazy() and memo()

* Add another regression test for defaultProps resolution order

* Resolve outer props for MemoComponent
2018-11-22 19:40:42 +00:00
Dan Abramov 14be29b2b9 Add more test coverage for nested memo() (#14311) 2018-11-22 19:30:56 +00:00
Dan Abramov dc0dd4bbff Use |0 to coerce to number (#14297) 2018-11-22 15:44:00 +00:00
Dan Abramov dd8205cef9 List ignored types instead of included types in the stack (#14308) 2018-11-22 15:41:29 +00:00
Isaiah Nields 1da310809e fix spelling error: Here's -> Here (#14307)
"Here's" should be changed to "Here" in the given sentence.
2018-11-22 14:47:20 +00:00
Dan Abramov a9fdf8a326 Warn about reassigning this.props (#14277)
* Warn about reassigning this.props

* Improve the warning

* Don't show the spammy bug warning if we suspect it's a component bug
2018-11-20 16:40:01 +00:00
Dan Abramov 327cf0ee33 Fix support for mixing react-dom/server@16.6 and react@<16.6 (#14291) 2018-11-20 13:09:44 +00:00
Sebastian Markbåge c954efa70f Remove import * as pattern from the codebase (#14282)
Whenever we do this, Rollup needs to materialize this as an object.
This causes it to also add the Babel compatibility property which is
unnecessary bloat. However, since when we use these, we leak the object
this often also deopts any compiler optimizations.

If we really need an object we should export default an object.

Currently there is an exception for DOMTopLevelEventTypes since
listing out the imports is a PITA and it doesn't escape so it should
get properly inlined. We should probably move to a different pattern
to avoid this for consistency though.
2018-11-19 15:32:54 -08:00
Dan Abramov ccb14e270c Fix SSR useCallback in render phase (#14279) 2018-11-19 20:47:38 +00:00
Dominic Gannaway 0e9cb3f5d0 Clear fields on unmount of fiber to avoid memory leak (#14276)
* Clear fields on unmount of fiber to avoid memory leak
2018-11-19 16:09:11 +00:00
Dominic Gannaway 592676503c Revert "Clear memoizedState on unmount of fiber to avoid memory leak (#14218)" (#14275)
This reverts commit 9b2fb24f99.
2018-11-19 15:24:46 +00:00
Dominic Gannaway 9b2fb24f99 Clear memoizedState on unmount of fiber to avoid memory leak (#14218)
* Clear properties on unmount of fiber to ensure objects are not retained
2018-11-19 10:58:14 +00:00
Jason Miller a22fabc2a1 Reduce scheduler serialization overhead (#14249)
In the process of switching to MessageChannel, it seems the postMessage call was modified to pass `"*"` (originally the target origin value from `window.postMessage`). This actually ends up triggering serialization, whereas passing `undefined` bypasses.

To save some investigation, passing a Number like `0` still incurs serialization overhead - `undefined` has special behavior.
2018-11-16 10:39:27 -08:00
Andrew Clark 21d5f7d32d Wrap shorthand CSS property collision warning in feature flag (#14245)
Disables the recently introduced (#14181) warning for shorthand
CSS property collisions by wrapping in a feature flag. Let's hold off
shipping this until at least the next minor.
2018-11-15 13:36:52 -08:00
Jan Pöschko 5f06576f51 Add a checkbox to fixtures UI to choose React production build (#13786)
* Add a checkbox to fixtures UI to choose React production build

* Assign header__label class name to label directly, instead of using a separate span

* center the production checkbox vertically
2018-11-14 15:34:46 -08:00
Andrew Clark 8feeed10d8 [scheduler] Remove window.postMessage fallback
Every browser we can about supports MessageChannel. The ones we don't
care about will fallback to the setTimeout implementation.
2018-11-14 14:44:26 -08:00
Andrew Clark 5bce0ef10a [scheduler] Post to MessageChannel instead of window (#14234)
Scheduler needs to schedule a task that fires after paint. To do this,
it currently posts a message event to `window`. This happens on every
frame until the queue is empty. An unfortunate consequence is that every
other message event handler also gets called on every frame; even if
they exit immediately, this adds up to significant per-frame overhead.

Instead, we'll create a MessageChannel and post to that, with a
fallback to the old behavior if MessageChannel does not exist.
2018-11-14 12:02:00 -08:00
Dan Abramov d7fd679a31 Add 16.6.3 Changelog (#14223)
* Add 16.6.3 Changelog

* Remove unreleased fix

* Drop another unreleased fix
2018-11-13 20:32:33 +00:00
Andrew Clark 3cd89daed9 Update error codes 2018-11-13 20:29:30 +00:00
Brian Vaughn 85f5a81eb7 Save CI-built node_modules as build artifacts (#14205)
* Store node_modules generated by CI script as an artifact
* NPM pack artifacts before archiving
2018-11-13 11:00:30 -08:00
Dan Abramov f55795c8ee Add regression test for #14188 (#14197) 2018-11-13 11:23:01 +00:00
Maksim Markelov d204747bef Update Readme (#14176)
Replace core with react, dom-client with react-dom
2018-11-12 16:25:32 +00:00
Sophie Alpert b98adb648a Simplify CSS shorthand property warning (#14183)
I figured out a simpler way to do #14181. It does allocate some but I think that's OK. Time complexity might even be better since we avoid the nested loops the old one had.
2018-11-09 16:56:51 -08:00
Sebastian Markbage f8bfd58680 fix typo 2018-11-09 16:16:25 -08:00