Skip to content

Commit 03fa2d0

Browse files
committed
Merge branch 'main' into mk/rsc-no-isr
2 parents aaa7805 + 122f2f3 commit 03fa2d0

File tree

34 files changed

+783
-503
lines changed

34 files changed

+783
-503
lines changed

.github/workflows/test-deno.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Deno tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Git Checkout Deno Module
15+
uses: actions/checkout@v2
16+
- name: Use Deno Version ${{ matrix.deno-version }}
17+
uses: denolib/setup-deno@v2
18+
with:
19+
deno-version: vx.x.x
20+
- name: Test Deno
21+
run: deno test packages/runtime/src/templates/edge-shared/

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"packages/runtime": "4.29.4",
2+
"packages/runtime": "4.30.0",
33
"packages/next": "1.4.3"
44
}

cypress/integration/middleware/enhanced.spec.ts

-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
describe('Enhanced middleware', () => {
2-
it('adds request headers', () => {
3-
cy.request('/api/hello').then((response) => {
4-
expect(response.body).to.have.nested.property('headers.x-hello', 'world')
5-
})
6-
})
7-
8-
it('adds request headers to a rewrite', () => {
9-
cy.request('/headers').then((response) => {
10-
expect(response.body).to.have.nested.property('headers.x-hello', 'world')
11-
})
12-
})
13-
142
it('rewrites the response body', () => {
153
cy.visit('/static')
164
cy.get('#message').contains('This was static but has been transformed in')

cypress/integration/middleware/standard.spec.ts

+12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
describe('Standard middleware', () => {
2+
it('adds request headers', () => {
3+
cy.request('/api/hello').then((response) => {
4+
expect(response.body).to.have.nested.property('headers.x-hello', 'world')
5+
})
6+
})
7+
8+
it('adds request headers to a rewrite', () => {
9+
cy.request('/headers').then((response) => {
10+
expect(response.body).to.have.nested.property('headers.x-hello', 'world')
11+
})
12+
})
13+
214
it('rewrites to internal page', () => {
315
// preview mode is off by default
416
cy.visit('/shows/rewriteme')

demos/default/pages/api/shows/[...params].js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default async (req, res) => {
1010
const id = params[0]
1111

1212
// Get the data
13-
const fetchRes = await fetch(`https://api.tvmaze.com/shows/${id}`)
13+
const fetchRes = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
1414
const data = await fetchRes.json()
1515

1616
// If show was found, return it

demos/default/pages/api/shows/[id].js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default async (req, res) => {
77
const { id } = query
88

99
// Get the data
10-
const fetchRes = await fetch(`https://api.tvmaze.com/shows/${id}`)
10+
const fetchRes = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
1111
const data = await fetchRes.json()
1212

1313
// If show was found, return it

demos/default/pages/deep/import.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const Show = ({ show }) => (
2525
)
2626

2727
export const getServerSideProps = async ({ params }) => {
28-
const res = await fetch('https://api.tvmaze.com/shows/42')
28+
const res = await fetch('https://tvproxy.netlify.app/shows/42')
2929
const data = await res.json()
3030

3131
return {

demos/default/pages/getServerSideProps/[id].js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const getServerSideProps = async ({ params }) => {
3434
// The ID to render
3535
const { id } = params
3636

37-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
37+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
3838
const data = await res.json()
3939

4040
// Set error code if show item could not be found

demos/default/pages/getServerSideProps/all/[[...slug]].js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const getServerSideProps = async ({ params }) => {
3434
// The ID to render
3535
const { slug } = params
3636

37-
const res = await fetch(`https://api.tvmaze.com/shows/${slug[0]}`)
37+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(slug[0])}`)
3838
const data = await res.json()
3939

4040
// Set error code if show item could not be found

demos/default/pages/getServerSideProps/static.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const Show = ({ show }) => (
2222
)
2323

2424
export const getServerSideProps = async ({ params }) => {
25-
const res = await fetch('https://api.tvmaze.com/shows/42')
25+
const res = await fetch('https://tvproxy.netlify.app/shows/42')
2626
const data = await res.json()
2727

2828
return {

demos/default/pages/getStaticProps/[id].js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function getStaticProps({ params }) {
2828
// The ID to render
2929
const { id } = params
3030

31-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
31+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
3232
const data = await res.json()
3333
const time = new Date().toLocaleTimeString()
3434

demos/default/pages/getStaticProps/static.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const Show = ({ show }) => (
1616
)
1717

1818
export async function getStaticProps(context) {
19-
const res = await fetch(`https://api.tvmaze.com/shows/71`)
19+
const res = await fetch(`https://tvproxy.netlify.app/shows/71`)
2020
const data = await res.json()
2121

2222
return {

demos/default/pages/getStaticProps/with-revalidate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const Show = ({ show }) => (
1616
)
1717

1818
export async function getStaticProps(context) {
19-
const res = await fetch(`https://api.tvmaze.com/shows/71`)
19+
const res = await fetch(`https://tvproxy.netlify.app/shows/71`)
2020
const data = await res.json()
2121

2222
return {

demos/default/pages/getStaticProps/withFallback/[...slug].js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function getStaticProps({ params }) {
4242
const { slug } = params
4343
const id = slug[slug.length - 1]
4444

45-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
45+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
4646
const data = await res.json()
4747
const time = new Date().toLocaleTimeString()
4848

demos/default/pages/getStaticProps/withFallback/[id].js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export async function getStaticProps({ params }) {
4141
// The ID to render
4242
const { id } = params
4343

44-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
44+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
4545
const data = await res.json()
4646
const time = new Date().toLocaleTimeString()
4747

demos/default/pages/getStaticProps/withFallbackBlocking/[id].js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export async function getStaticProps({ params }) {
3030
// The ID to render
3131
const { id } = params
3232

33-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
33+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
3434
const data = await res.json()
3535
const time = new Date().toLocaleTimeString()
3636

demos/default/pages/getStaticProps/withRevalidate/[id].js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export async function getStaticProps({ params }) {
2929
// The ID to render
3030
const { id } = params
3131

32-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
32+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
3333
const data = await res.json()
3434
const time = new Date().toLocaleTimeString()
3535

demos/default/pages/getStaticProps/withRevalidate/withFallback/[id].js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function getStaticProps({ params }) {
4242
// The ID to render
4343
const { id } = params
4444

45-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
45+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
4646
const data = await res.json()
4747
const time = new Date().toLocaleTimeString()
4848

demos/default/pages/getStaticProps/withRevalidate/withFallbackBlocking/[id].js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export async function getStaticProps({ params }) {
2929
// The ID to render
3030
const { id } = params
3131

32-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
32+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
3333
const data = await res.json()
3434
const time = new Date().toLocaleTimeString()
3535

demos/default/pages/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ Index.getInitialProps = async function () {
189189
const randomPage = Math.floor(Math.random() * 100) + 1
190190
// FIXME: stub out in dev
191191
const server = dev
192-
? `https://api.tvmaze.com/shows?page=${randomPage}`
193-
: `https://api.tvmaze.com/shows?page=${randomPage}`
192+
? `https://tvproxy.netlify.app/shows/page/${randomPage}`
193+
: `https://tvproxy.netlify.app/shows/page/${randomPage}`
194194

195195
// Get the data
196196
const res = await fetch(server)

demos/default/pages/shows/[...params].js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ CatchAll.getInitialProps = async ({ res: req, query }) => {
4747
const id = params[0]
4848

4949
// Get the data
50-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
50+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
5151
const data = await res.json()
5252

5353
// Set error code if show item could not be found

demos/default/pages/shows/[id].js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Show.getInitialProps = async ({ res: req, query }) => {
3535
const { id } = query
3636

3737
// Get the data
38-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
38+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
3939
const data = await res.json()
4040

4141
// Set error code if show item could not be found

0 commit comments

Comments
 (0)