Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3197165
remove draco
NickKhalow May 11, 2026
6276a3b
crete local player prefs
NickKhalow May 11, 2026
54ec518
disable locking for webgl
NickKhalow May 11, 2026
28b5a7f
update utility
NickKhalow May 11, 2026
c9ab28b
disable logging js websocket
NickKhalow May 11, 2026
a687d40
update playgrounds
NickKhalow May 11, 2026
b674709
enable status
NickKhalow May 11, 2026
e32c28e
webgl chrome dev tools
NickKhalow May 11, 2026
15237a8
webgl branching for prefs
NickKhalow May 11, 2026
d9f77dd
AudioAnalysisPlayground disable on webgl
NickKhalow May 11, 2026
6c3cb73
guard voice chat room
NickKhalow May 11, 2026
0042db7
apply compile definitions
NickKhalow May 11, 2026
e50e5a0
WebGLEditor build menu
NickKhalow May 11, 2026
683ec60
metadata
NickKhalow May 11, 2026
b07ecce
ci/cd yml files
NickKhalow May 11, 2026
480d938
remove redundant condition over shapes
NickKhalow May 11, 2026
972a75a
enable offline status for bridge in webgl
NickKhalow May 12, 2026
315ab75
update compilation flags
NickKhalow May 12, 2026
8adb7cb
Merge remote-tracking branch 'origin/dev' into feat/webgl-ci-cd
NickKhalow May 12, 2026
8264505
postmerge fix
NickKhalow May 12, 2026
e0a26a4
IDCLTypedArray
NickKhalow May 12, 2026
8c73caa
delete an empty file
NickKhalow May 12, 2026
54cfd60
update IJSArrayOperations
NickKhalow May 12, 2026
d977381
IDCLScriptObject
NickKhalow May 12, 2026
6c60761
scene runtime V8
NickKhalow May 12, 2026
bb6417d
add meta
NickKhalow May 12, 2026
f0578cc
remove old runtime impl
NickKhalow May 12, 2026
38bf2fa
rename
NickKhalow May 12, 2026
642b899
partial rename
NickKhalow May 12, 2026
a9e2f6d
update types
NickKhalow May 12, 2026
d0b3f0f
update types
NickKhalow May 12, 2026
943ff0f
substitution
NickKhalow May 12, 2026
10b8308
implement casting
NickKhalow May 12, 2026
73b7f28
add types
NickKhalow May 12, 2026
95bfb32
V8SceneRuntimeImpl
NickKhalow May 12, 2026
0f3a4c0
asmdef unsafe allow
NickKhalow May 12, 2026
622c75d
webgl impl for poolable array
NickKhalow May 12, 2026
abededf
guard LivekitPlayer on WebGL
NickKhalow May 12, 2026
5736eae
handle LivekitAddress on WebGL
NickKhalow May 12, 2026
c1a1cab
apply audio and video stream guards
NickKhalow May 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions .github/workflows/build-unitycloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: ['windows64', 'macos']
target: ['windows64', 'macos', 'web']
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -493,6 +493,18 @@ jobs:
!build/**/*.pdb
if-no-files-found: error

- name: Upload artifact for Web
id: upload-web-artifact
if: matrix.target == 'web'
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}
path: |
build
!build/**/*_BackUpThisFolder_ButDontShipItWithYourGame
!build/**/*_BurstDebugInformation_DoNotShip
if-no-files-found: error

- name: Compress the build folder to upload it to S3
run: |
mkdir upload_to_s3/ && \
Expand All @@ -501,13 +513,16 @@ jobs:
elif [ "${{ matrix.target }}" == "windows64" ]; then
cd build
zip -r ../upload_to_s3/${{ env.artifact_name }}.zip . -x "*_BackUpThisFolder_ButDontShipItWithYourGame**" -x "*_BurstDebugInformation_DoNotShip**" -x "*.pdb"
elif [ "${{ matrix.target }}" == "web" ]; then
cp -r build upload_to_s3/build
fi

- name: Install jq
run: sudo apt-get update -y && sudo apt-get install -y jq

