This package served as a language plugin for `relay-compiler`, providing TypeScript support, including the emission of type definitions for Relay artifacts. It enabled Relay users to leverage TypeScript for their GraphQL operations and component props. The current stable version is 15.0.1. Historically, it filled a critical gap by adding TypeScript capabilities to Relay's build process. However, as of Relay v13, TypeScript support is natively integrated into the core `relay-compiler`, rendering this standalone plugin obsolete. Its release cadence was tied to major Relay versions and bug fixes, but active development has ceased due to its superseded status. Developers are now advised to use the built-in TypeScript features of `relay-compiler` directly.
npm install relay-compiler-language-typescriptVerified import paths — ran on the pinned version, not inferred.
Demonstrates the `package.json` setup for installing the plugin and `relay-compiler`, configuring the `relay` script, and essential `tsconfig.json` and `.babelrc` settings.
Upgrade to `relay-compiler` v13.0.0 or higher and remove `relay-compiler-language-typescript` from your dependencies. Update your `relay-compiler` configuration to use the native TypeScript support.
Ensure your project's `typescript` peer dependency is at version 4.5.0 or higher. Review generated types for any subtle changes in behavior or stricter enforcement.
Upgrade your project's `typescript` peer dependency to version 4.x or higher before upgrading to `relay-compiler-language-typescript` v14.0.0.
Always set `compilerOptions.module` to `ES2015` (or higher) and `compilerOptions.target` to `ES2020` (or the highest compatible with your Babel setup) in your `tsconfig.json` to ensure `tsc` generates compatible ES module syntax.
The project maintainers state that `relay-compiler-language-typescript` cannot guarantee compatibility with RHL. Consider migrating to more modern hot-reloading solutions like React Refresh, or disabling RHL for files containing Relay artifacts.
In your `tsconfig.json`, set `compilerOptions.module` to `ES2015` or higher, and `compilerOptions.target` to `ES2020` or a compatible modern target. This ensures `tsc` outputs ES module syntax that `babel-plugin-relay` can correctly parse.
This package has known incompatibilities with RHL. The recommended solution is to transition to `react-refresh` (used in tools like Create React App v4+), which offers more robust hot reloading capabilities for modern React applications. Alternatively, configure RHL to exclude Relay-generated artifact directories from its processing.
Update your project's `typescript` dependency to `^4.5.0` or a newer compatible version (e.g., `npm install typescript@^4.5.0` or `yarn add typescript@^4.5.0`).