v16 RelayFieldLogger not available in @types/relay-runtime
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
In version 16, requiredFieldLogger was renamed to relayFieldLogger. ([Commit link](https://github.com/facebook/relay/commit/914794c4ddba))
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](https://github.com/facebook/relay/issues/4657)), 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?
Contributor guide
Assessment
This issue has not been assessed yet.