com.wallstop-studios.dxmessaging 2.1.1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/dotnet-tests.yml +72 -0
- package/.lychee.toml +4 -2
- package/AGENTS.md +13 -12
- package/Docs/Comparisons.md +5 -5
- package/Docs/Install.md +2 -1
- package/Docs/InterceptorsAndOrdering.md +1 -1
- package/Docs/Performance.md +15 -13
- package/Docs/QuickReference.md +1 -1
- package/Docs/Reference.md +5 -5
- package/Editor/Analyzers/Microsoft.CodeAnalysis.CSharp.dll +0 -0
- package/Editor/Analyzers/Microsoft.CodeAnalysis.CSharp.dll.meta +13 -2
- package/Editor/Analyzers/Microsoft.CodeAnalysis.dll +0 -0
- package/Editor/Analyzers/Microsoft.CodeAnalysis.dll.meta +11 -0
- package/Editor/Analyzers/System.Collections.Immutable.dll +0 -0
- package/Editor/Analyzers/System.Collections.Immutable.dll.meta +11 -0
- package/Editor/Analyzers/System.Reflection.Metadata.dll +0 -0
- package/Editor/Analyzers/System.Reflection.Metadata.dll.meta +13 -2
- package/Editor/Analyzers/System.Runtime.CompilerServices.Unsafe.dll +0 -0
- package/Editor/Analyzers/System.Runtime.CompilerServices.Unsafe.dll.meta +11 -0
- package/Editor/Analyzers/WallstopStudios.DxMessaging.SourceGenerators.dll +0 -0
- package/Editor/Analyzers/WallstopStudios.DxMessaging.SourceGenerators.dll.meta +3 -2
- package/Editor/AssemblyInfo.cs +3 -0
- package/Editor/AssemblyInfo.cs.meta +3 -0
- package/Editor/CustomEditors/MessagingComponentEditor.cs +24 -0
- package/Editor/DxMessagingEditorInitializer.cs +58 -1
- package/Editor/DxMessagingMenu.cs +38 -0
- package/Editor/DxMessagingMenu.cs.meta +11 -0
- package/Editor/DxMessagingSceneBuildProcessor.cs +81 -0
- package/Editor/DxMessagingSceneBuildProcessor.cs.meta +11 -0
- package/Editor/Settings/DxMessagingSettings.cs +37 -6
- package/Editor/Settings/DxMessagingSettingsProvider.cs +45 -7
- package/Editor/SetupCscRsp.cs +133 -53
- package/Editor/Testing/MessagingComponentEditorHarness.cs +218 -0
- package/Editor/Testing/MessagingComponentEditorHarness.cs.meta +3 -0
- package/Editor/Testing.meta +3 -0
- package/README.md +10 -4
- package/Runtime/AssemblyInfo.cs +1 -0
- package/Runtime/Core/Attributes/DxOptionalParameterAttribute.cs +52 -0
- package/Runtime/Core/DataStructure/CyclicBuffer.cs +16 -0
- package/Runtime/Core/Diagnostics/MessageEmissionData.cs +27 -12
- package/Runtime/Core/Diagnostics/MessageRegistrationType.cs +62 -0
- package/Runtime/Core/DxMessagingStaticState.cs +108 -0
- package/Runtime/Core/DxMessagingStaticState.cs.meta +11 -0
- package/Runtime/Core/Extensions/IListExtensions.cs +24 -0
- package/Runtime/Core/Extensions/MessageBusExtensions.cs +144 -2
- package/Runtime/Core/Extensions/MessageExtensions.cs +2 -2
- package/Runtime/Core/Helper/MessageCache.cs +16 -0
- package/Runtime/Core/Helper/MessageHelperIndexer.cs +77 -0
- package/Runtime/Core/InstanceId.cs +91 -3
- package/Runtime/Core/MessageBus/DiagnosticsTarget.cs +31 -0
- package/Runtime/Core/MessageBus/DiagnosticsTarget.cs.meta +11 -0
- package/Runtime/Core/MessageBus/IMessageBus.cs +44 -16
- package/Runtime/Core/MessageBus/MessageBus.cs +96 -25
- package/Runtime/Core/MessageBus/MessageRegistrationBuilder.cs +46 -2
- package/Runtime/Core/MessageBus/MessagingRegistration.cs +63 -5
- package/Runtime/Core/MessageBus/RegistrationLog.cs +10 -0
- package/Runtime/Core/MessageHandler.cs +141 -8
- package/Runtime/Core/MessageRegistrationHandle.cs +59 -0
- package/Runtime/Core/MessageRegistrationToken.cs +20 -4
- package/Runtime/Core/Messages/ReflexiveMessage.cs +38 -0
- package/Runtime/Core/MessagingDebug.cs +16 -1
- package/Runtime/Unity/CurrentGlobalMessageBusProvider.cs +6 -0
- package/Runtime/Unity/DxMessagingRuntimeInitializer.cs +19 -0
- package/Runtime/Unity/DxMessagingRuntimeInitializer.cs.meta +11 -0
- package/Runtime/Unity/InitialGlobalMessageBusProvider.cs +6 -0
- package/Runtime/Unity/Integrations/Reflex/ReflexRegistrationInstaller.cs +19 -0
- package/Runtime/Unity/Integrations/VContainer/VContainerRegistrationExtensions.cs +10 -0
- package/Runtime/Unity/Integrations/Zenject/ZenjectRegistrationInstaller.cs +14 -0
- package/Runtime/Unity/MessageAwareComponent.cs +2 -0
- package/Runtime/Unity/MessageBusProviderHandle.cs +4 -0
- package/Runtime/Unity/MessagingComponent.cs +109 -0
- package/Runtime/Unity/MessagingComponentInstaller.cs +2 -0
- package/Runtime/Unity/ScriptableMessageBusProvider.cs +2 -0
- package/Samples~/DI/README.md +13 -13
- package/Samples~/Mini Combat/README.md +15 -15
- package/Samples~/Mini Combat/Walkthrough.md +12 -12
- package/Samples~/UI Buttons + Inspector/README.md +4 -4
- package/SourceGenerators/Directory.Build.props +9 -0
- package/{Tests/Runtime/WallstopStudios.DxMessaging.Tests.Runtime.csproj.meta → SourceGenerators/Directory.Build.props.meta} +1 -1
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoConstructorGenerator.cs +23 -24
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxMessageIdGenerator.cs +91 -27
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.csproj +24 -4
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/DocsSnippetCompilationTests.cs +193 -0
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/DocsSnippetCompilationTests.cs.meta +11 -0
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/DxAutoConstructorGeneratorDiagnosticsTests.cs +69 -0
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/DxAutoConstructorGeneratorDiagnosticsTests.cs.meta +11 -0
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/DxMessageIdGeneratorDiagnosticsTests.cs +66 -0
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/DxMessageIdGeneratorDiagnosticsTests.cs.meta +11 -0
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/GeneratorTestUtilities.cs +155 -0
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/GeneratorTestUtilities.cs.meta +11 -0
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/WallstopStudios.DxMessaging.SourceGenerators.Tests.csproj +20 -0
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/WallstopStudios.DxMessaging.SourceGenerators.Tests.csproj.meta +7 -0
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests.meta +8 -0
- package/Tests/Editor/MessagingComponentEditorHarnessTests.cs +243 -0
- package/Tests/Editor/MessagingComponentEditorHarnessTests.cs.meta +3 -0
- package/Tests/Editor/MessagingComponentSerializationTests.cs +129 -0
- package/Tests/Editor/MessagingComponentSerializationTests.cs.meta +3 -0
- package/Tests/Editor/WallstopStudios.DxMessaging.Tests.Editor.asmdef +19 -0
- package/Tests/Editor/WallstopStudios.DxMessaging.Tests.Editor.asmdef.meta +3 -0
- package/Tests/Editor.meta +3 -0
- package/Tests/Runtime/Benchmarks/BenchmarkSession.cs +3 -0
- package/Tests/Runtime/Benchmarks/BenchmarkTestBase.cs +3 -0
- package/Tests/Runtime/Benchmarks/ComparisonPerformanceTests.cs +3 -0
- package/Tests/Runtime/Benchmarks/PerformanceTests.cs +137 -0
- package/Tests/Runtime/Core/AlternateBusTests.cs +3 -0
- package/Tests/Runtime/Core/BroadcastTests.cs +3 -0
- package/Tests/Runtime/Core/CyclicBufferTests.cs +3 -0
- package/Tests/Runtime/Core/DefaultBusFallbackTests.cs +5 -2
- package/Tests/Runtime/Core/DiagnosticsTests.cs +6 -3
- package/Tests/Runtime/Core/DxMessagingStaticStateTests.cs +69 -0
- package/Tests/Runtime/Core/DxMessagingStaticStateTests.cs.meta +11 -0
- package/Tests/Runtime/Core/EdgeCaseTests.cs +3 -0
- package/Tests/Runtime/Core/EnablementTests.cs +3 -0
- package/Tests/Runtime/Core/Extensions/MessageExtensionsProviderTests.cs +2 -2
- package/Tests/Runtime/Core/GenericMessageTests.cs +3 -0
- package/Tests/Runtime/Core/GlobalAcceptAllTests.cs +3 -0
- package/Tests/Runtime/Core/InterceptorCancellationTests.cs +3 -0
- package/Tests/Runtime/Core/LifecycleTests.cs +3 -0
- package/Tests/Runtime/Core/MessageEmissionDataTests.cs +70 -0
- package/Tests/Runtime/Core/MessageEmissionDataTests.cs.meta +11 -0
- package/Tests/Runtime/Core/MessagingComponentLifecycleTests.cs +3 -0
- package/Tests/Runtime/Core/MessagingTestBase.cs +3 -0
- package/Tests/Runtime/Core/MutationDedupeTests.cs +3 -0
- package/Tests/Runtime/Core/MutationDestructionTests.cs +3 -0
- package/Tests/Runtime/Core/MutationDuringEmissionTests.cs +3 -0
- package/Tests/Runtime/Core/MutationGlobalAddTests.cs +3 -0
- package/Tests/Runtime/Core/MutationInterceptorTests.cs +3 -0
- package/Tests/Runtime/Core/MutationPostProcessorAcrossHandlersTests.cs +3 -0
- package/Tests/Runtime/Core/MutationPostProcessorMoreTests.cs +3 -0
- package/Tests/Runtime/Core/MutationPriorityTests.cs +3 -0
- package/Tests/Runtime/Core/NominalTests.cs +3 -0
- package/Tests/Runtime/Core/OrderingTests.cs +3 -0
- package/Tests/Runtime/Core/OverDeregistrationTests.cs +3 -0
- package/Tests/Runtime/Core/PostProcessorTests.cs +3 -0
- package/Tests/Runtime/Core/ReflexiveErrorTests.cs +3 -0
- package/Tests/Runtime/Core/ReflexiveMessageWarningTests.cs +4 -1
- package/Tests/Runtime/Core/ReflexiveTests.cs +3 -0
- package/Tests/Runtime/Core/RegistrationTests.cs +3 -0
- package/Tests/Runtime/Core/StringShorthandTests.cs +3 -0
- package/Tests/Runtime/Core/TargetedTests.cs +3 -0
- package/Tests/Runtime/Core/TypedShorthandTests.cs +3 -0
- package/Tests/Runtime/Core/UntargetedEquivalenceTests.cs +3 -0
- package/Tests/Runtime/Core/UntargetedPrefreezeTests.cs +14 -78
- package/Tests/Runtime/Core/UntargetedTests.cs +3 -0
- package/Tests/Runtime/Integrations/Reflex/ReflexIntegrationTests.cs +4 -1
- package/Tests/Runtime/Integrations/VContainer/VContainerIntegrationTests.cs +3 -0
- package/Tests/Runtime/Integrations/Zenject/ZenjectIntegrationTests.cs +3 -0
- package/Tests/Runtime/Scripts/Components/GenericMessageAwareComponent.cs +3 -0
- package/Tests/Runtime/Scripts/Components/ManualListenerComponent.cs +3 -0
- package/Tests/Runtime/Scripts/Components/ReflexiveReceiverComponent.cs +3 -0
- package/Tests/Runtime/TestUtilities/UnityFixtureBase.cs +3 -0
- package/Tests/Runtime/Unity/MessageBusProviderAssetTests.cs +3 -0
- package/Tests/Runtime/Unity/MessageBusProviderHandleTests.cs +87 -3
- package/Tests/Runtime/Unity/MessagingComponentInstallerSceneTests.cs +109 -0
- package/Tests/Runtime/Unity/MessagingComponentInstallerSceneTests.cs.meta +11 -0
- package/Tests/Runtime/Unity/MessagingComponentProviderIntegrationTests.cs +159 -17
- package/package.json +1 -1
- package/Tests/Runtime/WallstopStudios.DxMessaging.Tests.Runtime.csproj +0 -7
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
name: dotnet-tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
- main
|
|
8
|
+
- develop
|
|
9
|
+
pull_request:
|
|
10
|
+
branches:
|
|
11
|
+
- "*"
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Setup .NET
|
|
22
|
+
uses: actions/setup-dotnet@v5
|
|
23
|
+
with:
|
|
24
|
+
dotnet-version: "9.0.x"
|
|
25
|
+
|
|
26
|
+
- name: Install reportgenerator tool
|
|
27
|
+
run: |
|
|
28
|
+
dotnet tool install --global dotnet-reportgenerator-globaltool
|
|
29
|
+
echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH"
|
|
30
|
+
|
|
31
|
+
- name: Restore
|
|
32
|
+
run: dotnet restore SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/WallstopStudios.DxMessaging.SourceGenerators.Tests.csproj
|
|
33
|
+
|
|
34
|
+
- name: Run generator diagnostics tests
|
|
35
|
+
run: >
|
|
36
|
+
dotnet test SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/WallstopStudios.DxMessaging.SourceGenerators.Tests.csproj
|
|
37
|
+
--configuration Release
|
|
38
|
+
--collect:"XPlat Code Coverage"
|
|
39
|
+
|
|
40
|
+
- name: Generate coverage summary
|
|
41
|
+
run: |
|
|
42
|
+
mkdir -p artifacts/coverage
|
|
43
|
+
reportgenerator \
|
|
44
|
+
-reports:".artifacts/SourceGenerators.Tests/TestResults/**/coverage.cobertura.xml" \
|
|
45
|
+
-targetdir:"artifacts/coverage" \
|
|
46
|
+
-reporttypes:"TextSummary;HtmlSummary;Cobertura"
|
|
47
|
+
cat artifacts/coverage/Summary.txt
|
|
48
|
+
|
|
49
|
+
- name: Upload coverage report
|
|
50
|
+
uses: actions/upload-artifact@v4
|
|
51
|
+
with:
|
|
52
|
+
name: generator-coverage
|
|
53
|
+
path: artifacts/coverage
|
|
54
|
+
|
|
55
|
+
- name: Check for TODO/FIXME markers
|
|
56
|
+
shell: bash
|
|
57
|
+
run: |
|
|
58
|
+
set -uo pipefail
|
|
59
|
+
if rg --files-with-matches "(TODO|FIXME)" \
|
|
60
|
+
--hidden \
|
|
61
|
+
--no-ignore \
|
|
62
|
+
-g '!.git/**' \
|
|
63
|
+
-g '!.artifacts/**' \
|
|
64
|
+
-g '!node_modules/**' \
|
|
65
|
+
-g '!Tests/**/TestResults/**' \
|
|
66
|
+
-g '!PLAN.md' \
|
|
67
|
+
-g '!.vs/**'; then
|
|
68
|
+
echo "::error::Found TODO/FIXME markers in the repository. Please resolve or suppress them."
|
|
69
|
+
exit 1
|
|
70
|
+
else
|
|
71
|
+
echo "No TODO/FIXME markers detected."
|
|
72
|
+
fi
|
package/.lychee.toml
CHANGED
|
@@ -17,10 +17,12 @@ accept = ["200..=299", 429]
|
|
|
17
17
|
# Only check web links
|
|
18
18
|
scheme = ["https", "http"]
|
|
19
19
|
|
|
20
|
-
# Ignore
|
|
20
|
+
# Ignore endpoints that block automated clients (local hosts, CF challenges)
|
|
21
21
|
exclude = [
|
|
22
22
|
"^https?://localhost",
|
|
23
23
|
"^http://127\\.0\\.0\\.1",
|
|
24
24
|
"^https?://0\\.0\\.0\\.0",
|
|
25
|
-
"^file://"
|
|
25
|
+
"^file://",
|
|
26
|
+
# NPM package page serves a Cloudflare JS challenge to non-browser clients; registry endpoint remains covered.
|
|
27
|
+
"^https://www\\.npmjs\\.com/package/com\\.wallstop-studios\\.dxmessaging$"
|
|
26
28
|
]
|
package/AGENTS.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Project Structure & Module Organization
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
- Package manifest:
|
|
5
|
+
- [Runtime](Runtime/) — core library (`DxMessaging.Core`) and Unity components (`DxMessaging.Unity`).
|
|
6
|
+
- [Editor](Editor/) — editor utilities, analyzers, and setup (`DxMessaging.Editor`).
|
|
7
|
+
- [SourceGenerators](SourceGenerators/) — Roslyn source generators (`netstandard2.0`).
|
|
8
|
+
- [Tests/Runtime](Tests/Runtime/) — NUnit/Unity Test Framework tests (e.g., [Core Nominal tests](Tests/Runtime/Core/NominalTests.cs)).
|
|
9
|
+
- [Docs](Docs/) — usage patterns and examples.
|
|
10
|
+
- Package manifest: [package.json](package.json) (published to NPM/UPM).
|
|
11
11
|
|
|
12
12
|
## Build, Test, and Development Commands
|
|
13
13
|
|
|
@@ -17,18 +17,19 @@
|
|
|
17
17
|
|
|
18
18
|
## Coding Style & Naming Conventions
|
|
19
19
|
|
|
20
|
-
- Indent with 4 spaces for `.cs` (JSON/YAML: 2). CRLF, UTF‑8 BOM (see
|
|
20
|
+
- Indent with 4 spaces for `.cs` (JSON/YAML: 2). CRLF, UTF‑8 BOM (see [.editorconfig](.editorconfig)).
|
|
21
21
|
- Prefer explicit types over `var`. Braces required. `using` directives inside the namespace.
|
|
22
|
-
- Naming: `PascalCase` for types/methods/properties; interfaces `I*`; type parameters `T*`; events prefixed `On*`; public fields lowerCamelCase (matches examples in
|
|
22
|
+
- Naming: `PascalCase` for types/methods/properties; interfaces `I*`; type parameters `T*`; events prefixed `On*`; public fields lowerCamelCase (matches examples in the [README](README.md)).
|
|
23
23
|
- Place code under `DxMessaging.Core`, `DxMessaging.Unity`, or `DxMessaging.Editor` as appropriate.
|
|
24
24
|
- Do not use underscores in function names, especially test function names.
|
|
25
25
|
- Do not use regions, anywhere, ever.
|
|
26
26
|
- Avoid `var` wherever possible, use expressive types.
|
|
27
|
+
- Do not use nullable reference types.
|
|
27
28
|
|
|
28
29
|
## Testing Guidelines
|
|
29
30
|
|
|
30
31
|
- Frameworks: NUnit + Unity Test Framework. Use `[Test]`/`[UnityTest]` as needed.
|
|
31
|
-
- Location: add files under
|
|
32
|
+
- Location: add files under [Tests/Runtime](Tests/Runtime/) `<Area>/` named `*Tests.cs` with classes `*Tests`.
|
|
32
33
|
- Keep tests independent: prefer a local `MessageBus` and explicit `MessageRegistrationToken` lifecycles.
|
|
33
34
|
- Do not use underscores in test function names.
|
|
34
35
|
- Prefer expressive assertions and failure messages so it is clear what exactly is failing when a test fails.
|
|
@@ -42,10 +43,10 @@
|
|
|
42
43
|
## Commit & Pull Request Guidelines
|
|
43
44
|
|
|
44
45
|
- Commits: short, imperative subject; group related changes; reference issues/PRs (e.g., “Fix registration dedupe (#123)”).
|
|
45
|
-
- PRs: include a clear description, linked issues, before/after notes for performance changes (see
|
|
46
|
-
- Releasing: changes to
|
|
46
|
+
- PRs: include a clear description, linked issues, before/after notes for performance changes (see [Tests/Runtime/Benchmarks](Tests/Runtime/Benchmarks/)), and tests for bug fixes/features.
|
|
47
|
+
- Releasing: changes to [package.json](package.json) on `master` may trigger the NPM publish workflow.
|
|
47
48
|
|
|
48
49
|
## Security & Configuration Tips
|
|
49
50
|
|
|
50
|
-
- Editor analyzer DLLs are copied into the Unity project by
|
|
51
|
+
- Editor analyzer DLLs are copied into the Unity project by [SetupCscRsp.cs](Editor/SetupCscRsp.cs); do not commit generated DLLs into this repo.
|
|
51
52
|
- Keep public APIs minimal and consistent; avoid breaking changes without a major version bump.
|
package/Docs/Comparisons.md
CHANGED
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
|
|
29
29
|
## Performance Benchmarks
|
|
30
30
|
|
|
31
|
-
These sections are auto-updated by the PlayMode comparison benchmarks in
|
|
31
|
+
These sections are auto-updated by the PlayMode comparison benchmarks in the [Comparison Performance PlayMode tests](../Tests/Runtime/Benchmarks/ComparisonPerformanceTests.cs). Run the suite locally to refresh the tables.
|
|
32
32
|
|
|
33
33
|
### Comparisons (Windows)
|
|
34
34
|
|
|
35
35
|
| Message Tech | Operations / Second | Allocations? |
|
|
36
36
|
| ---------------------------------- | ------------------- | ------------ |
|
|
37
|
-
| DxMessaging (Untargeted) - No-Copy | 14,
|
|
38
|
-
| UniRx MessageBroker |
|
|
39
|
-
| MessagePipe (Global) |
|
|
40
|
-
| Zenject SignalBus | 2,
|
|
37
|
+
| DxMessaging (Untargeted) - No-Copy | 14,640,000 | No |
|
|
38
|
+
| UniRx MessageBroker | 18,074,000 | No |
|
|
39
|
+
| MessagePipe (Global) | 97,824,000 | No |
|
|
40
|
+
| Zenject SignalBus | 2,354,000 | Yes |
|
|
41
41
|
|
|
42
42
|
### Comparisons (macOS)
|
|
43
43
|
|
package/Docs/Install.md
CHANGED
|
@@ -9,7 +9,8 @@ This page helps you install DxMessaging into a Unity 2021.3+ project using the U
|
|
|
9
9
|
- Unity Package Manager > Add package from git URL...
|
|
10
10
|
- Paste:
|
|
11
11
|
|
|
12
|
-
```
|
|
12
|
+
```bash
|
|
13
|
+
# Unity UPM: Add package from git URL...
|
|
13
14
|
https://github.com/wallstop/DxMessaging.git
|
|
14
15
|
```
|
|
15
16
|
|
|
@@ -36,7 +36,7 @@ new GameEvent().Emit(); // Both DoWork() and ProcessLater() execute
|
|
|
36
36
|
- Ensures all listeners see a consistent view of the registration state
|
|
37
37
|
- Makes debugging and reasoning about message flow easier
|
|
38
38
|
|
|
39
|
-
This snapshot behavior is extensively tested in
|
|
39
|
+
This snapshot behavior is extensively tested in the [Mutation During Emission tests](../Tests/Runtime/Core/MutationDuringEmissionTests.cs).
|
|
40
40
|
|
|
41
41
|
---
|
|
42
42
|
|
package/Docs/Performance.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Performance Benchmarks
|
|
2
2
|
|
|
3
|
-
This page is auto-updated by the Unity PlayMode benchmark tests in
|
|
3
|
+
This page is auto-updated by the Unity PlayMode benchmark tests in the [Performance PlayMode benchmark suite](../Tests/Runtime/Benchmarks/PerformanceTests.cs).
|
|
4
4
|
|
|
5
5
|
How it works:
|
|
6
6
|
|
|
@@ -8,21 +8,23 @@ How it works:
|
|
|
8
8
|
- The benchmark test writes an OS-specific section below with a markdown table.
|
|
9
9
|
- CI runs skip writing to avoid noisy diffs.
|
|
10
10
|
|
|
11
|
-
See also:
|
|
11
|
+
See also: [Performance optimizations](./DesignAndArchitecture.md#performance-optimizations) for design details.
|
|
12
12
|
|
|
13
13
|
## Windows
|
|
14
14
|
|
|
15
|
-
| Message Tech
|
|
16
|
-
|
|
|
17
|
-
| Unity
|
|
18
|
-
| DxMessaging (GameObject) - Normal
|
|
19
|
-
| DxMessaging (Component) - Normal
|
|
20
|
-
| DxMessaging (GameObject) - No-Copy
|
|
21
|
-
| DxMessaging (Component) - No-Copy
|
|
22
|
-
| DxMessaging (Untargeted) - No-Copy
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
| Reflexive (
|
|
15
|
+
| Message Tech | Operations / Second | Allocations? |
|
|
16
|
+
| ------------------------------------------ | ------------------- | ------------ |
|
|
17
|
+
| Unity | 2,504,000 | Yes |
|
|
18
|
+
| DxMessaging (GameObject) - Normal | 8,522,000 | No |
|
|
19
|
+
| DxMessaging (Component) - Normal | 8,524,000 | No |
|
|
20
|
+
| DxMessaging (GameObject) - No-Copy | 9,398,000 | No |
|
|
21
|
+
| DxMessaging (Component) - No-Copy | 9,508,000 | No |
|
|
22
|
+
| DxMessaging (Untargeted) - No-Copy | 14,742,000 | No |
|
|
23
|
+
| DxMessaging (Untargeted) - Interceptors | 6,620,000 | No |
|
|
24
|
+
| DxMessaging (Untargeted) - Post-Processors | 5,234,000 | No |
|
|
25
|
+
| Reflexive (One Argument) | 2,840,000 | No |
|
|
26
|
+
| Reflexive (Two Arguments) | 2,352,000 | No |
|
|
27
|
+
| Reflexive (Three Arguments) | 2,318,000 | No |
|
|
26
28
|
|
|
27
29
|
## macOS
|
|
28
30
|
|
package/Docs/QuickReference.md
CHANGED
|
@@ -106,7 +106,7 @@ public sealed class DamageSystem : IStartable, IDisposable
|
|
|
106
106
|
}
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
Tip: Define `ZENJECT_PRESENT`, `VCONTAINER_PRESENT`, or `REFLEX_PRESENT` to enable the optional shims under
|
|
109
|
+
Tip: Define `ZENJECT_PRESENT`, `VCONTAINER_PRESENT`, or `REFLEX_PRESENT` to enable the optional shims under [Runtime/Unity/Integrations](../Runtime/Unity/Integrations/) that bind the builder automatically for those containers.
|
|
110
110
|
|
|
111
111
|
Interceptors and post‑processors
|
|
112
112
|
|
package/Docs/Reference.md
CHANGED
|
@@ -64,11 +64,11 @@ Unity bridge types
|
|
|
64
64
|
|
|
65
65
|
Source files (for exploration)
|
|
66
66
|
|
|
67
|
-
- Message bus interface: Runtime/Core/MessageBus/IMessageBus.cs
|
|
68
|
-
- Message bus: Runtime/Core/MessageBus/MessageBus.cs
|
|
69
|
-
- Message handler/token: Runtime/Core/MessageHandler.cs, Runtime/Core/MessageRegistrationToken.cs
|
|
70
|
-
- Emit helpers: Runtime/Core/Extensions/MessageExtensions.cs
|
|
71
|
-
- Attributes: Runtime/Core/Attributes
|
|
67
|
+
- Message bus interface: [IMessageBus](../Runtime/Core/MessageBus/IMessageBus.cs)
|
|
68
|
+
- Message bus: [MessageBus](../Runtime/Core/MessageBus/MessageBus.cs)
|
|
69
|
+
- Message handler/token: [MessageHandler](../Runtime/Core/MessageHandler.cs), [MessageRegistrationToken](../Runtime/Core/MessageRegistrationToken.cs)
|
|
70
|
+
- Emit helpers: [MessageExtensions](../Runtime/Core/Extensions/MessageExtensions.cs)
|
|
71
|
+
- Attributes: [Attributes directory](../Runtime/Core/Attributes/)
|
|
72
72
|
|
|
73
73
|
API tables (quick view)
|
|
74
74
|
|
|
Binary file
|
|
@@ -11,15 +11,26 @@ PluginImporter:
|
|
|
11
11
|
isExplicitlyReferenced: 0
|
|
12
12
|
validateReferences: 1
|
|
13
13
|
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
: Any
|
|
16
|
+
second:
|
|
17
|
+
enabled: 0
|
|
18
|
+
settings:
|
|
19
|
+
Exclude Editor: 0
|
|
20
|
+
Exclude Linux64: 1
|
|
21
|
+
Exclude OSXUniversal: 1
|
|
22
|
+
Exclude WebGL: 1
|
|
23
|
+
Exclude Win: 1
|
|
24
|
+
Exclude Win64: 1
|
|
14
25
|
- first:
|
|
15
26
|
Any:
|
|
16
27
|
second:
|
|
17
|
-
enabled:
|
|
28
|
+
enabled: 0
|
|
18
29
|
settings: {}
|
|
19
30
|
- first:
|
|
20
31
|
Editor: Editor
|
|
21
32
|
second:
|
|
22
|
-
enabled:
|
|
33
|
+
enabled: 1
|
|
23
34
|
settings:
|
|
24
35
|
DefaultValueInitialized: true
|
|
25
36
|
- first:
|
|
Binary file
|
|
@@ -11,6 +11,17 @@ PluginImporter:
|
|
|
11
11
|
isExplicitlyReferenced: 0
|
|
12
12
|
validateReferences: 1
|
|
13
13
|
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
: Any
|
|
16
|
+
second:
|
|
17
|
+
enabled: 0
|
|
18
|
+
settings:
|
|
19
|
+
Exclude Editor: 0
|
|
20
|
+
Exclude Linux64: 1
|
|
21
|
+
Exclude OSXUniversal: 1
|
|
22
|
+
Exclude WebGL: 1
|
|
23
|
+
Exclude Win: 1
|
|
24
|
+
Exclude Win64: 1
|
|
14
25
|
- first:
|
|
15
26
|
Any:
|
|
16
27
|
second:
|
|
Binary file
|
|
@@ -11,6 +11,17 @@ PluginImporter:
|
|
|
11
11
|
isExplicitlyReferenced: 0
|
|
12
12
|
validateReferences: 1
|
|
13
13
|
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
: Any
|
|
16
|
+
second:
|
|
17
|
+
enabled: 0
|
|
18
|
+
settings:
|
|
19
|
+
Exclude Editor: 0
|
|
20
|
+
Exclude Linux64: 1
|
|
21
|
+
Exclude OSXUniversal: 1
|
|
22
|
+
Exclude WebGL: 1
|
|
23
|
+
Exclude Win: 1
|
|
24
|
+
Exclude Win64: 1
|
|
14
25
|
- first:
|
|
15
26
|
Any:
|
|
16
27
|
second:
|
|
Binary file
|
|
@@ -11,15 +11,26 @@ PluginImporter:
|
|
|
11
11
|
isExplicitlyReferenced: 0
|
|
12
12
|
validateReferences: 1
|
|
13
13
|
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
: Any
|
|
16
|
+
second:
|
|
17
|
+
enabled: 0
|
|
18
|
+
settings:
|
|
19
|
+
Exclude Editor: 0
|
|
20
|
+
Exclude Linux64: 1
|
|
21
|
+
Exclude OSXUniversal: 1
|
|
22
|
+
Exclude WebGL: 1
|
|
23
|
+
Exclude Win: 1
|
|
24
|
+
Exclude Win64: 1
|
|
14
25
|
- first:
|
|
15
26
|
Any:
|
|
16
27
|
second:
|
|
17
|
-
enabled:
|
|
28
|
+
enabled: 0
|
|
18
29
|
settings: {}
|
|
19
30
|
- first:
|
|
20
31
|
Editor: Editor
|
|
21
32
|
second:
|
|
22
|
-
enabled:
|
|
33
|
+
enabled: 1
|
|
23
34
|
settings:
|
|
24
35
|
DefaultValueInitialized: true
|
|
25
36
|
- first:
|
|
Binary file
|
|
@@ -11,6 +11,17 @@ PluginImporter:
|
|
|
11
11
|
isExplicitlyReferenced: 0
|
|
12
12
|
validateReferences: 1
|
|
13
13
|
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
: Any
|
|
16
|
+
second:
|
|
17
|
+
enabled: 0
|
|
18
|
+
settings:
|
|
19
|
+
Exclude Editor: 0
|
|
20
|
+
Exclude Linux64: 1
|
|
21
|
+
Exclude OSXUniversal: 1
|
|
22
|
+
Exclude WebGL: 1
|
|
23
|
+
Exclude Win: 1
|
|
24
|
+
Exclude Win64: 1
|
|
14
25
|
- first:
|
|
15
26
|
Any:
|
|
16
27
|
second:
|
|
Binary file
|
|
@@ -18,9 +18,10 @@ PluginImporter:
|
|
|
18
18
|
second:
|
|
19
19
|
enabled: 0
|
|
20
20
|
settings:
|
|
21
|
-
Exclude Editor:
|
|
21
|
+
Exclude Editor: 0
|
|
22
22
|
Exclude Linux64: 1
|
|
23
23
|
Exclude OSXUniversal: 1
|
|
24
|
+
Exclude WebGL: 1
|
|
24
25
|
Exclude Win: 1
|
|
25
26
|
Exclude Win64: 1
|
|
26
27
|
- first:
|
|
@@ -31,7 +32,7 @@ PluginImporter:
|
|
|
31
32
|
- first:
|
|
32
33
|
Editor: Editor
|
|
33
34
|
second:
|
|
34
|
-
enabled:
|
|
35
|
+
enabled: 1
|
|
35
36
|
settings:
|
|
36
37
|
CPU: AnyCPU
|
|
37
38
|
DefaultValueInitialized: true
|
|
@@ -7,6 +7,7 @@ namespace DxMessaging.Editor.CustomEditors
|
|
|
7
7
|
using Core.Diagnostics;
|
|
8
8
|
using Core.MessageBus;
|
|
9
9
|
using Core.Messages;
|
|
10
|
+
using DxMessaging.Editor.Testing;
|
|
10
11
|
using Unity;
|
|
11
12
|
using UnityEditor;
|
|
12
13
|
using UnityEngine;
|
|
@@ -36,6 +37,9 @@ namespace DxMessaging.Editor.CustomEditors
|
|
|
36
37
|
_listenerFoldouts.Clear();
|
|
37
38
|
}
|
|
38
39
|
|
|
40
|
+
/// <summary>
|
|
41
|
+
/// Draws the custom inspector, including diagnostics summaries and listener management controls.
|
|
42
|
+
/// </summary>
|
|
39
43
|
public override void OnInspectorGUI()
|
|
40
44
|
{
|
|
41
45
|
base.OnInspectorGUI();
|
|
@@ -66,6 +70,26 @@ namespace DxMessaging.Editor.CustomEditors
|
|
|
66
70
|
return;
|
|
67
71
|
}
|
|
68
72
|
|
|
73
|
+
MessagingComponentInspectorState inspectorState =
|
|
74
|
+
MessagingComponentEditorHarness.Capture(component);
|
|
75
|
+
ProviderDiagnosticsView providerDiagnostics = inspectorState.ProviderDiagnostics;
|
|
76
|
+
|
|
77
|
+
if (providerDiagnostics.SerializedProviderMissingWarning)
|
|
78
|
+
{
|
|
79
|
+
EditorGUILayout.HelpBox(
|
|
80
|
+
"Auto-configure serialized provider is enabled, but no provider asset is assigned.",
|
|
81
|
+
MessageType.Warning
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (providerDiagnostics.SerializedProviderNullBusWarning)
|
|
86
|
+
{
|
|
87
|
+
EditorGUILayout.HelpBox(
|
|
88
|
+
"The serialized provider resolved without returning a message bus. Verify the provider implementation.",
|
|
89
|
+
MessageType.Warning
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
69
93
|
if (component._registeredListeners.Count == 0)
|
|
70
94
|
{
|
|
71
95
|
EditorGUILayout.LabelField("No listeners registered.");
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
namespace DxMessaging.Editor
|
|
2
2
|
{
|
|
3
3
|
#if UNITY_EDITOR
|
|
4
|
+
using Core;
|
|
4
5
|
using Core.MessageBus;
|
|
5
6
|
using Settings;
|
|
6
7
|
using UnityEditor;
|
|
8
|
+
using UnityEngine;
|
|
7
9
|
|
|
8
10
|
/// <summary>
|
|
9
11
|
/// Applies DxMessaging Editor settings to global runtime defaults on domain load.
|
|
@@ -11,12 +13,67 @@ namespace DxMessaging.Editor
|
|
|
11
13
|
[InitializeOnLoad]
|
|
12
14
|
public static class DxMessagingEditorInitializer
|
|
13
15
|
{
|
|
16
|
+
private static bool s_playModeWarningIssued;
|
|
17
|
+
|
|
14
18
|
static DxMessagingEditorInitializer()
|
|
15
19
|
{
|
|
20
|
+
EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
|
|
21
|
+
ApplyEditorSettings();
|
|
22
|
+
WarnIfDomainReloadDisabled();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private static void OnPlayModeStateChanged(PlayModeStateChange stateChange)
|
|
26
|
+
{
|
|
27
|
+
if (
|
|
28
|
+
stateChange == PlayModeStateChange.EnteredEditMode
|
|
29
|
+
|| stateChange == PlayModeStateChange.EnteredPlayMode
|
|
30
|
+
)
|
|
31
|
+
{
|
|
32
|
+
ApplyEditorSettings();
|
|
33
|
+
WarnIfDomainReloadDisabled();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
|
38
|
+
private static void ApplySettingsBeforeSceneLoad()
|
|
39
|
+
{
|
|
40
|
+
if (!Application.isPlaying)
|
|
41
|
+
{
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
ApplyEditorSettings();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private static void ApplyEditorSettings()
|
|
49
|
+
{
|
|
50
|
+
DxMessagingStaticState.Reset();
|
|
16
51
|
DxMessagingSettings settings = DxMessagingSettings.GetOrCreateSettings();
|
|
17
|
-
IMessageBus.
|
|
52
|
+
IMessageBus.GlobalDiagnosticsTargets = settings.DiagnosticsTargets;
|
|
18
53
|
IMessageBus.GlobalMessageBufferSize = settings.MessageBufferSize;
|
|
19
54
|
}
|
|
55
|
+
|
|
56
|
+
private static void WarnIfDomainReloadDisabled()
|
|
57
|
+
{
|
|
58
|
+
DxMessagingSettings settings = DxMessagingSettings.GetOrCreateSettings();
|
|
59
|
+
if (
|
|
60
|
+
s_playModeWarningIssued
|
|
61
|
+
|| settings.SuppressDomainReloadWarning
|
|
62
|
+
|| !EditorSettings.enterPlayModeOptionsEnabled
|
|
63
|
+
|| (EditorSettings.enterPlayModeOptions & EnterPlayModeOptions.DisableDomainReload)
|
|
64
|
+
== 0
|
|
65
|
+
)
|
|
66
|
+
{
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
s_playModeWarningIssued = true;
|
|
71
|
+
Debug.LogWarning(
|
|
72
|
+
"[DxMessaging] Enter Play Mode Options are disabling domain reload. "
|
|
73
|
+
+ "DxMessaging resets its internal statics, but third-party static state will persist. "
|
|
74
|
+
+ "Audit integration code or re-enable domain reload if inconsistent behaviour occurs."
|
|
75
|
+
);
|
|
76
|
+
}
|
|
20
77
|
}
|
|
21
78
|
#endif
|
|
22
79
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
namespace DxMessaging.Editor
|
|
2
|
+
{
|
|
3
|
+
#if UNITY_EDITOR
|
|
4
|
+
using Core;
|
|
5
|
+
using Core.MessageBus;
|
|
6
|
+
using UnityEditor;
|
|
7
|
+
using UnityEngine;
|
|
8
|
+
|
|
9
|
+
internal static class DxMessagingMenu
|
|
10
|
+
{
|
|
11
|
+
private const string Root = "Tools/Wallstop Studios/DxMessaging/";
|
|
12
|
+
|
|
13
|
+
[MenuItem(Root + "Reset Static State")]
|
|
14
|
+
private static void ResetStatics()
|
|
15
|
+
{
|
|
16
|
+
DxMessagingStaticState.Reset();
|
|
17
|
+
Debug.Log("[DxMessaging] Static state reset.");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
[MenuItem(Root + "Toggle Global Diagnostics")]
|
|
21
|
+
private static void ToggleGlobalDiagnostics()
|
|
22
|
+
{
|
|
23
|
+
DiagnosticsTarget current = IMessageBus.GlobalDiagnosticsTargets;
|
|
24
|
+
DiagnosticsTarget next = current switch
|
|
25
|
+
{
|
|
26
|
+
DiagnosticsTarget.Off => DiagnosticsTarget.Editor,
|
|
27
|
+
DiagnosticsTarget.Editor => DiagnosticsTarget.Runtime,
|
|
28
|
+
DiagnosticsTarget.Runtime => DiagnosticsTarget.All,
|
|
29
|
+
DiagnosticsTarget.All => DiagnosticsTarget.Off,
|
|
30
|
+
_ => DiagnosticsTarget.Off,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
IMessageBus.GlobalDiagnosticsTargets = next;
|
|
34
|
+
Debug.Log($"[DxMessaging] Global diagnostics targets set to {next}.");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
#endif
|
|
38
|
+
}
|