ChristopherChudzicki/math3d-react

Upgrade to module-based Mathbox, modern threeJS... interested?

Closed this issue · 11 comments

Hey all,

I've taken on an effort to bring Mathbox 2 into 2021. first by making it possible to pull the library in as a tree-shakable module, and then by getting it building a modern version of Three. The first part of this effort is complete:

https://github.com/mentat-collective/mathbox2

I haven't published to NPM yet, as I'm still learning my way around Webpack and want to make sure that I produce the correct builds.

Would a switch to this dependency be interesting for you all? There should be zero change in features, and it would make it easier to get onto a modern version of Three, and push upgrades from your work here back into the main Mathbox project.

I'm happy to send a pull request getting this going. I just wanted to check in first on the idea.

Cheers, and thank you for your lovely work here!

@sritchie Apologies for the long silence—This is really awesome! Bringing mathbox into the 2020s is really what I have regarded as one of the biggest challenges for math3d going forward.

I've only taken a very quick look at the repos, but I see you've done some work on mathbox, shadergraph, and threestrap, e.g., getting rid of the coffeescript & bundling with webpack.

I noticed the threestrap repo has threejs >0.66 and <0.127 as a peer dependency, but mathbox is still on 0.71... I know updating these repos could be a huge effort. (I recently starting trying to modernize threestrap; I'm maybe halfway done converting to typescript... https://github.com/ChristopherChudzicki/threestrap/tree/ts-plugins). I'd be curious to hear about your experience trying to update threejs in mathbox if you ever started down that path.

I'd have to check a bit more carefully if math3d could use this as a drop-in replacement. I believe I made a few updates/bug-fixes to mathbox that math3d needed. (Maybe not, though... I may just be using znah's fork, https://github.com/znah/mathbox )

Hey, will write more soon but I’ve got threestrap on typescript already, so that should save you some work. I just need to wrap that up and commit it! More soon…

Looking into this a bit, znah's fork (and math3d) seem to be using threejs version 84... (There's a note in the math3d changelog "Updated MathBox to use newer version of ThreeJS. This fixes scrolling/zooming issues in Firefox.")

That is actually EXTREMELY helpful, as my whole effort to get everything up to date got stuck at r80, with a bug in grids that appeared in Mathbox at that version.

I will push what I've got at some point today, and start work on getting all of this loaded back into my head.

I've pushed my changes to the Threestrap and Shadergraph repos:

mathbox is next...

Okay, I am sending these updates too quickly. I see now that I had not done any typescript conversion on Threestrap; I would love a PR with that work! that will give me a nice base to get the other projects moving over to typescript as well. Maybe we should get a call scheduled and chat about the plan here.

Cheers, and thanks again for getting back to me.

Maybe we should get a call scheduled and chat about the plan here.

That'd be great. I just sent you a message on Linkedin. Would love to contribute to updating this libs.

Hey @ChristopherChudzicki , I've just published a big release of the computer algebra system (https://github.com/sicmutils/sicmutils/releases/tag/v0.21.0), and I'm back on Mathbox fulltime until we get everything upgraded and published.

That repo you sent was fantastic and got me past most bugs.

I didn't see the LinkedIn note, but maybe an email at sritchie09@gmail.com is best.

Do you have some time this week to talk? Let's make a plan!

BOOM, I made it up to r101. I was stuck for a while on r84, with a pretty gnarly bug, but the debugging's complete and all is well.

r102 breaks everything again, but I'm on my way: https://github.com/mentat-collective/mathbox2/pull/10

Would love to chat when you get some time.

Boom, we're up to a modern, modular mathbox, on the latest version of three.js! Pinging again, since I'd love to talk about React + Mathbox.

Closing in favor of #330