Commit Graph
21 Commits
Author SHA1 Message Date
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