- name: Enforce artifact size budget
id: size_check
if: matrix.target != 'web'
env:
# Per-target absolute caps (MB)
MAX_MACOS_MB: 450
Expand Down Expand Up @@ -672,17 +687,29 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.EXPLORER_TEAM_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.EXPLORER_TEAM_AWS_SECRET_ACCESS_KEY }}
EXPLORER_TEAM_S3_BUCKET: ${{ secrets.EXPLORER_TEAM_S3_BUCKET }}
DESTINATION_PATH: "${{
inputs.is_release_build && format('@dcl/{0}/releases/{1}', github.event.repository.name, inputs.tag_version)
|| format('@dcl/{0}/branch/{1}/{2}-{3}-{4}', github.event.repository.name, env.SAFE_BRANCH_NAME, env.BUILD_PREFIX, github.run_number, env.SHA_SHORT)
}}"
EXPLORER_TEAM_S3_BUCKET_PUBLIC_URL: ${{ vars.EXPLORER_TEAM_S3_BUCKET_PUBLIC_URL }}
run: |
set -euo pipefail

DESTINATION_PATH="${{ inputs.is_release_build && format('@dcl/{0}/releases/{1}', github.event.repository.name, inputs.tag_version) || format('@dcl/{0}/branch/{1}/{2}-{3}-{4}', github.event.repository.name, env.SAFE_BRANCH_NAME, env.BUILD_PREFIX, github.run_number, env.SHA_SHORT) }}"

# Latest dev build for webgl
if [ "${{ matrix.target }}" == "web" ] && [ "${GITHUB_REF_NAME}" == "dev" ]; then
DESTINATION_PATH="@dcl/${{ github.event.repository.name }}/dev/webgl-latest"
fi

if [ "${{ matrix.target }}" == "web" ]; then
echo "Web build link: $EXPLORER_TEAM_S3_BUCKET_PUBLIC_URL/$DESTINATION_PATH/build/Decentraland/index.html"
fi

npx @dcl/cdn-uploader@next \
--bucket $EXPLORER_TEAM_S3_BUCKET \
--local-folder upload_to_s3 \
--bucket-folder $DESTINATION_PATH

# web doesn't have debug symbols
- name: Upload debug symbols
if: matrix.target != 'web'
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}_debug_symbols
Expand All @@ -692,7 +719,7 @@ jobs:
if-no-files-found: error

- name: Upload debug symbols to Sentry
if: ${{ needs.prebuild.outputs.sentry_enabled == 'true' }}
if: ${{ needs.prebuild.outputs.sentry_enabled == 'true' && matrix.target != 'web' }}
shell: bash
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_CLI_AUTH_TOKEN }}
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/pr-comment-artifact-url.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ jobs:
echo "Mac Artifact ID: $MAC_ARTIFACT_ID"
echo "MAC_ARTIFACT_ID=$MAC_ARTIFACT_ID" >> "$GITHUB_ENV"

