Izzimach / react-three-legacy

React bindings to create and control a 3D scene using three.js
Other
1.52k stars 127 forks source link

Update to React 0.13 #16

Closed Izzimach closed 9 years ago

Izzimach commented 9 years ago

Currently depends on React 0.12. With the release of React 0.13 and React Native this needs to be updated.

Looks like ReactComponent got stripped down so several of those calls need to be corrected.

Need to see if the constructor process changed. Check react-art.

Finally, composite components may have changed.

poshaughnessy commented 9 years ago

It'd be brilliant if you're able to upgrade to React 0.13! I took a quick look because I'm hoping to use React in the ES6 classes style. But I soon ran into issues and I'm a little lost because I'm not really familiar with React beyond the basics at the moment. I'll try to read up in case I might be able to help.

Anyway, the things I've spotted so far are ReactLegacyElement and ReactComponent.Mixin don't exist anymore...

Izzimach commented 9 years ago

Yeah, updating is non-trivial since this depends on React internals which are not always well-documented. I had hoped to run through react-art later this week which will hopefully provide a clear path for upgrading my react non-DOM projects.

Izzimach commented 9 years ago

Looks like 529ec04d9f9dc2d6b50d4f4fba8dfe034f1ccada on the dev branch works with React 0.13. I don't like the monkey-patching I had to do, but hopefully it won't be needed in the future.

@poshaughnessy can you pull the dev branch and test if it works with your code? If so, I'll look at #17 then probably deploy a new version to npm.

poshaughnessy commented 9 years ago

@Izzimach Great, thanks Gary, I'll try it today

poshaughnessy commented 9 years ago

@Izzimach Got it up and running with React v0.13. It's rendering the canvas OK with no errors, although I should say that I'm not testing it very thoroughly as I've just got an empty scene right now! I'll try to test it out with some added content shortly, but I might not be able to until Monday now. Looks good so far anyway - thanks!

poshaughnessy commented 9 years ago

Apologies - progress a little slow on my part!

I have an object showing up. However, I have an issue whereby the child component (currently just a cube with the cupcake material) is only rendering once; the parent component doesn't appear to be triggering a render on the child when it passes in different properties. I'm guessing this is the issue behind both problems I'm seeing:

I haven't been able to figure out why yet though - this is the first time I'm writing a React app with ES6 and I'm probably just being silly. I'll take a better look as soon as I have time (probably Friday now). After that, I hope to have a nice little demo to share, and for your info, I'm hoping to demonstrate it at a React meetup in London next month, so I'll be spreading the word about react-three then :-)

Anyway, in the meantime I guess you could close this issue if you like? I can open another if the issue turns out to be with this library!

p.s. Off topic but please may I ask: should it be possible to use a Collada model (via ColladaLoader), with react-three?

Izzimach commented 9 years ago

OK yeah, I'll close this issue. You can always re-open it if it turns out to be something wrong with react-three.

Is the current demo represented at https://github.com/poshaughnessy/react-three-demo ? I can check it out if you'd like. When you do get it working let me know as I would like an example and some tests for ES6.

poshaughnessy commented 9 years ago

Yes, that's the one!

The boilerplate is currently a mix between a couple of different templates I've been working on: es6-react-starter-template and es6-react-jspm-starter-template. They're more intended as finding a nice setup that I'm happy with for development and production builds, but probably not the best to show people as a first ES6 example for react-three. It should be easy for me to switch the boilerplate to e.g. the regular SystemJS es6-module-loader.js way though.