This is a complete rewrite of how `pd4web` works. I believe it offers a more simple approach, but yet quite similar from a coding perspective. **However, it's still far from complete and there are many features still missing.**
Main Changes
- Now we use C++ and emscripten bind;
- I embbed all necessary js code calls inside the c++ code, this means that now you just need to write the code below to make `pd4web` work.
js
<script src="./pd4web.js"></script>
<script>
let Pd4Web = null;
Pd4WebModule().then((Pd4WebModulePromise) => {
Pd4Web = new Pd4WebModulePromise.Pd4Web();
console.log("Pd4WebModule loaded");
});
Pd4Web.init();
</script>
- Now we use `cmake` and [pd.cmake](https://github.com/pure-data/pd.cmake) to compile externals, this make compilation and adding externals more simple.
- Now we build a `Git` repo for the PureData project. I believe this can be an excellent way to keep a project running over the years. Everything from the PureData code, the libraries code, the build script will be added to the project. And finally we create a Git repo.
- Now once you compile the project, you can modify the `index.html` file that it will not be replaced, you also can add files inside the `WebPatch` folder. We will just modify these files. `pd4web` will not delete anything.
1. `pd4web.js`
2. `pd4web.gui.js`
3. `pd4web.threads.js`
4. `pd4web.wasm`
5. `pd4web.worker.js`
6. `pd4web.ww.js`;
In another words, just the 'binary' files.