openscad / openscad-playground

OpenSCAD Web Playground
https://ochafik.com/openscad2
Other
76 stars 17 forks source link

A completely new playground, in React #1

Closed ochafik closed 1 year ago

ochafik commented 1 year ago

With OpenSCAD now much faster thanks to the experimental Manifold integration, I thought it's time to revamp last year's playground to maybe make it actually useful.

New Demo: https://ochafik.com/openscad2

image image image image image image

It's in React (uses @primefaces's primereact's neat widgets and icons, @gabotechs's react-stl-viewer for visualization and @react-monaco-editor's react-monaco-editor to wrap the Monaco editor, although I might switch to another editor to fix mobile editing. Otherwise it's more or lest just porting the JS code from my earlier prototype (https://github.com/ochafik/openscad-wasm/tree/editor-ochafik.com) into TypeScript.

Code completion is substantially better than last year: it actually pseudo parses the file and its transitive includes/uses, so it should be pretty (auto)complete!

It's quite a lot to review, maybe I can just keep beautifying it (and add some tests) and squash/merge it as it is at some point. @t-paul @kintel WDYT?

kintel commented 1 year ago

This looks great! I don't think it makes too much sense to review an initial batch of code like this, so I'd say let's focus on making it easy/repeatable to build/deploy for now. Once initial dev slows down, reviews are nice as that could let other contributors in as well. I'll give local build&deploy a shot.

ochafik commented 1 year ago

I'll give local build&deploy a shot.

@kintel something I forgot to mention in the README is you need to update the homepage field in package.json to match the prod deployment (domain And root path of the app), or else the Emscripten worker would fail with cryptic errors (there’s logic to inline it with its dependencies and replace its meta.url; oh, the hoops I had to go through to make it work on Firefox 🤣)

kintel commented 1 year ago

I test-published it to my own github pages. Worked perfectly, just needed a tiny tweak to the README.

kintel commented 1 year ago

I accidentally pushed it to main (forgot to fork first). Hope I didn't jump the gun on anything..