Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[babel 8] Output minimal strings by default (#12675)
Co-authored-by: Justin Ridgewell <justin@ridgewell.name> Co-authored-by: Justin Ridgewell <jridgewell@google.com>
- Loading branch information
1 parent
464a02f
commit cd090e9
Showing
37 changed files
with
231 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/babel-generator/test/fixtures/escapes/jsonEscape/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
0;// Not a directive | ||
"\u00A9"; | ||
"漏"; |
18 changes: 18 additions & 0 deletions
18
packages/babel-generator/test/fixtures/minified/literals-babel-7/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
5; | ||
5.0; | ||
5e1; | ||
5e4; | ||
"foobar"; | ||
'\x20'; | ||
"\n\r"; | ||
"馃槀"; | ||
"\uD83D_\uDE02" | ||
`馃槀`; | ||
/foobar/g; | ||
null; | ||
true; | ||
false; | ||
5.; | ||
0b10; | ||
0o70; | ||
0X1F; |
3 changes: 3 additions & 0 deletions
3
packages/babel-generator/test/fixtures/minified/literals-babel-7/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"BABEL_8_BREAKING": false | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-generator/test/fixtures/minified/literals-babel-7/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5;5;50;5e4;"foobar";" ";"\n\r";"\uD83D\uDE02";"\uD83D_\uDE02"`馃槀`;/foobar/g;null;true;false;5;2;56;31; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
'\x20'; | ||
"\n\r"; | ||
"馃槀"; | ||
"\uD83D_\uDE02" | ||
`馃槀`; | ||
/foobar/g; | ||
null; | ||
|
3 changes: 3 additions & 0 deletions
3
packages/babel-generator/test/fixtures/minified/literals/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"BABEL_8_BREAKING": true | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/babel-generator/test/fixtures/minified/literals/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5;5;50;5e4;"foobar";" ";"\n\r";"\uD83D\uDE02";`馃槀`;/foobar/g;null;true;false;5;2;56;31; | ||
5;5;50;5e4;"foobar";" ";"\n\r";"馃槀";"\uD83D_\uDE02"`馃槀`;/foobar/g;null;true;false;5;2;56;31; |
3 changes: 3 additions & 0 deletions
3
...react-jsx/test/fixtures/react-automatic/should-escape-xhtml-jsxattribute-babel-7/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div id="w么w" />; | ||
<div id="\w" />; | ||
<div id="w < w" />; |
3 changes: 3 additions & 0 deletions
3
...t-jsx/test/fixtures/react-automatic/should-escape-xhtml-jsxattribute-babel-7/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"BABEL_8_BREAKING": false | ||
} |
16 changes: 16 additions & 0 deletions
16
...act-jsx/test/fixtures/react-automatic/should-escape-xhtml-jsxattribute-babel-7/output.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
|
||
/*#__PURE__*/ | ||
_jsx("div", { | ||
id: "w\xF4w" | ||
}); | ||
|
||
/*#__PURE__*/ | ||
_jsx("div", { | ||
id: "\\w" | ||
}); | ||
|
||
/*#__PURE__*/ | ||
_jsx("div", { | ||
id: "w < w" | ||
}); |
3 changes: 3 additions & 0 deletions
3
...orm-react-jsx/test/fixtures/react-automatic/should-escape-xhtml-jsxattribute/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"BABEL_8_BREAKING": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...form-react-jsx/test/fixtures/react-automatic/should-escape-xhtml-jsxtext-babel-7/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div>wow</div>; | ||
<div>w么w</div>; | ||
|
||
<div>w & w</div>; | ||
<div>w & w</div>; | ||
|
||
<div>w w</div>; | ||
<div>this should not parse as unicode: \u00a0</div>; | ||
<div>this should parse as nbsp: 聽 </div>; | ||
<div>this should parse as unicode: {'\u00a0聽'}</div>; | ||
|
||
<div>w < w</div>; |
1 change: 1 addition & 0 deletions
1
...-react-jsx/test/fixtures/react-automatic/should-escape-xhtml-jsxtext-babel-7/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "BABEL_8_BREAKING": false } |
47 changes: 47 additions & 0 deletions
47
...rm-react-jsx/test/fixtures/react-automatic/should-escape-xhtml-jsxtext-babel-7/output.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import { jsxs as _jsxs } from "react/jsx-runtime"; | ||
|
||
/*#__PURE__*/ | ||
_jsx("div", { | ||
children: "wow" | ||
}); | ||
|
||
/*#__PURE__*/ | ||
_jsx("div", { | ||
children: "w\xF4w" | ||
}); | ||
|
||
/*#__PURE__*/ | ||
_jsx("div", { | ||
children: "w & w" | ||
}); | ||
|
||
/*#__PURE__*/ | ||
_jsx("div", { | ||
children: "w & w" | ||
}); | ||
|
||
/*#__PURE__*/ | ||
_jsx("div", { | ||
children: "w \xA0 w" | ||
}); | ||
|
||
/*#__PURE__*/ | ||
_jsx("div", { | ||
children: "this should not parse as unicode: \\u00a0" | ||
}); | ||
|
||
/*#__PURE__*/ | ||
_jsx("div", { | ||
children: "this should parse as nbsp: \xA0 " | ||
}); | ||
|
||
/*#__PURE__*/ | ||
_jsxs("div", { | ||
children: ["this should parse as unicode: ", '\u00a0聽'] | ||
}); | ||
|
||
/*#__PURE__*/ | ||
_jsx("div", { | ||
children: "w < w" | ||
}); |
1 change: 1 addition & 0 deletions
1
...ransform-react-jsx/test/fixtures/react-automatic/should-escape-xhtml-jsxtext/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "BABEL_8_BREAKING": true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ _jsx("div", { | |
|
||
/*#__PURE__*/ | ||
_jsx("div", { | ||
children: "w\xF4w" | ||
children: "w么w" | ||
}); | ||
|
||
/*#__PURE__*/ | ||
|
3 changes: 3 additions & 0 deletions
3
...transform-react-jsx/test/fixtures/react/should-escape-xhtml-jsxattribute-babel-7/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div id="w么w" />; | ||
<div id="\w" />; | ||
<div id="w < w" />; |
3 changes: 3 additions & 0 deletions
3
...sform-react-jsx/test/fixtures/react/should-escape-xhtml-jsxattribute-babel-7/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"BABEL_8_BREAKING": false | ||
} |
14 changes: 14 additions & 0 deletions
14
...ransform-react-jsx/test/fixtures/react/should-escape-xhtml-jsxattribute-babel-7/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/*#__PURE__*/ | ||
React.createElement("div", { | ||
id: "w\xF4w" | ||
}); | ||
|
||
/*#__PURE__*/ | ||
React.createElement("div", { | ||
id: "\\w" | ||
}); | ||
|
||
/*#__PURE__*/ | ||
React.createElement("div", { | ||
id: "w < w" | ||
}); |
3 changes: 3 additions & 0 deletions
3
...gin-transform-react-jsx/test/fixtures/react/should-escape-xhtml-jsxattribute/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"BABEL_8_BREAKING": true | ||
} |
2 changes: 1 addition & 1 deletion
2
...plugin-transform-react-jsx/test/fixtures/react/should-escape-xhtml-jsxattribute/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/*#__PURE__*/ | ||
React.createElement("div", { | ||
id: "w\xF4w" | ||
id: "w么w" | ||
}); | ||
|
||
/*#__PURE__*/ | ||
|
12 changes: 12 additions & 0 deletions
12
...ugin-transform-react-jsx/test/fixtures/react/should-escape-xhtml-jsxtext-babel-7/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div>wow</div>; | ||
<div>w么w</div>; | ||
|
||
<div>w & w</div>; | ||
<div>w & w</div>; | ||
|
||
<div>w w</div>; | ||
<div>this should not parse as unicode: \u00a0</div>; | ||
<div>this should parse as nbsp: 聽 </div>; | ||
<div>this should parse as unicode: {'\u00a0聽'}</div>; | ||
|
||
<div>w < w</div>; |
3 changes: 3 additions & 0 deletions
3
...-transform-react-jsx/test/fixtures/react/should-escape-xhtml-jsxtext-babel-7/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"BABEL_8_BREAKING": false | ||
} |
26 changes: 26 additions & 0 deletions
26
...gin-transform-react-jsx/test/fixtures/react/should-escape-xhtml-jsxtext-babel-7/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/*#__PURE__*/ | ||
React.createElement("div", null, "wow"); | ||
|
||
/*#__PURE__*/ | ||
React.createElement("div", null, "w\xF4w"); | ||
|
||
/*#__PURE__*/ | ||
React.createElement("div", null, "w & w"); | ||
|
||
/*#__PURE__*/ | ||
React.createElement("div", null, "w & w"); | ||
|
||
/*#__PURE__*/ | ||
React.createElement("div", null, "w \xA0 w"); | ||
|
||
/*#__PURE__*/ | ||
React.createElement("div", null, "this should not parse as unicode: \\u00a0"); | ||
|
||
/*#__PURE__*/ | ||
React.createElement("div", null, "this should parse as nbsp: \xA0 "); | ||
|
||
/*#__PURE__*/ | ||
React.createElement("div", null, "this should parse as unicode: ", '\u00a0聽'); | ||
|
||
/*#__PURE__*/ | ||
React.createElement("div", null, "w < w"); |
3 changes: 3 additions & 0 deletions
3
...l-plugin-transform-react-jsx/test/fixtures/react/should-escape-xhtml-jsxtext/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"BABEL_8_BREAKING": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...ansform-template-literals/test/fixtures/default/tag-with-unicode-escapes-babel-7/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
var foo = bar`\u0061\u{0061}\ud835\udc9c\u{1d49c}`; |
3 changes: 3 additions & 0 deletions
3
...orm-template-literals/test/fixtures/default/tag-with-unicode-escapes-babel-7/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"BABEL_8_BREAKING": false | ||
} |
5 changes: 5 additions & 0 deletions
5
...nsform-template-literals/test/fixtures/default/tag-with-unicode-escapes-babel-7/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var _templateObject; | ||
|
||
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } | ||
|
||
var foo = bar(_templateObject || (_templateObject = _taggedTemplateLiteral(["aa\uD835\uDC9C\uD835\uDC9C"], ["\\u0061\\u{0061}\\ud835\\udc9c\\u{1d49c}"]))); |
3 changes: 3 additions & 0 deletions
3
...n-transform-template-literals/test/fixtures/default/tag-with-unicode-escapes/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"BABEL_8_BREAKING": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters