Open satoren opened 1 month ago
This pull request introduces a significant enhancement to the Yex
library by adding numerous functions and modules for observing changes across various data structures, including arrays, maps, text, and XML elements. New observation functions are implemented in both Elixir and Rust, allowing developers to subscribe to changes and receive notifications through events. Additionally, new event structures are defined to facilitate this observation mechanism. The changes also include comprehensive tests to ensure the correct functionality of these new features.
File Path | Change Summary |
---|---|
lib/nif.ex | Added functions for observing changes in text, arrays, maps, and XML elements (e.g., text_observe/5 , array_observe/5 ). |
lib/protocols/awareness.ex | Updated module documentation; removed example without changing functionality. |
lib/shared_type/array.ex | Introduced observe/2 and observe_deep/2 functions for observing arrays. |
lib/shared_type/event.ex | Added modules for different event types: Yex.ArrayEvent , Yex.MapEvent , Yex.TextEvent , Yex.XmlEvent , Yex.XmlTextEvent . |
lib/shared_type/map.ex | Introduced observe/2 and observe_deep/2 functions for observing maps. |
lib/shared_type/shared_type.ex | Added Yex.SharedType protocol with functions for observing shared types. |
lib/shared_type/text.ex | Introduced observe/2 and observe_deep/2 functions for observing text changes. |
lib/shared_type/xml_element.ex | Added observe/2 and observe_deep/2 functions for observing XML elements. |
lib/shared_type/xml_fragment.ex | Introduced observe/2 and observe_deep/2 functions for observing XML fragments. |
lib/shared_type/xml_text.ex | Added observe/2 and observe_deep/2 functions for observing XML text. |
native/yex/src/array.rs | Implemented new traits for NifArray and added array_observe and array_observe_deep functions. |
native/yex/src/atoms.rs | Added new atoms for event observation. |
native/yex/src/event.rs | Introduced structures for event handling related to shared types. |
native/yex/src/lib.rs | Added new module event . |
native/yex/src/map.rs | Enhanced NifMap with observable traits and added map_observe and map_observe_deep functions. |
native/yex/src/subscription.rs | Updated subscription handling with new methods and changed return types. |
native/yex/src/text.rs | Enhanced NifText with observable traits and added text_observe and text_observe_deep functions. |
native/yex/src/xml.rs | Enhanced XML-related structs with observable traits and added corresponding observe functions. |
test/shared_type/array_test.exs | Added tests for array observation functions. |
test/shared_type/map_test.exs | Added tests for map observation functions. |
test/shared_type/shared_type_test.exs | Introduced tests for the SharedType protocol. |
test/shared_type/text_test.exs | Added tests for text observation functionality. |
test/shared_type/xml_element_test.exs | Added tests for observing XML element changes. |
test/shared_type/xml_fragment_test.exs | Added tests for observing XML fragment changes. |
test/shared_type/xml_text_test.exs | Added tests for observing XML text changes. |
Yex.Nif
module, which aligns with the main PR's focus on observing changes in XML elements and fragments.Yex.Awareness
module, which may interact with the observation functions in the main PR, although it does not directly modify the observation functionality.Yex.DocServer
, which could be relevant to the overall functionality of document handling and observation in the main PR.Yex.Sync.SharedDoc
module to manage awareness states, which could be relevant to the observation mechanisms introduced in the main PR.🐰 In the land of Yex, where data flows,
Observing changes, our excitement grows!
With arrays and maps, we watch them dance,
XML elements too, in a wondrous trance.
So hop along, dear friends, let's celebrate,
For in this code, we’ve opened the gate! 🎉
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Unlike the original observe/observe_deep, it is not called in the middle of a transaction. It is called in the form of a process message after the transaction is completed.
67
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests
These enhancements significantly improve the interactivity and responsiveness of the application, allowing users to track changes in real-time.