Refactor LogicComponent to use JsSyncManager infrastructure #496
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors the
LogicComponentbase class and its subclasses to use the newJsSyncManagerinfrastructure. It is a stacked PR that builds on top of #495 (protobuf implementation) and should be merged after that PR is completed.Depends on: #495 (Implement protobuf serialization and component updates)
Related Pro PR: https://github.com/dymaptic/GeoBlazor.Pro/pull/220 - These PRs should be reviewed together as they contain coordinated changes across both repositories.
What's Included
LogicComponent Refactoring
LogicComponent.cs- Major refactoring:IAppValidator,IJSRuntime,JsModuleManager,AuthenticationManagerIDisposablepattern in favor of managed lifecycleInvokeAsync<T>andInvokeVoidAsyncmethods usingJsSyncManagerextension methods[CallerMemberName]for automatic method name resolutionIsServerproperty for runtime detectionJsModuleManager Updates
GetLogicComponentmethod to retrieve/create JavaScript wrappers for logic componentsGetProLogicComponentmethod for Pro componentsStringExtensions
ToUpperFirstCharextension method (mirrors existingToLowerFirstChar)GeometryEngine Updates
InvokeAsynccalls to use new signature withclassNameandparameters:array[SerializedMethod]attributes for protobuf serialization supportProjectionEngine Updates
[SerializedMethod]attributesLocationService Updates
[SerializedMethod]attributesTypeScript Updates
geoBlazorCore.ts- Added wrapper getter functions for logic componentsgeometryEngine.ts- Updated wrapper implementationprojectionEngine.ts- Renamed fromprojection.ts, updated wrapperlocationService.ts- Updated wrapper implementationgeometry.ts,polygon.ts,polyline.ts- Geometry serialization updatesTest Updates
GeometryEngineTests.cs- Additional comprehensive tests (~161 lines)Breaking Changes
GeometryEngine,ProjectionEngine,LocationService)AddGeoBlazor()extension methodKey Pattern Changes
Before:
After:
Relationship to PR Series
This PR is part of a planned series to merge changes from
feature/478-multipart-operatorincrementally (see BRANCH_DIVERGENCE_ANALYSIS.md):Statistics
Test Plan
🤖 Generated with Claude Code