Skip to content

Commit

Permalink
Backed out changeset 1c7342bda81b
Browse files Browse the repository at this point in the history
Summary: This conflicts with our internal transform setup, we'll have to find another way to do this.

Reviewed By: yuzhi

Differential Revision: D2873773

fb-gh-sync-id: 30d1c25ec5cc4698bfaeb5a521cb15df33da1b47
  • Loading branch information
josephsavona authored and facebook-github-bot-7 committed Jan 28, 2016
1 parent 50923b8 commit c0e6da5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 50 deletions.
33 changes: 2 additions & 31 deletions scripts/babel-relay-plugin/lib/babelAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,8 @@ var path = require('path');

function babelAdapter(Plugin, t, name, visitorsBuilder) {
if (Plugin == null) {
var _ret = (function () {
// Babel 6.

var _visitorsBuilder = visitorsBuilder(t);

var _visitorsBuilder$visitor = _visitorsBuilder.visitor;
var _Program = _visitorsBuilder$visitor.Program;
var _TaggedTemplateExpression = _visitorsBuilder$visitor.TaggedTemplateExpression;

var taggedTemplateExpressionVisitor = {
TaggedTemplateExpression: function TaggedTemplateExpression(path) {
_TaggedTemplateExpression(path, this);
}
};

/**
* Run both transforms on Program to make sure that they run before other plugins.
*/
return {
v: {
visitor: {
Program: function Program(path, state) {
_Program(path, state);
path.traverse(taggedTemplateExpressionVisitor, state);
}
}
}
};
})();

if (typeof _ret === 'object') return _ret.v;
// Babel 6.
return visitorsBuilder(t);
}
// Babel 5.
var legacyT = _extends({}, t, {
Expand Down
20 changes: 1 addition & 19 deletions scripts/babel-relay-plugin/src/babelAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,7 @@ function babelAdapter(
): mixed {
if (Plugin == null) {
// Babel 6.
const {visitor: {Program, TaggedTemplateExpression}} = visitorsBuilder(t);

const taggedTemplateExpressionVisitor = {
TaggedTemplateExpression(path) {
TaggedTemplateExpression(path, this);
}
}

/**
* Run both transforms on Program to make sure that they run before other plugins.
*/
return {
visitor: {
Program(path, state) {
Program(path, state);
path.traverse(taggedTemplateExpressionVisitor, state);
}
}
}
return visitorsBuilder(t);
}
// Babel 5.
const legacyT = {
Expand Down

3 comments on commit c0e6da5

@skevy
Copy link
Contributor

@skevy skevy commented on c0e6da5 Jan 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @josephsavona what was the exact conflict?

@josephsavona
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skevy We have another recently added transform that needs to run before this one, because it modifies code within the template expansions within Relay.QL queries:

foo: () => Relay.QL`
  fragment on Foo {
    ${SometimesWeTransformThis}
  }
`

We'll sort out that issue and reapply this, the code itself is 👍

@tlvenn
Copy link
Contributor

@tlvenn tlvenn commented on c0e6da5 Jan 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josephsavona any update on this particular issue ? Thanks!

Please sign in to comment.