Skip to content

Sync with reactjs.org @ b50fe64c #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions content/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
- name: French
translated_name: Français
code: fr
status: 1
status: 2
- name: Gujarati
translated_name: ગુજરાતી
code: gu
Expand Down Expand Up @@ -123,6 +123,9 @@
translated_name: සිංහල
code: si
status: 0
- name: Swedish
translated_name: Svenska
code: sv
- name: Tamil
translated_name: தமிழ்
code: ta
Expand Down Expand Up @@ -158,4 +161,4 @@
- name: Traditional Chinese
translated_name: 繁體中文
code: zh-hant
status: 0
status: 0
8 changes: 7 additions & 1 deletion src/components/CodeEditor/CodeEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import {LiveEditor, LiveProvider} from 'react-live';
import {colors, media} from 'theme';
import MetaTitle from 'templates/components/MetaTitle';

// Replace unicode to text for other languages
const unicodeToText = text =>
text.replace(/\\u([\dA-F]{4})/gi, (_, p1) =>
String.fromCharCode(parseInt(p1, 16)),
);

const compileES5 = (
code, // eslint-disable-next-line no-undef
) => Babel.transform(code, {presets: ['es2015', 'react']}).code;
Expand Down Expand Up @@ -271,7 +277,7 @@ class CodeEditor extends Component {

if (showJSX) {
newState.code = code;
newState.compiledES6 = compileES6(code);
newState.compiledES6 = unicodeToText(compileES6(code));
} else {
newState.compiledES6 = code;
}
Expand Down
2 changes: 1 addition & 1 deletion src/site-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// NOTE: We can't just use `location.toString()` because when we are rendering
// the SSR part in node.js we won't have a proper location.
const urlRoot = 'https://reactjs.org';
const version = '16.8.3';
const version = '16.8.4';
const babelURL = 'https://unpkg.com/babel-standalone@6.26.0/babel.min.js';

export {babelURL, urlRoot, version};