@samitouri / QOS-React-2 / commits / 4a8c90a77c

[babel] Remove unsafe calls to path.stop()

Discovered this in a recent attempt at syncing Forget to Meta, it seems that calling path.stop() is unsafe as it appears to have strange behavior in plugins that come after. This resulted in `import type {...}` not being compiled away in the post-babel output which isn't valid JS syntax. Removing the `stop()` calls fixes it Test plan: made these changes locally, synced my local changes to Meta and reran - in simulator and observe that it now runs and doesn't throw a syntax error

Lauren Tan committed Apr 26, 2023 at 17:16 UTC 4a8c90a77cff6e931bbc0395b3f6405ccf900ee9
1 file changed -2
compiler/forget/src/Babel/BabelPlugin.ts
-2
@@ -171,7 +171,6 @@ export default function ReactForgetBabelPlugin(
171 Directive(path) {
172 if (hasUseForgetDirective(path.node)) {
173 fileHasUseForgetDirective = true;
174 - path.stop();
174 }
175 },
176 });
@@ -255,7 +254,6 @@ export default function ReactForgetBabelPlugin(
254 )
255 );
256 didUpdateImport = true;
258 - path.stop();
257 }
258 },
259 });