Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opennextjs/opennextjs-netlify
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: plugin-nextjs-v4.7.0
Choose a base ref
...
head repository: opennextjs/opennextjs-netlify
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: plugin-nextjs-v4.7.1
Choose a head ref
  • 15 commits
  • 23 files changed
  • 7 contributors

Commits on May 4, 2022

  1. chore(deps): update nextjs monorepo to v12.1.6 (#1342)

    * chore(deps): update nextjs monorepo to v12.1.6
    
    * chore: fix dependencies
    
    Co-authored-by: Renovate Bot <[email protected]>
    Co-authored-by: Matt Kane <[email protected]>
    3 people authored May 4, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fb6e9ef View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3bba918 View commit details
  3. fix(deps): update dependency @netlify/ipx to v1 (#1343)

    Co-authored-by: Renovate Bot <[email protected]>
    Co-authored-by: Matt Kane <[email protected]>
    3 people authored May 4, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4ab9ff4 View commit details
  4. chore: update RSC demo with new router syntax (#1339)

    * chore: update RSC demo with new router syntax
    
    * chore: fix dependencies
    
    * chore: update demo config
    
    Co-authored-by: Sarah Etter <[email protected]>
    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    3 people authored May 4, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d9ec000 View commit details

Commits on May 6, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    458a516 View commit details

Commits on May 9, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5694983 View commit details
  2. chore(deps): update dependency @types/react to v17.0.45 (#1348)

    Co-authored-by: Renovate Bot <[email protected]>
    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    3 people authored May 9, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fa4bcde View commit details

Commits on May 13, 2022

  1. chore: add example of cookies api to middleware demo (#1350)

    * chore: add demo of newer cookies api
    
    * chore: set prefetch to false
    sarahetter authored May 13, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    52ae761 View commit details

Commits on May 19, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9f7dc29 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1770e7c View commit details

Commits on May 23, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f761a4f View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4abc04c View commit details

Commits on May 25, 2022

  1. chore: change middleware demo to root level middleware file instead o…

    …f nested (#1359)
    
    * chore: change middleware demo to root level middleware file instead of nested
    
    * chore: cleanup
    sarahetter authored May 25, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    33d1773 View commit details
  2. fix: don't override user defined NEXTAUTH_URL (#1360)

    * fix: don't override user defined NEXTAUTH_URL
    
    A user could have defined this in next.config.js and the existing logic
    within the plugin overrides it.
    
    * test: small test cleanup
    
    * refactor: address cr comments
    ericapisani authored May 25, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9010da3 View commit details

Commits on May 26, 2022

  1. chore(main): release plugin-nextjs 4.7.1 (#1344)

    Co-authored-by: token-generator-app[bot] <82042599+token-generator-app[bot]@users.noreply.github.com>
    token-generator-app[bot] authored May 26, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9999c54 View commit details
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"plugin": "4.7.0"
"plugin": "4.7.1"
}
39 changes: 39 additions & 0 deletions demos/middleware/middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { NextResponse } from 'next/server'
import { NextFetchEvent, NextRequest } from 'next/server'

export function middleware(request: NextRequest, ev: NextFetchEvent) {
let response
const {nextUrl: {pathname}} = request

if (pathname.startsWith('/cookies')) {
response = NextResponse.next()
response.cookies.set('netlifyCookie', 'true')
return response
}

if (pathname.startsWith('/shows')) {
if (pathname.startsWith('/shows/rewrite-absolute')) {
response = NextResponse.rewrite(new URL('/shows/100', request.url))
response.headers.set('x-modified-in-rewrite', 'true')
}
if (pathname.startsWith('/shows/rewrite-external')) {
response = NextResponse.rewrite('http://example.com/')
response.headers.set('x-modified-in-rewrite', 'true')
}
if (pathname.startsWith('/shows/rewriteme')) {
const url = request.nextUrl.clone()
url.pathname = '/shows/100'
response = NextResponse.rewrite(url)
response.headers.set('x-modified-in-rewrite', 'true')
}

if (!response) {
response = NextResponse.next()
}
response.headers.set('x-modified-edge', 'true')
response.headers.set('x-is-deno', 'Deno' in globalThis ? 'true' : 'false')

return response
}

}
2 changes: 1 addition & 1 deletion demos/middleware/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"ntl": "ntl-internal"
},
"dependencies": {
"next": "^12.1.5-canary.2",
"next": "^12.1.7-canary.12",
"react": "18.0.0",
"react-dom": "18.0.0"
},
9 changes: 9 additions & 0 deletions demos/middleware/pages/cookies/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const Cookies = () => {
return (
<div>
<p>The cookie "netlifyCookie" should be set to true</p>
</div>
)
}

export default Cookies
17 changes: 14 additions & 3 deletions demos/middleware/pages/index.js
Original file line number Diff line number Diff line change
@@ -16,9 +16,20 @@ export default function Home() {
Welcome to <a href="https://nextjs.org">Next.js!</a>
</h1>

<p><Link href="/shows/rewriteme">Rewrite URL</Link></p>
<p><Link href="/shows/rewrite-absolute">Rewrite to absolute URL</Link></p>
<p><Link href="/shows/rewrite-external">Rewrite to external URL</Link></p>
<p>
<Link href="/shows/rewriteme">Rewrite URL</Link>
</p>
<p>
<Link href="/shows/rewrite-absolute">Rewrite to absolute URL</Link>
</p>
<p>
<Link href="/shows/rewrite-external">Rewrite to external URL</Link>
</p>
<p>
<Link href="/cookies" prefetch={false}>
Cookie API
</Link>
</p>
</main>
</div>
)
13 changes: 0 additions & 13 deletions demos/middleware/pages/shows/_middleware.ts

This file was deleted.

8 changes: 0 additions & 8 deletions demos/middleware/pages/shows/rewrite-absolute/_middleware.ts

This file was deleted.

8 changes: 0 additions & 8 deletions demos/middleware/pages/shows/rewrite-external/_middleware.ts

This file was deleted.

10 changes: 0 additions & 10 deletions demos/middleware/pages/shows/rewriteme/_middleware.ts

This file was deleted.

5 changes: 5 additions & 0 deletions demos/middleware/tsconfig.json
Original file line number Diff line number Diff line change
@@ -18,5 +18,10 @@
"exclude": [
"node_modules",
"../../src/templates/edge/*"
],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
]
}
Loading