Commit Graph
46 Commits
Author SHA1 Message Date
Dan 936a6f6c01 [email protected] 2020-01-12 17:54:30 +00:00
Dan AbramovandGitHub 4dde1c88df [Fresh] Fix edge case with early function call (#17824) 2020-01-12 17:53:50 +00:00
Dan AbramovandGitHub fe1bbbae20 Update Flow to 0.84 (#17805)
* Update Flow to 0.84

* Fix violations

* Use inexact object syntax in files from fbsource

* Fix warning extraction to use a modern parser

* Codemod inexact objects to new syntax

* Tighten types that can be exact

* Revert unintentional formatting changes from codemod
2020-01-09 14:50:44 +00:00
Dan AbramovandGitHub 6e9c0d3038 Bump Prettier (#17811)
* Bump Prettier

* Reformat

* Use non-deprecated option
2020-01-09 13:54:11 +00:00
Dan Abramov c026dea3dd [email protected] 2019-12-17 13:50:57 +00:00
Dan AbramovandGitHub 26ed50c397 [Fast Refresh] Support injecting runtime after renderer executes (#17633) 2019-12-17 13:49:39 +00:00
Dan AbramovandGitHub 0809ba8020 Rename toWarnDev -> toErrorDev, toLowPriorityWarnDev -> toWarnDev (#17605)
* Rename toWarnDev -> toErrorDev in tests

* Rename toWarnDev matcher implementation to toErrorDev

* Rename toLowPriorityWarnDev -> toWarnDev in tests and implementation
2019-12-16 12:48:16 +00:00
Dan AbramovandGitHub 9463b12510 Add component stacks to (almost) all warnings (#17586) 2019-12-12 23:47:55 +00:00
Dan AbramovandGitHub ea1a94291c [Fresh] Make all errors recoverable (#17438)
* [Fresh] Detect root updates more reliably

* [Fresh] Use WeakMap for root elements

* [Fresh] Make initial failures recoverable too

* Fix DevTools check

* Fix wrong flow type
2019-11-25 17:25:34 +00:00
Dan AbramovandGitHub c911d60fb3 [Fresh] Fix an infinite loop in an edge case (#17414)
* [Fresh] Fix an infinite loop in an edge case

* Make it work in IE11
2019-11-21 14:10:26 +00:00
Luna Ruan 6bc8c5187c update version numbers for 16.12 2019-11-14 16:02:18 -08:00
RickyandGitHub 89799a8696 [Fast Refresh] Fix for intentional unmounts after an error (#17368) 2019-11-14 18:40:25 +00:00
Vasilii CuharandDan Abramov 60287f76a3 [Fresh] Add options to configure RefreshSig and RefreshReg identifiers (#17340) 2019-11-12 14:16:23 +00:00
Andrew Clark c6b2227932 Update local package versions for 16.10 release 2019-10-22 14:30:06 -07:00
Andrew ClarkandGitHub 7c0e54af2f Remove concurrent apis from stable (#17088)
* Tests run in experimental mode by default

For local development, you usually want experiments enabled. Unless
the release channel is set with an environment variable, tests will
run with __EXPERIMENTAL__ set to `true`.

* Remove concurrent APIs from stable builds

Those who want to try concurrent mode should use the experimental
builds instead.

I've left the `unstable_` prefixed APIs in the Facebook build so we
can continue experimenting with them internally without blessing them
for widespread use.

* Turn on SSR flags in experimental build

* Remove prefixed concurrent APIs from www build

Instead we'll use the experimental builds when syncing to www.

* Remove "canary" from internal React version string
2019-10-15 15:09:19 -07:00
Andrew Clark ffd1822d25 Update local version numbers for 16.10.2 release 2019-10-03 14:14:10 -07:00
Andrew Clark c7a1929dda Update local version numbers for 16.10.1 release 2019-09-28 21:41:42 -07:00
Andrew Clark 96287996ae Update local version numbers for 16.10 release 2019-09-27 13:31:35 -07:00
Dan AbramovandGitHub e8719564d0 [Fresh] Always remount classes (#16823) 2019-09-18 16:32:11 +01:00
Dan Abramov e906a5a7c6 [email protected] 2019-09-10 20:46:34 +01:00
Dan AbramovandGitHub 4cf4274fc5 [Fresh] Hash signatures (#16738) 2019-09-10 20:28:13 +01:00
Dan AbramovandGitHub d6da760f61 [Fresh] Add skipEnvCheck option to Babel plugin (#16688) 2019-09-06 20:30:16 +01:00
Dan Abramov 51d3baa743 [email protected] 2019-09-06 20:02:43 +01:00
Dan AbramovandGitHub ef7874cdb9 [Fresh] Fix a crash with implicit arrow return (#16687) 2019-09-06 19:58:07 +01:00
Dan AbramovandGitHub 5d8f98da33 Don't ignore dependencies for render phase update (#16574) 2019-08-28 16:55:56 +01:00
lunaruanandDan Abramov adaeb27bbe Cleanup Babel PR (ReactFreshPlugin) (#16340)
* fix babel 7 issues

* fix babel 7 issues
2019-08-13 21:18:40 +01:00
Andrew ClarkandGitHub df2abd3e60 Upgrade ESLint so we can use JSX Fragment syntax (#16328)
Now that we're using Babel 7, this is the last blocker.
2019-08-09 12:59:02 -07:00
7ecb1d9de6 Babel 7 (#16297)
Upgraded from Babel 6 to Babel 7.

The only significant change seems to be the way `@babel/plugin-transform-classes` handles classes differently from `babel-plugin-transform-es2015-classes`. In regular mode, the former injects a `_createClass` function that increases the bundle size, and in the latter it removes the safeguard checks. However, this is okay because we don't all classes in new features, and we want to deprecate class usage in the future in the react repo.

Co-authored-by: Luna Ruan <[email protected]>
Co-authored-by: Abdul Rauf <[email protected]>
Co-authored-by: Maksim Markelov <[email protected]>
2019-08-08 17:46:35 -07:00
Dan AbramovandGitHub 50dab516e4 [Fresh] Support multiple renderers at the same time (#16302) 2019-08-08 19:03:38 +01:00
Dan AbramovandGitHub e59676f589 [Fresh] Transfer refs when remounting (#16241)
* Add a failing test for refs and remounting

* Transfer ref when remounting
2019-07-29 17:19:09 +01:00
Dan AbramovandGitHub 513ad8dff7 [Fresh] Track unrecoverable errors (#16183)
* [Fresh] Track unrecoverable errors

* Only initial errors set the flag
2019-07-23 16:11:13 +01:00
Min ho KimandSunil Pai 207cca8480 Fix typos (#16076) 2019-07-08 11:51:29 +01:00
Anton KorzunovandDan Abramov ee44ed2934 Clone a custom hook node before use (#16019) 2019-07-02 17:54:10 +01:00
Dan AbramovandGitHub cdacf6e709 Handle changes at module boundaries (#16002) 2019-06-27 20:53:03 +01:00
Andrew ClarkandGitHub 12ded78ee5 Prefix mock Scheduler APIs with _unstable (#15999)
For now this is only meant to be consumed via `act`.
2019-06-26 12:16:08 -07:00
Dan AbramovandGitHub 8d0a4baff7 [Fresh] Retry failed roots on refresh (#15966)
* Retry failed roots on refresh

* Don't prevent retry after error -> render(null) special case

The check wasn't very resilient because in Concurrent Mode it looks like we can get further follow-up commits even if we captured an error. So we can't reliably distinguish the case where after an error you _manually_ rendered null.

Retrying on an edit after a tree failed _and_ you rendered null in the same tree seems fine. It's also very unlikely a pattern like this actually exists in the wild.
2019-06-24 16:54:54 +01:00
Sunil PaiandGitHub 78da83d736 warn if passive effects get queued outside of an act() call. (#15763)
* warn if passive effects get queued outside of an act() call

While the code itself isn't much (it adds the warning to mountEffect() and updateEffect() in ReactFiberHooks), it does change a lot of our tests. We follow a bad-ish pattern here, which is doing asserts inside act() scopes, but it makes sense for *us* because we're testing intermediate states, and we're manually flush/yield what we need in these tests.

This commit has one last failing test. Working on it.

* pass lint

* pass failing test, fixes another

- a test was failing in ReactDOMServerIntegrationHooks while testing an effect; the behaviour of yields was different from browser and server when wrapped with act(). further, because of how we initialized modules, act() around renders wasn't working corrrectly. solved by passing in ReactTestUtils in initModules, and checking on the finally yielded values in the specific test.
- in ReactUpdates, while testing an infinite recursion detection, the test needed to be wrapped in an act(), which would have caused the recusrsion error to throw. solived by rethrowing the error from inside the act().

* pass ReactDOMServerSuspense

* stray todo

* a better message, consistent with the state update one.
2019-06-24 11:18:24 +01:00
Dan AbramovandGitHub bd0eeb7ddf Report refreshed families to the caller (#15957) 2019-06-22 23:57:54 +01:00
Dan AbramovandGitHub 7e4b8426b1 Use function expression for custom Hook signature argument (#15956) 2019-06-22 11:54:22 +01:00
Dan AbramovandGitHub 065bfc647f Make global names more obscure (#15941) 2019-06-20 20:20:09 +01:00
Dan AbramovandGitHub 78fe376cea Don't consider require-like calls to be likely HOCs (#15940) 2019-06-20 16:13:18 +01:00
Dan AbramovandGitHub dc869f603f [Fresh] Throw in prod and change annotation (#15939)
* Disable React Refresh Babel transform in prod

* Throw early if React Refresh runtime is imported in production

* @hot reset -> @refresh reset
2019-06-20 14:29:00 +01:00
Dan AbramovandGitHub fdc4e1cf0b [Fresh] Track mounted roots via DevTools Hook (#15928)
* Track mounted roots via DevTools Hook

* Add helper utilities to the runtime

These utilities will likely be needed by all module systems, so let's just put them here.

* Wrap more things in __DEV__

* Fix tests to also be DEV-only
2019-06-20 00:12:43 +01:00
Dan AbramovandGitHub 54c0ff852d [Fresh] Fall back to Map/Set if Weak equivalents are not available (#15907)
* Fall back to Map/Set if Weak equivalents are not available

* Fix Prettier vs Flow fighting
2019-06-17 16:00:29 +01:00
Dan AbramovandGitHub a7d112a15c [Fresh] Rename findHostNodesForHotUpdate to findHostInstancesForHotUpdate (#15904) 2019-06-17 15:06:43 +01:00
Dan AbramovandGitHub 85e765fbbd [Fresh] react-fresh => react-refresh (#15888) 2019-06-15 19:36:46 +01:00