Commit Graph

28 Commits

Author SHA1 Message Date
Dan Abramov
f818af9b03
[Fresh] Always remount classes (#16823) 2019-09-18 16:32:11 +01:00
Dan Abramov
2400400788 react-refresh@0.4.2 2019-09-10 20:46:34 +01:00
Dan Abramov
ba6bb0fccf
[Fresh] Hash signatures (#16738) 2019-09-10 20:28:13 +01:00
Dan Abramov
b260bef398
[Fresh] Add skipEnvCheck option to Babel plugin (#16688) 2019-09-06 20:30:16 +01:00
Dan Abramov
2f15881859 react-refresh@0.4.1 2019-09-06 20:02:43 +01:00
Dan Abramov
9044bb0fa3
[Fresh] Fix a crash with implicit arrow return (#16687) 2019-09-06 19:58:07 +01:00
Dan Abramov
01fb68b9bf
Don't ignore dependencies for render phase update (#16574) 2019-08-28 16:55:56 +01:00
lunaruan
89bbffed6e Cleanup Babel PR (ReactFreshPlugin) (#16340)
* fix babel 7 issues

* fix babel 7 issues
2019-08-13 21:18:40 +01:00
Andrew Clark
0bd0c5269f
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
lunaruan
b12a982062
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 <luna@fb.com>
Co-authored-by: Abdul Rauf <abdulraufmujahid@gmail.com>
Co-authored-by: Maksim Markelov <maks-markel@mail.ru>
2019-08-08 17:46:35 -07:00
Dan Abramov
12be8938a5
[Fresh] Support multiple renderers at the same time (#16302) 2019-08-08 19:03:38 +01:00
Dan Abramov
9914a19190
[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 Abramov
2237efcef9
[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 Kim
2a0f6390ed Fix typos (#16076) 2019-07-08 11:51:29 +01:00
Anton Korzunov
a865e4a642 Clone a custom hook node before use (#16019) 2019-07-02 17:54:10 +01:00
Dan Abramov
f11540926d
Handle changes at module boundaries (#16002) 2019-06-27 20:53:03 +01:00
Andrew Clark
4d307de458
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 Abramov
d420d2ccb6
[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 Pai
e1c5e8720d
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 Abramov
39b97e8eb8
Report refreshed families to the caller (#15957) 2019-06-22 23:57:54 +01:00
Dan Abramov
d271df5c99
Use function expression for custom Hook signature argument (#15956) 2019-06-22 11:54:22 +01:00
Dan Abramov
7a4c3e3b73
Make global names more obscure (#15941) 2019-06-20 20:20:09 +01:00
Dan Abramov
3d0af2aea8
Don't consider require-like calls to be likely HOCs (#15940) 2019-06-20 16:13:18 +01:00
Dan Abramov
d4f384d25b
[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 Abramov
e9d0a3ff25
[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 Abramov
cd98e63b47
[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 Abramov
a3c5b1fb8b
[Fresh] Rename findHostNodesForHotUpdate to findHostInstancesForHotUpdate (#15904) 2019-06-17 15:06:43 +01:00
Dan Abramov
f0156766dc
[Fresh] react-fresh => react-refresh (#15888) 2019-06-15 19:36:46 +01:00