Comments (6)
facebook/react#480 (comment), there is also the full technical reasoning facebook/react#480, but it may be a bit hard to digest.
The idea being that indentation is not intended for output and trailing whitespace is a bad idea all-around. 2 is added because that is almost universally what you want and not having it is really really cumbersome and mistake-prone.
from jsx.
@syranide reading that I can only see that there is one more rule regarding tab
handling. I've updated the original question with point 3
, and also see demo
Cheers 🌹
from jsx.
This question is being raised rather often, I'm thinking maybe we should add some kind of react.md
in this repo?
from jsx.
I'm thinking maybe we should add some kind of react.md in this repo?
I would prefer whitespace.md
. Even though the thing I am discussing feels react emit specific, but I feel that not having whitespace rules specified in jsx
decreases its portability.
Consider:
<div>
test
</div>
Would be weird if something things see it as test
(like react) and other's see it as \ntest\n
. But react.md is fine as well :)
from jsx.
@basarat "other's see it as \ntest\n
", which ones are that?
from jsx.
"other's see it as \ntest\n", which ones are that?
Other implementations that might use JSX for an HTML emit
from jsx.
Related Issues (20)
- Can we move JSX to be an extension of ES Spec that evolves forward like EcmaScript + TC39 ? HOT 3
- RFC: An evolved JSX 2.0 proposal HOT 1
- Get accessor in props HOT 1
- HTML and JSX spec HOT 1
- The syntax in website is missing JSXFragment as JSXChild
- Proposal: ability to return multiple chlidren by auto-wraping them into a Fragment HOT 2
- Proposal: using ! prefix on attributes to set them to `false`
- Ambiguous syntax HOT 2
- Spec out whitespacing / line break behaviors HOT 4
- Split Out Lexical Grammar
- Behavior of `�` and lone surrogates unicode entities HOT 2
- Proposal: Attributes with the same name as their value HOT 1
- Proposal: Syntactic sugar for props with same name as value passed HOT 1
- Distinguish tags from elements in the terminology
- Feature request: nameless closing tags
- Proposal: faster way to id and classes HOT 7
- Proposal: combining classes using only className HOT 2
- In this specification there is a reference to Babylon, now @babel-parser
- RFC: Standardizing `$:` namespace escaping
- Using alpinejs attribute in jsx
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 jsx.