diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index c945c51077c25..8afc07c12e76b 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -208,7 +208,7 @@ jobs: name: Test Unit runs-on: ubuntu-latest needs: [build, build-native-test] - timeout-minutes: 5 + timeout-minutes: 10 env: NEXT_TELEMETRY_DISABLED: 1 NEXT_TEST_JOB: 1 @@ -243,7 +243,7 @@ jobs: name: Test Development runs-on: ubuntu-latest needs: [build, build-native-test] - timeout-minutes: 20 + timeout-minutes: 25 env: NEXT_TELEMETRY_DISABLED: 1 NEXT_TEST_JOB: 1 @@ -283,7 +283,7 @@ jobs: if: ${{needs.build.outputs.docsChange == 'nope'}} - run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps - timeout-minutes: 5 + timeout-minutes: 10 if: ${{needs.build.outputs.docsChange == 'nope'}} - run: node run-tests.js --type development --timings -g ${{ matrix.group }}/2 @@ -343,7 +343,7 @@ jobs: if: ${{needs.build.outputs.docsChange == 'nope'}} - run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps - timeout-minutes: 5 + timeout-minutes: 10 if: ${{needs.build.outputs.docsChange == 'nope'}} - run: node run-tests.js --type development --timings -g ${{ matrix.group }}/2 @@ -364,7 +364,7 @@ jobs: name: Test Development (E2E) runs-on: ubuntu-latest needs: [build, build-native-test] - timeout-minutes: 20 + timeout-minutes: 25 env: NEXT_TELEMETRY_DISABLED: 1 NEXT_TEST_JOB: 1 @@ -405,7 +405,7 @@ jobs: if: ${{needs.build.outputs.docsChange == 'nope'}} - run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps - timeout-minutes: 5 + timeout-minutes: 10 if: ${{needs.build.outputs.docsChange == 'nope'}} - run: npx @replayio/playwright install chromium @@ -484,7 +484,7 @@ jobs: if: ${{needs.build.outputs.docsChange == 'nope'}} - run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps - timeout-minutes: 5 + timeout-minutes: 10 if: ${{needs.build.outputs.docsChange == 'nope'}} - run: NEXT_TEST_MODE=dev node run-tests.js --type e2e --timings -g ${{ matrix.group }}/3 @@ -545,7 +545,7 @@ jobs: if: ${{needs.build.outputs.docsChange == 'nope'}} - run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps - timeout-minutes: 5 + timeout-minutes: 10 if: ${{needs.build.outputs.docsChange == 'nope'}} - run: node run-tests.js --type production --timings -g ${{ matrix.group }}/2 @@ -595,7 +595,7 @@ jobs: if: ${{needs.build.outputs.docsChange == 'nope'}} - run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps - timeout-minutes: 5 + timeout-minutes: 10 if: ${{needs.build.outputs.docsChange == 'nope'}} - run: node run-tests.js --type production --timings -g ${{ matrix.group }}/2 @@ -606,7 +606,7 @@ jobs: name: Test Production (E2E) runs-on: ubuntu-latest needs: [build, build-native-test] - timeout-minutes: 25 + timeout-minutes: 30 env: NEXT_TELEMETRY_DISABLED: 1 NEXT_TEST_JOB: 1 @@ -647,7 +647,7 @@ jobs: if: ${{needs.build.outputs.docsChange == 'nope'}} - run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps - timeout-minutes: 5 + timeout-minutes: 10 if: ${{needs.build.outputs.docsChange == 'nope'}} - run: NEXT_TEST_MODE=start node run-tests.js --type e2e --timings -g ${{ matrix.group }}/3 @@ -698,7 +698,7 @@ jobs: if: ${{needs.build.outputs.docsChange == 'nope'}} - run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps - timeout-minutes: 5 + timeout-minutes: 10 if: ${{needs.build.outputs.docsChange == 'nope'}} - run: NEXT_TEST_MODE=start node run-tests.js --type e2e --timings -g ${{ matrix.group }}/3 @@ -709,7 +709,7 @@ jobs: name: Test Integration runs-on: ubuntu-latest needs: [build, build-native-test] - timeout-minutes: 20 + timeout-minutes: 25 env: NEXT_TELEMETRY_DISABLED: 1 NEXT_TEST_JOB: 1 @@ -771,7 +771,7 @@ jobs: if: ${{needs.build.outputs.docsChange == 'nope'}} - run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps - timeout-minutes: 5 + timeout-minutes: 10 if: ${{needs.build.outputs.docsChange == 'nope'}} - run: xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/20 @@ -791,7 +791,7 @@ jobs: name: Test Electron runs-on: ubuntu-latest needs: [build, build-native-test] - timeout-minutes: 5 + timeout-minutes: 10 env: NEXT_TELEMETRY_DISABLED: 1 NEXT_TEST_JOB: 1 @@ -847,7 +847,7 @@ jobs: name: Test Firefox (production) runs-on: ubuntu-latest needs: [build, build-native-test] - timeout-minutes: 5 + timeout-minutes: 10 env: BROWSER_NAME: 'firefox' NEXT_TELEMETRY_DISABLED: 1 @@ -882,7 +882,7 @@ jobs: name: Test Safari (production) runs-on: ubuntu-latest needs: [build, build-native-test] - timeout-minutes: 10 + timeout-minutes: 15 env: BROWSER_NAME: 'safari' NEXT_TEST_MODE: 'start' @@ -928,7 +928,7 @@ jobs: name: Test Safari 10.1 (nav) runs-on: ubuntu-latest needs: [build, build-native-test] - timeout-minutes: 5 + timeout-minutes: 10 env: BROWSERSTACK: true LEGACY_SAFARI: true @@ -975,7 +975,7 @@ jobs: name: Test Firefox Node.js 18 runs-on: ubuntu-latest needs: [build, testFirefox, build-native-test] - timeout-minutes: 5 + timeout-minutes: 10 env: BROWSER_NAME: 'firefox' NEXT_TELEMETRY_DISABLED: 1 @@ -1081,7 +1081,7 @@ jobs: name: Install pnpm - run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps - timeout-minutes: 5 + timeout-minutes: 10 name: Install playwright dependencies - run: RESET_VC_PROJECT=true node scripts/reset-vercel-project.mjs @@ -1248,7 +1248,7 @@ jobs: test-wasm: name: Test the wasm build runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 15 needs: [build, build-native-test, build-wasm-dev] steps: @@ -1283,7 +1283,7 @@ jobs: check-latest: true - run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps - timeout-minutes: 5 + timeout-minutes: 10 if: ${{needs.build.outputs.docsChange == 'nope'}} - run: node ./scripts/setup-wasm.mjs @@ -1361,6 +1361,7 @@ jobs: docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 build: >- set -e && + export JEMALLOC_SYS_WITH_LG_PAGE=16 && rustup toolchain install "${RUST_TOOLCHAIN}" && rustup default "${RUST_TOOLCHAIN}" && rustup target add aarch64-unknown-linux-gnu && @@ -1412,6 +1413,7 @@ jobs: docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine build: >- set -e && + export JEMALLOC_SYS_WITH_LG_PAGE=16 && npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi && rustup toolchain install "${RUST_TOOLCHAIN}" && rustup default "${RUST_TOOLCHAIN}" && diff --git a/bench/minimal-server/benchmark-app/app/layout.js b/bench/minimal-server/benchmark-app/app/layout.js new file mode 100644 index 0000000000000..bf15eff980a84 --- /dev/null +++ b/bench/minimal-server/benchmark-app/app/layout.js @@ -0,0 +1,10 @@ +import * as React from 'react' + +export default function Root({ children }) { + return ( + +
+ {children} + + ) +} diff --git a/bench/minimal-server/benchmark-app/app/rsc/page.js b/bench/minimal-server/benchmark-app/app/rsc/page.js new file mode 100644 index 0000000000000..395757bacd944 --- /dev/null +++ b/bench/minimal-server/benchmark-app/app/rsc/page.js @@ -0,0 +1,5 @@ +import * as React from 'react' + +export default function page() { + return- This is the about page, navigating between this page and Home is - always pretty fast. However, when you navigate to the Profile{' '} - page it takes more time because it uses SSR to fetch the user first; + This project shows different ways to display Profile info: using{' '} + Client rendered, Server rendered, and API rendered +
++ Navigating between this page and Home is always pretty fast. + However, when you navigate to the Server rendered profile page it + takes more time because it uses SSR to fetch the user and then to + display it
We are fetching data on the client-side :
+By making request to '/api/protected-api' serverless function
+so without a valid session cookie will fail
+{JSON.stringify(data)}
+Loading login info...
} + {isLoading &&Loading login info...
} - {!loading && !user && ( + {!isLoading && !user && ( <>To test the login click in Login
- Once you have logged in you should be able to click in{' '} - Profile and Logout + Once you have logged in you should be able to navigate between + protected routes: client rendered, server rendered profile pages, + and Logout
> )} @@ -34,4 +35,5 @@ const Home = () => { ) } +// fast/cached SSR page export default Home diff --git a/examples/auth0/pages/profile.tsx b/examples/auth0/pages/profile.tsx index c3c95e3f2f638..9e83595b6b55d 100644 --- a/examples/auth0/pages/profile.tsx +++ b/examples/auth0/pages/profile.tsx @@ -1,6 +1,4 @@ -// This import is only needed when checking authentication status directly from getInitialProps -// import auth0 from '../lib/auth0' -import { useFetchUser } from '../lib/user' +import { withPageAuthRequired } from '@auth0/nextjs-auth0' import Layout from '../components/layout' import { User } from '../interfaces' @@ -23,14 +21,13 @@ const ProfileCard = ({ user }: ProfileCardProps) => { ) } -const Profile = () => { - const { user, loading } = useFetchUser({ required: true }) - +const Profile = ({ user, isLoading }) => { return ( -+ + {getFrameSource(stackFrame)} @ {stackFrame.methodName} + + +
+
+ {decoded.map((entry, index) => (
+
+ {entry.content}
+
+ ))}
+
+ content
' + }, +} + +// elements with display:flex are focusable in IE10-11 +var focusFlexboxContainer = { + element: 'span', + mutate: function mutate(element) { + element.setAttribute( + 'style', + 'display: -webkit-flex; display: -ms-flexbox; display: flex;' + ) + element.innerHTML = 'hello' + }, +} + +// form[tabindex=0][disabled] should be focusable as the +// specification doesn't know the disabled attribute on the form element +// @specification https://www.w3.org/TR/html5/forms.html#the-form-element +var focusFormDisabled = { + element: 'form', + mutate: function mutate(element) { + element.setAttribute('tabindex', 0) + element.setAttribute('disabled', 'disabled') + }, +} + +// NOTE: https://github.com/medialize/ally.js/issues/35 +// fixes https://github.com/medialize/ally.js/issues/20 +// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-ismap +var focusImgIsmap = { + element: 'a', + mutate: function mutate(element) { + element.href = '#void' + element.innerHTML = '