The react/jsx repository maintains the official specification for JSX, an XML-like syntax extension to ECMAScript. Hosted at http://react.github.io/jsx/, this specification defines how JSX syntax should be parsed and understood across different implementations, though it explicitly clarifies that JSX is not intended for direct implementation by JavaScript engines or browsers. Instead, JSX serves as a target for preprocessors and transpilers that convert JSX tokens into standard ECMAScript code.
The specification was created to establish a concise and familiar syntax for defining tree structures with attributes. By providing a single, well-defined specification, the repository enables a community of independent parser and syntax highlighter developers to conform to consistent standards. This approach reduces the risk of incompatible syntax extensions emerging in the JavaScript ecosystem. The specification intentionally claims minimal syntactic real estate, keeping the syntax concise while leaving room for other language extensions to coexist without conflict.
The repository's rationale explicitly addresses why JSX was chosen over alternative approaches. Template literals, introduced in ECMAScript 6, were considered but rejected because they introduce substantial syntax noise when switching between embedded domain-specific languages and arbitrary ECMAScript expressions with identifiers in scope. Using template literals would also undermine their established meaning and create tooling incompatibilities. Similarly, object initializer approaches like JXON were evaluated but found lacking because balanced braces do not provide clear syntactic hints for where elements begin and end in large tree structures, whereas balanced named tags offer critical visual clarity.
The specification draws inspiration from prior art, particularly the E4X specification defined in ECMA-357, though JSX maintains no formal relation to E4X despite partial syntactic overlap. While E4X is a deprecated specification with deep semantic implications, JSX intentionally has no defined semantics and focuses purely on syntax. The specification emphasizes that JSX is designed as an ECMAScript feature, and its similarity to XML exists only for familiarity rather than compliance with any XML or HTML specification.
The repository is written primarily in HTML and is maintained by Meta Platform, Inc., with copyright extending from 2014 to the present. It operates under a Creative Commons Attribution 4.0 International License. The project actively welcomes community contributions for bugfixes and improvements, with a formal Contributing Guide available to guide developers through the development process. Contributors are expected to adhere to Meta's Code of Conduct. The specification continues to evolve, with the main repository purpose being ongoing development and refinement of the JSX standard to serve the broader JavaScript community and its various preprocessor implementations.