Skip to content

fix: correctly rewrite default locale ISR homepage to ODB handler #1757

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

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
81ce185
fix: redirect isr index pages without a sub path
orinokai Nov 10, 2022
1dd7c26
test: update homepage to test isr i18n
orinokai Nov 10, 2022
6bdee93
Merge branch 'main' into rs/isr-i18n-homepage
orinokai Nov 18, 2022
932eaab
Merge branch 'main' into rs/isr-i18n-homepage
orinokai Nov 21, 2022
ab4596b
feat: proxy tv maze api
orinokai Dec 5, 2022
c0fdadd
Merge branch 'main' into rs/isr-i18n-homepage
orinokai Dec 5, 2022
a44815c
Merge branch 'main' into rs/isr-i18n-homepage
orinokai Dec 7, 2022
fe332e6
Merge branch 'main' into rs/isr-i18n-homepage
orinokai Dec 8, 2022
2aa02db
fix: use static 404 for non-prerendered dynamic routes without fallba…
orinokai Dec 9, 2022
5f7f4ba
chore(deps): update dependency sass to v1.56.2 (#1837)
renovate[bot] Dec 12, 2022
9aa4c38
chore(deps): update dependency typescript to v4.9.4 (#1838)
renovate[bot] Dec 12, 2022
a5b8047
fix: support appDir (#1638)
ascorbic Dec 12, 2022
850a203
chore(deps): update dependency @netlify/build to v29 (#1832)
renovate[bot] Dec 16, 2022
6479e70
chore(deps): update nextjs monorepo (#1842)
renovate[bot] Dec 19, 2022
2539d24
fix(deps): update dependency destr to v1.2.2 (#1843)
renovate[bot] Dec 19, 2022
1bfabc3
chore(deps): update dependency @netlify/build to ^29.1.3 (#1845)
renovate[bot] Dec 19, 2022
ec95bba
chore: release main (#1835)
token-generator-app[bot] Dec 19, 2022
15279a2
chore(deps): update dependency @netlify/build to ^29.2.1 (#1848)
renovate[bot] Dec 20, 2022
254a9ab
chore(deps): update dependency @netlify/build to ^29.2.2 (#1853)
renovate[bot] Dec 21, 2022
28ea00e
test: re-enable unit tests (#1852)
ascorbic Dec 22, 2022
d4ff894
fix: serve static files from basePath (#1850)
ascorbic Dec 22, 2022
686ac61
chore: update next to 13.0.7 (#1840)
orinokai Dec 22, 2022
53ecc31
chore(deps): update dependency @netlify/build to ^29.3.0 (#1856)
renovate[bot] Dec 22, 2022
2d3eb65
chore(deps): update dependency @babel/core to v7.20.7 (#1858)
renovate[bot] Dec 26, 2022
c929816
fix(deps): update dependency moize to v6.1.4 (#1859)
renovate[bot] Dec 26, 2022
af2a3e0
fix(deps): update dependency regenerator-runtime to v0.13.11 (#1860)
renovate[bot] Jan 2, 2023
05ae395
chore(deps): update dependency @netlify/build to ^29.4.0 (#1862)
renovate[bot] Jan 3, 2023
3f62a61
fix: redirect isr index pages without a sub path
orinokai Nov 10, 2022
7da0835
test: update homepage to test isr i18n
orinokai Nov 10, 2022
1140bc8
feat: proxy tv maze api
orinokai Dec 5, 2022
532d38d
Merge branch 'rs/isr-i18n-homepage' of github.com:netlify/netlify-plu…
orinokai Jan 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module.exports = {
'unicorn/filename-case': 0,
'unicorn/no-array-push-push': 0,
'unicorn/numeric-separators-style': 0,
'max-lines': 0,
},
parserOptions: {
sourceType: 'module',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cypress-canary.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Run e2e (canary demo)
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
types: [opened, synchronize]
push:
branches:
- main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cypress-demo-nx.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Run e2e (Nx monorepo)
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
types: [opened, synchronize]
push:
branches:
- main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cypress-demo-static.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Run e2e (static root)
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
types: [opened, synchronize]
push:
branches:
- main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cypress-demo.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Run e2e (default demo)
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
types: [opened, synchronize]
push:
branches:
- main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cypress-middleware.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Run e2e (middleware demo)
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
types: [opened, synchronize]
push:
branches:
- main
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/e2e-appdir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Next.js appdir test suite

on:
pull_request:
types: [opened, synchronize]
push:
branches: [main]

jobs:
setup:
runs-on: ubuntu-latest
outputs:
test-files: ${{ steps['set-test-files'].outputs['test-files'] }}
steps:
- uses: actions/checkout@v3
- run: npm install
- id: set-test-files
name: Get test files
# Extracts the list of all test files as JSON and trims to be relative to the test dir to be easier to read
run:
echo "test-files=$(npx jest -c test/e2e/jest.config.appdir.js --listTests --json | jq -cM 'map(.[env.PWD |
length + 10:])')" >> $GITHUB_OUTPUT
# echo "test-files=$(npx jest -c test/e2e/jest.config.all.js --listTests --json | jq -cM 'map(.[env.PWD | length
# + 10:])')" >> $GITHUB_OUTPUT

test:
runs-on: ubuntu-latest
name: test (${{ matrix.test-file }})
needs:
- setup
strategy:
fail-fast: false
matrix:
# Creates a job for each chunk ID. This will be assigned one or more test files to run
test-file: ${{ fromJson(needs.setup.outputs['test-files']) }}
steps:
- uses: actions/checkout@v3
- run: npm install
- name: Run tests
run: npx jest --reporters=jest-junit --reporters=default -c test/e2e/jest.config.all.js ${{ matrix.test-file }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_BOT_AUTH_TOKEN }}
NETLIFY_SITE_ID: 1d5a5c76-d445-4ae5-b694-b0d3f2e2c395
NEXT_TEST_VERSION: canary
- uses: actions/upload-artifact@v3
if: ${{ always() }}
name: Upload test results
with:
name: test-results
path: reports/jest-*.xml
report:
name: Report appDir e2e test results
runs-on: ubuntu-latest
if: ${{ always() }}
needs:
- test
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: reports
- name: Combine reports
# The test reporter can handle multiple files, but these have random filenames so the output is better when combined
run: npx junit-report-merger test-results.xml reports/**/*.xml
- uses: phoenix-actions/test-reporting@v10
with:
name: Jest Tests
output-to: 'step-summary'
path: 'test-results.xml'
max-annotations: 49
reporter: jest-junit
13 changes: 2 additions & 11 deletions .github/workflows/e2e-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Next.js e2e test suite

on:
pull_request:
types: [opened, synchronize]
push:
branches: [main]

Expand Down Expand Up @@ -41,17 +42,6 @@ jobs:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_BOT_AUTH_TOKEN }}
NETLIFY_SITE_ID: 1d5a5c76-d445-4ae5-b694-b0d3f2e2c395
# RUN_SKIPPED_TESTS: true
# - uses: phoenix-actions/test-reporting@v10
# if: ${{ always() }}
# name: Report Test Results
# # Generates annotations for the test failures
# id: test-report
# with:
# name: E2E Test chunk ${{ matrix.chunk }}
# path: 'reports/**/*.xml' # Path to test results (inside artifact .zip)
# output-to: 'checks'
# max-annotations: 49 # Maximum number of annotations to be created
# reporter: jest-junit # Format of test results

- uses: actions/upload-artifact@v3
# upload test results
Expand All @@ -61,6 +51,7 @@ jobs:
name: test-results
path: reports/jest-*.xml
report:
name: Report Next.js e2e test results
runs-on: ubuntu-latest
if: ${{ always() }}
needs:
Expand Down
4 changes: 2 additions & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"packages/runtime": "4.29.3",
"packages/next": "1.4.2"
"packages/runtime": "4.29.4",
"packages/next": "1.4.3"
}
4 changes: 2 additions & 2 deletions cypress/integration/default/dynamic-routes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Dynamic Routing', () => {
cy.request({ url: '/getStaticProps/3/', headers: { 'x-nf-debug-logging': '1' }, failOnStatusCode: false }).then(
(res) => {
expect(res.status).to.eq(404)
expect(res.headers).to.have.property('x-nf-render-mode', 'odb')
expect(res.headers).to.not.have.property('x-nf-render-mode')
expect(res.body).to.contain('Custom 404')
},
)
Expand Down Expand Up @@ -102,7 +102,7 @@ describe('Dynamic Routing', () => {
failOnStatusCode: false,
}).then((res) => {
expect(res.status).to.eq(404)
expect(res.headers).to.have.property('x-nf-render-mode', 'odb')
expect(res.headers).to.not.have.property('x-nf-render-mode')
expect(res.body).to.contain('Custom 404')
})
})
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/nx/general.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ describe('Default site', () => {
cy.url().should('eq', `${Cypress.config().baseUrl}/`)
})

it('serves generated public files', async () => {
cy.request('service-worker.js').then((res) => {
it('serves generated public files', () => {
cy.request('favicon.ico').then((res) => {
expect(res.status).to.eq(200)
expect(res.headers['content-type']).to.match(/javascript/)
expect(res.headers['content-type']).to.match(/image/)
})
})

Expand Down
4 changes: 2 additions & 2 deletions demos/base-path/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"typescript": "^4.6.3"
},
"dependencies": {
"next": "^13.0.3"
"next": "^13.0.7"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -29,4 +29,4 @@
"url": "https://github.com/netlify/next-runtime/issues"
},
"homepage": "https://github.com/netlify/next-runtime#readme"
}
}
Loading