Add dynamic mapping support and improve state synchronization - #8
Merged
Conversation
- Add DynamicValue<T> type for static or function-based values - Make containsDynamicValues public in MappingValidator - Implement re-evaluation of dynamic mappings on selection changes - Add hasDynamicMapping() method to detect dynamic configurations - Add comprehensive tests for dynamic mapping behavior Dynamic mappings allow attribute values to depend on other selections, enabling complex product configurations where available options change based on previous choices.
- Add basic state sync tests for server state changes - Add edge case tests for mapping changes and state updates - Add 3D viewer synchronization tests for onChange callbacks - Add UI synchronization tests for live value updates - Add edge case tests for onChange callback behavior These tests ensure proper separation between client mutations and server state updates, validating that state only changes via STATE_CHANGED events from the server.
- Remove unused Attribute.select() method (only used in tests) - Remove unused getAttributeValueForNode() private method - Remove unused SNAPSHOT_DEVELOPED event name - Remove unused MessageType type alias - Remove associated test files for unused methods These methods and types were identified as dead code through static analysis and were not used anywhere in production code.
- Fix max-depth lint error in updateCurrentState by extracting helper method - Fix import formatting in snapshot test file - Apply prettier formatting to snapshot demo HTML
- Add new node test helpers for creating test nodes - Update create-element helper for better test support - Update DOM helpers for improved test utilities
- Update package dependencies - Update pnpm lock file
- Fix setUiConfig to properly accept Partial<UIConfig> - Fix setViewerConfig to properly accept Partial<ViewerConfig> - This allows partial updates instead of requiring full config objects
- Update camera config messaging tests - Update camera reset tests - Update camera tests - Update snapshot photo tests - Update snapshot message handler tests - Update snapshot tests These updates ensure all tests work correctly with the refactored code and new type definitions.
|
Size Change: +2.42 kB (+1.67%) Total Size: 147 kB
|
- Add mapping-concept.md explaining core concepts with bicycle example - Add static-mapping-examples.md for simple configurations - Add dynamic-mapping-examples.md for advanced dependencies - Use consistent bicycle configurator example throughout - Include positioning concept where components move with frame size
- Remove unused select() method from Attribute class - Remove SNAPSHOT_DEVELOPED event name (never used) - Remove MessageType type alias (redundant) - Remove attribute.test.ts file (method no longer exists) - Clean up codebase by removing unused functionality
- Simplify README.md mapping section to show only high-level concepts - Move detailed mapping explanations to dedicated documentation - Simplify README.npm.md to minimal content with GitHub reference - Fix 'Zero dependencies' claim to 'Minimal dependencies' - Prevent future sync issues between NPM and GitHub READMEs
- Simplify README.md mapping section to show only high-level concepts - Move detailed mapping explanations to dedicated documentation - Simplify README.npm.md to minimal content with GitHub reference - Fix 'Zero dependencies' claim to 'Minimal dependencies' - Prevent future sync issues between NPM and GitHub READMEs
- Apply prettier formatting to dynamic-mapping-examples.md - Move 'Why do we use mapping' section above example in mapping-concept.md - Improve document flow and readability
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Rename files to remove 'examples' suffix for cleaner URLs - Add conceptual introductions to static and dynamic mapping guides - Improve navigation with contextual links between documents - Remove duplicate content between guides - Clarify when to use static vs dynamic mapping - Maintain consistent bicycle example throughout - Use sentence case for all headings - Simplify README files to prevent sync issues
- Remove trailing punctuation from headings - Fix line length violations - Add blank lines around lists - Maintain consistent formatting
HMAZonderland
added a commit
that referenced
this pull request
Aug 5, 2025
The previous PR #8 included: - Dynamic mapping support with DynamicValue<T> type - Automatic re-evaluation of mappings on selection changes - Comprehensive documentation for static and dynamic mapping - Dead code removal from attribute system - Bug fixes for setConfig parameter types
4 tasks
HMAZonderland
added a commit
that referenced
this pull request
Aug 5, 2025
The previous PR #8 included: - Dynamic mapping support with DynamicValue<T> type - Automatic re-evaluation of mappings on selection changes - Comprehensive documentation for static and dynamic mapping - Dead code removal from attribute system - Bug fixes for setConfig parameter types
HMAZonderland
pushed a commit
that referenced
this pull request
Aug 5, 2025
Contributor
Author
|
🎉 This PR is included in version 3.7.0 🎉 The release is available on: Your pull request is in this release 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Changes
Dynamic mapping implementation
hasDynamicMapping()detection to AttributeServicegetVisibleNodesForAttribute()helperDocumentation overhaul
Code cleanup
Attribute.select()methodSNAPSHOT_DEVELOPEDevent (never used)MessageTypetype alias (redundant)README improvements
Test plan