Skip to content

Conversation

@TimPurdum
Copy link
Collaborator

@TimPurdum TimPurdum commented Dec 16, 2025

Summary

This PR implements the full protobuf serialization system and includes various component updates. It is a stacked PR that builds on top of #493 (protobuf infrastructure) and must be merged after that PR is completed.

Depends on: #493 (Add protobuf serialization infrastructure)

Related Pro PR: https://github.com/dymaptic/GeoBlazor.Pro/pull/219 - These PRs should be reviewed together as they contain coordinated changes across both repositories.

What's Included

Protobuf Serialization Implementation (PR 1.5 from divergence analysis)

  • ProtobufSerializationRecords.cs (~2,846 lines) - Complete protobuf record definitions for all serializable types
  • geoblazorProto.ts - TypeScript protobuf handling for binary serialization/deserialization
  • JsSyncManager.cs - Full implementation of protobuf invocation for JS interop
  • IJSStreamReferenceHelper.cs - Enhanced streaming support for binary data transfer
  • copyProtobuf.ps1 - Build script for protobuf file management

Geometry & Graphics Enhancements

  • Updated Geometry.cs, Point.cs, Polygon.cs, Polyline.cs, Extent.cs with protobuf support
  • Enhanced Graphic.cs with improved serialization
  • Updated Symbol.cs and derived symbol classes

Mesh Geometry Support (3D)

  • New MeshComponent.cs and MeshComponent.gb.cs - Base mesh component
  • MeshMaterial.cs/.gb.cs - Mesh material definitions
  • MeshMaterialMetallicRoughness.cs/.gb.cs - PBR material support
  • MeshTexture.cs - Texture handling
  • MeshTextureTransform.cs/.gb.cs - Texture transformation
  • MeshTransform.cs/.gb.cs - Mesh spatial transforms
  • MeshVertexAttributes.cs/.gb.cs - Vertex attribute definitions
  • MeshGeoreferencedVertexSpace.cs, MeshLocalVertexSpace.cs - Vertex space types

Popup System Updates

  • Enhanced PopupContent.cs, PopupTemplate.cs, PopupExpressionInfo.cs
  • Updated all popup content types (Attachments, Expression, Fields, Media, Relationship, Text)

Component Updates

  • MapView.razor.cs - Enhanced view with protobuf support
  • MapComponent.razor.cs - Base component updates
  • Various widget updates (Search, Locate, Bookmarks, etc.)
  • Media info components (Chart, Image, Pie)
  • Field info and format components

Source Generator Updates

  • Updated ProtobufSourceGenerator.cs
  • New CoreSourceGeneratorTests.cs with comprehensive test coverage
  • Removed deprecated ESBuildLauncherTests.cs
  • Added RoslynUtility.cs for test utilities

TypeScript Updates

  • arcGisJsInterop.ts - Major updates for protobuf integration
  • baseComponent.ts - New base component utilities
  • geoBlazorCore.ts - Core module updates
  • mapView.ts - MapView TypeScript enhancements
  • graphic.ts - Graphic handling updates

Performance Benefits

Binary serialization via protobuf-net provides significant improvements for Blazor Server scenarios:

  • Reduced payload size: Binary format is more compact than JSON
  • Faster serialization/deserialization: Protobuf is optimized for speed
  • Streaming support: Enables efficient transfer of large datasets (graphics, geometries)

Relationship to PR Series

This PR is part of a planned series to merge changes from feature/478-multipart-operator incrementally (see BRANCH_DIVERGENCE_ANALYSIS.md):

  1. PR Add protobuf serialization infrastructure #493: Protobuf Infrastructure ← Must be merged first
  2. This PR: Protobuf Implementation ← Current
  3. LogicComponent Refactoring (future)
  4. GeometryEngine Enhancements (future)
  5. Additional feature PRs...

Statistics

  • 170 files changed
  • ~10,151 lines added
  • ~2,709 lines removed

Test Plan

  • Verified Core project builds successfully
  • Ran existing unit tests (ran tests commit)
  • Run source generator tests
  • Verify protobuf serialization round-trips work correctly
  • Test in both Blazor Server and WebAssembly scenarios

Review Notes

Please review this PR alongside the Pro PR:

The mesh component additions in this PR correspond to mesh component removals in the Pro PR (moved from Pro to Core).

🤖 Generated with Claude Code

TimPurdum and others added 10 commits December 9, 2025 16:54
- Add protobuf-net package for binary serialization support
- Add ProtobufSerializationBase.cs with base records for serialization
- Add IProtobufSerializable interface for type contracts
- Add ProtobufSerializableAttribute and SerializedMethodAttribute
- Add JsSyncManager stub for JS interop with protobuf support
- Add ProtobufSourceGenerator skeleton for future serialization code generation
- Update ESBuildGenerator to use new shared project structure
- Add SourceGenerator.Shared project with ProcessHelper and extension methods
- Update Directory.Build.props with CoreProjectPath for source generators

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add TODO comments to placeholder implementations (SerializationExtensions,
  JsSyncManager, ProtobufSourceGenerator) documenting future work
- Document ProtoMember(1000) magic number - reserved for base class properties
  to avoid conflicts with derived class tags (1-999)
- Improve GeoBlazorMetaData exception handling - catch FileNotFoundException
  specifically instead of bare catch
- Add XML documentation to GeoBlazorMetaData class and properties
- Fix duplicate logging bug in ProcessHelper - output was being logged in
  ExitedCommandEvent then cleared, making error diagnostics empty

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants