Replies: 10 comments 3 replies
-
Awesome @Eliav2. I am excited about the new version! |
Beta Was this translation helpful? Give feedback.
-
Also looking forward to newer version. Thanks for your valuable work! |
Beta Was this translation helpful? Give feedback.
-
@Eliav2 any update on the status of this? Just interested to see if any progress has been made! |
Beta Was this translation helpful? Give feedback.
-
@Eliav2 any update on the react-arrows v3? |
Beta Was this translation helpful? Give feedback.
-
Just discovered this project, loving it! Really easy to use. Any update on v3? |
Beta Was this translation helpful? Give feedback.
-
It seems this project stopped working on it. Still, minimalist and has a good potential, tho. |
Beta Was this translation helpful? Give feedback.
-
@Eliav2 any update? |
Beta Was this translation helpful? Give feedback.
-
@Eliav2 ìs there anyone working on it? |
Beta Was this translation helpful? Give feedback.
-
an alpha version of react-xarrows v3 will be released soon. and docs site as well. |
Beta Was this translation helpful? Give feedback.
-
Any update on this? |
Beta Was this translation helpful? Give feedback.
-
update 28.12.2022
react-xarrows v3 is now in an early alpha stage (but most of the logic has been implemented). a first alpha release would be released with a docs site(the docs are being worked on).
react-xarrows v2 implemented a huge single component(with some smaller utility components), and each feature was controlled by a set of properties that were passed to this component. this approach does not scale well as complexity grows.
react-xarrows v3 takes a different approach, and emphasizes component composition rather then passing props. in simple words, V3 would give you the tools to compose your own custom arrow using composition, hooks, and utilities that abstract most of the complicated logic rather than trying to implement every possible use case in a single component and adjust it using props.
react-xarrows v3 chooses flexibility over simplicity. while v2 chose simplicity.
The new API emphasizes component composition, similar to MUI, and will remind it to some extent.
V3 is definitely considered a breaking change as the API changed significantly.
old post
react-xarrows v3 is on its way.
the main purpose of this new major version is to separate logic about different features to different extendible components. the change is mostly internal but the behavior of the react-arrows might change as the entire lib structure has changed and things working quite differently now. this is why it is considered a new major version.
on V3, any developer could simply use the default exported Xarrow component, or construct and extend its own Xarrow component using the different separate internal components. this would help me and possible future contributors to enhance this lib over time, yet keeping it simple to use and performant.
Interesting! explain me farther about the new internal!
in v3 the internal components are built using the render props pattern, and each component is responsible for a single feature of react-xarrows.
without going too much into details, an example for custom xarrow could like this:
for example
XarrowCore
(the first element in the tree) would be responsible for managing state,XarrowBasicPath
for passing down possible(and extensible) path,XarrowAnchors
would be responsible for choosing the best anchor based on the current state, and so on.we can see
XarrowCore
receivesstart
andend
props (and some extra props for the SVG or the div elements).then
XarrowCore
passes to his children component the state of these elements, so the component could potentially do anything with it.next, this state is passed to
XarrowBasicPath
which returns an extensiblegetPath
to his children. this state is used byXarrowAnchors
which changes this state to choose the best anchor based on the positions of the elements. and so on.Update! new-new architecture
An even simpler approach has been decided:
a special class that receives xarrowFeature object classes and returns a new React Component constructed of their features.
each feature object is constructed of properties that are functions for example changing state and for rendering jsx, state change function execute first and only after jsx functions:
this architecture would allow developers to write a custom plugins for this lib.
some of the planned changes are:
Xelem
component to passupdateXarrow
directly to children components.currently, in order to invoke updates on xarrow you have to consume useXarrow hook on components that use Xarrow. however, sometimes they appear on the current component tree and you don't want to extract them to a different component, or worse, you can't because you prefer class components.
most of the changes are about better developer experience, better API, better performance, and better internal structure. not about new features.
no breaking changes are currently planned, but this may change as work is going on.
stay tuned!
Beta Was this translation helpful? Give feedback.
All reactions