Comments (6)
I just edited in my thoughts as you replied, realised it might not be obvious why it would be a good idea.
from relay-compiler-language-typescript.
I see now.
This does indeed seem quite weird. I think there's still value in emitting the types (just as flow does) but emit those as any
as well (ie. not as a unique symbol type).
Ie. for the above linked playground we should emit something like this instead
EDIT:
The value we gain is that it allows people to use Relay with typescript without having to typecast to any when rendering the components, as the typings inside the react-relay package will now simply mark that the property value doesn't matter, but still transform the prop types.
from relay-compiler-language-typescript.
Fair, we could do that too. What’s your thought for there still being value? Just as a named label that could help indicate what reference is required?
from relay-compiler-language-typescript.
@ckknight Are you perchance interested in submitting a PR for that? The type generator receives a flag that indicates wether or not the single artefact directory feature is enabled.
Having said all that, and we absolutely should not break the default setup, I would suggest you consider enabling the single artefact directory feature after all, as it’s the only stable simple way we could come up with that would allow you to have typed fragment references without using the Haste module system.
from relay-compiler-language-typescript.
To be honest I would not be too surprised if using the single artifact directory ends out being the way most people will use relay going forward (either that or we get some nifty way of tracking where the artifacts are being output in the future such that we can get around the issues we're circumventing by using this feature). It helps both Flow and TypeScript users get the typechecking features they deserve.
With that said - making the changes stated here makes sense, it will help us reach parity with the Flow implementation.
from relay-compiler-language-typescript.
Agreed. facebook/relay#2509
from relay-compiler-language-typescript.
Related Issues (20)
- Generated refetch definition with variables can not pass the validation of backend, such as github.com/vektah/gqlparser/v2
- Generate GraphQL fragment files for VSCode GraphQL Extension fragment autocompletion HOT 2
- Cannot read property 'createKeywordTypeNode' of undefined HOT 8
- Support for [email protected] HOT 8
- Migrate travis CI release process to GitHub actions HOT 3
- Unknown directive 'appendNode' HOT 1
- module esnext HOT 2
- Why is it not releasing HOT 7
- `require` substitution is not working HOT 6
- doc: explain why configuration with a single artifact directory is suggested
- Update to TS 4.4 and update types to support exactOptionalPropertyTypes HOT 1
- @stream argument naming by schema spec is: `initialCount` not `initial_count` HOT 1
- Invalid AST Node error with graphql@16 HOT 2
- Typescript 4.5 type generation is broken HOT 6
- Relay Compiler generates Typescript Synthax error HOT 3
- Error: Cannot find module 'relay-compiler-language-typescript' on 15.0
- Fragment Typematching
- Input Types generated as readonly HOT 1
- deprecate this package HOT 1
- Issue with import of the __generated__
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from relay-compiler-language-typescript.