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: remove deprecated Function.prototype.caller reference #3806

Merged
merged 2 commits into from
Nov 9, 2024

Conversation

simmerer
Copy link
Contributor

@simmerer simmerer commented Nov 5, 2024

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_caller_or_arguments_usage

Screenshot 2024-11-05 at 3 08 01 PM

While it's helpful during development to have as much information as possible about which component doesn't have the necessary context, it's very not helpful to have the error message itself throw a blocking error due to this deprecated usage 😅

In a future PR, it might be nice to rename the caller argument found throughout GraphiQL packages to something like callerFn for clarity, making it clear at a glance that it's a custom arg and not an attempt to access Function.prototype.caller.

Copy link

changeset-bot bot commented Nov 5, 2024

🦋 Changeset detected

Latest commit: 91fde2b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@graphiql/react Minor
@graphiql/plugin-code-exporter Major
@graphiql/plugin-explorer Major
graphiql Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

linux-foundation-easycla bot commented Nov 5, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@acao
Copy link
Member

acao commented Nov 9, 2024

thanks @simmerer ! I am currently in the process of migrating most of this logic to a lower service level, and will be removing this usage of caller. this will be very helpful for the time being, thank you!

noting that this will cause bugs when users accidentally double tap the execute button, or execute multiple queries quickly in serial, as the usage of caller is meant to also uniquely identify the request being executed, so that previous in-flight requests can be cancelled iirc. but this is something I am already accommodating for in the rewrite using unique IDs, and for now I think we can ensure the button is fully disabled

Copy link

codecov bot commented Nov 9, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 65.32%. Comparing base (7a59187) to head (91fde2b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/graphiql-react/src/utility/context.ts 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3806   +/-   ##
=======================================
  Coverage   65.32%   65.32%           
=======================================
  Files         122      122           
  Lines        7003     7003           
  Branches     2260     2260           
=======================================
  Hits         4575     4575           
  Misses       2411     2411           
  Partials       17       17           
Files with missing lines Coverage Δ
packages/graphiql-react/src/utility/context.ts 84.61% <0.00%> (ø)

@acao
Copy link
Member

acao commented Nov 9, 2024

I'm going to call this good to go for now, as the full resolution will be introduced in 4.x soon! thank you!

@acao acao merged commit f86e2bc into graphql:main Nov 9, 2024
14 checks passed
@acao acao mentioned this pull request Nov 9, 2024
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