Skip to content
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

fix: recursive call with cross-references #320

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

hywax
Copy link

@hywax hywax commented Dec 28, 2023

Description

This PR adds an early exit from the comparison function if the objects are completely equal. If the object references are equal, you can be sure that they are equal.

Additional context

I'm running into a stack overflow problem when I use the import "ts type in defineProps" while the component is loaded via "defineAsyncComponent". Apparently cross-references are being created somewhere inside and the HMR goes into recursion. At the same time, everything else works as it should.

Error

Снимок экрана 2023-12-28 в 16 32 00

console.log(obj1 === obj2)

Снимок экрана 2023-12-28 в 16 28 30


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

hywax added a commit to hywax/mafl that referenced this pull request Dec 28, 2023
@@ -212,6 +212,11 @@ function deepEqual(obj1: any, obj2: any, excludeProps: string[] = []): boolean {
return obj1 === obj2
}

// Check if both equals object
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can and should be moved to the very top, no?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, corrected

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.

None yet

2 participants