Skip to content

Improve deadlock deps fix#2

Closed
raythurnvoid wants to merge 1 commit intoaleclarson:feat/ssr-circular-importfrom
raythurnvoid:improve_deadlock_deps_fix
Closed

Improve deadlock deps fix#2
raythurnvoid wants to merge 1 commit intoaleclarson:feat/ssr-circular-importfrom
raythurnvoid:improve_deadlock_deps_fix

Conversation

@raythurnvoid
Copy link
Copy Markdown

Your PR works well with "forked circular dependencies" but it fails when in a circular dependency a module need a value from another module in its stack es:

A --> B --> C --> A

where C needs a value from A in order to be initialized, otherwise it throws.

i've made a test for this case: https://github.com/raythurnevoid/vite/tree/improve_deadlock_deps_fix/packages/playground/ssr-react/src/circular-dep-init

Actually the fix is still not perfect since it works only when a module actually throws on initialization but this doesn't always happend. This can now be optimized using pendingImports.

@raythurnvoid raythurnvoid changed the base branch from master to feat/ssr-circular-import June 25, 2021 00:51
@aleclarson aleclarson closed this Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants