Repository navigation
Breaking Changes
- Namespace: All plugin types are now in the
UnityWebGLSignalRnamespace. Addusing UnityWebGLSignalR;to your scripts. - Invoke API: The 10
Invokeoverloads have been replaced with a singleInvoke(string methodName, params object[] args)method. Existing call sites are source-compatible. - Minimum Unity version: Legacy Emscripten compatibility code removed. Requires Unity 2021+ (tested on Unity 6).
Added
SignalROptionsclass for configuring authentication, transport, timeouts, and other connection settings.TransportTypeandSignalRLogLevelenums for strongly-typed option values.Init(string url, SignalROptions options)overload for passing configuration options.IsConnectedproperty to check connection state (Editor and WebGL).IDisposableimplementation for proper cleanup ofHubConnectionresources.WithAutomaticReconnect()enabled by default on both Editor and WebGL paths.- Custom retry delays via
SignalROptions.RetryDelays. - Assembly definition (
UnityWebGLSignalR.asmdef) for proper project references. - CORS support on the server for development mode.
- Unity EditMode tests (28) for options serialization and plugin logic.
- Unity PlayMode integration tests (5) for end-to-end client-server validation.
- GitHub Actions CI (
ci.yml) for Unity EditMode tests, WebGL builds, and smoke tests on PRs. - Automated release pipeline (
release.yml): merging tomainauto-determines version (PR label or patch increment), exports.unitypackage, tags, and creates a GitHub Release. - Reusable test workflow (
test.yml) used by CI pipeline. - Composite action (
setup-unity) for disk space cleanup, PowerShell install, SignalR DLLs, and Unity Library caching. ExportPackageeditor script for CI-driven.unitypackageexport with version from environment variable.- Custom WebGL template (
Assets/WebGLTemplates/SignalR/) with SignalR JS client<script>tag included automatically in all WebGL builds. - Release pipeline auto-updates
Server/wwwroot/with fresh WebGL build on merge to main. - WebGL smoke test (Playwright) — headless browser test verifying the jslib SignalR bridge end-to-end in CI.
- Release dry-run mode via
workflow_dispatch.
Fixed
- Memory leak: JavaScript
invokeCallbackallocated buffers via_mallocbut never called_free. Every callback invocation leaked memory. - Falsy argument bug: JavaScript
InvokeJsused truthiness checks (if (arg1 && arg2)) which failed for empty strings,"0", and"false". Now uses!== 0null-pointer check with aNULL_SENTINELfor marshaling null arguments through the C#/JS boundary. - Null handler crash: WebGL
HandlerCallbackmethods did not checkTryGetValueresults, causingNullReferenceExceptionfor unregistered methods. - Async void crash: Editor
Invokemethods wereasync voidwith no try/catch. Exceptions fromInvokeAsyncwould crash silently. - Duplicate On() crash: Calling
On()twice for the same method name threwArgumentExceptionfromDictionary.Add. Now uses indexer assignment. - Reconnecting NRE:
OnConnectionReconnectingEventaccessedexception.Messagewithout null check (fixed in both Editor and jslib paths). - Event handler race: Connection event handlers were subscribed after
StartAsynccompleted, creating a window where close events could be missed. Moved toInit(). - WebGL Dispose() leak: Static
typesandhandlersdictionaries were never cleared on dispose, leaking handler registrations across sessions.
Changed
On<T>Editor overloads simplified to pass handler directly toconnection.On().- JavaScript bridge (
SignalR.jslib) reduced from 240 to ~170 lines by replacing duplicated if/else chains with loops. OnJshandler slots (handlerCallback1-8) replaced with per-registration closure capture.signalr.ps1switched fromnugetCLI todotnet restore— removes the NuGet CLI dependency.- TestScript updated to use
[SerializeField]instead ofGameObject.Find. - Instance replacement now logs a warning.
- Removed
version.txt— version now derived from git tags.
Full Changelog: v0.0.7...v1.0.0