Repository navigation
feat(hmr): improve circular import updates #14867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
42be688
7fc17fb
abd9bd1
ac964de
c5c9a6f
62070dc
d4583cc
1bc383d
655cff5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { msg } from './mod-a' | ||
|
|
||
| document.querySelector('.circular').textContent = msg | ||
|
|
||
| if (import.meta.hot) { | ||
| import.meta.hot.accept() | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| export const value = 'mod-a' | ||
|
|
||
| import { value as _value } from './mod-b' | ||
|
|
||
| export const msg = `mod-a -> ${_value}` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import { value as _value } from './mod-c' | ||
|
|
||
| export const value = `mod-b -> ${_value}` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I add It might be good to improve this case as well in future.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah this one is tricky currently since the two boundary could start fetching at the same time, causing potential execution order issues. We could detect and only refresh
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ah, that's a good point. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import { value as _value } from './mod-a' | ||
|
|
||
| // Should error as `_value` is not defined yet within the circular imports | ||
| let __value | ||
| try { | ||
| __value = `${_value} (unexpected no error)` | ||
| } catch { | ||
| __value = 'mod-a (expected error)' | ||
| } | ||
|
|
||
| export const value = `mod-c -> ${__value}` |
Uh oh!
There was an error while loading. Please reload this page.