storefront-foundation / react-storefront

React Storefront - PWA for eCommerce. 100% offline, platform agnostic, headless, Magento 2 supported. Always Open Source, Apache-2.0 license. Join us as contributor (contributors@reactstorefront.io).
https://www.reactstorefront.io
Other
796 stars 190 forks source link

Simple Navigation updates #182

Closed jasonadkison closed 3 years ago

jasonadkison commented 3 years ago

Issue: All anchor elements that match page routes are forced into client-side navigation by RSF. This causes unexpected behavior such as the target="_blank" attribute having no effect.

Solution: Updated useSimpleNavigation to allow users ability to opt out of client-side navigation behavior by setting the data-native attribute on anchor elements. This allows the anchor element to behave as it would natively.


Issue: In development listRoutes returns missing routes in development when using alternative file extensions (.jsx, .ts, .tsx)

Solution: Updated glob pattern used by createDevelopmentPagesManifest to include files with .jsx, .ts, .tsx extensions.


Issue: In development listRoutes returns incorrectly parsed as values when using new Next.js route patterns. e.g. listRoutes returns as: "/[" when given the route /pages/[...catchAll].js

Solution: Updated createDevelopmentPagesManifest to better parse the as value.

jasonadkison commented 3 years ago

This PR highlights certain issues with using RSF in development. I left a few comments where issues remain but I currently don't have the resources to fully fix.