-
Notifications
You must be signed in to change notification settings - Fork 186
refactor: Replace type info system with universal @v format #22373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Implemented server-to-client bean serialization with lazy Component resolution: - Server-side: Added BEAN_TYPE=5 to JacksonCodec with custom Component serializer * Components serialize as {"__vaadinType": "component", "nodeId": <id>} * Uses Jackson ObjectMapper with field visibility configuration * Handles nested beans and arrays automatically - Client-side: Added bean deserialization to ClientJsonCodec * Lazy component resolution - components are resolved when accessed * Native JavaScript function for component field access * Supports nested beans with component references - Tests: Comprehensive test coverage * 6 client-side unit tests for bean deserialization * 3 integration tests covering simple beans, nested beans, and component references * All tests passing successfully This enables sending complex Java beans with Component references from server to client via executeJs(), with automatic lazy resolution of components on the client side. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…adin Changed the special key used to identify Vaadin-specific types in JSON from "__vaadinType" to "@vaadin" to further avoid potential conflicts with user data. This applies to Component references in bean serialization. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…texts Changed single Component serialization to use the same format as Components within beans: - Single Components now serialize as [BEAN_TYPE, {"@vaadin": "component", "nodeId": <id>}] - This provides consistency between single Component serialization and Component fields within beans - Added BEAN_TYPE constant to JsonCodec for compatibility - Added test coverage for single Component serialization This unified format simplifies client-side handling and provides a consistent API for all Component serialization scenarios. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Removed NODE_TYPE constant from JsonCodec and JacksonCodec - Updated ClientJsonCodec to no longer handle NODE_TYPE format - Fixed ExecuteJavaScriptProcessorTest to use new component format - Updated decodeStateNode to handle new @vaadin component format - Fixed JacksonCodecTest to expect new component format - Added test for decodeStateNode with new component format - Fixed test assertions to match actual behavior - Clarified comment about GWT.isScript() check for compilation phase - All Component references now use: {"@vaadin": "component", "nodeId": <id>} 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
TC Format Checker Report - 10:00 - 30 - Sep
Here is the list of files with format issues in your PR:
|
Remove the complex array-based type wrapping system (NODE_TYPE, ARRAY_TYPE, RETURN_CHANNEL_TYPE, BEAN_TYPE) in favor of a universal @v format that can be used anywhere in the JSON tree. Key changes: - Components: {"@v": "node", "id": nodeId} (was [0, nodeId]) - Return channels: {"@v": "return", "nodeId": x, "channelId": y} (was [2, x, y]) - Arrays: Use standard JSON arrays without wrapping - Beans: Use standard Jackson serialization with custom serializers Benefits: - Simplified architecture with single universal system - Better performance using native JSON.parse with reviver - More extensible format for future types - Cleaner serialization logic without recursive type detection 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
6fe33cd
to
97d7ed2
Compare
|
Test Results1 167 files - 101 1 167 suites - 101 1h 37m 40s ⏱️ + 20m 59s For more details on these failures and errors, see this check. Results for commit 97d7ed2. ± Comparison against base commit 236a649. This pull request removes 288 and adds 23 tests. Note that renamed tests count towards both.
|
In #22396 |
Remove the complex array-based type wrapping system (NODE_TYPE, ARRAY_TYPE,
RETURN_CHANNEL_TYPE, BEAN_TYPE) in favor of a universal @v format that can
be used anywhere in the JSON tree.
Key changes:
Benefits: