-
Notifications
You must be signed in to change notification settings - Fork 66
Conversation
I think this is a reasonable thing but I'll defer to @jeffmo. If we take it my instinct here is to not export it from utils but from jstransform itself, or maybe even just export esprima itself. But I haven't actually looked closely at our source here and don't know the structure well. |
Perhaps the most reasonable thing to do is use peer dependencies here, if esprima-fb version compatibility is important. |
This is a good idea. I don't like exporting all of esprima, but I'll agree with @zpao that this makes a tiny bit more sense to be exported from |
@jeffmo: makes sense. I've rebased the changes. I went back to the modules requiring cc: @zpao |
I'll let @jeffmo make the final merge here since he owns this more than me. He's been on stage at a conference today but I'm sure he'll get to it this week. |
This would also simplify diff --git a/package.json b/package.json
index 2a7f4476..2548659b 100644
--- a/package.json
+++ b/package.json
@@ -34,3 +34,2 @@
"commoner": "^0.10.0",
- "esprima-fb": "^6001.1.0-dev-harmony-fb",
"jstransform": "^6.2.0"
diff --git a/vendor/fbtransform/transforms/react.js b/vendor/fbtransform/transforms/react.js
index 11ed7a8f..088c0245 100644
--- a/vendor/fbtransform/transforms/react.js
+++ b/vendor/fbtransform/transforms/react.js
@@ -18,3 +18,3 @@
-var Syntax = require('esprima-fb').Syntax;
+var Syntax = require('jstransform').Syntax;
var utils = require('jstransform/src/utils');
diff --git a/vendor/fbtransform/transforms/reactDisplayName.js b/vendor/fbtransform/transforms/reactDisplayName.js
index 7d974a0d..50dc85d2 100644
--- a/vendor/fbtransform/transforms/reactDisplayName.js
+++ b/vendor/fbtransform/transforms/reactDisplayName.js
@@ -18,3 +18,3 @@
-var Syntax = require('esprima-fb').Syntax;
+var Syntax = require('jstransform').Syntax;
var utils = require('jstransform/src/utils');
diff --git a/vendor/fbtransform/transforms/xjs.js b/vendor/fbtransform/transforms/xjs.js
index fb2f7fb8..8aac7c58 100644
--- a/vendor/fbtransform/transforms/xjs.js
+++ b/vendor/fbtransform/transforms/xjs.js
@@ -17,3 +17,3 @@
"use strict";
-var Syntax = require('esprima-fb').Syntax;
+var Syntax = require('jstransform').Syntax;
var utils = require('jstransform/src/utils'); |
version 6.3.2 published |
thanks @jeffmo! |
This PR exposes
require('esprima-fb').Syntax
fromjstransform/src/utils
and updates the references to it throughout.Motivation: I find myself doubly including
esprima-fb
because of the weird version numbers it uses and my need to reachSyntax
. The most visible example of this is with envify (used by React), which requiresjstransform
andesprima-fb
. Since thejstransform
version can float, you end up in a situation wherejstransform
uses X version ofesprima-fb
, butenvify
is using Y version solely for theSyntax
object.Hopefully if this gets merged, I'll make a pull request to simplify envify and maybe we can bump envify in React's next release.