question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JSX - Add toggle for FB translation pipeline compatibility

See original GitHub issue

Extracted from https://github.com/prettier/prettier/pull/1831

Currently we don’t break between text and tags/expressions when there is no existing white space. This is not the ideal behaviour in most cases, but was added to make Prettier compatible with the Facebook translation pipeline (see https://github.com/prettier/prettier/issues/1581#issuecomment-300975032 for more detail).

With translation pipeline compatibility:

<div>
  before<div>
    <a>content</a>
  </div>after
</div>

Without:

<div>
  before
  <div>
    <a>content</a>
  </div>
  after
</div>

It would seem sensible to make the behaviour toggle-able and disabled by default. This way projects that don’t need compatibility with the Facebook translation pipeline (which should be most of them) can have slightly nicer formatting.

Having compatibility turned off should make it easier to improve the formatting in https://github.com/prettier/prettier/issues/2231

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
karlcommented, Jun 24, 2017

No worries! There is always stuff like this when a spec meets real world use 😀

1reaction
karlcommented, Jun 24, 2017

I’ve slowly been coming to the same realisation that the current master isn’t going to work for FB. I’ll have a look and see what the quickest fix is to unblock this.

Once we’ve got the release out that will give us time to investigate other approaches without a pressing time constraint.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Freedom from create-react-app (How to ... - Level Up Coding
When I started migrating to Microfrontends using Module Federation, I faced two challenges with apps built using create-react-app (CRA).
Read more >
Translate your React app with ease using Facebook's own ...
Translate your React app with ease using Facebook's own framework (FBT). Checkout this demo app using the concepts from this blog post.
Read more >
Lit for React Developers - Google Codelabs
In this codelab, you'll learn how to translate React concepts to Lit.
Read more >
Exploring React Native's new architecture - LogRocket Blog
In this article, we'll explore the upcoming React Native version and the changes to the React Native architecture. Let's jump right into it....
Read more >
awesome-vscode | A curated list of delightful VS Code ...
Linters; Framework-specific; Debugger for Chrome; Facebook Flow ... Formatting Toggle; Auto Import; shell-format; Vscode Google Translate; Explorer Icons.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found