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

Bump netlify/next runtime and fix api routes in middleware #13040

Merged
merged 5 commits into from
Jun 12, 2024

Conversation

pettinarip
Copy link
Member

@pettinarip pettinarip commented May 27, 2024

Description

Things done in this PR:

  • bump @netlify/plugin-nextjs to the latest, v5
  • since in this latest version, the included_files from netlify.toml doesn't seem to work, we excluded the heavy files from Netlify function bundles in the next.config.js file
  • ignore /api routes from middleware

Bonus:
This also fix the issue we currently have when navigating to the home page by using the eth logo on the navbar where it was doing a full page nav instead of a client side one.

Copy link

netlify bot commented May 27, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 2de39bc
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/666817aedcf89d0008edf031
😎 Deploy Preview https://deploy-preview-13040--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 48 (🟢 up 10 from production)
Accessibility: 92 (no change from production)
Best Practices: 83 (🔴 down 9 from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member Author

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When navigating to a non-existing nested page like /en/dapps/test we enter in a redirect loop.

@pettinarip pettinarip marked this pull request as draft May 27, 2024 16:58
@pettinarip pettinarip changed the title Fix middleware compression issues Performance: fix middleware compression issues May 31, 2024
@github-actions github-actions bot added config ⚙️ Changes to configuration files dependencies 📦 Changes related to project dependencies labels Jun 10, 2024
@pettinarip pettinarip changed the title Performance: fix middleware compression issues Bump netlify/next runtime and fix api routes in middleware Jun 11, 2024
@pettinarip pettinarip marked this pull request as ready for review June 11, 2024 09:35
@@ -48,7 +51,7 @@ export async function middleware(req: NextRequest) {
const localeDetected = detectLocale(req.headers.get("accept-language"))
const locale = localeDetected || DEFAULT_LOCALE

const redirectUrl = new URL(`/${locale}${pathname}`, req.url)
const redirectUrl = new URL(`/${locale}${pathname}${search}`, req.url)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the search params to the redirect, thing that was missing.

@wackerow wackerow merged commit 7610f4a into dev Jun 12, 2024
6 checks passed
@wackerow wackerow deleted the fixed-locale-prefix branch June 12, 2024 15:27
This was referenced Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config ⚙️ Changes to configuration files dependencies 📦 Changes related to project dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants