These are chat archives for redfin/react-server

1st
Jun 2016
Jason Benesch
@jbenesch
Jun 01 2016 18:38
hey @doug-wade! happy wednesday! There may be (probably) no practical usage with this example, but I did want to flush out the concept of mutating a react component tree during runtime. http://www.webpackbin.com/4JWusWO7Z
Douglas Wade
@doug-wade
Jun 01 2016 18:41
@jbenesch that is amazing and also brilliant and I also love it
And it looks like, in practice, there’s no need to introduce another source transform to make it look good/reasonable
I’ve also never seen webpack bin before — its pretty slick
although if we want to wrap every component...
But thanks for making it more concrete
Jason Benesch
@jbenesch
Jun 01 2016 18:49
yeah like I said, I’m not sure there is much practicality and I’d have to run some performance tests against a large subtree, but it does better highlight the react data structure that gets a bit obfuscated by jsx
Jason Benesch
@jbenesch
Jun 01 2016 19:05
My only concern with a source transform on build (as I understand it), is that now my code doesn’t run as it’s written on the file. It may work great, but trying to track down a bug in a build transform sounds like a nightmare. It would seem to me that if you are going to mutate the AST, you’d just use a codemod and write the file back out to the src dir doing the: "edit every single react component” with a unstable_handleError() method in one fell swoop. But that's just my 2 cents fwiw!