Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Add native WebGL backend #91

Merged
merged 4 commits into from
Jun 23, 2022
Merged

Conversation

KurtGokhan
Copy link
Contributor

@KurtGokhan KurtGokhan commented Jun 20, 2022

This is a JS engine backend for WebGL platform. It is implemented using Emscripten/Unity interoperability features. Implemented it in typescript, which can be built to generate the actual jslib file.

Will solve issues like #47

A live example of how it works can be seen here. https://reactunity.github.io/reference/material/dialogs

It is possible to debug the script code as this backend will show files under unity-jsb:// protocol.

image

Currently there are some issues. There will be GC leaks in this version. I will fix this issue later. (Some API methods like SetPropertyInternal should automatically free values. I guess the GC issues are related to them. I don't know the full list of APIs that have this behavior. Will investigate.)

I marked some API methods as TODO. I don't understand how they are supposed to work, so please comment if you have an idea of how to implement them. Also some API methods are not possible to implement.

Edit: I think all of the GC issues are fixed now. I don't have GC leaks in ReactUnity anymore even though it is doing a lot of interop.

@ialex32x ialex32x merged commit 4d7e5b6 into ialex32x:master Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants