The front-end and the back-end communicate with three channels. The first is the WebSocket connection to the Engine API. Once that connection is online, a WebRTC connection is negotiated, which contains one video stream from the server to us for the GUI, and a second, which is a binary data channel from us to the server, which we send JSON over for real-time events like mouse positioning. The lifecycle of the WebRTC connection and the WebSocket connection are tied, since if the WebSocket connection breaks down, the WebRTC connection must get restarted (to get a connection to the *same* backend that we have an open WebSocket connection to). This starts a move to split the WebRTC and WebSocket pair to be managed by a new class (EngineConnection), which will only start and maintain the WebSocket and WebRTC channels. Anything using the EngineConnection will be able to communnicate commands without needing to add control logic for the underlying data channels. Signed-off-by: Paul R. Tagliamonte <paul@kittycad.io>
Kurt demo project
live at app.kittycad.io
Not sure what to call this, it's both a language/interpreter and a UI that uses the language as the source of truth model the user build with direct-manipulation with the UI.
It might make sense to split this repo up at some point, but not the lang and the UI are all togther in a react app
Originally Presented on 10/01/2023
To run, there are a couple steps since we're compiling rust to WASM, you'll need to have rust stuff installed, then
yarn install
then
yarn build:wasm
That will build the WASM binary and put in the public dir (though gitignored)
finally
yarn start
and yarn test you would have need to have built the WASM previously. The tests need to download the binary from a server, so if you've already got yarn start running, that will work, otherwise running
yarn simpleserver
in one terminal and
yarn test
in another.
If you want to edit the rust files, you can cd into src/wasm-lib and then use the usual rust commands, cargo build, cargo test, when you want to bring the changes back to the web-app, a fresh yarn build:wasm in the root will be needed.
Worth noting that the integration of the WASM into this project is very hacky because I'm really pushing create-react-app further than what's practical, but focusing on features atm rather than the setup.
Developing in Chrome
Chrome is in the process of rolling out a new default which
blocks Third-Party Cookies.
If you're having trouble logging into the modeling-app, you may need to
enable third-party cookies. You can enable third-party cookies by clicking on
the eye with a slash through it in the URL bar, and clicking on "Enable
Third-Party Cookies".
Tauri
To spin up up tauri dev, yarn install and yarn build:wasm need to have been done before hand then
yarn tauri dev
Will spin up the web app before opening up the tauri dev desktop app. Note that it's probably a good idea to close the browser tab that gets opened since at the time of writting they can conflict.
The dev instance automatically opens up the browser devtools which can be disabled by commenting it out
To build, run yarn tauri build, or yarn tauri build --debug to keep access to the devtools.
Note that these became separate apps on Macos, so make sure you open the right one after a build 😉
Release a new version
- Bump the versions in the .json files by creating a
Bump to v{x}.{y}.{z}PR, committing the changes from
VERSION=x.y.z yarn run bump-jsons
The PR may serve as a place to discuss the human-readable changelog and extra QA.
-
Merge the PR
-
Create a new release and tag pointing to the bump version commit using semantic versioning
v{x}.{y}.{z} -
A new Action kicks in at https://github.com/KittyCAD/modeling-app/actions, uploading artifacts to the release