Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Migration: Routing library #4159

Closed
arikfr opened this issue Sep 20, 2019 · 3 comments · Fixed by #4525
Closed

React Migration: Routing library #4159

arikfr opened this issue Sep 20, 2019 · 3 comments · Fixed by #4525
Labels
Frontend: React Frontend codebase migration to React

Comments

@arikfr
Copy link
Member

arikfr commented Sep 20, 2019

As we're dropping Angular, we need to pick a new routing library. Some of the options are:

@arikfr arikfr added the Frontend: React Frontend codebase migration to React label Sep 20, 2019
@arikfr
Copy link
Member Author

arikfr commented Sep 20, 2019

Maybe Next.js is also an option?

@arikfr
Copy link
Member Author

arikfr commented Sep 22, 2019

Out of the 3 t looks like Universal Router is the way to go (great find, @kravets-levko!). Aside from being focused and simple it has some interesting features for us:

  • Ability to set baseUrl might help us get rid of a separate index.html file when running in MUTLI_ORG mode (and remove the need to have server rendering of the template).
  • Middleware approach will allow to have extensions to the routing logic in a clean way (helpful to implement custom SaaS logic around account status).

It seems like we will have to replace all of our <a> tags with custom ones to use the History API. I think Angular's router does it differently by having some listener on <a> tags events? @kravets-levko do you know?

@arikfr
Copy link
Member Author

arikfr commented Sep 22, 2019

Yep, Angular has a click listener on the root element. The only reasons I see to replicate a similar logic:

  • Avoid having to search and replace existing <a> tag usages with the new tag.
  • Have generated links in query results to other queries/dashboards work with internal navigation instead of invoking full page refresh.

Not sure it's worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend: React Frontend codebase migration to React
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant