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(scan): fix promise/proxy handling and optimize object inspection #107

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pivanov
Copy link
Collaborator

@pivanov pivanov commented Dec 12, 2024

Improving the handling of proxy objects and promises and ensures that complex objects, like Next.js params or URLSearchParams, are inspected accurately without errors or performance issues.

Key Changes:

  • proxy detection and unwrapping
  • Improved handling of Promise and Symbol.iterator edge cases.
  • optimized object inspection by consolidating operations for better performance.

These updates fix bugs in the property inspector and ensure a smoother, error-free experience when dealing with complex object types.

Result:
image

Thanks for the guidance of @RobPruzan 🙇‍♂️

Copy link

vercel bot commented Dec 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
react-scan ⬜️ Skipped (Inspect) Dec 12, 2024 8:02am

Copy link

vercel bot commented Dec 12, 2024

@pivanov is attempting to deploy a commit to the Million Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

pkg-pr-new bot commented Dec 14, 2024

Open in Stackblitz

npm i https://pkg.pr.new/aidenybai/react-scan@107

commit: 6aaeded

  - Remove unreliable proxy detection and instanceof checks
  - Add safer URLSearchParams handling to prevent Next.js errors
  - Use capability checks instead of type detection
  - Improve error handling for property access

  This addresses issues with proxy detection and type checking in the
  element inspector, making it more reliable across different environments
  while preventing Next.js-specific errors when handling search params.
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.

3 participants