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

fix(router): fix issue with top-level catch-all not being matched in server renderer #26861

Merged
merged 2 commits into from
Feb 1, 2024

Conversation

EvanBacon
Copy link
Contributor

Why

  • The server manifest was supporting non-optional [[...a]] syntax, which isn't supported in the client router and would require a breaking change to add. This resulted in a forked behavior between client-side routing and server-side routing. This change treats [...a] as optional catch-alls (matching / and /a) to behave the same across routers.

Test Plan

  • Added unit tests
  • A project with just app/[...a].tsx will work in server and static rendering modes.

Checklist

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Feb 1, 2024
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Feb 1, 2024
@EvanBacon EvanBacon merged commit b4d5b6e into main Feb 1, 2024
8 of 9 checks passed
@EvanBacon EvanBacon deleted the @evanbacon/router/fix-server-routing-bug branch February 1, 2024 22:04
EvanBacon added a commit that referenced this pull request Feb 1, 2024
…server renderer (#26861)

- The server manifest was supporting non-optional `[[...a]]` syntax,
which isn't supported in the client router and would require a breaking
change to add. This resulted in a forked behavior between client-side
routing and server-side routing. This change treats `[...a]` as optional
catch-alls (matching `/` and `/a`) to behave the same across routers.

- Added unit tests
- A project with just `app/[...a].tsx` will work in server and static
rendering modes.

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
@brentvatne brentvatne added the published Changes from the PR have been published to npm label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint changed bot: passed checks ExpoBot has nothing to complain about published Changes from the PR have been published to npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants