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

Declare global PromiseWithResolvers type #6552

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

samchungy
Copy link

@samchungy samchungy commented Oct 3, 2024

🚨 IMPORTANT: Please do not create a Pull Request without creating an issue first.

Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of
the pull request.

Description

Declares a global type to allow builds for users who are not using ESNext to pass. This takes a similar approach to other libraries where the DOM lib is not present.

Related #6353

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as
    expected)
  • This change requires a documentation update

Screenshots/Sandbox (if appropriate/relevant):

Adding links to sandbox or providing screenshots can help us understand more about this PR and take
action on it as appropriate

How Has This Been Tested?

Locally editing the node module with the global

Test Environment:

  • NodeJS: 20

Checklist:

  • I have followed the
    CONTRIBUTING doc and the
    style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
    ^ Not sure how. Can confirm it now passes locally
  • New and existing unit tests and linter rules pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Further comments

Copy link

changeset-bot bot commented Oct 3, 2024

🦋 Changeset detected

Latest commit: 0a76f0e

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

This PR includes changesets to release 1 package
Name Type
@graphql-tools/delegate 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

@samchungy samchungy changed the title Declare global PromiseWithResolvers Declare global PromiseWithResolvers type Oct 3, 2024
@samchungy samchungy marked this pull request as ready for review October 3, 2024 00:48
@acrogenesis
Copy link

acrogenesis commented Oct 4, 2024

seeing this error too

yarn build   
yarn run v1.22.22
$ tsc
node_modules/@graphql-tools/delegate/typings/leftOver.d.ts:4:37 - error TS2304: Cannot find name 'PromiseWithResolvers'.

4 export type Deferred<T = unknown> = PromiseWithResolvers<T>;
                                      ~~~~~~~~~~~~~~~~~~~~


Found 1 error in node_modules/@graphql-tools/delegate/typings/leftOver.d.ts:4

error Command failed with exit code 2.

adding the global declaration fixes the build issue.

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