path-tree icon indicating copy to clipboard operation
path-tree copied to clipboard

Add new node kinds

Open fundon opened this issue 3 years ago • 5 comments
trafficstars

  • Regex: supports regex on parameter
  • ~Root?: allow '' empty str at top of the tree, replace /~

fundon avatar Sep 26 '22 11:09 fundon

:name([0-9]+)

fundon avatar Sep 27 '22 14:09 fundon

For my MQTT usecase I have shared here: https://github.com/viz-rs/path-tree/pull/41#issuecomment-2152654653 there would be the need to have a wildcard which excludes the trailing / when matching.

I have used a named wildcard like this: MQTT/multilevel/:value*.

this matches topics like:

MQTT/multilevel/ -> value: "" MQTT/multilevel/a -> value: "a" MQTT/multilevel/a/b -> value: "a/b"

and so on, but the MQTT specification also requires matching of:

MQTT/multilevel

which would result in including the / in the values above and MQTT/multilevel would be the empty string.

This was and is still "good enough" for me, but it would be nice to have a dedicated matcher or option for this usecase also.

mbodmer avatar Jun 06 '24 15:06 mbodmer

Another nice thing would be an optional "root node", which would allow having routes which don't need a common first character.

mbodmer avatar Jun 06 '24 15:06 mbodmer

Another nice thing would be an optional "root node", which would allow having routes which don't need a common first character.

This was supported in very early versions.

This was and is still "good enough" for me, but it would be nice to have a dedicated matcher or option for this usecase also

I will consider adding this feature.

fundon avatar Jun 06 '24 15:06 fundon

I know MQTT is not the intended use case, but since the router is very versatile it almost supports it :-) so i just wanted to drop it here for reference. Of course it is up to you to decide the future direction of the project.

mbodmer avatar Jun 06 '24 15:06 mbodmer