WEB_ARTIFACT_ID=$(gh api "/repos/$OWNER/$REPO/actions/artifacts" \
--jq ".artifacts.[] |
select(.workflow_run.id==${PREVIOUS_JOB_ID}) |
select(.expired==false) |
select(.name==\"Decentraland_web\") |
.id")
echo "Web Artifact ID: $WEB_ARTIFACT_ID"
echo "WEB_ARTIFACT_ID=$WEB_ARTIFACT_ID" >> "$GITHUB_ENV"

ORIGINAL_EVENT=$(jq -r '.event' <<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Original Event: $ORIGINAL_EVENT"

Expand Down Expand Up @@ -208,6 +217,8 @@ jobs:
WINDOWS_ARTIFACT_S3_URL: "${{ format('{0}/{1}/Decentraland_windows64.zip', vars.EXPLORER_TEAM_S3_BUCKET_PUBLIC_URL, env.ARTIFACT_S3_DESTINATION_PATH) }}"
MAC_ARTIFACT_URL: "${{ github.server_url }}/${{ github.repository }}/suites/${{ env.SUITE_ID }}/artifacts/${{ env.MAC_ARTIFACT_ID }}"
MAC_ARTIFACT_S3_URL: "${{ format('{0}/{1}/Decentraland_macos.zip', vars.EXPLORER_TEAM_S3_BUCKET_PUBLIC_URL, env.ARTIFACT_S3_DESTINATION_PATH) }}"
WEB_ARTIFACT_URL: "${{ github.server_url }}/${{ github.repository }}/suites/${{ env.SUITE_ID }}/artifacts/${{ env.WEB_ARTIFACT_ID }}"
WEB_ARTIFACT_S3_URL: "${{ format('{0}/{1}/build/Decentraland/index.html', vars.EXPLORER_TEAM_S3_BUCKET_PUBLIC_URL, env.ARTIFACT_S3_DESTINATION_PATH) }}"
HEAD_SHA: "${{ env.HEAD_SHA }}"
uses: peter-evans/create-or-update-comment@v3
with:
Expand All @@ -217,7 +228,7 @@ jobs:
body: |-
![badge] <img src="https://ui.decentraland.org/decentraland_256x256.png" width="30">

Windows and Mac build successful in Unity Cloud! You can find a link to the downloadable artifact below.
Windows, Mac and Web build successful in Unity Cloud! You can find a link to the downloadable artifact below.

| Name | Link |
| -------- | ----------------------- |
Expand All @@ -227,6 +238,8 @@ jobs:
| Download Windows S3 | ${{ env.WINDOWS_ARTIFACT_S3_URL }} |
| Download Mac | ${{ env.MAC_ARTIFACT_URL }} |
| Download Mac S3 | ${{ env.MAC_ARTIFACT_S3_URL }} |
| Download Web | ${{ env.WEB_ARTIFACT_URL }} |
| Web Build on S3 | ${{ env.WEB_ARTIFACT_S3_URL }} |
| Built on | ${{ env.BUILD_DATE }} |

${{ env.SIZE_REPORT }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public async UniTask CloseAsync(int websocketId, CancellationToken ct)
text = Encoding.UTF8.GetString(result.Span),
};

var binary = jsOperations.NewUint8Array(result.Length);
IDCLTypedArray<byte> binary = jsOperations.NewUint8Array(result.Length);
binary.WriteBytes(result.Array, 0ul, (ulong)result.Length, 0ul);

return new IWebSocketApi.ReceiveResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected enum CommsMessageType {
private readonly ISceneCommunicationPipe sceneCommunicationPipe;
protected readonly IJsOperations jsOperations;
private readonly ISceneCommunicationPipe.MsgType typeToHandle;
private readonly ScriptObject eventArray;
private readonly IDCLScriptObject eventArray;
private readonly ISceneCommunicationPipe.SceneMessageHandler onMessageReceivedCached;
private readonly ISceneData sceneData;

Expand Down Expand Up @@ -105,15 +105,15 @@ public ScriptObject GetResult()
for (var i = 0; i < eventsToProcess.Count; i++)
{
PoolableByteArray src = eventsToProcess[i];
ITypedArray<byte> dst = jsOperations.GetTempUint8Array();
dst.WriteBytes(src.Span, 0ul, (ulong)src.Length, 0ul);
IDCLTypedArray<byte> dst = jsOperations.GetTempUint8Array();
dst.WriteBytes(src.Array, 0ul, (ulong)src.Length, 0ul);
src.Dispose();
object subArray = dst.InvokeMethod("subarray", 0, src.Length);
object subArray = ((IDCLScriptObject)dst).InvokeMethod("subarray", 0, src.Length);
eventArray.SetProperty(i, subArray);
}

eventsToProcess.Clear();
return eventArray;
return (ScriptObject)eventArray.GetNativeObject();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ public class EngineAPIImplementation : IEngineApi
private readonly CustomSampler deserializeBatchSampler;
private readonly ISceneExceptionsHandler exceptionsHandler;
private readonly IInstancePoolsProvider instancePoolsProvider;
#if !UNITY_WEBGL
private readonly MultiThreadSync multiThreadSync;
private readonly MultiThreadSync.Owner syncOwner;
#endif
private readonly IOutgoingCRDTMessagesProvider outgoingCrtdMessagesProvider;
private readonly CustomSampler outgoingMessagesSampler;
private readonly ISystemGroupsUpdateGate systemGroupsUpdateGate;
Expand All @@ -53,9 +55,12 @@ public EngineAPIImplementation(
ICRDTWorldSynchronizer crdtWorldSynchronizer,
IOutgoingCRDTMessagesProvider outgoingCrtdMessagesProvider,
ISystemGroupsUpdateGate systemGroupsUpdateGate,
ISceneExceptionsHandler exceptionsHandler,
MultiThreadSync multiThreadSync,
MultiThreadSync.Owner syncOwner)
ISceneExceptionsHandler exceptionsHandler
#if !UNITY_WEBGL
,MultiThreadSync multiThreadSync,
MultiThreadSync.Owner syncOwner
#endif
)
{
sharedPoolsProvider = poolsProvider;
this.instancePoolsProvider = instancePoolsProvider;
Expand All @@ -64,8 +69,10 @@ public EngineAPIImplementation(
this.crdtSerializer = crdtSerializer;
this.crdtWorldSynchronizer = crdtWorldSynchronizer;
this.outgoingCrtdMessagesProvider = outgoingCrtdMessagesProvider;
#if !UNITY_WEBGL
this.multiThreadSync = multiThreadSync;
this.syncOwner = syncOwner;
#endif
this.systemGroupsUpdateGate = systemGroupsUpdateGate;
this.exceptionsHandler = exceptionsHandler;

Expand Down Expand Up @@ -248,7 +255,9 @@ private void ApplySyncCommandBuffer(IWorldSyncCommandBuffer worldSyncBuffer)
{
try
{
#if !UNITY_WEBGL
using MultiThreadSync.Scope mutex = multiThreadSync.GetScope(syncOwner);
#endif

applyBufferSampler.Begin();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using ECS.Prioritization.Components;
using ECS.StreamableLoading.Common.Components;
using ECS.StreamableLoading.Common.Systems;
using Microsoft.ClearScript.JavaScript;
using Newtonsoft.Json;
using SceneRunner.Scene;
using SceneRuntime;
Expand Down Expand Up @@ -63,23 +62,23 @@ public void Dispose() { }

await UniTask.SwitchToMainThread();

async UniTask<StreamableLoadingResult<ITypedArray<byte>>> CreateFileRequestAsync(SubIntention intention, IAcquiredBudget budget, IPartitionComponent partition, CancellationToken ct)
async UniTask<StreamableLoadingResult<IDCLTypedArray<byte>>> CreateFileRequestAsync(SubIntention intention, IAcquiredBudget budget, IPartitionComponent partition, CancellationToken ct)
{
using DownloadHandler? downloadHandler = await webRequestController.GetAsync(intention.CommonArguments.URL, ct, ReportCategory.JAVASCRIPT).ExposeDownloadHandlerAsync();
NativeArray<byte>.ReadOnly nativeBytes = downloadHandler.nativeData;

await DCLTask.SwitchToThreadPool();

// create script byte array
ITypedArray<byte> array = jsOperations.NewUint8Array(nativeBytes.Length);
IDCLTypedArray<byte> array = jsOperations.NewUint8Array(nativeBytes.Length);

// transfer data to script byte array
array.Write(nativeBytes, (ulong)nativeBytes.Length, 0);
return new StreamableLoadingResult<ITypedArray<byte>>(array);
return new StreamableLoadingResult<IDCLTypedArray<byte>>(array);
}

var intent = new SubIntention(new CommonLoadingArguments(url));
ITypedArray<byte> content = (await intent.RepeatLoopAsync(NoAcquiredBudget.INSTANCE, PartitionComponent.TOP_PRIORITY, CreateFileRequestAsync, ReportCategory.JAVASCRIPT, ct)).UnwrapAndRethrow();
IDCLTypedArray<byte> content = (await intent.RepeatLoopAsync(NoAcquiredBudget.INSTANCE, PartitionComponent.TOP_PRIORITY, CreateFileRequestAsync, ReportCategory.JAVASCRIPT, ct)).UnwrapAndRethrow();

return new IRuntime.ReadFileResponse
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,17 @@ public class SDKObservableEventsEngineAPIImplementation : EngineAPIImplementatio

public SDKObservableEventsEngineAPIImplementation(ISharedPoolsProvider poolsProvider, IInstancePoolsProvider instancePoolsProvider, ICRDTProtocol crdtProtocol, ICRDTDeserializer crdtDeserializer, ICRDTSerializer crdtSerializer,
ICRDTWorldSynchronizer crdtWorldSynchronizer, IOutgoingCRDTMessagesProvider outgoingCrtdMessagesProvider,
ISystemGroupsUpdateGate systemGroupsUpdateGate, ISceneExceptionsHandler exceptionsHandler,
MultiThreadSync multiThreadSync, MultiThreadSync.Owner syncOwner) : base(poolsProvider, instancePoolsProvider, crdtProtocol,
ISystemGroupsUpdateGate systemGroupsUpdateGate, ISceneExceptionsHandler exceptionsHandler
#if !UNITY_WEBGL
, MultiThreadSync multiThreadSync, MultiThreadSync.Owner syncOwner
#endif
) : base(poolsProvider, instancePoolsProvider, crdtProtocol,
crdtDeserializer, crdtSerializer, crdtWorldSynchronizer, outgoingCrtdMessagesProvider,
systemGroupsUpdateGate, exceptionsHandler, multiThreadSync, syncOwner) { }
systemGroupsUpdateGate, exceptionsHandler
#if !UNITY_WEBGL
, multiThreadSync, syncOwner
#endif
) { }

public void TryAddSubscription(string eventId)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
using DCL.Multiplayer.Connections.Messaging.Pipe;
using ECS;
using Microsoft.ClearScript;
using Microsoft.ClearScript.JavaScript;
using Microsoft.ClearScript.V8;
using SceneRuntime.V8;
using NSubstitute;
using NUnit.Framework;
using SceneRunner.Scene;
Expand Down Expand Up @@ -49,9 +51,9 @@ public void SetUp()
var uint8ArrayCtor = (ScriptObject)engine.Global.GetProperty("Uint8Array");

jsOperations = Substitute.For<IJsOperations>();
jsOperations.NewArray().Returns(_ => arrayCtor.Invoke(true));
jsOperations.NewArray().Returns(_ => new V8ScriptObjectAdapter((ScriptObject)arrayCtor.Invoke(true)));

jsOperations.GetTempUint8Array().Returns(_ => uint8ArrayCtor.Invoke(true, IJsOperations.LIVEKIT_MAX_SIZE));
jsOperations.GetTempUint8Array().Returns(_ => new V8TypedArrayAdapter((ITypedArray<byte>)uint8ArrayCtor.Invoke(true, IJsOperations.LIVEKIT_MAX_SIZE)));

api = new CommunicationsControllerAPIImplementation(
sceneData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,13 @@ public void SetUp()
crdtWorldSynchronizer = Substitute.For<ICRDTWorldSynchronizer>(),
outgoingCrtdMessagesProvider = Substitute.For<IOutgoingCRDTMessagesProvider>(),
Substitute.For<ISystemGroupsUpdateGate>(),
new RethrowSceneExceptionsHandler(),
new MultiThreadSync(new SceneShortInfo()), new MultiThreadSync.Owner("TEST"));
new RethrowSceneExceptionsHandler()
#if !UNITY_WEBGL
,
new MultiThreadSync(new SceneShortInfo()),
new MultiThreadSync.Owner("TEST")
#endif
);

crdtDeserializer.When(d => d.DeserializeBatch(ref Arg.Any<ReadOnlyMemory<byte>>(), Arg.Any<IList<CRDTMessage>>()))
.Do(c =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Microsoft.ClearScript.JavaScript;
using Utility;

namespace CrdtEcsBridge.PoolsProviders
{
public static class InstancePoolsProviderExtensions
{
public static void RenewCrdtRawDataPoolFromScriptArray(
this IInstancePoolsProvider instancePoolsProvider, ITypedArray<byte> scriptArray,
this IInstancePoolsProvider instancePoolsProvider, IDCLTypedArray<byte> scriptArray,
ref PoolableByteArray lastInput)
{
EnsureArrayLength(instancePoolsProvider, (int)scriptArray.Length, ref lastInput);
Expand Down
Loading
Loading