Skip to content

Commit

Permalink
Remove @babel/plugin-transform-template-literals
Browse files Browse the repository at this point in the history
Summary:
Remove babel/plugin-transform-template-literals as  this is natively supported by,
- Hermes
- JSC
- v8 (Since some community uses v8 too).

Ref:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#browser_compatibility
- http://kangax.github.io/compat-table/es6/
- https://github.com/WebKit/WebKit/blob/923859afb65b75c83b5c6ce68846e14a8e38845d/Source/JavaScriptCore/features.json#L371

Changelog:
[Breaking] Removed babel plugin transform-template-literals from metro preset

Reviewed By: blakef

Differential Revision: D42069641

fbshipit-source-id: e4dfc8234e2a74ab5ed68ed14258bcee03f5b67e
  • Loading branch information
jacdebug authored and facebook-github-bot committed Dec 16, 2022
1 parent 2f42bc9 commit 322dea8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
3 changes: 1 addition & 2 deletions packages/metro-react-native-babel-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@babel/plugin-syntax-nullish-coalescing-operator": "^7.0.0",
"@babel/plugin-syntax-optional-chaining": "^7.0.0",
"@babel/plugin-transform-arrow-functions": "^7.0.0",
"@babel/plugin-transform-async-to-generator": "^7.0.0",
"@babel/plugin-transform-block-scoping": "^7.0.0",
"@babel/plugin-transform-classes": "^7.0.0",
"@babel/plugin-transform-computed-properties": "^7.0.0",
Expand All @@ -46,12 +47,10 @@
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/plugin-transform-react-jsx-self": "^7.0.0",
"@babel/plugin-transform-react-jsx-source": "^7.0.0",
"@babel/plugin-transform-async-to-generator": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/plugin-transform-shorthand-properties": "^7.0.0",
"@babel/plugin-transform-spread": "^7.0.0",
"@babel/plugin-transform-sticky-regex": "^7.0.0",
"@babel/plugin-transform-template-literals": "^7.0.0",
"@babel/plugin-transform-typescript": "^7.5.0",
"@babel/plugin-transform-unicode-regex": "^7.0.0",
"@babel/template": "^7.0.0",
Expand Down
6 changes: 0 additions & 6 deletions packages/metro-react-native-babel-preset/src/configs/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@ const getPreset = (src, options) => {
],
);
}
if (!isHermes && (isNull || src.indexOf('`') !== -1)) {
extraPlugins.push([
require('@babel/plugin-transform-template-literals'),
{loose: true}, // dont 'a'.concat('b'), just use 'a'+'b'
]);
}
if (isNull || src.indexOf('async') !== -1) {
extraPlugins.push([
require('@babel/plugin-proposal-async-generator-functions'),
Expand Down

0 comments on commit 322dea8

Please sign in to comment.