-
Notifications
You must be signed in to change notification settings - Fork 0
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
Improve error message of collocated fragments. #7
Conversation
'needs this information, that module should directly define a ' + | ||
'fragment querying for that data, colocated next to where the ' + | ||
'data is used.\n' | ||
`this module does not use it directly or it the fragment is named incorrectly. If a different module ` + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd even remove the first part of the error message. Let's make it clear that the problem is a) name of the imported component and b) the underscore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, thanks! Just pls fix some typos
`needs the data from this fragment, that module should directly define it's own fragment ` + | ||
`to query for it's own data, and such fragment should be spread in the parent component.` + | ||
`The naming convention should be <nameOfComponentCamelCase>_<optionalSuffix>. ` + | ||
`The <nameOfComponentCamelCase> should match the import name. Optinal suffix should be separated ` + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`The <nameOfComponentCamelCase> should match the import name. Optinal suffix should be separated ` + | |
`The <nameOfComponentCamelCase> should match the import name. The optional suffix should be separated ` + |
'needs this information, that module should directly define a ' + | ||
'fragment querying for that data, colocated next to where the ' + | ||
'data is used.\n' | ||
`this module does not use it directly or it the fragment is named incorrectly. If a different module ` + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`this module does not use it directly or it the fragment is named incorrectly. If a different module ` + | |
`this module does not use it directly or the fragment is named incorrectly. If a different module ` + |
`The <nameOfComponentCamelCase> must match the import name. The optional suffix should be separated ` + | ||
`by underscore (usually when you need to pass multiple fragments to the same component).\n` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we didn't make it explicit? We have information about the names of fragments right? This could be better for DX 🙌
It took us some debugging to find out that the problem is that we need to have
_
in the name of a fragment :-) Tried to improve the error message. If a better error message comes to your mind, I am all ears! :-)