SIGN IN SIGN UP
oven-sh / bun UNCLAIMED

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one

0 0 150 Rust

[JS Parser] dot property shorthand for JSX

This is a non-standard backwards-compatible feature that I suspect other tooling will soon adopt (and expect to help other tooling adopt it)

```jsx
var hello = {hi: 'yo'};
export const Foo = () => <Bar {hello.hi} />
```

Desugars into:
```jsx
var hello = {hi: 'yo'};
export const Foo = () => <Bar hi={hello.hi} />
```

This works with defines and macros too.

```jsx
export const Foo = () => <Bar {process.env.NODE_ENV} />
```

```jsx
export const Foo = () => <Bar NODE_ENV="development" />
```
J
Jarred Sumner committed
093807391a9563ad36c2b04a286da23d09fad835
Parent: 18c9235