babel-plugin-trace-execution icon indicating copy to clipboard operation
babel-plugin-trace-execution copied to clipboard

How to use babel-plugin-trace-execution ?

Open asicfr opened this issue 8 years ago • 1 comments

I want to use babel-plugin-trace-execution on a reactjs application.
How to configure it ?

Thanks

asicfr avatar Jun 13 '17 13:06 asicfr

It's good it it's now working for me

This is example repo on it https://github.com/ColCh/babel-plugin-trace-execution-demo

Works after this patch applies (within node modules)

diff --git 1/./index.js 2/./index.js.bak
index 0c1776f..bcd5bb6 100644
--- 1/./index.js
+++ 2/./index.js.bak
@@ -135,15 +135,15 @@ exports.default = function (_ref) {
      * Append trace call() AFTER assignment expressions. Highlight contains
      * entire expression. Bindings include new values.
      */
-    // AssignmentExpression: function AssignmentExpression(path) {
-    //   var _path$node2 = path.node,
-    //       start = _path$node2.start,
-    //       end = _path$node2.end;
-
-    //   path.insertAfter(createTraceCall(_extends({
-    //     bindings: getBindingsForScope(path.scope, this.bindings)
-    //   }, getOffsettedRange(start, end, this.fnOffset))));
-    // },
+    AssignmentExpression: function AssignmentExpression(path) {
+      var _path$node2 = path.node,
+          start = _path$node2.start,
+          end = _path$node2.end;
+
+      path.insertAfter(createTraceCall(_extends({
+        bindings: getBindingsForScope(path.scope, this.bindings)
+      }, getOffsettedRange(start, end, this.fnOffset))));
+    },
 
 
     /**

ColCh avatar Apr 13 '19 09:04 ColCh