-
Notifications
You must be signed in to change notification settings - Fork 86
fix: correctly rewrite default locale ISR homepage to ODB handler #1757
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
Conversation
✅ Deploy Preview for netlify-plugin-nextjs-export-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for nextjs-plugin-custom-routes-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-i18next-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-plugin-canary ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-plugin-edge-middleware ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
❌ Deploy Preview for nextjs-plugin-next-11-demo failed.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
I think CodeQL's complaints could be fixed by casting the value with |
…ck (#1795) * fix: rewrite fallback false routes to 404 page * fix: allow ISR 404 pages to use the ODB handler * chore: update tests to expect static 404 pages for fallback false * chore: fix boolean type on is404Isr param * chore: add tests for 404 redirects
@ascorbic the new proxy API validates that this is a number anyway, so I think it's fine to just ignore CodeQL in this case |
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* chore: update canary demo * chore: add app-dir demo * fix: resolve page deps in app dir * fix: patch duplicate declaration * fix: resolve nft deps * feat: add support for appdir edge runtime * chore: update next canary and react (and change APIs) * fix: update patch syntax * fix: include file itself in deps * chore: upgrade next and remove workaround * chore: move app-dir site to canary * chore: update snapshot * chore: add initial app-dir tests * chore: use correct site for canary tests * chore: enable plugin * ci: use vitest for canary e2e tests * chore: re-enable plugin * chore: setup playwright * chore: wait longer when first using playwright * chore: run tests headless * chore: install chromium * chore: longer timeout * chore: use undici * chore: enable remaining tests * chore: fix test syntax * chore: update demos * chore: update canary * chore: fix 404 test * chore: disable test that depends on an upstream fix * chore: fix handling of "self" object * chore: update packages * chore: update canary * chore: tidy and add license for next.js code * chore: handle empty static manifest * chore: downgrasde canary because of regression * chore: logging for windows * Apply suggestions from code review Co-authored-by: Erica Pisani <[email protected]> * chore: update next canary * chore: remove npmrc * chore: update next and react * chore: update test site * chore: update tests * chore: add back npmrc This reverts commit 40480f4. * fix: use globby not tiny-glob * chore: update fixtures * chore: deps * chore: update tests and demo * fix: correct request types * fix: skip generating lambda for edge api routes * chore: log request * chore: add runtime as dep * chore: pre-version * chore: add canary to ws * chore: fix build * chore: fix monorepo setup * chore: upgrade * chore: react no-longer pre-bundled * chore: remove deliberately broken demo pages * fix: move pre-rendered appdir files * fix: correct manifest path * chore: update demo * chore: update tests * chore: add sass test * chore: update demo config * chore: skip test that also fails upstream * chore: update next canary * chore: update use usage * chore: update canary * fix: support loading static files for both pages and app * chore: update canary * chore: update canary * chore: final canary! * chore(deps): update demos and deps to Next 13 * chore: add swc * chore: switch old node tests to use node 14 * fix: correct requestdata type * chore: update next/link syntax * chore: use legacy image component for now * chore: update demo * chore: update canary demo * chore: all the tests * chore: fix eslint * chore: parallelise e2e tests * chore: don't fail fast * chore: unignore modules and use node-fetch * chore: very parallel * chore: don't mock fetch 🤦 * chore: remove disabled tests * chore: test with node 18 * chore: switchable fetch * chore: remove irrelevant tests * chore: remove disabled test * chore: add reporter * chore: no concurrency * chore: try to fix jest * chore: fix test command * chore: artifact file path * chore: use site build command * chore: download artifacts * chore: report per-chunk * chore: update syntax * chore: report to summary * chore: do annotate * chore: update and add summary * chore: rearrange * chore: combine tests * chore: fix test * chore: rearrange and disable failing suites * chore: skip broken ntl and fail faster * chore: disable suite * chore: skip failing tests * chore: add ability to run disabled tests * chore: add comments to workflow file * chore: one worker per file * chore: oops * chore: make path relative to test dir * chore: conditionally skip * chore: enable middleware-responses test * chore: run all tests once * chore: don't run disabled tests * fix: ensure responses are Responses * chore: re-enable test * chore: run all tests * chore: enable another suite * fix: better headers.getAll polyfill * chore: enable middleware-redirects suite * chore: conditionally enable req body tests * chore: disable failing tests * chore: add test readme doc * chore: remove eslint changes * chore: add new appdir tests * chore: use canary for appdir tests * chore: use extended matchers * chore: increase timeout * chore: enable tests that were disabled upstream * chore: don't clobber package.json in tests * chore: set EdgeRuntime name globally * chore: remove logs * chore: update tests * chore: test updates * chore: increase timeout * chore: increase timeout for site deploy * chore: include step annotations * chore: don't use canary demo for this * chore: increase timeout * chore: add rewrite-to-edge demo * chore: deploy edge functions after cache * chore: refresh lockfile * chore: enable rewrite tests * chore: update tests * chore: update tests * chore: enable rsc tests * chore: skip tests * chore: re-enable dev check * chore: update lockfile * chore: run workflows only on new pr and pr sync * chore: add log about testing appdir * chore: only use cache: manual if site uses appDir * chore: changes from review * ci: fix e2e test * fix: correctly match static files against rewrites * chore: upgrade next * chore: increase timeout * chore: extend timeout * fix: handle prefetch correctly * chore: rmeove log * chore: log env * chore: enough with these rules * chore: fix base url * chore: try with all tests * chore: don't run disabled tests * fix: vary on prefetch Co-authored-by: Erica Pisani <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: token-generator-app[bot] <82042599+token-generator-app[bot]@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* fix: serve static files from basePath * chore: add test Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* chore: update next to 13.0.7 * chore: disable test Co-authored-by: Matt Kane <[email protected]> Co-authored-by: Matt Kane <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…gin-nextjs into rs/isr-i18n-homepage
Closing in favour of #1867 which is a more tidy version with the TV Maze API Proxy stuff split into a separate PR |
Summary
ISR homepages with i18n were not correctly matched as static routes and were being served as SSR pages because no rewrite was created. This was because the matcher only worked for URLs with subpaths.
This PR updates the logic to match URLs prefixed with the default locale, with or without a subpath, and ensures that, when slicing off the locale, an index page at the root defaults to '/'.
Test plan
Snapshots have been updated with the new redirects. Tests should pass as before.
Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal
Fixes netlify/pod-ecosystem-frameworks#233