-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply HMR updates in topological order (#8752)
- Loading branch information
1 parent
e21af59
commit fdae6c0
Showing
9 changed files
with
160 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/core/integration-tests/test/integration/react-refresh-circular/App.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from 'react'; | ||
import {Provider} from './Provider'; | ||
|
||
export function App() { | ||
return <Provider /> | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/core/integration-tests/test/integration/react-refresh-circular/Consumer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {useContext} from 'react'; | ||
import {Context} from './Provider'; | ||
|
||
// This prevents the module from being self accepting | ||
// (not all exports are react components). | ||
export function tmp() {} | ||
|
||
export function Consumer() { | ||
return <>{String(useContext(Context))}</>; | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/core/integration-tests/test/integration/react-refresh-circular/Provider.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import {Consumer} from './Consumer'; | ||
|
||
// This prevents the module from being self accepting | ||
// since it is not a react component. | ||
export let Context = React.createContext(null); | ||
|
||
export function Provider() { | ||
return ( | ||
<Context.Provider value={2}> | ||
<Consumer /> | ||
</Context.Provider> | ||
); | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/core/integration-tests/test/integration/react-refresh-circular/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<div id="root"></div> | ||
<script type="module" src="index.js"></script> |
6 changes: 6 additions & 0 deletions
6
packages/core/integration-tests/test/integration/react-refresh-circular/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import ReactDOM from "react-dom"; | ||
import { App } from "./App"; | ||
import { act } from "react-dom/test-utils"; | ||
|
||
export default () => | ||
act(async () => {ReactDOM.render(<App />, document.getElementById("root"));}); |
6 changes: 6 additions & 0 deletions
6
packages/core/integration-tests/test/integration/react-refresh-circular/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"dependencies": { | ||
"react": "^17.0.0", | ||
"react-dom": "^17.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters