Skip to content

fix: use native path matching for prebundled react conditional #2206

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

Merged
merged 4 commits into from
Jul 11, 2023

Conversation

orinokai
Copy link
Contributor

Description

During the upgrade to Next 13.4 we implemented a fix so that the correct prebundled version of React is chosen when the route is App vs Pages router. However, we were attempting to determine the type of route using a custom path matching algorithm and it was failing when the route used route groups.

This PR uses the Next native getAppPathRoutes function to normalize the route, removing route groups and other artifacts in the path.

Tests

Unit tests have been added (and former tests restored as these were yet to be re-enabled after #2080 was merged).

Relevant links (GitHub issues, etc.) or a picture of cute animal

Fixes netlify/pod-ecosystem-frameworks#489 (again)

@orinokai orinokai requested a review from a team as a code owner July 10, 2023 08:53
@netlify
Copy link

netlify bot commented Jul 10, 2023

Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!

Name Link
🔨 Latest commit db61238
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/64ad60623875b00008f3a0c6
😎 Deploy Preview https://deploy-preview-2206--netlify-plugin-nextjs-static-root-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@netlify
Copy link

netlify bot commented Jul 10, 2023

Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!

Name Link
🔨 Latest commit db61238
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/64ad60626998280008c10b18
😎 Deploy Preview https://deploy-preview-2206--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Jul 10, 2023
@netlify
Copy link

netlify bot commented Jul 10, 2023

Deploy Preview for netlify-plugin-nextjs-demo ready!

Name Link
🔨 Latest commit db61238
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/64ad6062b3007d0007cdfbef
😎 Deploy Preview https://deploy-preview-2206--netlify-plugin-nextjs-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@netlify
Copy link

netlify bot commented Jul 10, 2023

Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!

Name Link
🔨 Latest commit db61238
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/64ad60622bb21f00083f9683
😎 Deploy Preview https://deploy-preview-2206--netlify-plugin-nextjs-next-auth-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@netlify
Copy link

netlify bot commented Jul 10, 2023

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit db61238
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/64ad606214557d00078989b6
😎 Deploy Preview https://deploy-preview-2206--next-i18next-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@netlify
Copy link

netlify bot commented Jul 10, 2023

Deploy Preview for netlify-plugin-nextjs-export-demo ready!

Name Link
🔨 Latest commit db61238
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/64ad6062f918030008803c97
😎 Deploy Preview https://deploy-preview-2206--netlify-plugin-nextjs-export-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@netlify
Copy link

netlify bot commented Jul 10, 2023

Deploy Preview for nextjs-plugin-custom-routes-demo ready!

Name Link
🔨 Latest commit db61238
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/64ad60629e4b57000808f79a
😎 Deploy Preview https://deploy-preview-2206--nextjs-plugin-custom-routes-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@netlify
Copy link

netlify bot commented Jul 10, 2023

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit db61238
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/64ad6062bc958700076eff70
😎 Deploy Preview https://deploy-preview-2206--next-plugin-edge-middleware.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@netlify
Copy link

netlify bot commented Jul 10, 2023

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit db61238
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/64ad6062676ec30008ae10fc
😎 Deploy Preview https://deploy-preview-2206--next-plugin-canary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

Copy link
Contributor

@MarcL MarcL left a comment

Choose a reason for hiding this comment

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

Looks good to me but might be wise to get @pieh or @nickytonline to review it before merging.

Copy link

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

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

🚢

@kodiakhq kodiakhq bot merged commit ba036fb into main Jul 11, 2023
@kodiakhq kodiakhq bot deleted the rs/fix-prebundled-react-paths branch July 11, 2023 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants