<commit_before># ES Syntax

## Using Babel

[Babel](http://babeljs.io) is a JavaScript compiler which allow you write code with new syntax today without worry about browser support. We have put [`babel-loader`](https://webpack.js.org/loaders/babel-loader/) into default webpack config in Dabao.

We choose `babel-preset-env` which includes `babel-preset-2015`, `babel-preset-2016` and `babel-preset-2017` but exclude `stage-x` plugins. Because these rules `babel-preset-env` supports are stable and common enough for both web developers and modern browsers.

### Why Babel?

Babel is one the most popular JS compilers...

### What Syntax We May Know But NOT Supported in Dabao?

* function binding
* decorators

Note: We will consider make a versioning issue to keep the preset upgrading in the future.

## Supporting React (JSX) and Vue

Dabao also supports React (JSX) and Vue. Check [JS Frameworks](js-frameworks.md) for more.<commit_msg>Updated js syntax doc.<commit_after># ES Syntax

## Using Babel

[Babel](http://babeljs.io) is a JavaScript compiler which allow you write code with new syntax today without worry about browser support. We have put [`babel-loader`](https://webpack.js.org/loaders/babel-loader/) into default webpack config in Dabao.

We choose `babel-preset-env` which includes `babel-preset-2015`, `babel-preset-2016` and `babel-preset-2017` but exclude `stage-x` plugins. Because these rules `babel-preset-env` supports are stable and common enough for both web developers and modern browsers.

### Why Babel?

Babel is one the most popular JS compilers. So we choose Babel which is easy to understand.

### Why `babel-preset-env`? My browser has supported ES6.

There are quite amount of users using browser without ES6/7 support. On consideration of common situation first, Dabao chooses `babel-preset-env` which will compiles all new stable syntax into ES5. And it won't cause obvious side affects in new browsers which has support ES6/7. It even also let developers reproduce and discuss the ways workaround with each others under the same Babel config when they suffer runtime bugs.

### What Syntax We May Know But NOT Supported in Dabao?

* function binding
* decorators

Note: We will consider make a versioning issue to keep the preset upgrading in the future.

## Supporting React (JSX) and Vue

Dabao also supports React (JSX) and Vue syntax. Check [JS Frameworks](js-frameworks.md) for more.
{'fraction_non_alphanumeric': 0.08027995059695348, 'fraction_numerical': 0.012350761630300536, 'mean_word_length': 4.497737556561086, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5678438', 'n_tokens_mistral': 716, 'n_tokens_neox': 667, 'n_words': 326}