facebook / facebook/relay

[rust] relay-compiler to support template literals across lines.

Open
#3,473 6 comments 0 reactions 0 assignees View on GitHub
wontfix
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

with the new rust compiler if a template literal spans more than one line it will refuse to output artifacts—this is prevliant when used with Prettier that decides its own formatting:

```ts
// ❌ No produced documents
const Thing = ({ search: searchRef }) => {
const search = useFragment(
graphql`
fragment search_data on SearchItem {
name
}
`,
searchRef,
);

return

{ search.name } < /h1>;;
};

// ✅ Produces documents
const Thing = ({ search: searchRef }) => {
const search = useFragment(
graphql`fragment search_data on SearchItem {
name
}`,
searchRef,
);

return

{ search.name } < /h1>;;
};
```

Like i suggested, this is more than okay to enforce — but with a lack of control to when prettier does stuff it makse it hard to enforce that?

---

More than happy to help rectify this, but will need to just be pointed at the correct files to go to impl this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.