hi, i've gotten far along on a port to react-route...
# contribute-code
r
hi, i've gotten far along on a port to react-router v6: https://github.com/0x6a77/datahub/tree/react-router-v6. it's too big and gnarly for a pr, so i'm sorta following the rfc process
both history (https://github.com/remix-run/history) and react-router (https://github.com/remix-run/react-router) have undergone significant realignment and refactor to more closely follow recent cra/react design advances. i'm pretty sure it's reached the end of the line with partial route matching and direct history manipulation. i don't see a way for this not to be disruptive. it also seems inevitable if datahub continues to embrace best react practices. (datahub is freaking amazing so i want to do my best to make good/right choices)
for history it's pretty straightforward to use
<Navigate>
et al. but the lack of partial routing matches is painful (and probably controversial). i do have that working. mostly it's a big improvement, but it's not pretty in a few spots and needs some teamwork
the motivation to do this port is that v6 makes it pretty straightforward to re-root the frontend so that datahub can be one of many webapps running in a single cluster behind an application load-balancer. i.e. path-based routing when all the services are at a single domain host. e.g.
<https://host.example.com/[datahub>, jenkins, etc]
b
nice! would be great if the individual entity page titles show up in my browser history instead of all showing "Datahub"
r
blerg! i'll see if i can do something about this with navigate
plus1 1
@better-orange-49102 i added a nice default with specialization on the entities (just group so far). but this is doable without react-router-v6, so i'll hang onto it for a later pr (if/once v6 is done)
👍 1
b
I wonder if we can get the entity type - Name in there somehow
But thanks @refined-battery-91101 for all the details here. These changes do indeed seem that they will be disruptive. And totally see the value in making the change to move to v6. Thank you very much for spearheading the charge here so far. We will take a closer look cc @green-football-43791 @bulky-soccer-26729
r
@big-carpet-38439 it turns out that v5-v6 history management changes are entirely internal and don't affect displayed history. once we get through a v6 refactor i can come back with a pr proposal of how to make history look nicer. thanks!
also, i've been thinking a lot about how to make this nicer given graphiql is the one true source of this stuff. one crazy idea is to map colons to slashes (and back). routes would be perfectly and cleanly compliant and extracting parameters and matches would be low impedance (the code would be be clear and nice). it's a weird leap tho
one thing to keep in mind: colons -> slashes is basic ts/js string sub. but slashes -> colons would also be simple given that
useMatch()
reliably and simply produces the parts and parameters needed to concat them with colons to reform a proper graphiql id