Created
December 7, 2015 16:30
-
-
Save faceyspacey/aeec88dfd89aac63f0d5 to your computer and use it in GitHub Desktop.
bla
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Plugin.registerCompiler({ | |
extensions: ['jsx'], | |
}, function () { | |
return new BabelCompiler({ | |
react: true | |
}); | |
}); | |
var oldProcessFilesForTarget = BabelCompiler.prototype.processFilesForTarget; | |
var parentReg = /(<([A-Z][a-z0-9]+[\s\S]*?)(\/>|>))/g; | |
var lookupReg = /(?:this\.(\w+)\(([\s\S]*?)\))/g; | |
var parentReplace = "<$2 __parent={this} $3"; //allow for climbing component tree backwards via `__parent` | |
var lookupReplace = "this.__lookup('$1', [$2])"; //`this.__lookup` will perform method search utilizing `__parent` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment