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

replace passthrough with fallthrough #84

Merged
merged 2 commits into from
Jan 4, 2024

Conversation

edivados
Copy link
Contributor

@edivados edivados commented Jan 4, 2024

Copy link

codesandbox bot commented Jan 4, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

changeset-bot bot commented Jan 4, 2024

🦋 Changeset detected

Latest commit: b2ef06f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 29 packages
Name Type
vinxi Patch
@vinxi/plugin-directives Patch
@vinxi/react-server Patch
@vinxi/router Patch
@vinxi/server-components Patch
@vinxi/server-functions Patch
example-react-server Patch
app Patch
example-react-spa-basic Patch
react-spa-mdx Patch
react-spa-tanstack-router-app Patch
example-react-spa-tanstack-router-app Patch
react-ssr-basic-cloudflare Patch
react-ssr-basic Patch
react-ssr-tanstack-router-app Patch
react-ssr-wouter Patch
solid-spa-basic Patch
solid-ssr-basic Patch
example-ssr-solid-router Patch
example-vanilla-empty Patch
example-vanilla-partyroom Patch
example-vanilla-spa Patch
example-vanilla-stack Patch
example-vanilla-trpc Patch
test-multi-spa Patch
test-react-rsc Patch
test-react-srv-fn Patch
react-ssr-test-fs Patch
test-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jan 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vinxi-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 4, 2024 11:49am

@nksaraf
Copy link
Owner

nksaraf commented Jan 4, 2024

Is there a way to add a test case for this? maybe to check if we are getting the correct 404 things

@edivados
Copy link
Contributor Author

edivados commented Jan 4, 2024

I will try to add one later today (my time). In the multi-spa test there is a check to make sure you don't get 404 on non existing paths but I am not sure if it covers file endings.

@edivados
Copy link
Contributor Author

edivados commented Jan 4, 2024

Just for context. Nitro sets fallthrough to true for / by default if not explicitly defined.

https://github.com/unjs/nitro/blob/1aec53e14ab953e265bb7496a5af2408d809d553/src/nitro.ts#L82-L83

@nksaraf
Copy link
Owner

nksaraf commented Jan 4, 2024

Makes sense that nitro does that. But we should be explicit on our end anyway.

@nksaraf
Copy link
Owner

nksaraf commented Jan 4, 2024

I'll merge this without the tests for now. I think we need a running list of things to write tests for and then hopefully people contribute to that

@nksaraf nksaraf merged commit 67a245c into nksaraf:main Jan 4, 2024
6 checks passed
@nksaraf nksaraf mentioned this pull request Jan 4, 2024
5 tasks
@edivados
Copy link
Contributor Author

edivados commented Jan 4, 2024

For static routers this should maybe be configurable. I imagine there are usecases where you don't want requests to fallthrough. The exact behavior of fallthrough on public assets is not clear to me right now. Does it only apply to / (root) and file paths or just any path it can't find? Will have to take a look.

Since there was passthrough on every router type I assumed you intended to enable it.

In any case tests would be good.

@edivados edivados deleted the replace-passthrough branch January 4, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants