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

v16 RelayFieldLogger not available in @types/relay-runtime #4666

Open
danielob opened this issue Apr 5, 2024 · 0 comments
Open

v16 RelayFieldLogger not available in @types/relay-runtime #4666

danielob opened this issue Apr 5, 2024 · 0 comments

Comments

@danielob
Copy link

danielob commented Apr 5, 2024

In version 16, requiredFieldLogger was renamed to relayFieldLogger. (Commit link)

We are utilizing the latest versions of all relevant packages (react-relay, relay-runtime, @types/relay-runtime):

yarn list v1.22.19
warning Filtering by arguments is deprecated. Please use the pattern option instead.
├─ @types/react-relay@16.0.6
├─ @types/relay-runtime@14.1.23
├─ react-relay@16.2.0
├─ relay-compiler@16.2.0
└─ relay-runtime@16.2.0

However, upon inspecting the type definitions in @types/relay-runtime, it appears that the naming has not been updated, causing issues when passing the logger into the relay environment. To address this, we've implemented a workaround as follows:

import { requiredFieldLogger } from 'path/to/our/logger';

const environment = new Environment({
    network,
    store,
    requiredFieldLogger, // required by the definition of EnvironmentConfig in @types/relay-runtime
    // @ts-ignore
    relayFieldLogger: requiredFieldLogger, // without this, we encounter a runtime error 
});

While some discussions mention similar issues with outdated type definitions (link), they do not directly impact us.

Is there any plan to update the type definitions for version 16? If not, what would be the recommended path for contributing changes to the DefinitelyTyped repository?

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

No branches or pull requests

1 participant