craftedbygc / taxi

Taxi is a 🤏 small and 🐊 snappy js library for adding slick PJAX navigation and beautiful transitions to your website.
https://taxi.js.org
565 stars 11 forks source link

Taxi doesn't resolve redirects #16

Closed tobimori closed 1 year ago

tobimori commented 1 year ago

When I click on a link that redirects with taxi, the URL of the anchor tag gets set, and not the URL redirected to. This might also cause issues with third party pages.

Ideally, Taxi waits for the redirected page to be fetched, and sets the correct URL afterward, or forwards the user to said page if it's third party.

jakewhiteley commented 1 year ago

@tobimori so you are clicking a link to /page-a, but there is a 301 redirect which server-side redirects the request to /page-b.

The issue is the url bar still says /page-a.

Is this correct?

tobimori commented 1 year ago

exactly.

jakewhiteley commented 1 year ago

@tobimori I have made some changes in https://github.com/craftedbygc/taxi/releases/tag/1.4.0-rc.0

Are you able to help me test?

I struggled a bit with this one, as the navigation lifecycle wasn't easy to work with. In the end I settled for a solution where if the end URL != the expected URL, it will replace history after the fetch has happened, before firing the renderer onEnter method

tobimori commented 1 year ago

seems to work on first glance - thanks!

jakewhiteley commented 1 year ago

Pushed to 1.4.0 :)