Our great sponsors
-
examples
Enjoy our curated collection of examples and solutions. Use these patterns to build your own robust and scalable applications. (by vercel)
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
u/lrobinson2011 I am super excited about these updates, but I do have a slight misgiving about the changes to middleware. We use `middlware.ts` extensively, with a fair amount of routes. Previously, we could programmatically check a route to see if it was actually page or a request to something like an image, etc, with `req.page.name`. The removal of the page from the `req` object and the reliance on `new URLPattern()` (which I can't get working as mentioned in this issue here) makes the use-case of app-wide authorization much more annoying that it previously was. I am wondering what the motivation was, and if there is a more idiomatic way of only applying middleware to page routes and ignoring `/_next/`, `/public/` etc. Thanks!
To partially answer your question, there are examples of what the benefit of things like Middleware can be: https://github.com/vercel/examples/tree/main/edge-functions
Related posts
- Mastering Data Fetching in React: A Comprehensive Guide to SWR
- Building a Blog Subscription and Pusher with AirCode and Resend
- How to build and deploy a modern-day Next.js application
- Next.js Weekly #14: Faster Dev Server, Platform Starter Kit v2, Misconceptions about Client Components [👇 all news in comments]
- Next.js 13.4.8