@samitouri / QOS-React / commits / 08b4ee83cc

[compiler] Add babel-plugin-idx to snap

To surface any potential conflicts with this plugin, let's install it into snap so we can surface any runtime errors after compilation ghstack-source-id: 545eee6fb7f6401e919422581cf64070da581d50 Pull Request resolved: https://github.com/facebook/react/pull/30434

Lauren Tan committed Jul 23, 2024 at 15:46 UTC 08b4ee83cce726998bb5845898a24bd280033d4e
3 files changed +12 -1
compiler/packages/snap/package.json
+1
@@ -24,6 +24,7 @@
24 "@babel/preset-typescript": "^7.18.6",
25 "@parcel/watcher": "^2.1.0",
26 "@testing-library/react": "^13.4.0",
27 + "babel-plugin-idx": "^3.0.3",
28 "babel-plugin-syntax-hermes-parser": "^0.15.1",
29 "chalk": "4",
30 "fbt": "^1.0.0",
compiler/packages/snap/src/compiler.ts
+6 -1
@@ -250,7 +250,11 @@ function getEvaluatorPresets(
250 ): Array<BabelCore.PluginItem> {
251 const presets: Array<BabelCore.PluginItem> = [
252 {
253 - plugins: ['babel-plugin-fbt', 'babel-plugin-fbt-runtime'],
253 + plugins: [
254 + 'babel-plugin-fbt',
255 + 'babel-plugin-fbt-runtime',
256 + 'babel-plugin-idx',
257 + ],
258 },
259 ];
260 presets.push(
@@ -365,6 +369,7 @@ export async function transformFixtureInput(
369 [plugin, options],
370 'babel-plugin-fbt',
371 'babel-plugin-fbt-runtime',
372 + 'babel-plugin-idx',
373 ],
374 sourceType: 'module',
375 ast: includeEvaluator,
compiler/yarn.lock
+5
@@ -3768,6 +3768,11 @@ babel-plugin-fbt@^1.0.0:
3768 nullthrows "^1.1.1"
3769 yargs "^15.3.1"
3770
3771 +babel-plugin-idx@^3.0.3:
3772 + version "3.0.3"
3773 + resolved "https://registry.yarnpkg.com/babel-plugin-idx/-/babel-plugin-idx-3.0.3.tgz#326d25772210a40ff7fc63eee7f3ed239e8dc9ed"
3774 + integrity sha512-05baCoIGsvZJKemq6KQ4KVFlweEpY4aSY56wk3W781JxCNW3u0KfBElBt26/cPZbHkjF1mnwGIOlFY+9I/VOZA==
3775 +
3776 babel-plugin-istanbul@^6.1.1:
3777 version "6.1.1"
3778 resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73"