The reference to the old archetype is invalidated by getOrPut() calls of
std.ArrayHashMap. The implementation of std.ArrayHashMap means that
pointers can be invalidated on getOrPut() calls even if the key exists
in the map. This means that the reference to the old archetype needs to
be refreshed unconditionally (i.e. not only if the new archetype didn't
exist previously).
There is no technical different between the ways they are used. So its
better to merge them.
This commit further removes the internal ValueTag which worked under
Tag. On doing that tag type ``.ref`` has been renamed to ``.object``.
This is a workaround for a limitation right now. The html-generator has
no way to dynamically add JS sources (and that can't be done without
using a preprocessor library) so we hardcode js-runtime in it.
In the future, I think the correct behavior would be to move tools/
inside js-runtime along with a wasm application building SDK and get rid
of any direct JS access we have today (which is just
src/platform/wasm.zig and src/platform/mach.js).
This is a temporary application to begin iterating on high-level ECS applications.
Eventually, this will be removed - for now it's just here so we can see how this API
looks today and improve it.
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This requires apps expose a `pub const App` from their `main.zig`, effectively adopting
the high-level/low-level application API outlined in hexops/mach#349
If `pub const App` does not exist, a clear compiler error is produced:
```
./src/platform/common.zig:5:9: error: expected e.g. `pub const App = mach.App(modules, init)' (App definition missing in your main Zig file)
@compileError("expected e.g. `pub const App = mach.App(modules, init)' (App definition missing in your main Zig file)");
^
./src/platform/native.zig:13:28: note: called from here
common.checkApplication(app_pkg);
^
./src/platform/native.zig:12:10: note: called from here
comptime {
^
./src/platform/native.zig:15:20: error: container '.app' has no member called 'App'
const App = app_pkg.App;
^
```
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>