diff --git a/.eslintrc.json b/.eslintrc.json index 0081edc950129..4151575356c85 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -93,7 +93,7 @@ ], "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": [ - "warn", + "error", { "args": "none", "ignoreRestSiblings": true @@ -102,7 +102,7 @@ "no-use-before-define": "off", "no-useless-constructor": "off", "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-useless-constructor": "warn", + "@typescript-eslint/no-useless-constructor": "error", "@typescript-eslint/prefer-literal-enum-member": "error" } }, @@ -150,7 +150,7 @@ "packages/next/webpack.config.js" ], "rules": { - "no-shadow": ["warn", { "builtinGlobals": false }], + "no-shadow": ["error", { "builtinGlobals": false }], "import/no-extraneous-dependencies": [ "error", { "devDependencies": false } @@ -162,9 +162,9 @@ "rules": { // Note: you must disable the base rule as it can report incorrect errors "no-shadow": "off", - "@typescript-eslint/no-shadow": ["warn", { "builtinGlobals": false }], + "@typescript-eslint/no-shadow": ["error", { "builtinGlobals": false }], "@typescript-eslint/no-unused-vars": [ - "warn", + "error", { "args": "all", "argsIgnorePattern": "^_", @@ -211,39 +211,39 @@ } ], "rules": { - "array-callback-return": "warn", - "default-case": ["warn", { "commentPattern": "^no default$" }], - "dot-location": ["warn", "property"], - "eqeqeq": ["warn", "smart"], - "new-parens": "warn", - "no-array-constructor": "warn", - "no-caller": "warn", - "no-cond-assign": ["warn", "except-parens"], - "no-const-assign": "warn", - "no-control-regex": "warn", - "no-delete-var": "warn", - "no-dupe-args": "warn", - "no-dupe-class-members": "warn", - "no-dupe-keys": "warn", - "no-duplicate-case": "warn", - "no-empty-character-class": "warn", - "no-empty-pattern": "warn", - "no-eval": "warn", - "no-ex-assign": "warn", - "no-extend-native": "warn", - "no-extra-bind": "warn", - "no-extra-label": "warn", - "no-fallthrough": "warn", - "no-func-assign": "warn", - "no-implied-eval": "warn", - "no-invalid-regexp": "warn", - "no-iterator": "warn", - "no-label-var": "warn", - "no-labels": ["warn", { "allowLoop": true, "allowSwitch": false }], - "no-lone-blocks": "warn", - "no-loop-func": "warn", + "array-callback-return": "error", + "default-case": ["error", { "commentPattern": "^no default$" }], + "dot-location": ["error", "property"], + "eqeqeq": ["error", "smart"], + "new-parens": "error", + "no-array-constructor": "error", + "no-caller": "error", + "no-cond-assign": ["error", "except-parens"], + "no-const-assign": "error", + "no-control-regex": "error", + "no-delete-var": "error", + "no-dupe-args": "error", + "no-dupe-class-members": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-empty-character-class": "error", + "no-empty-pattern": "error", + "no-eval": "error", + "no-ex-assign": "error", + "no-extend-native": "error", + "no-extra-bind": "error", + "no-extra-label": "error", + "no-fallthrough": "error", + "no-func-assign": "error", + "no-implied-eval": "error", + "no-invalid-regexp": "error", + "no-iterator": "error", + "no-label-var": "error", + "no-labels": ["error", { "allowLoop": true, "allowSwitch": false }], + "no-lone-blocks": "error", + "no-loop-func": "error", "no-mixed-operators": [ - "warn", + "error", { "groups": [ ["&", "|", "^", "~", "<<", ">>", ">>>"], @@ -254,37 +254,37 @@ "allowSamePrecedence": false } ], - "no-multi-str": "warn", - "no-native-reassign": "warn", - "no-negated-in-lhs": "warn", - "no-new-func": "warn", - "no-new-object": "warn", - "no-new-symbol": "warn", - "no-new-wrappers": "warn", - "no-obj-calls": "warn", - "no-octal": "warn", - "no-octal-escape": "warn", - "no-regex-spaces": "warn", + "no-multi-str": "error", + "no-native-reassign": "error", + "no-negated-in-lhs": "error", + "no-new-func": "error", + "no-new-object": "error", + "no-new-symbol": "error", + "no-new-wrappers": "error", + "no-obj-calls": "error", + "no-octal": "error", + "no-octal-escape": "error", + "no-regex-spaces": "error", "no-restricted-syntax": [ - "warn", + "error", "WithStatement", { "message": "substr() is deprecated, use slice() or substring() instead", "selector": "MemberExpression > Identifier[name='substr']" } ], - "no-script-url": "warn", - "no-self-assign": "warn", - "no-self-compare": "warn", - "no-sequences": "warn", - "no-shadow-restricted-names": "warn", - "no-sparse-arrays": "warn", + "no-script-url": "error", + "no-self-assign": "error", + "no-self-compare": "error", + "no-sequences": "error", + "no-shadow-restricted-names": "error", + "no-sparse-arrays": "error", "no-template-curly-in-string": "error", - "no-this-before-super": "warn", - "no-throw-literal": "warn", + "no-this-before-super": "error", + "no-throw-literal": "error", "no-undef": "error", - "no-unexpected-multiline": "warn", - "no-unreachable": "warn", + "no-unexpected-multiline": "error", + "no-unreachable": "error", "no-unused-expressions": [ "error", { @@ -293,64 +293,64 @@ "allowTaggedTemplates": true } ], - "no-unused-labels": "warn", + "no-unused-labels": "error", "no-unused-vars": [ - "warn", + "error", { "args": "none", "ignoreRestSiblings": true } ], "no-use-before-define": "off", - "no-useless-computed-key": "warn", - "no-useless-concat": "warn", - "no-useless-constructor": "warn", - "no-useless-escape": "warn", + "no-useless-computed-key": "error", + "no-useless-concat": "error", + "no-useless-constructor": "error", + "no-useless-escape": "error", "no-useless-rename": [ - "warn", + "error", { "ignoreDestructuring": false, "ignoreImport": false, "ignoreExport": false } ], - "no-with": "warn", - "no-whitespace-before-property": "warn", - "react-hooks/exhaustive-deps": "warn", - "require-yield": "warn", - "rest-spread-spacing": ["warn", "never"], - "strict": ["warn", "never"], - "unicode-bom": ["warn", "never"], - "use-isnan": "warn", - "valid-typeof": "warn", - "getter-return": "warn", - "react/forbid-foreign-prop-types": ["warn", { "allowInPropTypes": true }], - "react/jsx-no-comment-textnodes": "warn", - "react/jsx-no-duplicate-props": "warn", - "react/jsx-no-target-blank": "warn", + "no-with": "error", + "no-whitespace-before-property": "error", + "react-hooks/exhaustive-deps": "error", + "require-yield": "error", + "rest-spread-spacing": ["error", "never"], + "strict": ["error", "never"], + "unicode-bom": ["error", "never"], + "use-isnan": "error", + "valid-typeof": "error", + "getter-return": "error", + "react/forbid-foreign-prop-types": ["error", { "allowInPropTypes": true }], + "react/jsx-no-comment-textnodes": "error", + "react/jsx-no-duplicate-props": "error", + "react/jsx-no-target-blank": "error", "react/jsx-no-undef": "error", "react/jsx-pascal-case": [ - "warn", + "error", { "allowAllCaps": true, "ignore": [] } ], - "react/jsx-uses-react": "warn", - "react/jsx-uses-vars": "warn", - "react/no-danger-with-children": "warn", - "react/no-deprecated": "warn", - "react/no-direct-mutation-state": "warn", - "react/no-is-mounted": "warn", + "react/jsx-uses-react": "error", + "react/jsx-uses-vars": "error", + "react/no-danger-with-children": "error", + "react/no-deprecated": "error", + "react/no-direct-mutation-state": "error", + "react/no-is-mounted": "error", "react/no-typos": "error", "react/react-in-jsx-scope": "off", "react/require-render-return": "error", - "react/style-prop-object": "warn", + "react/style-prop-object": "error", "react-hooks/rules-of-hooks": "error", - // "@typescript-eslint/non-nullable-type-assertion-style": "warn", - "@typescript-eslint/prefer-as-const": "warn", + // "@typescript-eslint/non-nullable-type-assertion-style": "error", + "@typescript-eslint/prefer-as-const": "error", "@typescript-eslint/no-redeclare": [ - "warn", + "error", { "builtinGlobals": false, "ignoreDeclarationMerge": true } ] } diff --git a/.github/workflows/test_e2e_deploy_related.yml b/.github/workflows/test_e2e_deploy_related.yml deleted file mode 100644 index acda4db3332c7..0000000000000 --- a/.github/workflows/test_e2e_deploy_related.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Test E2E (Vercel Deploy), related - -on: - pull_request: - types: [opened, synchronize] - -jobs: - test: - if: '!github.event.pull_request.head.repo.fork' - runs-on: ubuntu-latest - - env: - CARGO_PROFILE_RELEASE_LTO: 'true' - DATADOG_API_KEY: ${{ secrets.DATA_DOG_API_KEY }} - DD_ENV: 'ci' - NAPI_CLI_VERSION: 2.16.2 - NEXT_JUNIT_TEST_REPORT: 'true' - NEXT_TELEMETRY_DISABLED: 1 - NEXT_TEST_JOB: 1 - NEXT_TEST_MODE: 'deploy' - NODE_LTS_VERSION: 20 - TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }} - TURBO_REMOTE_ONLY: 'true' - TURBO_TEAM: 'vercel' - TURBO_VERSION: 1.13.3-canary.2 - VERCEL_TEST_TEAM: vtest314-next-e2e-tests - VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }} - - strategy: - fail-fast: false - - steps: - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_LTS_VERSION }} - check-latest: true - - - name: Setup pnpm - run: corepack enable - - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 25 - - - name: Setup tests - run: | - pnpm install - pnpm run build - npm i -g vercel@latest - node scripts/run-e2e-test-project-reset.mjs - - - name: Run tests - run: | - docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.41.2-jammy /bin/bash -c "cd /work && \ - NODE_VERSION=${{ env.NODE_LTS_VERSION }} ./scripts/setup-node.sh && \ - corepack enable > /dev/null && \ - NEXT_JUNIT_TEST_REPORT=${{ env.NEXT_JUNIT_TEST_REPORT }} \ - DATADOG_API_KEY=${{ env.DATADOG_API_KEY }} \ - DD_ENV=${{ env.DD_ENV }} \ - VERCEL_TEST_TOKEN=${{ env.VERCEL_TEST_TOKEN }} \ - VERCEL_TEST_TEAM=${{ env.VERCEL_TEST_TEAM }} \ - NEXT_TEST_JOB=${{ env.NEXT_TEST_JOB }} \ - NEXT_TEST_MODE=${{ env.NEXT_TEST_MODE }} \ - TEST_TIMINGS_TOKEN=${{ env.TEST_TIMINGS_TOKEN }} \ - xvfb-run node run-tests.js --related --timings -c 1 >> /proc/1/fd/1" - - - name: Save test report as artifacts - if: always() - uses: actions/upload-artifact@v4 - with: - name: test-reports - if-no-files-found: ignore - retention-days: 2 - path: test/test-junit-report - - - name: Upload test report to Datadog - continue-on-error: true - run: | - pnpx @datadog/datadog-ci@2.23.1 junit upload --tags test.type:nextjs_deploy_e2e --service nextjs ./test/test-junit-report diff --git a/Cargo.lock b/Cargo.lock index 982b635219835..593060f5cc206 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -321,7 +321,7 @@ dependencies = [ [[package]] name = "auto-hash-map" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "serde", "smallvec", @@ -1138,7 +1138,7 @@ dependencies = [ "cssparser-macros", "dtoa-short", "itoa", - "phf 0.10.1", + "phf 0.11.2", "serde", "smallvec", ] @@ -3092,7 +3092,7 @@ dependencies = [ [[package]] name = "node-file-trace" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "serde", @@ -3568,9 +3568,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" dependencies = [ - "phf_macros 0.10.0", "phf_shared 0.10.0", - "proc-macro-hack", ] [[package]] @@ -3579,7 +3577,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ - "phf_macros 0.11.2", + "phf_macros", "phf_shared 0.11.2", ] @@ -3613,20 +3611,6 @@ dependencies = [ "rand", ] -[[package]] -name = "phf_macros" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" -dependencies = [ - "phf_generator 0.10.0", - "phf_shared 0.10.0", - "proc-macro-hack", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "phf_macros" version = "0.11.2" @@ -3821,12 +3805,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro2" version = "1.0.79" @@ -6969,12 +6947,12 @@ dependencies = [ [[package]] name = "turbo-prehash" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" [[package]] name = "turbo-tasks" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "async-trait", @@ -7006,7 +6984,7 @@ dependencies = [ [[package]] name = "turbo-tasks-build" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "cargo-lock", @@ -7018,7 +6996,7 @@ dependencies = [ [[package]] name = "turbo-tasks-bytes" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "bytes", @@ -7032,7 +7010,7 @@ dependencies = [ [[package]] name = "turbo-tasks-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "dotenvs", @@ -7046,7 +7024,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fetch" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "lazy_static", @@ -7062,7 +7040,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fs" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "auto-hash-map", @@ -7094,7 +7072,7 @@ dependencies = [ [[package]] name = "turbo-tasks-hash" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "md4", "turbo-tasks-macros", @@ -7104,7 +7082,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "proc-macro-error", @@ -7118,7 +7096,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros-shared" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "proc-macro2", "quote", @@ -7128,7 +7106,7 @@ dependencies = [ [[package]] name = "turbo-tasks-malloc" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "mimalloc", ] @@ -7136,7 +7114,7 @@ dependencies = [ [[package]] name = "turbo-tasks-memory" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "auto-hash-map", @@ -7163,7 +7141,7 @@ dependencies = [ [[package]] name = "turbopack" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "async-recursion", @@ -7193,7 +7171,7 @@ dependencies = [ [[package]] name = "turbopack-binding" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "auto-hash-map", "mdxjs", @@ -7234,7 +7212,7 @@ dependencies = [ [[package]] name = "turbopack-browser" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7257,7 +7235,7 @@ dependencies = [ [[package]] name = "turbopack-cli-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "clap", @@ -7274,7 +7252,7 @@ dependencies = [ [[package]] name = "turbopack-core" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "async-recursion", @@ -7303,7 +7281,7 @@ dependencies = [ [[package]] name = "turbopack-css" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7330,7 +7308,7 @@ dependencies = [ [[package]] name = "turbopack-dev-server" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "async-compression", @@ -7366,7 +7344,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "async-trait", @@ -7401,7 +7379,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-hmr-protocol" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "serde", "serde_json", @@ -7412,7 +7390,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-plugins" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "async-trait", @@ -7437,7 +7415,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-runtime" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "indoc", @@ -7453,7 +7431,7 @@ dependencies = [ [[package]] name = "turbopack-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7469,7 +7447,7 @@ dependencies = [ [[package]] name = "turbopack-image" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "base64 0.21.4", @@ -7488,7 +7466,7 @@ dependencies = [ [[package]] name = "turbopack-json" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "serde", @@ -7503,7 +7481,7 @@ dependencies = [ [[package]] name = "turbopack-mdx" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "mdxjs", @@ -7518,7 +7496,7 @@ dependencies = [ [[package]] name = "turbopack-node" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "async-stream", @@ -7552,7 +7530,7 @@ dependencies = [ [[package]] name = "turbopack-nodejs" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7572,7 +7550,7 @@ dependencies = [ [[package]] name = "turbopack-resolve" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7590,7 +7568,7 @@ dependencies = [ [[package]] name = "turbopack-static" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "serde", @@ -7606,7 +7584,7 @@ dependencies = [ [[package]] name = "turbopack-swc-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "swc_core", "turbo-tasks", @@ -7617,7 +7595,7 @@ dependencies = [ [[package]] name = "turbopack-trace-server" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "either", @@ -7637,7 +7615,7 @@ dependencies = [ [[package]] name = "turbopack-trace-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "crossbeam-channel", @@ -7653,7 +7631,7 @@ dependencies = [ [[package]] name = "turbopack-wasm" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240607.3#c2fb13e3101ae2a6331453a3e925d832e52ced91" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240610.2#efcea7608461e2c90943cbea54ef638c7e7a25d6" dependencies = [ "anyhow", "indexmap 1.9.3", diff --git a/Cargo.toml b/Cargo.toml index 48b55d8bee122..16ffbc9d43e30 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,11 +37,11 @@ swc_core = { version = "0.92.5", features = [ testing = { version = "0.35.25" } # Turbo crates -turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240607.3" } +turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240610.2" } # [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros.. -turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240607.3" } +turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240610.2" } # [TODO]: need to refactor embed_directory! macro usage in next-core -turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240607.3" } +turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240610.2" } # General Deps diff --git a/docs/02-app/01-building-your-application/04-caching/index.mdx b/docs/02-app/01-building-your-application/04-caching/index.mdx index 625097480c24b..8e482a7918f4a 100644 --- a/docs/02-app/01-building-your-application/04-caching/index.mdx +++ b/docs/02-app/01-building-your-application/04-caching/index.mdx @@ -536,9 +536,42 @@ See the [Route Segment Config](/docs/app/api-reference/file-conventions/route-se For [dynamic segments](/docs/app/building-your-application/routing/dynamic-routes) (e.g. `app/blog/[slug]/page.js`), paths provided by `generateStaticParams` are cached in the Full Route Cache at build time. At request time, Next.js will also cache paths that weren't known at build time the first time they're visited. -You can disable caching at request time by using `export const dynamicParams = false` option in a route segment. When this config option is used, only paths provided by `generateStaticParams` will be served, and other routes will 404 or match (in the case of [catch-all routes](/docs/app/building-your-application/routing/dynamic-routes#catch-all-segments)). +To statically render all paths at build time, supply the full list of paths to `generateStaticParams`: -See the [`generateStaticParams` API reference](/docs/app/api-reference/functions/generate-static-params). +```tsx filename="app/blog/[slug]/page.tsx" switcher +export async function generateStaticParams() { + const posts = await fetch('https://.../posts').then((res) => res.json()) + + return posts.map((post) => ({ + slug: post.slug, + })) +} +``` + +To statically render a subset of paths at build time, and the rest the first time they're visited at runtime, return a partial list of paths: + +```tsx filename="app/blog/[slug]/page.tsx" switcher +export async function generateStaticParams() { + const posts = await fetch('https://.../posts').then((res) => res.json()) + + // Render the first 10 posts at build time + return posts.slice(0, 10).map((post) => ({ + slug: post.slug, + })) +} +``` + +To statically render all paths the first time they're visited, return an empty array (no paths will be rendered at build time): + +```tsx filename="app/blog/[slug]/page.tsx" switcher +export async function generateStaticParams() { + return [] +} +``` + +> **Good to know:** You must always return an array from `generateStaticParams`, even if it's empty. Otherwise, the route will be dynamically rendered. + +To disable caching at request time, add the `export const dynamicParams = false` option in a route segment. When this config option is used, only paths provided by `generateStaticParams` will be served, and other routes will 404 or match (in the case of [catch-all routes](/docs/app/building-your-application/routing/dynamic-routes#catch-all-segments)). ### React `cache` function diff --git a/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx b/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx index 75fa2686bda13..4aa94f9c022fb 100644 --- a/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx +++ b/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx @@ -97,7 +97,7 @@ export default function sitemap() { Output: -```xml filename="acme.com/sitemap" +```xml filename="acme.com/sitemap.xml" https://acme.com @@ -163,7 +163,7 @@ export default function sitemap(): MetadataRoute.Sitemap { Output: -```xml filename="acme.com/sitemap" +```xml filename="acme.com/sitemap.xml" https://acme.com @@ -264,7 +264,7 @@ export default async function sitemap({ id }) { } ``` -Your generated sitemaps will be available at `/.../sitemap/[id]`. For example, `/product/sitemap/1`. +Your generated sitemaps will be available at `/.../sitemap/[id]`. For example, `/product/sitemap/1.xml`. See the [`generateSitemaps` API reference](/docs/app/api-reference/functions/generate-sitemaps) for more information. diff --git a/docs/02-app/02-api-reference/02-file-conventions/route-segment-config.mdx b/docs/02-app/02-api-reference/02-file-conventions/route-segment-config.mdx index 0c00300a97663..95c0b34be0f12 100644 --- a/docs/02-app/02-api-reference/02-file-conventions/route-segment-config.mdx +++ b/docs/02-app/02-api-reference/02-file-conventions/route-segment-config.mdx @@ -84,6 +84,7 @@ export const dynamicParams = true // true | false, > **Good to know**: > > - This option replaces the `fallback: true | false | blocking` option of `getStaticPaths` in the `pages` directory. +> - To statically render all paths the first time they're visited, you'll need to return an empty array in `generateStaticParams`. > - When `dynamicParams = true`, the segment uses [Streaming Server Rendering](/docs/app/building-your-application/routing/loading-ui-and-streaming#streaming-with-suspense). > - If the `dynamic = 'error'` and `dynamic = 'force-static'` are used, it'll change the default of `dynamicParams` to `false`. diff --git a/docs/02-app/02-api-reference/04-functions/generate-static-params.mdx b/docs/02-app/02-api-reference/04-functions/generate-static-params.mdx index 34aa34733df33..ea0eb37964c11 100644 --- a/docs/02-app/02-api-reference/04-functions/generate-static-params.mdx +++ b/docs/02-app/02-api-reference/04-functions/generate-static-params.mdx @@ -26,6 +26,7 @@ export default function Page({ params }) { > **Good to know** > > - You can use the [`dynamicParams`](/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams) segment config option to control what happens when a dynamic segment is visited that was not generated with `generateStaticParams`. +> - You must always return [an array from `generateStaticParams`](#all-paths-at-build-time), even if it's empty. > - During `next dev`, `generateStaticParams` will be called when you navigate to a route. > - During `next build`, `generateStaticParams` runs before the corresponding Layouts or Pages are generated. > - During revalidation (ISR), `generateStaticParams` will not be called again. @@ -168,6 +169,69 @@ export default function Page({ params }) { ## Examples +### Static Rendering + +#### All paths at build time + +To statically render all paths at build time, supply the full list of paths to `generateStaticParams`: + +```tsx filename="app/blog/[slug]/page.tsx" switcher +export async function generateStaticParams() { + const posts = await fetch('https://.../posts').then((res) => res.json()) + + return posts.map((post) => ({ + slug: post.slug, + })) +} +``` + +#### Subset of paths at build time + +To statically render a subset of paths at build time, and the rest the first time they're visited at runtime, return a partial list of paths: + +```tsx filename="app/blog/[slug]/page.tsx" switcher +export async function generateStaticParams() { + const posts = await fetch('https://.../posts').then((res) => res.json()) + + // Render the first 10 posts at build time + return posts.slice(0, 10).map((post) => ({ + slug: post.slug, + })) +} +``` + +Then, by using the [`dynamicParams`](/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams) segment config option, you can control what happens when a dynamic segment is visited that was not generated with `generateStaticParams`. + +```jsx filename="app/blog/[slug]/page.js" +// All posts besides the top 10 will be a 404 +export const dynamicParams = false + +export async function generateStaticParams() { + const posts = await fetch('https://.../posts').then((res) => res.json()) + const topPosts = posts.slice(0, 10) + + return topPosts.map((post) => ({ + slug: post.slug, + })) +} +``` + +#### All paths at runtime + +To statically render all paths the first time they're visited, return an empty array (no paths will be rendered at build time): + +```tsx filename="app/blog/[slug]/page.tsx" switcher +export async function generateStaticParams() { + return [] +} +``` + +> **Good to know:** You must always return an array from `generateStaticParams`, even if it's empty. Otherwise, the route will be dynamically rendered. + +### Disable rendering for unspecified paths + +To prevent unspecified paths from being statically rendered at runtime, add the `export const dynamicParams = false` option in a route segment. When this config option is used, only paths provided by `generateStaticParams` will be served, and unspecified routes will 404 or match (in the case of [catch-all routes](/docs/app/building-your-application/routing/dynamic-routes#catch-all-segments)). + ### Multiple Dynamic Segments in a Route You can generate params for dynamic segments above the current layout or page, but **not below**. For example, given the `app/products/[category]/[product]` route: @@ -177,7 +241,7 @@ You can generate params for dynamic segments above the current layout or page, b There are two approaches to generating params for a route with multiple dynamic segments: -### Generate params from the bottom up +#### Generate params from the bottom up Generate multiple dynamic segments from the child route segment. @@ -217,7 +281,7 @@ export default function Page({ params }) { } ``` -### Generate params from the top down +#### Generate params from the top down Generate the parent segments first and use the result to generate the child segments. @@ -301,24 +365,6 @@ export default function Page({ params }) { > **Good to know**: `fetch` requests are automatically [memoized](/docs/app/building-your-application/caching#request-memoization) for the same data across all `generate`-prefixed functions, Layouts, Pages, and Server Components. React [`cache` can be used](/docs/app/building-your-application/caching#react-cache-function) if `fetch` is unavailable. -### Generate only a subset of params - -You can generate a subset of params for a route by returning an array of objects with only the dynamic segments you want to generate. Then, by using the [`dynamicParams`](/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams) segment config option, you can control what happens when a dynamic segment is visited that was not generated with `generateStaticParams`. - -```jsx filename="app/blog/[slug]/page.js" -// All posts besides the top 10 will be a 404 -export const dynamicParams = false - -export async function generateStaticParams() { - const posts = await fetch('https://.../posts').then((res) => res.json()) - const topPosts = posts.slice(0, 10) - - return topPosts.map((post) => ({ - slug: post.slug, - })) -} -``` - ## Version History | Version | Changes | diff --git a/docs/02-app/02-api-reference/04-functions/unstable_after.mdx b/docs/02-app/02-api-reference/04-functions/unstable_after.mdx index b1f243f541f25..21efe30979431 100644 --- a/docs/02-app/02-api-reference/04-functions/unstable_after.mdx +++ b/docs/02-app/02-api-reference/04-functions/unstable_after.mdx @@ -20,6 +20,8 @@ const nextConfig = { module.exports = nextConfig ``` +The function accepts a callback that will be executed after the response is finished: + ```tsx filename="app/layout.tsx switcher import { unstable_after as after } from 'next/server' import { log } from '@/app/utils' @@ -52,11 +54,25 @@ export default function Layout({ children }) { > - `unstable_after()` is a [dynamic function](/docs/app/building-your-application/rendering/server-components#dynamic-functions) that will opt a route into dynamic rendering. This behavior can be overridden with the [`export dynamic = "force-static"`](/docs/app/api-reference/file-conventions/route-segment-config#dynamic) segment config. > - You can use React `cache` to deduplicate functions called inside `unstable_after()`. > - [`cookies()`](/docs/app/api-reference/functions/cookies) cannot be set inside `unstable_after()` since the response has already been sent. +> - `unstable_after()` can be nested inside other `unstable_after()` calls. -### Parameters +## Parameters -- A function that will be executed after the response is finished. +- A callback function which will be executed after the response is finished. -### Returns +## Returns - `unstable_after()` does not return a value. + +## Alternatives + +The use case for `unstable_after()` is to process secondary tasks without blocking the primary response. It's similar to using the platform's [`waitUntil()`](https://vercel.com/docs/functions/functions-api-reference) or removing `await` from a promise, but with the following differences: + +- **`waitUntil()`**: accepts a promise and enqueues a task to be executed during the lifecycle of the request, whereas `unstable_after()` accepts a callback that will be executed **after** the response is finished. +- **Removing `await`**: starts executing during the response, which uses resources. It's also not reliable in serverless environments as the function stops computation immediately after the response is sent, potentially interrupting the task. + +We recommend using `unstable_after()` as it has been designed to consider other Next.js APIs and contexts. + +## Serverless function duration + +`unstable_after()` will run for the platform's default or configured max duration of a serverless function. If your platform supports it, you can configure the timeout limit using the [`maxDuration`](/docs/app/api-reference/file-conventions/route-segment-config#maxduration) route segment config. diff --git a/lerna.json b/lerna.json index 94a4e3ec3aa34..c3bdab6d1098d 100644 --- a/lerna.json +++ b/lerna.json @@ -16,5 +16,5 @@ "registry": "https://registry.npmjs.org/" } }, - "version": "15.0.0-canary.23" + "version": "15.0.0-canary.25" } diff --git a/lint-staged.config.js b/lint-staged.config.js index 9397860c6c07e..167eaaaa0fa0d 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,44 +1,8 @@ -const { quote } = require('shell-quote') -const { ESLint } = require('eslint') - -const eslint = new ESLint() - -/** - * Escape filenames to ensure that spaces and such aren't interpreted as - * separators. - * - * @param {string[]} filenames - * @returns {string[]} - */ -function escape(filenames) { - if (process.platform === 'win32') { - return filenames - } - - return filenames.map((filename) => quote([filename]).replace(/\\@/g, '@')) -} - module.exports = { - '*.{js,jsx,mjs,ts,tsx,mts}': async (filenames) => { - const escapedFileNames = escape(filenames).join(' ') - const eslintFileNames = await Promise.all( - filenames.map(async (filename) => { - const ignored = await eslint.isPathIgnored(filename) - return ignored ? null : filename - }) - ) - - return [ - `prettier --with-node-modules --ignore-path .prettierignore --write ${escapedFileNames}`, - `eslint --no-ignore --max-warnings=0 --fix ${eslintFileNames - .filter((filename) => filename !== null) - .map((filename) => { - return `"${filename}"` - }) - .join(' ')}`, - `git add ${escapedFileNames}`, - ] - }, + '*.{js,jsx,mjs,ts,tsx,mts}': [ + 'prettier --with-node-modules --ignore-path .prettierignore --write', + 'eslint --fix', + ], '*.{json,md,mdx,css,html,yml,yaml,scss}': [ 'prettier --with-node-modules --ignore-path .prettierignore --write', ], diff --git a/package.json b/package.json index d7add869c8697..07c9d84f46acd 100644 --- a/package.json +++ b/package.json @@ -33,12 +33,12 @@ "git-clean": "git clean -d -x -e node_modules -e packages -f", "typescript": "tsc --noEmit", "lint-typescript": "turbo run typescript", - "lint-eslint": "eslint . --ext js,jsx,ts,tsx --max-warnings=0 --config .eslintrc.json --no-eslintrc", + "lint-eslint": "eslint . --ext js,jsx,ts,tsx --config .eslintrc.json --no-eslintrc", "lint-no-typescript": "run-p prettier-check lint-eslint lint-language", "types-and-precompiled": "run-p lint-typescript check-precompiled validate-externals-doc", "validate-externals-doc": "node ./scripts/validate-externals-doc.js", "lint": "run-p test-types lint-typescript prettier-check lint-eslint lint-language", - "lint-fix": "pnpm prettier-fix && eslint . --ext js,jsx,ts,tsx --fix --max-warnings=0 --config .eslintrc.json --no-eslintrc", + "lint-fix": "pnpm prettier-fix && eslint . --ext js,jsx,ts,tsx --fix --config .eslintrc.json --no-eslintrc", "lint-language": "alex .", "prettier-check": "prettier --check .", "check-examples": "./scripts/check-examples.sh", @@ -197,18 +197,18 @@ "pretty-bytes": "5.3.0", "pretty-ms": "7.0.0", "random-seed": "0.3.0", - "react": "19.0.0-rc-1df34bdf62-20240605", + "react": "19.0.0-rc-6230622a1a-20240610", "react-17": "npm:react@17.0.2", - "react-builtin": "npm:react@19.0.0-rc-1df34bdf62-20240605", - "react-dom": "19.0.0-rc-1df34bdf62-20240605", + "react-builtin": "npm:react@19.0.0-rc-6230622a1a-20240610", + "react-dom": "19.0.0-rc-6230622a1a-20240610", "react-dom-17": "npm:react-dom@17.0.2", - "react-dom-builtin": "npm:react-dom@19.0.0-rc-1df34bdf62-20240605", - "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-1df34bdf62-20240605", - "react-experimental-builtin": "npm:react@0.0.0-experimental-1df34bdf62-20240605", - "react-server-dom-turbopack": "19.0.0-rc-1df34bdf62-20240605", - "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-1df34bdf62-20240605", - "react-server-dom-webpack": "19.0.0-rc-1df34bdf62-20240605", - "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-1df34bdf62-20240605", + "react-dom-builtin": "npm:react-dom@19.0.0-rc-6230622a1a-20240610", + "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-6230622a1a-20240610", + "react-experimental-builtin": "npm:react@0.0.0-experimental-6230622a1a-20240610", + "react-server-dom-turbopack": "19.0.0-rc-6230622a1a-20240610", + "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-6230622a1a-20240610", + "react-server-dom-webpack": "19.0.0-rc-6230622a1a-20240610", + "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-6230622a1a-20240610", "react-ssr-prepass": "1.0.8", "react-virtualized": "9.22.3", "relay-compiler": "13.0.2", @@ -218,8 +218,8 @@ "resolve-from": "5.0.0", "sass": "1.54.0", "satori": "0.10.9", - "scheduler-builtin": "npm:scheduler@0.25.0-rc-1df34bdf62-20240605", - "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-1df34bdf62-20240605", + "scheduler-builtin": "npm:scheduler@0.25.0-rc-6230622a1a-20240610", + "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-6230622a1a-20240610", "seedrandom": "3.0.5", "semver": "7.3.7", "shell-quote": "1.7.3", @@ -253,10 +253,10 @@ "@babel/traverse": "7.22.5", "@types/react": "npm:types-react@19.0.0-rc.0", "@types/react-dom": "npm:types-react-dom@19.0.0-rc.0", - "react": "19.0.0-rc-1df34bdf62-20240605", - "react-dom": "19.0.0-rc-1df34bdf62-20240605", - "react-is": "19.0.0-rc-1df34bdf62-20240605", - "scheduler": "0.25.0-rc-1df34bdf62-20240605" + "react": "19.0.0-rc-6230622a1a-20240610", + "react-dom": "19.0.0-rc-6230622a1a-20240610", + "react-is": "19.0.0-rc-6230622a1a-20240610", + "scheduler": "0.25.0-rc-6230622a1a-20240610" }, "engines": { "node": ">=18.17.0", diff --git a/packages/create-next-app/package.json b/packages/create-next-app/package.json index 6ac5ceb7c032c..acc47eb880e53 100644 --- a/packages/create-next-app/package.json +++ b/packages/create-next-app/package.json @@ -1,6 +1,6 @@ { "name": "create-next-app", - "version": "15.0.0-canary.23", + "version": "15.0.0-canary.25", "keywords": [ "react", "next", @@ -32,7 +32,7 @@ "@types/async-retry": "1.4.2", "@types/ci-info": "2.0.0", "@types/cross-spawn": "6.0.0", - "@types/node": "^20.12.3", + "@types/node": "20.14.2", "@types/prompts": "2.4.2", "@types/tar": "6.1.13", "@types/validate-npm-package-name": "4.0.2", diff --git a/packages/create-next-app/templates/app-tw/js/README-template.md b/packages/create-next-app/templates/app-tw/js/README-template.md index 4745a63eda105..66bb426ffe6ec 100644 --- a/packages/create-next-app/templates/app-tw/js/README-template.md +++ b/packages/create-next-app/templates/app-tw/js/README-template.md @@ -18,7 +18,7 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file. -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load Inter, a custom Google Font. +This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. ## Learn More diff --git a/packages/create-next-app/templates/app-tw/ts/README-template.md b/packages/create-next-app/templates/app-tw/ts/README-template.md index a98bfa8140e14..234c6d154f643 100644 --- a/packages/create-next-app/templates/app-tw/ts/README-template.md +++ b/packages/create-next-app/templates/app-tw/ts/README-template.md @@ -18,7 +18,7 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load Inter, a custom Google Font. +This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. ## Learn More diff --git a/packages/create-next-app/templates/app/js/README-template.md b/packages/create-next-app/templates/app/js/README-template.md index c3ff7774f638d..6410399e647f8 100644 --- a/packages/create-next-app/templates/app/js/README-template.md +++ b/packages/create-next-app/templates/app/js/README-template.md @@ -18,7 +18,7 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file. -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load Inter, a custom Google Font. +This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. ## Learn More diff --git a/packages/create-next-app/templates/app/ts/README-template.md b/packages/create-next-app/templates/app/ts/README-template.md index a98bfa8140e14..234c6d154f643 100644 --- a/packages/create-next-app/templates/app/ts/README-template.md +++ b/packages/create-next-app/templates/app/ts/README-template.md @@ -18,7 +18,7 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load Inter, a custom Google Font. +This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. ## Learn More diff --git a/packages/create-next-app/templates/default-tw/js/README-template.md b/packages/create-next-app/templates/default-tw/js/README-template.md index c828f80be635d..eb8aec4611422 100644 --- a/packages/create-next-app/templates/default-tw/js/README-template.md +++ b/packages/create-next-app/templates/default-tw/js/README-template.md @@ -22,7 +22,7 @@ You can start editing the page by modifying `pages/index.js`. The page auto-upda The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/pages/building-your-application/routing/api-routes) instead of React pages. -This project uses [`next/font`](https://nextjs.org/docs/pages/building-your-application/optimizing/fonts) to automatically optimize and load Inter, a custom Google Font. +This project uses [`next/font`](https://nextjs.org/docs/pages/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. ## Learn More diff --git a/packages/create-next-app/templates/default-tw/ts/README-template.md b/packages/create-next-app/templates/default-tw/ts/README-template.md index 90708d2e75099..ef0e47e31fa3d 100644 --- a/packages/create-next-app/templates/default-tw/ts/README-template.md +++ b/packages/create-next-app/templates/default-tw/ts/README-template.md @@ -22,7 +22,7 @@ You can start editing the page by modifying `pages/index.tsx`. The page auto-upd The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/pages/building-your-application/routing/api-routes) instead of React pages. -This project uses [`next/font`](https://nextjs.org/docs/pages/building-your-application/optimizing/fonts) to automatically optimize and load Inter, a custom Google Font. +This project uses [`next/font`](https://nextjs.org/docs/pages/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. ## Learn More diff --git a/packages/create-next-app/templates/default/js/README-template.md b/packages/create-next-app/templates/default/js/README-template.md index c828f80be635d..eb8aec4611422 100644 --- a/packages/create-next-app/templates/default/js/README-template.md +++ b/packages/create-next-app/templates/default/js/README-template.md @@ -22,7 +22,7 @@ You can start editing the page by modifying `pages/index.js`. The page auto-upda The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/pages/building-your-application/routing/api-routes) instead of React pages. -This project uses [`next/font`](https://nextjs.org/docs/pages/building-your-application/optimizing/fonts) to automatically optimize and load Inter, a custom Google Font. +This project uses [`next/font`](https://nextjs.org/docs/pages/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. ## Learn More diff --git a/packages/create-next-app/templates/default/ts/README-template.md b/packages/create-next-app/templates/default/ts/README-template.md index 90708d2e75099..ef0e47e31fa3d 100644 --- a/packages/create-next-app/templates/default/ts/README-template.md +++ b/packages/create-next-app/templates/default/ts/README-template.md @@ -22,7 +22,7 @@ You can start editing the page by modifying `pages/index.tsx`. The page auto-upd The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/pages/building-your-application/routing/api-routes) instead of React pages. -This project uses [`next/font`](https://nextjs.org/docs/pages/building-your-application/optimizing/fonts) to automatically optimize and load Inter, a custom Google Font. +This project uses [`next/font`](https://nextjs.org/docs/pages/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. ## Learn More diff --git a/packages/eslint-config-next/package.json b/packages/eslint-config-next/package.json index c9a7df2503da0..af8a52fad51a2 100644 --- a/packages/eslint-config-next/package.json +++ b/packages/eslint-config-next/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-next", - "version": "15.0.0-canary.23", + "version": "15.0.0-canary.25", "description": "ESLint configuration used by Next.js.", "main": "index.js", "license": "MIT", @@ -10,7 +10,7 @@ }, "homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config", "dependencies": { - "@next/eslint-plugin-next": "15.0.0-canary.23", + "@next/eslint-plugin-next": "15.0.0-canary.25", "@rushstack/eslint-patch": "^1.3.3", "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.0", "eslint-import-resolver-node": "^0.3.6", diff --git a/packages/eslint-plugin-next/package.json b/packages/eslint-plugin-next/package.json index 50ade39c4c856..1655ba6ad37eb 100644 --- a/packages/eslint-plugin-next/package.json +++ b/packages/eslint-plugin-next/package.json @@ -1,6 +1,6 @@ { "name": "@next/eslint-plugin-next", - "version": "15.0.0-canary.23", + "version": "15.0.0-canary.25", "description": "ESLint plugin for Next.js.", "main": "dist/index.js", "license": "MIT", diff --git a/packages/font/package.json b/packages/font/package.json index 091c04d1b88c5..21816345b5c39 100644 --- a/packages/font/package.json +++ b/packages/font/package.json @@ -1,6 +1,6 @@ { "name": "@next/font", - "version": "15.0.0-canary.23", + "version": "15.0.0-canary.25", "repository": { "url": "vercel/next.js", "directory": "packages/font" diff --git a/packages/font/src/google/font-data.json b/packages/font/src/google/font-data.json index c4a78a18f81f0..29e18ae7d101a 100644 --- a/packages/font/src/google/font-data.json +++ b/packages/font/src/google/font-data.json @@ -496,9 +496,17 @@ "subsets": ["devanagari", "latin", "latin-ext"] }, "Anaheim": { - "weights": ["400"], + "weights": ["400", "500", "600", "700", "800", "variable"], "styles": ["normal"], - "subsets": ["latin", "latin-ext"] + "axes": [ + { + "tag": "wght", + "min": 400, + "max": 800, + "defaultValue": 400 + } + ], + "subsets": ["latin", "latin-ext", "vietnamese"] }, "Andada Pro": { "weights": ["400", "500", "600", "700", "800", "variable"], @@ -4771,7 +4779,7 @@ "Holtwood One SC": { "weights": ["400"], "styles": ["normal"], - "subsets": ["latin"] + "subsets": ["latin", "latin-ext"] }, "Homemade Apple": { "weights": ["400"], @@ -7096,8 +7104,16 @@ "subsets": ["latin", "latin-ext"] }, "Monda": { - "weights": ["400", "700"], + "weights": ["400", "500", "600", "700", "variable"], "styles": ["normal"], + "axes": [ + { + "tag": "wght", + "min": 400, + "max": 700, + "defaultValue": 400 + } + ], "subsets": ["latin", "latin-ext", "vietnamese"] }, "Monofett": { @@ -8292,7 +8308,7 @@ "defaultValue": 400 } ], - "subsets": ["hebrew", "latin", "latin-ext"] + "subsets": ["cyrillic-ext", "greek-ext", "hebrew", "latin", "latin-ext"] }, "Noto Sans Imperial Aramaic": { "weights": ["400"], diff --git a/packages/font/src/google/index.ts b/packages/font/src/google/index.ts index 0b764d7bb19ad..dd161be8a5fa6 100644 --- a/packages/font/src/google/index.ts +++ b/packages/font/src/google/index.ts @@ -926,15 +926,22 @@ export declare function Amita< }): T extends undefined ? NextFont : NextFontWithVariable export declare function Anaheim< T extends CssVariable | undefined = undefined, ->(options: { - weight: '400' | Array<'400'> +>(options?: { + weight?: + | '400' + | '500' + | '600' + | '700' + | '800' + | 'variable' + | Array<'400' | '500' | '600' | '700' | '800'> style?: 'normal' | Array<'normal'> display?: Display variable?: T preload?: boolean fallback?: string[] adjustFontFallback?: boolean - subsets?: Array<'latin' | 'latin-ext'> + subsets?: Array<'latin' | 'latin-ext' | 'vietnamese'> }): T extends undefined ? NextFont : NextFontWithVariable export declare function Andada_Pro< T extends CssVariable | undefined = undefined, @@ -8419,7 +8426,7 @@ export declare function Holtwood_One_SC< preload?: boolean fallback?: string[] adjustFontFallback?: boolean - subsets?: Array<'latin'> + subsets?: Array<'latin' | 'latin-ext'> }): T extends undefined ? NextFont : NextFontWithVariable export declare function Homemade_Apple< T extends CssVariable | undefined = undefined, @@ -12815,8 +12822,14 @@ export declare function Molle< }): T extends undefined ? NextFont : NextFontWithVariable export declare function Monda< T extends CssVariable | undefined = undefined, ->(options: { - weight: '400' | '700' | Array<'400' | '700'> +>(options?: { + weight?: + | '400' + | '500' + | '600' + | '700' + | 'variable' + | Array<'400' | '500' | '600' | '700'> style?: 'normal' | Array<'normal'> display?: Display variable?: T @@ -14680,7 +14693,9 @@ export declare function Noto_Sans_Hebrew< preload?: boolean fallback?: string[] adjustFontFallback?: boolean - subsets?: Array<'hebrew' | 'latin' | 'latin-ext'> + subsets?: Array< + 'cyrillic-ext' | 'greek-ext' | 'hebrew' | 'latin' | 'latin-ext' + > axes?: 'wdth'[] }): T extends undefined ? NextFont : NextFontWithVariable export declare function Noto_Sans_Imperial_Aramaic< diff --git a/packages/next-bundle-analyzer/package.json b/packages/next-bundle-analyzer/package.json index 7a0b841555df6..75806b74ac495 100644 --- a/packages/next-bundle-analyzer/package.json +++ b/packages/next-bundle-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@next/bundle-analyzer", - "version": "15.0.0-canary.23", + "version": "15.0.0-canary.25", "main": "index.js", "types": "index.d.ts", "license": "MIT", diff --git a/packages/next-codemod/package.json b/packages/next-codemod/package.json index 173c683fc8938..2587dbe02118a 100644 --- a/packages/next-codemod/package.json +++ b/packages/next-codemod/package.json @@ -1,6 +1,6 @@ { "name": "@next/codemod", - "version": "15.0.0-canary.23", + "version": "15.0.0-canary.25", "license": "MIT", "repository": { "type": "git", diff --git a/packages/next-env/package.json b/packages/next-env/package.json index fa1cc5d6b097d..47211a3f5667b 100644 --- a/packages/next-env/package.json +++ b/packages/next-env/package.json @@ -1,6 +1,6 @@ { "name": "@next/env", - "version": "15.0.0-canary.23", + "version": "15.0.0-canary.25", "keywords": [ "react", "next", @@ -23,7 +23,7 @@ "scripts": { "dev": "ncc build ./index.ts -w -o dist/", "prerelease": "node ../../scripts/rm.mjs dist", - "types": "tsc index.ts --declaration --emitDeclarationOnly --declarationDir dist --esModuleInterop", + "types": "tsc --declaration --emitDeclarationOnly --declarationDir dist", "release": "ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register", "build": "pnpm release && pnpm types", "prepublishOnly": "cd ../../ && turbo run build" diff --git a/packages/next-env/tsconfig.json b/packages/next-env/tsconfig.json index d0e9e223e6a05..bf4c959b79202 100644 --- a/packages/next-env/tsconfig.json +++ b/packages/next-env/tsconfig.json @@ -6,5 +6,7 @@ "resolveJsonModule": true, "esModuleInterop": true, "skipLibCheck": false - } + }, + "include": ["**/*.ts"], + "exclude": ["node_modules", "dist"] } diff --git a/packages/next-mdx/package.json b/packages/next-mdx/package.json index e2a86a3798385..c8b38de241f7c 100644 --- a/packages/next-mdx/package.json +++ b/packages/next-mdx/package.json @@ -1,6 +1,6 @@ { "name": "@next/mdx", - "version": "15.0.0-canary.23", + "version": "15.0.0-canary.25", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-plugin-storybook/package.json b/packages/next-plugin-storybook/package.json index 126d047effba2..5ff3cf7f0fd7f 100644 --- a/packages/next-plugin-storybook/package.json +++ b/packages/next-plugin-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-storybook", - "version": "15.0.0-canary.23", + "version": "15.0.0-canary.25", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-storybook" diff --git a/packages/next-polyfill-module/package.json b/packages/next-polyfill-module/package.json index 0c37743b7b2dd..8a5c49bba3472 100644 --- a/packages/next-polyfill-module/package.json +++ b/packages/next-polyfill-module/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-module", - "version": "15.0.0-canary.23", + "version": "15.0.0-canary.25", "description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)", "main": "dist/polyfill-module.js", "license": "MIT", diff --git a/packages/next-polyfill-nomodule/package.json b/packages/next-polyfill-nomodule/package.json index 747a7d76861d8..5ba0187a703c4 100644 --- a/packages/next-polyfill-nomodule/package.json +++ b/packages/next-polyfill-nomodule/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-nomodule", - "version": "15.0.0-canary.23", + "version": "15.0.0-canary.25", "description": "A polyfill for non-dead, nomodule browsers.", "main": "dist/polyfill-nomodule.js", "license": "MIT", diff --git a/packages/next-swc/crates/next-core/src/app_segment_config.rs b/packages/next-swc/crates/next-core/src/app_segment_config.rs index a4a76ede1533b..9b815d44f8d2c 100644 --- a/packages/next-swc/crates/next-core/src/app_segment_config.rs +++ b/packages/next-swc/crates/next-core/src/app_segment_config.rs @@ -8,7 +8,7 @@ use turbo_tasks_fs::FileSystemPath; use turbopack_binding::{ swc::core::{ common::{source_map::Pos, Span, Spanned, GLOBALS}, - ecma::ast::{Expr, Ident, Program}, + ecma::ast::{Decl, Expr, FnExpr, Ident, Program}, }, turbopack::{ core::{ @@ -73,6 +73,9 @@ pub struct NextSegmentConfig { pub runtime: Option, pub preferred_region: Option>, pub experimental_ppr: Option, + /// Wether these metadata exports are defined in the source file. + pub generate_image_metadata: bool, + pub generate_sitemaps: bool, } #[turbo_tasks::value_impl] @@ -95,6 +98,7 @@ impl NextSegmentConfig { runtime, preferred_region, experimental_ppr, + .. } = self; *dynamic = dynamic.or(parent.dynamic); *dynamic_params = dynamic_params.or(parent.dynamic_params); @@ -137,6 +141,7 @@ impl NextSegmentConfig { runtime, preferred_region, experimental_ppr, + .. } = self; merge_parallel(dynamic, ¶llel_config.dynamic, "dynamic")?; merge_parallel( @@ -272,22 +277,35 @@ pub async fn parse_segment_config_from_source( let mut config = NextSegmentConfig::default(); for item in &module_ast.body { - let Some(decl) = item + let Some(export_decl) = item .as_module_decl() .and_then(|mod_decl| mod_decl.as_export_decl()) - .and_then(|export_decl| export_decl.decl.as_var()) else { continue; }; - for decl in &decl.decls { - let Some(ident) = decl.name.as_ident().map(|ident| ident.deref()) else { - continue; - }; + match &export_decl.decl { + Decl::Var(var_decl) => { + for decl in &var_decl.decls { + let Some(ident) = decl.name.as_ident().map(|ident| ident.deref()) else { + continue; + }; - if let Some(init) = decl.init.as_ref() { - parse_config_value(source, &mut config, ident, init, eval_context); + if let Some(init) = decl.init.as_ref() { + parse_config_value(source, &mut config, ident, init, eval_context); + } + } + } + Decl::Fn(fn_decl) => { + let ident = &fn_decl.ident; + // create an empty expression of {}, we don't need init for function + let init = Expr::Fn(FnExpr { + ident: None, + function: fn_decl.function.clone(), + }); + parse_config_value(source, &mut config, ident, &init, eval_context); } + _ => {} } } config @@ -431,6 +449,14 @@ fn parse_config_value( config.preferred_region = Some(preferred_region); } + // Match exported generateImageMetadata function and generateSitemaps function, and pass + // them to config. + "generateImageMetadata" => { + config.generate_image_metadata = true; + } + "generateSitemaps" => { + config.generate_sitemaps = true; + } "experimental_ppr" => { let value = eval_context.eval(init); let Some(val) = value.as_bool() else { diff --git a/packages/next-swc/crates/next-core/src/next_app/metadata/mod.rs b/packages/next-swc/crates/next-core/src/next_app/metadata/mod.rs index ac35312e3a235..08af0f5908a72 100644 --- a/packages/next-swc/crates/next-core/src/next_app/metadata/mod.rs +++ b/packages/next-swc/crates/next-core/src/next_app/metadata/mod.rs @@ -306,8 +306,7 @@ pub fn normalize_metadata_route(mut page: AppPage) -> Result { route += ".txt" } else if route == "/manifest" { route += ".webmanifest" - // Do not append the suffix for the sitemap route - } else if !route.ends_with("/sitemap") { + } else { // Remove the file extension, e.g. /route-path/robots.txt -> /route-path let pathname_prefix = split_directory(&route).0.unwrap_or_default(); suffix = get_metadata_route_suffix(pathname_prefix); @@ -317,13 +316,8 @@ pub fn normalize_metadata_route(mut page: AppPage) -> Result { // //route.ts. If it's a metadata file route, we need to // append /[id]/route to the page. if !route.ends_with("/route") { - let is_static_metadata_file = is_static_metadata_route_file(&page.to_string()); let (base_name, ext) = split_extension(&route); - let is_static_route = route.starts_with("/robots") - || route.starts_with("/manifest") - || is_static_metadata_file; - page.0.pop(); page.push(PageSegment::Static( @@ -338,10 +332,6 @@ pub fn normalize_metadata_route(mut page: AppPage) -> Result { .into(), ))?; - if !is_static_route { - page.push(PageSegment::OptionalCatchAll("__metadata_id__".into()))?; - } - page.push(PageSegment::PageType(PageType::Route))?; } @@ -358,11 +348,11 @@ mod test { let cases = vec![ [ "/client/(meme)/more-route/twitter-image", - "/client/(meme)/more-route/twitter-image-769mad/[[...__metadata_id__]]/route", + "/client/(meme)/more-route/twitter-image-769mad/route", ], [ "/client/(meme)/more-route/twitter-image2", - "/client/(meme)/more-route/twitter-image2-769mad/[[...__metadata_id__]]/route", + "/client/(meme)/more-route/twitter-image2-769mad/route", ], ["/robots.txt", "/robots.txt/route"], ["/manifest.webmanifest", "/manifest.webmanifest/route"], diff --git a/packages/next-swc/crates/next-core/src/next_app/metadata/route.rs b/packages/next-swc/crates/next-core/src/next_app/metadata/route.rs index 7227f34bdce9d..d978de8369d3f 100644 --- a/packages/next-swc/crates/next-core/src/next_app/metadata/route.rs +++ b/packages/next-swc/crates/next-core/src/next_app/metadata/route.rs @@ -2,7 +2,7 @@ //! //! See `next/src/build/webpack/loaders/next-metadata-route-loader` -use anyhow::{bail, Result}; +use anyhow::{bail, Ok, Result}; use base64::{display::Base64Display, engine::general_purpose::STANDARD}; use indoc::{formatdoc, indoc}; use turbo_tasks::{ValueToString, Vc}; @@ -22,7 +22,9 @@ use super::get_content_type; use crate::{ app_structure::MetadataItem, mode::NextMode, - next_app::{app_entry::AppEntry, app_route_entry::get_app_route_entry, AppPage, PageSegment}, + next_app::{ + app_entry::AppEntry, app_route_entry::get_app_route_entry, AppPage, PageSegment, PageType, + }, next_config::NextConfig, parse_segment_config_from_source, }; @@ -30,9 +32,9 @@ use crate::{ /// Computes the route source for a Next.js metadata file. #[turbo_tasks::function] pub async fn get_app_metadata_route_source( - page: AppPage, mode: NextMode, metadata: MetadataItem, + is_multi_dynamic: bool, ) -> Result>> { Ok(match metadata { MetadataItem::Static { path } => static_route_source(mode, path), @@ -43,7 +45,7 @@ pub async fn get_app_metadata_route_source( if stem == "robots" || stem == "manifest" { dynamic_text_route_source(path) } else if stem == "sitemap" { - dynamic_site_map_route_source(mode, path, page) + dynamic_site_map_route_source(mode, path, is_multi_dynamic) } else { dynamic_image_route_source(path) } @@ -52,11 +54,11 @@ pub async fn get_app_metadata_route_source( } #[turbo_tasks::function] -pub fn get_app_metadata_route_entry( +pub async fn get_app_metadata_route_entry( nodejs_context: Vc, edge_context: Vc, project_root: Vc, - page: AppPage, + mut page: AppPage, mode: NextMode, metadata: MetadataItem, next_config: Vc, @@ -69,11 +71,43 @@ pub fn get_app_metadata_route_entry( let source = Vc::upcast(FileSource::new(original_path)); let segment_config = parse_segment_config_from_source(source); + let is_dynamic_metadata = matches!(metadata, MetadataItem::Dynamic { .. }); + let is_multi_dynamic: bool = if Some(segment_config).is_some() { + // is_multi_dynamic is true when config.generateSitemaps or + // config.generateImageMetadata is defined in dynamic routes + let config = segment_config.await.unwrap(); + config.generate_sitemaps || config.generate_image_metadata + } else { + false + }; + + // Map dynamic sitemap and image routes based on the exports. + // if there's generator export: add /[__metadata_id__] to the route; + // otherwise keep the original route. + // For sitemap, if the last segment is sitemap, appending .xml suffix. + if is_dynamic_metadata { + // remove the last /route segment of page + page.0.pop(); + + let _ = if is_multi_dynamic { + page.push(PageSegment::Dynamic("__metadata_id__".into())) + } else { + // if page last segment is sitemap, change to sitemap.xml + if page.last() == Some(&PageSegment::Static("sitemap".into())) { + page.0.pop(); + page.push(PageSegment::Static("sitemap.xml".into())) + } else { + Ok(()) + } + }; + // Push /route back + let _ = page.push(PageSegment::PageType(PageType::Route)); + }; get_app_route_entry( nodejs_context, edge_context, - get_app_metadata_route_source(page.clone(), mode, metadata), + get_app_metadata_route_source(mode, metadata, is_multi_dynamic), page, project_root, Some(segment_config), @@ -208,26 +242,24 @@ async fn dynamic_text_route_source(path: Vc) -> Result, - page: AppPage, + is_multi_dynamic: bool, ) -> Result>> { let stem = path.file_stem().await?; let stem = stem.as_deref().unwrap_or_default(); let ext = &*path.extension().await?; - let content_type = get_content_type(path).await?; - let mut static_generation_code = ""; - if mode.is_production() && page.contains(&PageSegment::Dynamic("[__metadata_id__]".into())) { + if mode.is_production() && is_multi_dynamic { static_generation_code = indoc! { r#" export async function generateStaticParams() { const sitemaps = await generateSitemaps() const params = [] - for (const item of sitemaps) { - params.push({ __metadata_id__: item.id.toString() }) - } + for (const item of sitemaps) {{ + params.push({ __metadata_id__: item.id.toString() + '.xml' }) + }} return params } "#, @@ -252,29 +284,25 @@ async fn dynamic_site_map_route_source( }} export async function GET(_, ctx) {{ - const {{ __metadata_id__ = [], ...params }} = ctx.params || {{}} - const targetId = __metadata_id__[0] - let id = undefined - const sitemaps = generateSitemaps ? await generateSitemaps() : null + const {{ __metadata_id__: id, ...params }} = ctx.params || {{}} + const hasXmlExtension = id ? id.endsWith('.xml') : false + if (id && !hasXmlExtension) {{ + return new NextResponse('Not Found', {{ + status: 404, + }}) + }} - if (sitemaps) {{ - id = sitemaps.find((item) => {{ - if (process.env.NODE_ENV !== 'production') {{ - if (item?.id == null) {{ - throw new Error('id property is required for every item returned from generateSitemaps') - }} + if (process.env.NODE_ENV !== 'production' && sitemapModule.generateSitemaps) {{ + const sitemaps = await sitemapModule.generateSitemaps() + for (const item of sitemaps) {{ + if (item?.id == null) {{ + throw new Error('id property is required for every item returned from generateSitemaps') }} - return item.id.toString() === targetId - }})?.id - - if (id == null) {{ - return new NextResponse('Not Found', {{ - status: 404, - }}) }} }} - - const data = await handler({{ id }}) + + const targetId = id && hasXmlExtension ? id.slice(0, -4) : undefined + const data = await handler({{ id: targetId }}) const content = resolveRouteData(data, fileType) return new NextResponse(content, {{ @@ -324,12 +352,12 @@ async fn dynamic_image_route_source(path: Vc) -> Result {{ if (process.env.NODE_ENV !== 'production') {{ if (item?.id == null) {{ diff --git a/packages/next-swc/package.json b/packages/next-swc/package.json index c01106d87150b..78cd19bdeb97c 100644 --- a/packages/next-swc/package.json +++ b/packages/next-swc/package.json @@ -1,6 +1,6 @@ { "name": "@next/swc", - "version": "15.0.0-canary.23", + "version": "15.0.0-canary.25", "private": true, "scripts": { "clean": "node ../../scripts/rm.mjs native", diff --git a/packages/next/package.json b/packages/next/package.json index 0293509e348d2..6bcdf71ce10e1 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "next", - "version": "15.0.0-canary.23", + "version": "15.0.0-canary.25", "description": "The React Framework", "main": "./dist/server/next.js", "license": "MIT", @@ -93,7 +93,7 @@ ] }, "dependencies": { - "@next/env": "15.0.0-canary.23", + "@next/env": "15.0.0-canary.25", "@swc/helpers": "0.5.11", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", @@ -157,10 +157,10 @@ "@jest/types": "29.5.0", "@mswjs/interceptors": "0.23.0", "@napi-rs/triples": "1.2.0", - "@next/polyfill-module": "15.0.0-canary.23", - "@next/polyfill-nomodule": "15.0.0-canary.23", - "@next/react-refresh-utils": "15.0.0-canary.23", - "@next/swc": "15.0.0-canary.23", + "@next/polyfill-module": "15.0.0-canary.25", + "@next/polyfill-nomodule": "15.0.0-canary.25", + "@next/react-refresh-utils": "15.0.0-canary.25", + "@next/swc": "15.0.0-canary.25", "@opentelemetry/api": "1.6.0", "@playwright/test": "1.41.2", "@swc/core": "1.5.7", @@ -206,7 +206,7 @@ "@types/ws": "8.2.0", "@vercel/ncc": "0.34.0", "@vercel/nft": "0.27.1", - "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240607.3", + "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240610.2", "acorn": "8.11.3", "amphtml-validator": "1.0.35", "anser": "1.4.9", diff --git a/packages/next/src/build/analysis/get-page-static-info.ts b/packages/next/src/build/analysis/get-page-static-info.ts index 97dd5b2f69455..d77c236e10d53 100644 --- a/packages/next/src/build/analysis/get-page-static-info.ts +++ b/packages/next/src/build/analysis/get-page-static-info.ts @@ -59,6 +59,8 @@ export interface PageStaticInfo { ssr?: boolean rsc?: RSCModuleType generateStaticParams?: boolean + generateSitemaps?: boolean + generateImageMetadata?: boolean middleware?: MiddlewareConfigParsed amp?: boolean | 'hybrid' extraConfig?: Record @@ -141,8 +143,8 @@ function checkExports( ssg: boolean runtime?: string preferredRegion?: string | string[] - generateImageMetadata?: boolean - generateSitemaps?: boolean + generateImageMetadata: boolean + generateSitemaps: boolean generateStaticParams: boolean extraProperties?: Set directives?: Set @@ -467,20 +469,6 @@ function warnAboutUnsupportedValue( warnedUnsupportedValueMap.set(pageFilePath, true) } -// Detect if metadata routes is a dynamic route, which containing -// generateImageMetadata or generateSitemaps as export -export async function isDynamicMetadataRoute( - pageFilePath: string -): Promise { - const fileContent = (await tryToReadFile(pageFilePath, true)) || '' - if (/generateImageMetadata|generateSitemaps/.test(fileContent)) { - const swcAST = await parseModule(pageFilePath, fileContent) - const exportsInfo = checkExports(swcAST, pageFilePath) - return !!(exportsInfo.generateImageMetadata || exportsInfo.generateSitemaps) - } - return false -} - /** * For a given pageFilePath and nextConfig, if the config supports it, this * function will read the file and return the runtime that should be used. @@ -499,7 +487,7 @@ export async function getPageStaticInfo(params: { const fileContent = (await tryToReadFile(pageFilePath, !isDev)) || '' if ( - /(? { const isAppRoute = pagesType === 'app' - const pages = pagePaths.reduce<{ [key: string]: string }>( - (result, pagePath) => { - // Do not process .d.ts files as routes - if (pagePath.endsWith('.d.ts') && pageExtensions.includes('ts')) { - return result - } + const pages: MappedPages = {} + const promises = pagePaths.map>(async (pagePath) => { + // Do not process .d.ts files as routes + if (pagePath.endsWith('.d.ts') && pageExtensions.includes('ts')) { + return + } - let pageKey = getPageFromPath(pagePath, pageExtensions) - if (isAppRoute) { - pageKey = pageKey.replace(/%5F/g, '_') - if (pageKey === '/not-found') { - pageKey = UNDERSCORE_NOT_FOUND_ROUTE_ENTRY - } + let pageKey = getPageFromPath(pagePath, pageExtensions) + if (isAppRoute) { + pageKey = pageKey.replace(/%5F/g, '_') + if (pageKey === '/not-found') { + pageKey = UNDERSCORE_NOT_FOUND_ROUTE_ENTRY } + } - const normalizedPath = normalizePathSep( - join( - pagesType === 'pages' - ? PAGES_DIR_ALIAS - : pagesType === 'app' - ? APP_DIR_ALIAS - : ROOT_DIR_ALIAS, - pagePath - ) + const normalizedPath = normalizePathSep( + join( + pagesType === 'pages' + ? PAGES_DIR_ALIAS + : pagesType === 'app' + ? APP_DIR_ALIAS + : ROOT_DIR_ALIAS, + pagePath ) + ) - const route = - pagesType === 'app' ? normalizeMetadataRoute(pageKey) : pageKey - result[route] = normalizedPath - return result - }, - {} - ) + let route = pagesType === 'app' ? normalizeMetadataRoute(pageKey) : pageKey + + if (isMetadataRoute(route) && pagesType === 'app') { + const filePath = join(appDir!, pagePath) + const staticInfo = await getPageStaticInfo({ + nextConfig: {}, + pageFilePath: filePath, + isDev, + page: pageKey, + pageType: pagesType, + }) + + route = normalizeMetadataPageToRoute( + route, + !!(staticInfo.generateImageMetadata || staticInfo.generateSitemaps) + ) + } + + pages[route] = normalizedPath + }) + + await Promise.all(promises) switch (pagesType) { case PAGE_TYPES.ROOT: { diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index 5e2d15e62d2aa..6729c182a510e 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -100,11 +100,8 @@ import { } from '../telemetry/events' import type { EventBuildFeatureUsage } from '../telemetry/events' import { Telemetry } from '../telemetry/storage' -import { - isDynamicMetadataRoute, - getPageStaticInfo, -} from './analysis/get-page-static-info' -import { createPagesMapping, getPageFilePath, sortByPageExts } from './entries' +import { getPageStaticInfo } from './analysis/get-page-static-info' +import { createPagesMapping, sortByPageExts } from './entries' import { PAGE_TYPES } from '../lib/page-types' import { generateBuildId } from './generate-build-id' import { isWriteable } from './is-writeable' @@ -912,15 +909,16 @@ export default async function build( } NextBuildContext.previewProps = previewProps - const mappedPages = nextBuildSpan + const mappedPages = await nextBuildSpan .traceChild('create-pages-mapping') - .traceFn(() => + .traceAsyncFn(() => createPagesMapping({ isDev: false, pageExtensions: config.pageExtensions, pagesType: PAGE_TYPES.PAGES, pagePaths: pagesPaths, pagesDir, + appDir, }) ) NextBuildContext.mappedPages = mappedPages @@ -942,60 +940,29 @@ export default async function build( }) ) - mappedAppPages = nextBuildSpan + mappedAppPages = await nextBuildSpan .traceChild('create-app-mapping') - .traceFn(() => + .traceAsyncFn(() => createPagesMapping({ pagePaths: appPaths, isDev: false, pagesType: PAGE_TYPES.APP, pageExtensions: config.pageExtensions, - pagesDir: pagesDir, - }) - ) - - // If the metadata route doesn't contain generating dynamic exports, - // we can replace the dynamic catch-all route and use the static route instead. - for (const [pageKey, pagePath] of Object.entries(mappedAppPages)) { - if (pageKey.includes('[[...__metadata_id__]]')) { - const pageFilePath = getPageFilePath({ - absolutePagePath: pagePath, pagesDir, appDir, - rootDir, }) - - const isDynamic = await isDynamicMetadataRoute(pageFilePath) - if (!isDynamic) { - delete mappedAppPages[pageKey] - mappedAppPages[pageKey.replace('[[...__metadata_id__]]/', '')] = - pagePath - } - - if ( - pageKey.includes('sitemap/[[...__metadata_id__]]') && - isDynamic - ) { - delete mappedAppPages[pageKey] - mappedAppPages[ - pageKey.replace( - 'sitemap/[[...__metadata_id__]]', - 'sitemap/[__metadata_id__]' - ) - ] = pagePath - } - } - } + ) NextBuildContext.mappedAppPages = mappedAppPages } - const mappedRootPaths = createPagesMapping({ + const mappedRootPaths = await createPagesMapping({ isDev: false, pageExtensions: config.pageExtensions, pagePaths: rootPaths, pagesType: PAGE_TYPES.ROOT, pagesDir: pagesDir, + appDir, }) NextBuildContext.mappedRootPaths = mappedRootPaths @@ -1223,11 +1190,6 @@ export default async function build( '{"type": "commonjs"}' ) - // We need to write the manifest with rewrites before build - await nextBuildSpan - .traceChild('write-routes-manifest') - .traceAsyncFn(() => writeManifest(routesManifestPath, routesManifest)) - await writeEdgePartialPrerenderManifest(distDir, {}) const outputFileTracingRoot = @@ -2338,9 +2300,14 @@ export default async function build( return buildDataRoute(page, buildId) }) - await writeManifest(routesManifestPath, routesManifest) + // await writeManifest(routesManifestPath, routesManifest) } + // We need to write the manifest with rewrites before build + await nextBuildSpan + .traceChild('write-routes-manifest') + .traceAsyncFn(() => writeManifest(routesManifestPath, routesManifest)) + // Since custom _app.js can wrap the 404 page we have to opt-out of static optimization if it has getInitialProps // Only export the static 404 when there is no /_error present const useStaticPages404 = diff --git a/packages/next/src/build/output/store.ts b/packages/next/src/build/output/store.ts index b77ebd8f8545c..f761ba6055075 100644 --- a/packages/next/src/build/output/store.ts +++ b/packages/next/src/build/output/store.ts @@ -24,13 +24,13 @@ export type OutputState = } )) -const internalSegments = ['[[...__metadata_id__]]', '[__metadata_id__]'] export function formatTrigger(trigger: string) { - for (const segment of internalSegments) { - if (trigger.includes(segment)) { - trigger = trigger.replace(segment, '') - } + // Format dynamic sitemap routes to simpler file path + // e.g., /sitemap.xml[] -> /sitemap.xml + if (trigger.includes('[__metadata_id__]')) { + trigger = trigger.replace('/[__metadata_id__]', '/[id]') } + if (trigger.length > 1 && trigger.endsWith('/')) { trigger = trigger.slice(0, -1) } diff --git a/packages/next/src/build/webpack/loaders/metadata/discover.ts b/packages/next/src/build/webpack/loaders/metadata/discover.ts index c0264c4e50d61..74d0403ed6d2d 100644 --- a/packages/next/src/build/webpack/loaders/metadata/discover.ts +++ b/packages/next/src/build/webpack/loaders/metadata/discover.ts @@ -10,6 +10,7 @@ import type { MetadataResolver } from '../next-app-loader' import type { PageExtensions } from '../../../page-extensions-type' const METADATA_TYPE = 'metadata' +const NUMERIC_SUFFIX_ARRAY = Array(10).fill(0) // Produce all compositions with filename (icon, apple-icon, etc.) with extensions (png, jpg, etc.) async function enumMetadataFiles( @@ -27,11 +28,10 @@ async function enumMetadataFiles( ): Promise { const collectedFiles: string[] = [] + // Collect ., []. const possibleFileNames = [filename].concat( numericSuffix - ? Array(10) - .fill(0) - .map((_, index) => filename + index) + ? NUMERIC_SUFFIX_ARRAY.map((_, index) => filename + index) : [] ) for (const name of possibleFileNames) { @@ -91,14 +91,15 @@ export async function createStaticMetadataFromRoute( return } + const isFavicon = type === 'favicon' const resolvedMetadataFiles = await enumMetadataFiles( resolvedDir, STATIC_METADATA_IMAGES[type].filename, [ ...STATIC_METADATA_IMAGES[type].extensions, - ...(type === 'favicon' ? [] : pageExtensions), + ...(isFavicon ? [] : pageExtensions), ], - { metadataResolver, numericSuffix: true } + { metadataResolver, numericSuffix: !isFavicon } ) resolvedMetadataFiles .sort((a, b) => a.localeCompare(b)) diff --git a/packages/next/src/build/webpack/loaders/next-app-loader.ts b/packages/next/src/build/webpack/loaders/next-app-loader.ts index 6c781d76e7feb..5d49a3a3e3fad 100644 --- a/packages/next/src/build/webpack/loaders/next-app-loader.ts +++ b/packages/next/src/build/webpack/loaders/next-app-loader.ts @@ -121,15 +121,14 @@ async function createAppRouteCode({ // If this is a metadata route, then we need to use the metadata loader for // the route to ensure that the route is generated. - const filename = path.parse(resolvedPagePath).name - if (isMetadataRoute(name) && filename !== 'route') { + const fileBaseName = path.parse(resolvedPagePath).name + if (isMetadataRoute(name) && fileBaseName !== 'route') { const { ext } = getFilenameAndExtension(resolvedPagePath) - const isDynamic = pageExtensions.includes(ext) + const isDynamicRouteExtension = pageExtensions.includes(ext) resolvedPagePath = `next-metadata-route-loader?${stringify({ - page, filePath: resolvedPagePath, - isDynamic: isDynamic ? '1' : '0', + isDynamicRouteExtension: isDynamicRouteExtension ? '1' : '0', })}!?${WEBPACK_RESOURCE_QUERIES.metadataRoute}` } @@ -142,7 +141,7 @@ async function createAppRouteCode({ VAR_USERLAND: resolvedPagePath, VAR_DEFINITION_PAGE: page, VAR_DEFINITION_PATHNAME: pathname, - VAR_DEFINITION_FILENAME: filename, + VAR_DEFINITION_FILENAME: fileBaseName, VAR_DEFINITION_BUNDLE_PATH: bundlePath, VAR_RESOLVED_PAGE_PATH: resolvedPagePath, VAR_ORIGINAL_PATHNAME: page, diff --git a/packages/next/src/build/webpack/loaders/next-flight-loader/index.ts b/packages/next/src/build/webpack/loaders/next-flight-loader/index.ts index 46d6b0ede8142..79a0ae48ef6ea 100644 --- a/packages/next/src/build/webpack/loaders/next-flight-loader/index.ts +++ b/packages/next/src/build/webpack/loaders/next-flight-loader/index.ts @@ -97,24 +97,21 @@ export default function transformSource( return } - // `proxy` is the module proxy that we treat the module as a client boundary. - // For ESM, we access the property of the module proxy directly for each export. - // This is bit hacky that treating using a CJS like module proxy for ESM's exports, - // but this will avoid creating nested proxies for each export. It will be improved in the future. let esmSource = `\ import { createProxy } from "${MODULE_PROXY_PATH}" - -const proxy = createProxy(String.raw\`${resourceKey}\`) ` let cnt = 0 for (const ref of clientRefs) { if (ref === '') { - esmSource += `exports[''] = proxy['']\n` + esmSource += `\nexports[''] = createProxy(String.raw\`${resourceKey}#\`);` } else if (ref === 'default') { - esmSource += `export default createProxy(String.raw\`${resourceKey}#default\`);\n` + esmSource += `\ +export default createProxy(String.raw\`${resourceKey}#default\`); +` } else { - esmSource += `const e${cnt} = proxy["${ref}"];\n` - esmSource += `export { e${cnt++} as ${ref} };\n` + esmSource += ` +const e${cnt} = createProxy(String.raw\`${resourceKey}#${ref}\`); +export { e${cnt++} as ${ref} };` } } diff --git a/packages/next/src/build/webpack/loaders/next-metadata-route-loader.ts b/packages/next/src/build/webpack/loaders/next-metadata-route-loader.ts index 5adb640f7ce33..e49475b52fb4c 100644 --- a/packages/next/src/build/webpack/loaders/next-metadata-route-loader.ts +++ b/packages/next/src/build/webpack/loaders/next-metadata-route-loader.ts @@ -21,15 +21,19 @@ const cacheHeader = { } type MetadataRouteLoaderOptions = { - page: string + // Using separate argument to avoid json being parsed and hit error + // x-ref: https://github.com/vercel/next.js/pull/62615 filePath: string - isDynamic: '1' | '0' + isDynamicRouteExtension: '1' | '0' } export function getFilenameAndExtension(resourcePath: string) { const filename = path.basename(resourcePath) const [name, ext] = filename.split('.', 2) - return { name, ext } + return { + name, + ext, + } } function getContentType(resourcePath: string) { @@ -123,11 +127,11 @@ ${errorOnBadHandler(resourcePath)} export async function GET(_, ctx) { const { __metadata_id__, ...params } = ctx.params || {} - const targetId = __metadata_id__?.[0] + const targetId = __metadata_id__ let id = undefined - const imageMetadata = generateImageMetadata ? await generateImageMetadata({ params }) : null - - if (imageMetadata) { + + if (generateImageMetadata) { + const imageMetadata = await generateImageMetadata({ params }) id = imageMetadata.find((item) => { if (process.env.NODE_ENV !== 'production') { if (item?.id == null) { @@ -142,14 +146,14 @@ export async function GET(_, ctx) { }) } } + return handler({ params: ctx.params ? params : undefined, id }) } ` } -async function getDynamicSiteMapRouteCode( +async function getDynamicSitemapRouteCode( resourcePath: string, - page: string, loaderContext: webpack.LoaderContext ) { let staticGenerationCode = '' @@ -163,23 +167,20 @@ async function getDynamicSiteMapRouteCode( (name) => name !== 'default' && name !== 'generateSitemaps' ) - const hasGenerateSiteMaps = exportNames.includes('generateSitemaps') - if ( - process.env.NODE_ENV === 'production' && - hasGenerateSiteMaps && - page.includes('[__metadata_id__]') - ) { + const hasGenerateSitemaps = exportNames.includes('generateSitemaps') + + if (process.env.NODE_ENV === 'production' && hasGenerateSitemaps) { staticGenerationCode = `\ -/* dynamic sitemap route */ -export async function generateStaticParams() { - const sitemaps = generateSitemaps ? await generateSitemaps() : [] - const params = [] + /* dynamic sitemap route */ + export async function generateStaticParams() { + const sitemaps = await sitemapModule.generateSitemaps() + const params = [] - for (const item of sitemaps) { - params.push({ __metadata_id__: item.id.toString() }) - } - return params -} + for (const item of sitemaps) { + params.push({ __metadata_id__: item.id.toString() + '.xml' }) + } + return params + } ` } @@ -190,7 +191,6 @@ import { resolveRouteData } from 'next/dist/build/webpack/loaders/metadata/resol const sitemapModule = { ...userland } const handler = sitemapModule.default -const generateSitemaps = sitemapModule.generateSitemaps const contentType = ${JSON.stringify(getContentType(resourcePath))} const fileType = ${JSON.stringify(getFilenameAndExtension(resourcePath).name)} @@ -206,35 +206,27 @@ ${ } export async function GET(_, ctx) { - const { __metadata_id__, ...params } = ctx.params || {} - ${ - '' /* sitemap will be optimized to [__metadata_id__] from [[..._metadata_id__]] in production */ - } - const targetId = process.env.NODE_ENV !== 'production' - ? __metadata_id__?.[0] - : __metadata_id__ + const { __metadata_id__: id, ...params } = ctx.params || {} + const hasXmlExtension = id ? id.endsWith('.xml') : false - let id = undefined - const sitemaps = generateSitemaps ? await generateSitemaps() : null + if (id && !hasXmlExtension) { + return new NextResponse('Not Found', { + status: 404, + }) + } - if (sitemaps) { - id = sitemaps.find((item) => { - if (process.env.NODE_ENV !== 'production') { - if (item?.id == null) { - throw new Error('id property is required for every item returned from generateSitemaps') - } + if (process.env.NODE_ENV !== 'production' && sitemapModule.generateSitemaps) { + const sitemaps = await sitemapModule.generateSitemaps() + for (const item of sitemaps) { + if (item?.id == null) { + throw new Error('id property is required for every item returned from generateSitemaps') } - let itemID = item.id.toString() - return itemID === targetId - })?.id - if (id == null) { - return new NextResponse('Not Found', { - status: 404, - }) } } - const data = await handler({ id }) + const targetId = id && hasXmlExtension ? id.slice(0, -4) : undefined + + const data = await handler({ id: targetId }) const content = resolveRouteData(data, fileType) return new NextResponse(content, { @@ -254,15 +246,16 @@ ${staticGenerationCode} // TODO-METADATA: improve the cache control strategy const nextMetadataRouterLoader: webpack.LoaderDefinitionFunction = async function () { - const { page, isDynamic, filePath } = this.getOptions() + const { isDynamicRouteExtension, filePath } = this.getOptions() const { name: fileBaseName } = getFilenameAndExtension(filePath) + this.addDependency(filePath) let code = '' - if (isDynamic === '1') { + if (isDynamicRouteExtension === '1') { if (fileBaseName === 'robots' || fileBaseName === 'manifest') { code = getDynamicTextRouteCode(filePath) } else if (fileBaseName === 'sitemap') { - code = await getDynamicSiteMapRouteCode(filePath, page, this) + code = await getDynamicSitemapRouteCode(filePath, this) } else { code = getDynamicImageRouteCode(filePath) } diff --git a/packages/next/src/client/components/react-dev-overlay/internal/helpers/parseStack.ts b/packages/next/src/client/components/react-dev-overlay/internal/helpers/parseStack.ts index 693b53d7bdcdf..a7af46b00c933 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/helpers/parseStack.ts +++ b/packages/next/src/client/components/react-dev-overlay/internal/helpers/parseStack.ts @@ -16,6 +16,22 @@ export function parseStack(stack: string): StackFrame[] { } } + // throw away eval information that stacktrace-parser doesn't support + // adapted from https://github.com/stacktracejs/error-stack-parser/blob/9f33c224b5d7b607755eb277f9d51fcdb7287e24/error-stack-parser.js#L59C33-L59C62 + stack = stack + .split('\n') + .map((line) => { + if (line.includes('(eval ')) { + line = line + .replace(/eval code/g, 'eval') + .replace(/\(eval at [^()]* \(/, '(file://') + .replace(/\),.*$/g, ')') + } + + return line + }) + .join('\n') + const frames = parse(stack) return frames.map((frame) => { try { diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js index 878f0bf3d1eb2..b1262973216c8 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js @@ -35848,8 +35848,25 @@ function getResource(type, currentProps, pendingProps, currentResource) { _styles.set(_key, _resource); + var instance = ownerDocument.querySelector(getStylesheetSelectorFromKey(_key)); + + if (instance) { + var loadingState = instance._p; + + if (loadingState) ; else { + // This instance is already loaded + _resource.instance = instance; + _resource.state.loading = Loaded | Inserted; + } + } + if (!preloadPropsMap.has(_key)) { - preloadStylesheet(ownerDocument, _key, preloadPropsFromStylesheet(qualifiedProps), _resource.state); + var preloadProps = preloadPropsFromStylesheet(qualifiedProps); + preloadPropsMap.set(_key, preloadProps); + + if (!instance) { + preloadStylesheet(ownerDocument, _key, preloadProps, _resource.state); + } } } @@ -35996,31 +36013,24 @@ function stylesheetPropsFromRawProps(rawProps) { } function preloadStylesheet(ownerDocument, key, preloadProps, state) { - preloadPropsMap.set(key, preloadProps); - - if (!ownerDocument.querySelector(getStylesheetSelectorFromKey(key))) { - // There is no matching stylesheet instance in the Document. - // We will insert a preload now to kick off loading because - // we expect this stylesheet to commit - var preloadEl = ownerDocument.querySelector(getPreloadStylesheetSelectorFromKey(key)); - - if (preloadEl) { - // If we find a preload already it was SSR'd and we won't have an actual - // loading state to track. For now we will just assume it is loaded - state.loading = Loaded; - } else { - var instance = ownerDocument.createElement('link'); - state.preload = instance; - instance.addEventListener('load', function () { - return state.loading |= Loaded; - }); - instance.addEventListener('error', function () { - return state.loading |= Errored; - }); - setInitialProperties(instance, 'link', preloadProps); - markNodeAsHoistable(instance); - ownerDocument.head.appendChild(instance); - } + var preloadEl = ownerDocument.querySelector(getPreloadStylesheetSelectorFromKey(key)); + + if (preloadEl) { + // If we find a preload already it was SSR'd and we won't have an actual + // loading state to track. For now we will just assume it is loaded + state.loading = Loaded; + } else { + var instance = ownerDocument.createElement('link'); + state.preload = instance; + instance.addEventListener('load', function () { + return state.loading |= Loaded; + }); + instance.addEventListener('error', function () { + return state.loading |= Errored; + }); + setInitialProperties(instance, 'link', preloadProps); + markNodeAsHoistable(instance); + ownerDocument.head.appendChild(instance); } } @@ -36888,7 +36898,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-experimental-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-experimental-6230622a1a-20240610'; // Might add PROFILE later. diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js index ca9c12e9cc76d..2543bedce9385 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js @@ -13569,20 +13569,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { case "style": return "string" === typeof pendingProps.precedence && "string" === typeof pendingProps.href - ? ((pendingProps = getStyleKey(pendingProps.href)), - (JSCompiler_inline_result = getResourcesFromRoot( + ? ((currentProps = getStyleKey(pendingProps.href)), + (pendingProps = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles), - (currentProps = JSCompiler_inline_result.get(pendingProps)), - currentProps || - ((currentProps = { + (currentResource = pendingProps.get(currentProps)), + currentResource || + ((currentResource = { type: "style", instance: null, count: 0, state: null }), - JSCompiler_inline_result.set(pendingProps, currentProps)), - currentProps) + pendingProps.set(currentProps, currentResource)), + currentResource) : { type: "void", instance: null, count: 0, state: null }; case "link": if ( @@ -13605,22 +13605,31 @@ function getResource(type, currentProps, pendingProps, currentResource) { state: { loading: 0, preload: null } }), styles$231.set(type, resource$232), + (styles$231 = JSCompiler_inline_result.querySelector( + getStylesheetSelectorFromKey(type) + )) && + !styles$231._p && + ((resource$232.instance = styles$231), + (resource$232.state.loading = 5)), preloadPropsMap.has(type) || - preloadStylesheet( - JSCompiler_inline_result, - type, - { - rel: "preload", - as: "style", - href: pendingProps.href, - crossOrigin: pendingProps.crossOrigin, - integrity: pendingProps.integrity, - media: pendingProps.media, - hrefLang: pendingProps.hrefLang, - referrerPolicy: pendingProps.referrerPolicy - }, - resource$232.state - )); + ((pendingProps = { + rel: "preload", + as: "style", + href: pendingProps.href, + crossOrigin: pendingProps.crossOrigin, + integrity: pendingProps.integrity, + media: pendingProps.media, + hrefLang: pendingProps.hrefLang, + referrerPolicy: pendingProps.referrerPolicy + }), + preloadPropsMap.set(type, pendingProps), + styles$231 || + preloadStylesheet( + JSCompiler_inline_result, + type, + pendingProps, + resource$232.state + ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); return resource$232; @@ -13636,20 +13645,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { currentProps && "function" !== typeof currentProps && "symbol" !== typeof currentProps - ? ((pendingProps = getScriptKey(pendingProps)), - (JSCompiler_inline_result = getResourcesFromRoot( + ? ((currentProps = getScriptKey(pendingProps)), + (pendingProps = getResourcesFromRoot( JSCompiler_inline_result ).hoistableScripts), - (currentProps = JSCompiler_inline_result.get(pendingProps)), - currentProps || - ((currentProps = { + (currentResource = pendingProps.get(currentProps)), + currentResource || + ((currentResource = { type: "script", instance: null, count: 0, state: null }), - JSCompiler_inline_result.set(pendingProps, currentProps)), - currentProps) + pendingProps.set(currentProps, currentResource)), + currentResource) : { type: "void", instance: null, count: 0, state: null } ); default: @@ -13669,21 +13678,19 @@ function stylesheetPropsFromRawProps(rawProps) { }); } function preloadStylesheet(ownerDocument, key, preloadProps, state) { - preloadPropsMap.set(key, preloadProps); - ownerDocument.querySelector(getStylesheetSelectorFromKey(key)) || - (ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]") - ? (state.loading = 1) - : ((key = ownerDocument.createElement("link")), - (state.preload = key), - key.addEventListener("load", function () { - return (state.loading |= 1); - }), - key.addEventListener("error", function () { - return (state.loading |= 2); - }), - setInitialProperties(key, "link", preloadProps), - markNodeAsHoistable(key), - ownerDocument.head.appendChild(key))); + ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]") + ? (state.loading = 1) + : ((key = ownerDocument.createElement("link")), + (state.preload = key), + key.addEventListener("load", function () { + return (state.loading |= 1); + }), + key.addEventListener("error", function () { + return (state.loading |= 2); + }), + setInitialProperties(key, "link", preloadProps), + markNodeAsHoistable(key), + ownerDocument.head.appendChild(key)); } function getScriptKey(src) { return '[src="' + escapeSelectorAttributeValueInsideDoubleQuotes(src) + '"]'; @@ -14782,14 +14789,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1631 = React.version; if ( - "19.0.0-experimental-1df34bdf62-20240605" !== + "19.0.0-experimental-6230622a1a-20240610" !== isomorphicReactPackageVersion$jscomp$inline_1631 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1631, - "19.0.0-experimental-1df34bdf62-20240605" + "19.0.0-experimental-6230622a1a-20240610" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -14808,7 +14815,7 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { var devToolsConfig$jscomp$inline_1638 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-experimental-1df34bdf62-20240605", + version: "19.0.0-experimental-6230622a1a-20240610", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2016 = { @@ -14838,7 +14845,7 @@ var internals$jscomp$inline_2016 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-experimental-1df34bdf62-20240605" + reconcilerVersion: "19.0.0-experimental-6230622a1a-20240610" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2017 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -14944,4 +14951,4 @@ exports.hydrateRoot = function (container, initialChildren, options) { listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.0.0-experimental-1df34bdf62-20240605"; +exports.version = "19.0.0-experimental-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js index a95facdb76834..574227c795ee7 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js @@ -35896,8 +35896,25 @@ function getResource(type, currentProps, pendingProps, currentResource) { _styles.set(_key, _resource); + var instance = ownerDocument.querySelector(getStylesheetSelectorFromKey(_key)); + + if (instance) { + var loadingState = instance._p; + + if (loadingState) ; else { + // This instance is already loaded + _resource.instance = instance; + _resource.state.loading = Loaded | Inserted; + } + } + if (!preloadPropsMap.has(_key)) { - preloadStylesheet(ownerDocument, _key, preloadPropsFromStylesheet(qualifiedProps), _resource.state); + var preloadProps = preloadPropsFromStylesheet(qualifiedProps); + preloadPropsMap.set(_key, preloadProps); + + if (!instance) { + preloadStylesheet(ownerDocument, _key, preloadProps, _resource.state); + } } } @@ -36044,31 +36061,24 @@ function stylesheetPropsFromRawProps(rawProps) { } function preloadStylesheet(ownerDocument, key, preloadProps, state) { - preloadPropsMap.set(key, preloadProps); - - if (!ownerDocument.querySelector(getStylesheetSelectorFromKey(key))) { - // There is no matching stylesheet instance in the Document. - // We will insert a preload now to kick off loading because - // we expect this stylesheet to commit - var preloadEl = ownerDocument.querySelector(getPreloadStylesheetSelectorFromKey(key)); - - if (preloadEl) { - // If we find a preload already it was SSR'd and we won't have an actual - // loading state to track. For now we will just assume it is loaded - state.loading = Loaded; - } else { - var instance = ownerDocument.createElement('link'); - state.preload = instance; - instance.addEventListener('load', function () { - return state.loading |= Loaded; - }); - instance.addEventListener('error', function () { - return state.loading |= Errored; - }); - setInitialProperties(instance, 'link', preloadProps); - markNodeAsHoistable(instance); - ownerDocument.head.appendChild(instance); - } + var preloadEl = ownerDocument.querySelector(getPreloadStylesheetSelectorFromKey(key)); + + if (preloadEl) { + // If we find a preload already it was SSR'd and we won't have an actual + // loading state to track. For now we will just assume it is loaded + state.loading = Loaded; + } else { + var instance = ownerDocument.createElement('link'); + state.preload = instance; + instance.addEventListener('load', function () { + return state.loading |= Loaded; + }); + instance.addEventListener('error', function () { + return state.loading |= Errored; + }); + setInitialProperties(instance, 'link', preloadProps); + markNodeAsHoistable(instance); + ownerDocument.head.appendChild(instance); } } @@ -36936,7 +36946,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-experimental-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-experimental-6230622a1a-20240610'; function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation. implementation) { diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js index 40806315323ea..869e063e75513 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js @@ -14260,20 +14260,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { case "style": return "string" === typeof pendingProps.precedence && "string" === typeof pendingProps.href - ? ((pendingProps = getStyleKey(pendingProps.href)), - (JSCompiler_inline_result = getResourcesFromRoot( + ? ((currentProps = getStyleKey(pendingProps.href)), + (pendingProps = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles), - (currentProps = JSCompiler_inline_result.get(pendingProps)), - currentProps || - ((currentProps = { + (currentResource = pendingProps.get(currentProps)), + currentResource || + ((currentResource = { type: "style", instance: null, count: 0, state: null }), - JSCompiler_inline_result.set(pendingProps, currentProps)), - currentProps) + pendingProps.set(currentProps, currentResource)), + currentResource) : { type: "void", instance: null, count: 0, state: null }; case "link": if ( @@ -14296,22 +14296,31 @@ function getResource(type, currentProps, pendingProps, currentResource) { state: { loading: 0, preload: null } }), styles$251.set(type, resource$252), + (styles$251 = JSCompiler_inline_result.querySelector( + getStylesheetSelectorFromKey(type) + )) && + !styles$251._p && + ((resource$252.instance = styles$251), + (resource$252.state.loading = 5)), preloadPropsMap.has(type) || - preloadStylesheet( - JSCompiler_inline_result, - type, - { - rel: "preload", - as: "style", - href: pendingProps.href, - crossOrigin: pendingProps.crossOrigin, - integrity: pendingProps.integrity, - media: pendingProps.media, - hrefLang: pendingProps.hrefLang, - referrerPolicy: pendingProps.referrerPolicy - }, - resource$252.state - )); + ((pendingProps = { + rel: "preload", + as: "style", + href: pendingProps.href, + crossOrigin: pendingProps.crossOrigin, + integrity: pendingProps.integrity, + media: pendingProps.media, + hrefLang: pendingProps.hrefLang, + referrerPolicy: pendingProps.referrerPolicy + }), + preloadPropsMap.set(type, pendingProps), + styles$251 || + preloadStylesheet( + JSCompiler_inline_result, + type, + pendingProps, + resource$252.state + ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); return resource$252; @@ -14327,20 +14336,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { currentProps && "function" !== typeof currentProps && "symbol" !== typeof currentProps - ? ((pendingProps = getScriptKey(pendingProps)), - (JSCompiler_inline_result = getResourcesFromRoot( + ? ((currentProps = getScriptKey(pendingProps)), + (pendingProps = getResourcesFromRoot( JSCompiler_inline_result ).hoistableScripts), - (currentProps = JSCompiler_inline_result.get(pendingProps)), - currentProps || - ((currentProps = { + (currentResource = pendingProps.get(currentProps)), + currentResource || + ((currentResource = { type: "script", instance: null, count: 0, state: null }), - JSCompiler_inline_result.set(pendingProps, currentProps)), - currentProps) + pendingProps.set(currentProps, currentResource)), + currentResource) : { type: "void", instance: null, count: 0, state: null } ); default: @@ -14360,21 +14369,19 @@ function stylesheetPropsFromRawProps(rawProps) { }); } function preloadStylesheet(ownerDocument, key, preloadProps, state) { - preloadPropsMap.set(key, preloadProps); - ownerDocument.querySelector(getStylesheetSelectorFromKey(key)) || - (ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]") - ? (state.loading = 1) - : ((key = ownerDocument.createElement("link")), - (state.preload = key), - key.addEventListener("load", function () { - return (state.loading |= 1); - }), - key.addEventListener("error", function () { - return (state.loading |= 2); - }), - setInitialProperties(key, "link", preloadProps), - markNodeAsHoistable(key), - ownerDocument.head.appendChild(key))); + ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]") + ? (state.loading = 1) + : ((key = ownerDocument.createElement("link")), + (state.preload = key), + key.addEventListener("load", function () { + return (state.loading |= 1); + }), + key.addEventListener("error", function () { + return (state.loading |= 2); + }), + setInitialProperties(key, "link", preloadProps), + markNodeAsHoistable(key), + ownerDocument.head.appendChild(key)); } function getScriptKey(src) { return '[src="' + escapeSelectorAttributeValueInsideDoubleQuotes(src) + '"]'; @@ -15492,14 +15499,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1719 = React.version; if ( - "19.0.0-experimental-1df34bdf62-20240605" !== + "19.0.0-experimental-6230622a1a-20240610" !== isomorphicReactPackageVersion$jscomp$inline_1719 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1719, - "19.0.0-experimental-1df34bdf62-20240605" + "19.0.0-experimental-6230622a1a-20240610" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15518,7 +15525,7 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { var devToolsConfig$jscomp$inline_1726 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-experimental-1df34bdf62-20240605", + version: "19.0.0-experimental-6230622a1a-20240610", rendererPackageName: "react-dom" }; (function (internals) { @@ -15561,7 +15568,7 @@ var devToolsConfig$jscomp$inline_1726 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-experimental-1df34bdf62-20240605" + reconcilerVersion: "19.0.0-experimental-6230622a1a-20240610" }); function noop() {} function getCrossOriginStringAs(as, input) { @@ -15815,7 +15822,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-experimental-1df34bdf62-20240605"; +exports.version = "19.0.0-experimental-6230622a1a-20240610"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js index bff1234e7c701..50f3351789139 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") { var React = require("next/dist/compiled/react-experimental"); var ReactDOM = require('react-dom'); -var ReactVersion = '19.0.0-experimental-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-experimental-6230622a1a-20240610'; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; @@ -1941,7 +1941,7 @@ function sanitizeURL(url) { // Run `yarn generate-inline-fizz-runtime` to generate. var clientRenderBoundary = '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'; var completeBoundary = '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};'; -var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};'; +var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};'; var completeSegment = '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};'; var formReplaying = 'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});'; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js index 8b5a9ae0fe69a..23065ec2d9ee9 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js @@ -5442,12 +5442,12 @@ function flushCompletedBoundary(request, destination, boundary) { ? 0 === (completedSegments.instructions & 2) ? ((completedSegments.instructions |= 10), destination.push( - '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' )) : 0 === (completedSegments.instructions & 8) ? ((completedSegments.instructions |= 8), destination.push( - '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' )) : destination.push('$RR("') : 0 === (completedSegments.instructions & 2) @@ -5863,4 +5863,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-experimental-1df34bdf62-20240605"; +exports.version = "19.0.0-experimental-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js index 64ba8d9c55e1e..1b311e7bace6d 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") { var React = require("next/dist/compiled/react-experimental"); var ReactDOM = require('react-dom'); -var ReactVersion = '19.0.0-experimental-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-experimental-6230622a1a-20240610'; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; @@ -1941,7 +1941,7 @@ function sanitizeURL(url) { // Run `yarn generate-inline-fizz-runtime` to generate. var clientRenderBoundary = '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'; var completeBoundary = '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};'; -var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};'; +var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};'; var completeSegment = '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};'; var formReplaying = 'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});'; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js index 73b225d2a0035..080b75226badb 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js @@ -5531,12 +5531,12 @@ function flushCompletedBoundary(request, destination, boundary) { ? 0 === (completedSegments.instructions & 2) ? ((completedSegments.instructions |= 10), destination.push( - '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' )) : 0 === (completedSegments.instructions & 8) ? ((completedSegments.instructions |= 8), destination.push( - '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' )) : destination.push('$RR("') : 0 === (completedSegments.instructions & 2) @@ -5959,4 +5959,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-experimental-1df34bdf62-20240605"; +exports.version = "19.0.0-experimental-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js index 73e35cb9878fb..47ac3fa761a15 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") { var React = require("next/dist/compiled/react-experimental"); var ReactDOM = require('react-dom'); -var reactDOMPackageVersion = '19.0.0-experimental-1df34bdf62-20240605'; +var reactDOMPackageVersion = '19.0.0-experimental-6230622a1a-20240610'; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; @@ -2016,7 +2016,7 @@ function sanitizeURL(url) { // Run `yarn generate-inline-fizz-runtime` to generate. var clientRenderBoundary = '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'; var completeBoundary = '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};'; -var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};'; +var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};'; var completeSegment = '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};'; var formReplaying = 'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});'; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js index 27b6b0307d0c5..725e15419d634 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js @@ -2332,10 +2332,10 @@ var completeSegmentScript1Full = stringToPrecomputedChunk( ), completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC("'), completeBoundaryWithStylesScript1FullBoth = stringToPrecomputedChunk( - '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' ), completeBoundaryWithStylesScript1FullPartial = stringToPrecomputedChunk( - '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' ), completeBoundaryWithStylesScript1Partial = stringToPrecomputedChunk('$RR("'), completeBoundaryScript2 = stringToPrecomputedChunk('","'), @@ -6345,12 +6345,12 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-1df34bdf62-20240605" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-6230622a1a-20240610" !== isomorphicReactPackageVersion) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion, - "19.0.0-experimental-1df34bdf62-20240605" + "19.0.0-experimental-6230622a1a-20240610" ) ); } @@ -6555,4 +6555,4 @@ exports.resume = function (children, postponedState, options) { startWork(request); }); }; -exports.version = "19.0.0-experimental-1df34bdf62-20240605"; +exports.version = "19.0.0-experimental-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js index e4cc5bc173b5f..84cc171c78b82 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js @@ -5504,13 +5504,13 @@ function flushCompletedBoundary(request, destination, boundary) { ? ((completedSegments.instructions |= 10), writeChunk( destination, - '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' )) : 0 === (completedSegments.instructions & 8) ? ((completedSegments.instructions |= 8), writeChunk( destination, - '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' )) : writeChunk(destination, '$RR("') : 0 === (completedSegments.instructions & 2) @@ -5864,13 +5864,13 @@ function addToReplayParent(node, parentKeyPath, trackedPostpones) { } var isomorphicReactPackageVersion$jscomp$inline_800 = React.version; if ( - "19.0.0-experimental-1df34bdf62-20240605" !== + "19.0.0-experimental-6230622a1a-20240610" !== isomorphicReactPackageVersion$jscomp$inline_800 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_800 + - "\n - react-dom: 19.0.0-experimental-1df34bdf62-20240605\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-6230622a1a-20240610\nLearn more: https://react.dev/warnings/version-mismatch") ); exports.renderToReadableStream = function (children, options) { return new Promise(function (resolve, reject) { @@ -5961,4 +5961,4 @@ exports.renderToReadableStream = function (children, options) { safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks); }); }; -exports.version = "19.0.0-experimental-1df34bdf62-20240605"; +exports.version = "19.0.0-experimental-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js index 74fcbcf35e596..0cb90ebfd3c7b 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") { var React = require("next/dist/compiled/react-experimental"); var ReactDOM = require('react-dom'); -var reactDOMPackageVersion = '19.0.0-experimental-1df34bdf62-20240605'; +var reactDOMPackageVersion = '19.0.0-experimental-6230622a1a-20240610'; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; @@ -2016,7 +2016,7 @@ function sanitizeURL(url) { // Run `yarn generate-inline-fizz-runtime` to generate. var clientRenderBoundary = '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'; var completeBoundary = '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};'; -var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};'; +var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};'; var completeSegment = '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};'; var formReplaying = 'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});'; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js index d2a7dfea4aefe..3b96678ec3d29 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js @@ -2349,10 +2349,10 @@ var completeSegmentScript1Full = stringToPrecomputedChunk( ), completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC("'), completeBoundaryWithStylesScript1FullBoth = stringToPrecomputedChunk( - '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' ), completeBoundaryWithStylesScript1FullPartial = stringToPrecomputedChunk( - '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' ), completeBoundaryWithStylesScript1Partial = stringToPrecomputedChunk('$RR("'), completeBoundaryScript2 = stringToPrecomputedChunk('","'), @@ -6468,11 +6468,11 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-1df34bdf62-20240605" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-6230622a1a-20240610" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-1df34bdf62-20240605\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-6230622a1a-20240610\nLearn more: https://react.dev/warnings/version-mismatch") ); } ensureCorrectIsomorphicReactVersion(); @@ -6676,4 +6676,4 @@ exports.resume = function (children, postponedState, options) { startWork(request); }); }; -exports.version = "19.0.0-experimental-1df34bdf62-20240605"; +exports.version = "19.0.0-experimental-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js index a53aad340966d..18c0609458ce4 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js @@ -21,7 +21,7 @@ var async_hooks = require('async_hooks'); var ReactDOM = require('react-dom'); var stream = require('stream'); -var reactDOMPackageVersion = '19.0.0-experimental-1df34bdf62-20240605'; +var reactDOMPackageVersion = '19.0.0-experimental-6230622a1a-20240610'; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; @@ -1997,7 +1997,7 @@ function sanitizeURL(url) { // Run `yarn generate-inline-fizz-runtime` to generate. var clientRenderBoundary = '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'; var completeBoundary = '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};'; -var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};'; +var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};'; var completeSegment = '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};'; var formReplaying = 'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});'; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js index 4e95e7baaeb87..4d1d54adaed25 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js @@ -2271,10 +2271,10 @@ var completeSegmentScript1Full = stringToPrecomputedChunk( ), completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC("'), completeBoundaryWithStylesScript1FullBoth = stringToPrecomputedChunk( - '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' ), completeBoundaryWithStylesScript1FullPartial = stringToPrecomputedChunk( - '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' ), completeBoundaryWithStylesScript1Partial = stringToPrecomputedChunk('$RR("'), completeBoundaryScript2 = stringToPrecomputedChunk('","'), @@ -6263,11 +6263,11 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-1df34bdf62-20240605" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-6230622a1a-20240610" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-1df34bdf62-20240605\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-6230622a1a-20240610\nLearn more: https://react.dev/warnings/version-mismatch") ); } ensureCorrectIsomorphicReactVersion(); @@ -6548,4 +6548,4 @@ exports.resumeToPipeableStream = function (children, postponedState, options) { } }; }; -exports.version = "19.0.0-experimental-1df34bdf62-20240605"; +exports.version = "19.0.0-experimental-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js index e9be6fa003c53..0613fd5ed9ec5 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js @@ -36549,8 +36549,25 @@ function getResource(type, currentProps, pendingProps, currentResource) { _styles.set(_key, _resource); + var instance = ownerDocument.querySelector(getStylesheetSelectorFromKey(_key)); + + if (instance) { + var loadingState = instance._p; + + if (loadingState) ; else { + // This instance is already loaded + _resource.instance = instance; + _resource.state.loading = Loaded | Inserted; + } + } + if (!preloadPropsMap.has(_key)) { - preloadStylesheet(ownerDocument, _key, preloadPropsFromStylesheet(qualifiedProps), _resource.state); + var preloadProps = preloadPropsFromStylesheet(qualifiedProps); + preloadPropsMap.set(_key, preloadProps); + + if (!instance) { + preloadStylesheet(ownerDocument, _key, preloadProps, _resource.state); + } } } @@ -36697,31 +36714,24 @@ function stylesheetPropsFromRawProps(rawProps) { } function preloadStylesheet(ownerDocument, key, preloadProps, state) { - preloadPropsMap.set(key, preloadProps); - - if (!ownerDocument.querySelector(getStylesheetSelectorFromKey(key))) { - // There is no matching stylesheet instance in the Document. - // We will insert a preload now to kick off loading because - // we expect this stylesheet to commit - var preloadEl = ownerDocument.querySelector(getPreloadStylesheetSelectorFromKey(key)); - - if (preloadEl) { - // If we find a preload already it was SSR'd and we won't have an actual - // loading state to track. For now we will just assume it is loaded - state.loading = Loaded; - } else { - var instance = ownerDocument.createElement('link'); - state.preload = instance; - instance.addEventListener('load', function () { - return state.loading |= Loaded; - }); - instance.addEventListener('error', function () { - return state.loading |= Errored; - }); - setInitialProperties(instance, 'link', preloadProps); - markNodeAsHoistable(instance); - ownerDocument.head.appendChild(instance); - } + var preloadEl = ownerDocument.querySelector(getPreloadStylesheetSelectorFromKey(key)); + + if (preloadEl) { + // If we find a preload already it was SSR'd and we won't have an actual + // loading state to track. For now we will just assume it is loaded + state.loading = Loaded; + } else { + var instance = ownerDocument.createElement('link'); + state.preload = instance; + instance.addEventListener('load', function () { + return state.loading |= Loaded; + }); + instance.addEventListener('error', function () { + return state.loading |= Errored; + }); + setInitialProperties(instance, 'link', preloadProps); + markNodeAsHoistable(instance); + ownerDocument.head.appendChild(instance); } } @@ -37589,7 +37599,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-experimental-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-experimental-6230622a1a-20240610'; // Might add PROFILE later. diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js index e426db9f52f4b..9d61431c8aea1 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js @@ -13948,20 +13948,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { case "style": return "string" === typeof pendingProps.precedence && "string" === typeof pendingProps.href - ? ((pendingProps = getStyleKey(pendingProps.href)), - (JSCompiler_inline_result = getResourcesFromRoot( + ? ((currentProps = getStyleKey(pendingProps.href)), + (pendingProps = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles), - (currentProps = JSCompiler_inline_result.get(pendingProps)), - currentProps || - ((currentProps = { + (currentResource = pendingProps.get(currentProps)), + currentResource || + ((currentResource = { type: "style", instance: null, count: 0, state: null }), - JSCompiler_inline_result.set(pendingProps, currentProps)), - currentProps) + pendingProps.set(currentProps, currentResource)), + currentResource) : { type: "void", instance: null, count: 0, state: null }; case "link": if ( @@ -13984,22 +13984,31 @@ function getResource(type, currentProps, pendingProps, currentResource) { state: { loading: 0, preload: null } }), styles$232.set(type, resource$233), + (styles$232 = JSCompiler_inline_result.querySelector( + getStylesheetSelectorFromKey(type) + )) && + !styles$232._p && + ((resource$233.instance = styles$232), + (resource$233.state.loading = 5)), preloadPropsMap.has(type) || - preloadStylesheet( - JSCompiler_inline_result, - type, - { - rel: "preload", - as: "style", - href: pendingProps.href, - crossOrigin: pendingProps.crossOrigin, - integrity: pendingProps.integrity, - media: pendingProps.media, - hrefLang: pendingProps.hrefLang, - referrerPolicy: pendingProps.referrerPolicy - }, - resource$233.state - )); + ((pendingProps = { + rel: "preload", + as: "style", + href: pendingProps.href, + crossOrigin: pendingProps.crossOrigin, + integrity: pendingProps.integrity, + media: pendingProps.media, + hrefLang: pendingProps.hrefLang, + referrerPolicy: pendingProps.referrerPolicy + }), + preloadPropsMap.set(type, pendingProps), + styles$232 || + preloadStylesheet( + JSCompiler_inline_result, + type, + pendingProps, + resource$233.state + ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); return resource$233; @@ -14015,20 +14024,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { currentProps && "function" !== typeof currentProps && "symbol" !== typeof currentProps - ? ((pendingProps = getScriptKey(pendingProps)), - (JSCompiler_inline_result = getResourcesFromRoot( + ? ((currentProps = getScriptKey(pendingProps)), + (pendingProps = getResourcesFromRoot( JSCompiler_inline_result ).hoistableScripts), - (currentProps = JSCompiler_inline_result.get(pendingProps)), - currentProps || - ((currentProps = { + (currentResource = pendingProps.get(currentProps)), + currentResource || + ((currentResource = { type: "script", instance: null, count: 0, state: null }), - JSCompiler_inline_result.set(pendingProps, currentProps)), - currentProps) + pendingProps.set(currentProps, currentResource)), + currentResource) : { type: "void", instance: null, count: 0, state: null } ); default: @@ -14048,21 +14057,19 @@ function stylesheetPropsFromRawProps(rawProps) { }); } function preloadStylesheet(ownerDocument, key, preloadProps, state) { - preloadPropsMap.set(key, preloadProps); - ownerDocument.querySelector(getStylesheetSelectorFromKey(key)) || - (ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]") - ? (state.loading = 1) - : ((key = ownerDocument.createElement("link")), - (state.preload = key), - key.addEventListener("load", function () { - return (state.loading |= 1); - }), - key.addEventListener("error", function () { - return (state.loading |= 2); - }), - setInitialProperties(key, "link", preloadProps), - markNodeAsHoistable(key), - ownerDocument.head.appendChild(key))); + ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]") + ? (state.loading = 1) + : ((key = ownerDocument.createElement("link")), + (state.preload = key), + key.addEventListener("load", function () { + return (state.loading |= 1); + }), + key.addEventListener("error", function () { + return (state.loading |= 2); + }), + setInitialProperties(key, "link", preloadProps), + markNodeAsHoistable(key), + ownerDocument.head.appendChild(key)); } function getScriptKey(src) { return '[src="' + escapeSelectorAttributeValueInsideDoubleQuotes(src) + '"]'; @@ -15161,14 +15168,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1660 = React.version; if ( - "19.0.0-experimental-1df34bdf62-20240605" !== + "19.0.0-experimental-6230622a1a-20240610" !== isomorphicReactPackageVersion$jscomp$inline_1660 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1660, - "19.0.0-experimental-1df34bdf62-20240605" + "19.0.0-experimental-6230622a1a-20240610" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15187,7 +15194,7 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { var devToolsConfig$jscomp$inline_1667 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-experimental-1df34bdf62-20240605", + version: "19.0.0-experimental-6230622a1a-20240610", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2050 = { @@ -15217,7 +15224,7 @@ var internals$jscomp$inline_2050 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-experimental-1df34bdf62-20240605" + reconcilerVersion: "19.0.0-experimental-6230622a1a-20240610" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2051 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -15474,4 +15481,4 @@ exports.observeVisibleRects = function ( } }; }; -exports.version = "19.0.0-experimental-1df34bdf62-20240605"; +exports.version = "19.0.0-experimental-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js index 8eb39f3787470..197c5b33a7c0c 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js @@ -144,7 +144,7 @@ var Internals = { findDOMNode: null }; -var ReactVersion = '19.0.0-experimental-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-experimental-6230622a1a-20240610'; /** * HTML nodeType values that represent the type of the node diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js index 129540b8c827b..9e324072ab49c 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js @@ -206,4 +206,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-experimental-1df34bdf62-20240605"; +exports.version = "19.0.0-experimental-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js index 15aeabc7fdaec..1a32afc1da3c1 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js @@ -16,7 +16,7 @@ if (process.env.NODE_ENV !== "production") { var React = require("next/dist/compiled/react-experimental"); -var ReactVersion = '19.0.0-experimental-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-experimental-6230622a1a-20240610'; var ReactSharedInternalsServer = // $FlowFixMe: It's defined in the one we resolve to. React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js index 726abeedb5d63..456b1c2aa9462 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js @@ -151,4 +151,4 @@ exports.preloadModule = function (href, options) { }); } else Internals.d.m(href); }; -exports.version = "19.0.0-experimental-1df34bdf62-20240605"; +exports.version = "19.0.0-experimental-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom-experimental/package.json b/packages/next/src/compiled/react-dom-experimental/package.json index b339bdd6a3d96..0cc406b2d32b9 100644 --- a/packages/next/src/compiled/react-dom-experimental/package.json +++ b/packages/next/src/compiled/react-dom-experimental/package.json @@ -72,10 +72,10 @@ "./package.json": "./package.json" }, "dependencies": { - "scheduler": "0.0.0-experimental-1df34bdf62-20240605" + "scheduler": "0.0.0-experimental-6230622a1a-20240610" }, "peerDependencies": { - "react": "0.0.0-experimental-1df34bdf62-20240605" + "react": "0.0.0-experimental-6230622a1a-20240610" }, "browser": { "./server.js": "./server.browser.js", diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js index 6db71eaa50edf..4cc92bdf21d53 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js @@ -35384,8 +35384,25 @@ function getResource(type, currentProps, pendingProps, currentResource) { _styles.set(_key, _resource); + var instance = ownerDocument.querySelector(getStylesheetSelectorFromKey(_key)); + + if (instance) { + var loadingState = instance._p; + + if (loadingState) ; else { + // This instance is already loaded + _resource.instance = instance; + _resource.state.loading = Loaded | Inserted; + } + } + if (!preloadPropsMap.has(_key)) { - preloadStylesheet(ownerDocument, _key, preloadPropsFromStylesheet(qualifiedProps), _resource.state); + var preloadProps = preloadPropsFromStylesheet(qualifiedProps); + preloadPropsMap.set(_key, preloadProps); + + if (!instance) { + preloadStylesheet(ownerDocument, _key, preloadProps, _resource.state); + } } } @@ -35532,31 +35549,24 @@ function stylesheetPropsFromRawProps(rawProps) { } function preloadStylesheet(ownerDocument, key, preloadProps, state) { - preloadPropsMap.set(key, preloadProps); - - if (!ownerDocument.querySelector(getStylesheetSelectorFromKey(key))) { - // There is no matching stylesheet instance in the Document. - // We will insert a preload now to kick off loading because - // we expect this stylesheet to commit - var preloadEl = ownerDocument.querySelector(getPreloadStylesheetSelectorFromKey(key)); - - if (preloadEl) { - // If we find a preload already it was SSR'd and we won't have an actual - // loading state to track. For now we will just assume it is loaded - state.loading = Loaded; - } else { - var instance = ownerDocument.createElement('link'); - state.preload = instance; - instance.addEventListener('load', function () { - return state.loading |= Loaded; - }); - instance.addEventListener('error', function () { - return state.loading |= Errored; - }); - setInitialProperties(instance, 'link', preloadProps); - markNodeAsHoistable(instance); - ownerDocument.head.appendChild(instance); - } + var preloadEl = ownerDocument.querySelector(getPreloadStylesheetSelectorFromKey(key)); + + if (preloadEl) { + // If we find a preload already it was SSR'd and we won't have an actual + // loading state to track. For now we will just assume it is loaded + state.loading = Loaded; + } else { + var instance = ownerDocument.createElement('link'); + state.preload = instance; + instance.addEventListener('load', function () { + return state.loading |= Loaded; + }); + instance.addEventListener('error', function () { + return state.loading |= Errored; + }); + setInitialProperties(instance, 'link', preloadProps); + markNodeAsHoistable(instance); + ownerDocument.head.appendChild(instance); } } @@ -36424,7 +36434,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-rc-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-rc-6230622a1a-20240610'; // Might add PROFILE later. diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js index a047fba31ec29..52d5e3c749149 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js @@ -13413,20 +13413,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { case "style": return "string" === typeof pendingProps.precedence && "string" === typeof pendingProps.href - ? ((pendingProps = getStyleKey(pendingProps.href)), - (JSCompiler_inline_result = getResourcesFromRoot( + ? ((currentProps = getStyleKey(pendingProps.href)), + (pendingProps = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles), - (currentProps = JSCompiler_inline_result.get(pendingProps)), - currentProps || - ((currentProps = { + (currentResource = pendingProps.get(currentProps)), + currentResource || + ((currentResource = { type: "style", instance: null, count: 0, state: null }), - JSCompiler_inline_result.set(pendingProps, currentProps)), - currentProps) + pendingProps.set(currentProps, currentResource)), + currentResource) : { type: "void", instance: null, count: 0, state: null }; case "link": if ( @@ -13449,22 +13449,31 @@ function getResource(type, currentProps, pendingProps, currentResource) { state: { loading: 0, preload: null } }), styles$229.set(type, resource$230), + (styles$229 = JSCompiler_inline_result.querySelector( + getStylesheetSelectorFromKey(type) + )) && + !styles$229._p && + ((resource$230.instance = styles$229), + (resource$230.state.loading = 5)), preloadPropsMap.has(type) || - preloadStylesheet( - JSCompiler_inline_result, - type, - { - rel: "preload", - as: "style", - href: pendingProps.href, - crossOrigin: pendingProps.crossOrigin, - integrity: pendingProps.integrity, - media: pendingProps.media, - hrefLang: pendingProps.hrefLang, - referrerPolicy: pendingProps.referrerPolicy - }, - resource$230.state - )); + ((pendingProps = { + rel: "preload", + as: "style", + href: pendingProps.href, + crossOrigin: pendingProps.crossOrigin, + integrity: pendingProps.integrity, + media: pendingProps.media, + hrefLang: pendingProps.hrefLang, + referrerPolicy: pendingProps.referrerPolicy + }), + preloadPropsMap.set(type, pendingProps), + styles$229 || + preloadStylesheet( + JSCompiler_inline_result, + type, + pendingProps, + resource$230.state + ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); return resource$230; @@ -13480,20 +13489,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { currentProps && "function" !== typeof currentProps && "symbol" !== typeof currentProps - ? ((pendingProps = getScriptKey(pendingProps)), - (JSCompiler_inline_result = getResourcesFromRoot( + ? ((currentProps = getScriptKey(pendingProps)), + (pendingProps = getResourcesFromRoot( JSCompiler_inline_result ).hoistableScripts), - (currentProps = JSCompiler_inline_result.get(pendingProps)), - currentProps || - ((currentProps = { + (currentResource = pendingProps.get(currentProps)), + currentResource || + ((currentResource = { type: "script", instance: null, count: 0, state: null }), - JSCompiler_inline_result.set(pendingProps, currentProps)), - currentProps) + pendingProps.set(currentProps, currentResource)), + currentResource) : { type: "void", instance: null, count: 0, state: null } ); default: @@ -13513,21 +13522,19 @@ function stylesheetPropsFromRawProps(rawProps) { }); } function preloadStylesheet(ownerDocument, key, preloadProps, state) { - preloadPropsMap.set(key, preloadProps); - ownerDocument.querySelector(getStylesheetSelectorFromKey(key)) || - (ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]") - ? (state.loading = 1) - : ((key = ownerDocument.createElement("link")), - (state.preload = key), - key.addEventListener("load", function () { - return (state.loading |= 1); - }), - key.addEventListener("error", function () { - return (state.loading |= 2); - }), - setInitialProperties(key, "link", preloadProps), - markNodeAsHoistable(key), - ownerDocument.head.appendChild(key))); + ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]") + ? (state.loading = 1) + : ((key = ownerDocument.createElement("link")), + (state.preload = key), + key.addEventListener("load", function () { + return (state.loading |= 1); + }), + key.addEventListener("error", function () { + return (state.loading |= 2); + }), + setInitialProperties(key, "link", preloadProps), + markNodeAsHoistable(key), + ownerDocument.head.appendChild(key)); } function getScriptKey(src) { return '[src="' + escapeSelectorAttributeValueInsideDoubleQuotes(src) + '"]'; @@ -14626,14 +14633,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1651 = React.version; if ( - "19.0.0-rc-1df34bdf62-20240605" !== + "19.0.0-rc-6230622a1a-20240610" !== isomorphicReactPackageVersion$jscomp$inline_1651 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1651, - "19.0.0-rc-1df34bdf62-20240605" + "19.0.0-rc-6230622a1a-20240610" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -14652,7 +14659,7 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { var devToolsConfig$jscomp$inline_1658 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-rc-1df34bdf62-20240605", + version: "19.0.0-rc-6230622a1a-20240610", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2036 = { @@ -14682,7 +14689,7 @@ var internals$jscomp$inline_2036 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-rc-1df34bdf62-20240605" + reconcilerVersion: "19.0.0-rc-6230622a1a-20240610" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2037 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -14788,4 +14795,4 @@ exports.hydrateRoot = function (container, initialChildren, options) { listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.0.0-rc-1df34bdf62-20240605"; +exports.version = "19.0.0-rc-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js index 57fa6f402ca9d..d70e6d3421157 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js @@ -35432,8 +35432,25 @@ function getResource(type, currentProps, pendingProps, currentResource) { _styles.set(_key, _resource); + var instance = ownerDocument.querySelector(getStylesheetSelectorFromKey(_key)); + + if (instance) { + var loadingState = instance._p; + + if (loadingState) ; else { + // This instance is already loaded + _resource.instance = instance; + _resource.state.loading = Loaded | Inserted; + } + } + if (!preloadPropsMap.has(_key)) { - preloadStylesheet(ownerDocument, _key, preloadPropsFromStylesheet(qualifiedProps), _resource.state); + var preloadProps = preloadPropsFromStylesheet(qualifiedProps); + preloadPropsMap.set(_key, preloadProps); + + if (!instance) { + preloadStylesheet(ownerDocument, _key, preloadProps, _resource.state); + } } } @@ -35580,31 +35597,24 @@ function stylesheetPropsFromRawProps(rawProps) { } function preloadStylesheet(ownerDocument, key, preloadProps, state) { - preloadPropsMap.set(key, preloadProps); - - if (!ownerDocument.querySelector(getStylesheetSelectorFromKey(key))) { - // There is no matching stylesheet instance in the Document. - // We will insert a preload now to kick off loading because - // we expect this stylesheet to commit - var preloadEl = ownerDocument.querySelector(getPreloadStylesheetSelectorFromKey(key)); - - if (preloadEl) { - // If we find a preload already it was SSR'd and we won't have an actual - // loading state to track. For now we will just assume it is loaded - state.loading = Loaded; - } else { - var instance = ownerDocument.createElement('link'); - state.preload = instance; - instance.addEventListener('load', function () { - return state.loading |= Loaded; - }); - instance.addEventListener('error', function () { - return state.loading |= Errored; - }); - setInitialProperties(instance, 'link', preloadProps); - markNodeAsHoistable(instance); - ownerDocument.head.appendChild(instance); - } + var preloadEl = ownerDocument.querySelector(getPreloadStylesheetSelectorFromKey(key)); + + if (preloadEl) { + // If we find a preload already it was SSR'd and we won't have an actual + // loading state to track. For now we will just assume it is loaded + state.loading = Loaded; + } else { + var instance = ownerDocument.createElement('link'); + state.preload = instance; + instance.addEventListener('load', function () { + return state.loading |= Loaded; + }); + instance.addEventListener('error', function () { + return state.loading |= Errored; + }); + setInitialProperties(instance, 'link', preloadProps); + markNodeAsHoistable(instance); + ownerDocument.head.appendChild(instance); } } @@ -36472,7 +36482,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-rc-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-rc-6230622a1a-20240610'; function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation. implementation) { diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js index fcab6f04d28eb..494d4a867b0ed 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js @@ -14104,20 +14104,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { case "style": return "string" === typeof pendingProps.precedence && "string" === typeof pendingProps.href - ? ((pendingProps = getStyleKey(pendingProps.href)), - (JSCompiler_inline_result = getResourcesFromRoot( + ? ((currentProps = getStyleKey(pendingProps.href)), + (pendingProps = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles), - (currentProps = JSCompiler_inline_result.get(pendingProps)), - currentProps || - ((currentProps = { + (currentResource = pendingProps.get(currentProps)), + currentResource || + ((currentResource = { type: "style", instance: null, count: 0, state: null }), - JSCompiler_inline_result.set(pendingProps, currentProps)), - currentProps) + pendingProps.set(currentProps, currentResource)), + currentResource) : { type: "void", instance: null, count: 0, state: null }; case "link": if ( @@ -14140,22 +14140,31 @@ function getResource(type, currentProps, pendingProps, currentResource) { state: { loading: 0, preload: null } }), styles$249.set(type, resource$250), + (styles$249 = JSCompiler_inline_result.querySelector( + getStylesheetSelectorFromKey(type) + )) && + !styles$249._p && + ((resource$250.instance = styles$249), + (resource$250.state.loading = 5)), preloadPropsMap.has(type) || - preloadStylesheet( - JSCompiler_inline_result, - type, - { - rel: "preload", - as: "style", - href: pendingProps.href, - crossOrigin: pendingProps.crossOrigin, - integrity: pendingProps.integrity, - media: pendingProps.media, - hrefLang: pendingProps.hrefLang, - referrerPolicy: pendingProps.referrerPolicy - }, - resource$250.state - )); + ((pendingProps = { + rel: "preload", + as: "style", + href: pendingProps.href, + crossOrigin: pendingProps.crossOrigin, + integrity: pendingProps.integrity, + media: pendingProps.media, + hrefLang: pendingProps.hrefLang, + referrerPolicy: pendingProps.referrerPolicy + }), + preloadPropsMap.set(type, pendingProps), + styles$249 || + preloadStylesheet( + JSCompiler_inline_result, + type, + pendingProps, + resource$250.state + ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); return resource$250; @@ -14171,20 +14180,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { currentProps && "function" !== typeof currentProps && "symbol" !== typeof currentProps - ? ((pendingProps = getScriptKey(pendingProps)), - (JSCompiler_inline_result = getResourcesFromRoot( + ? ((currentProps = getScriptKey(pendingProps)), + (pendingProps = getResourcesFromRoot( JSCompiler_inline_result ).hoistableScripts), - (currentProps = JSCompiler_inline_result.get(pendingProps)), - currentProps || - ((currentProps = { + (currentResource = pendingProps.get(currentProps)), + currentResource || + ((currentResource = { type: "script", instance: null, count: 0, state: null }), - JSCompiler_inline_result.set(pendingProps, currentProps)), - currentProps) + pendingProps.set(currentProps, currentResource)), + currentResource) : { type: "void", instance: null, count: 0, state: null } ); default: @@ -14204,21 +14213,19 @@ function stylesheetPropsFromRawProps(rawProps) { }); } function preloadStylesheet(ownerDocument, key, preloadProps, state) { - preloadPropsMap.set(key, preloadProps); - ownerDocument.querySelector(getStylesheetSelectorFromKey(key)) || - (ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]") - ? (state.loading = 1) - : ((key = ownerDocument.createElement("link")), - (state.preload = key), - key.addEventListener("load", function () { - return (state.loading |= 1); - }), - key.addEventListener("error", function () { - return (state.loading |= 2); - }), - setInitialProperties(key, "link", preloadProps), - markNodeAsHoistable(key), - ownerDocument.head.appendChild(key))); + ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]") + ? (state.loading = 1) + : ((key = ownerDocument.createElement("link")), + (state.preload = key), + key.addEventListener("load", function () { + return (state.loading |= 1); + }), + key.addEventListener("error", function () { + return (state.loading |= 2); + }), + setInitialProperties(key, "link", preloadProps), + markNodeAsHoistable(key), + ownerDocument.head.appendChild(key)); } function getScriptKey(src) { return '[src="' + escapeSelectorAttributeValueInsideDoubleQuotes(src) + '"]'; @@ -15336,14 +15343,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1739 = React.version; if ( - "19.0.0-rc-1df34bdf62-20240605" !== + "19.0.0-rc-6230622a1a-20240610" !== isomorphicReactPackageVersion$jscomp$inline_1739 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1739, - "19.0.0-rc-1df34bdf62-20240605" + "19.0.0-rc-6230622a1a-20240610" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15362,7 +15369,7 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { var devToolsConfig$jscomp$inline_1746 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-rc-1df34bdf62-20240605", + version: "19.0.0-rc-6230622a1a-20240610", rendererPackageName: "react-dom" }; (function (internals) { @@ -15405,7 +15412,7 @@ var devToolsConfig$jscomp$inline_1746 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-rc-1df34bdf62-20240605" + reconcilerVersion: "19.0.0-rc-6230622a1a-20240610" }); function noop() {} function getCrossOriginStringAs(as, input) { @@ -15659,7 +15666,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-rc-1df34bdf62-20240605"; +exports.version = "19.0.0-rc-6230622a1a-20240610"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js index 0a5c814c7c5a5..fae26ddcab7bc 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") { var React = require("next/dist/compiled/react"); var ReactDOM = require('react-dom'); -var ReactVersion = '19.0.0-rc-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-rc-6230622a1a-20240610'; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; @@ -1941,7 +1941,7 @@ function sanitizeURL(url) { // Run `yarn generate-inline-fizz-runtime` to generate. var clientRenderBoundary = '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'; var completeBoundary = '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};'; -var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};'; +var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};'; var completeSegment = '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};'; var formReplaying = 'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});'; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js index 7324f2d312c3d..3a49cf59b7cd5 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js @@ -5098,12 +5098,12 @@ function flushCompletedBoundary(request, destination, boundary) { ? 0 === (completedSegments.instructions & 2) ? ((completedSegments.instructions |= 10), destination.push( - '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' )) : 0 === (completedSegments.instructions & 8) ? ((completedSegments.instructions |= 8), destination.push( - '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' )) : destination.push('$RR("') : 0 === (completedSegments.instructions & 2) @@ -5469,4 +5469,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-rc-1df34bdf62-20240605"; +exports.version = "19.0.0-rc-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js index 95be43805dcde..946c5e4474556 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") { var React = require("next/dist/compiled/react"); var ReactDOM = require('react-dom'); -var ReactVersion = '19.0.0-rc-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-rc-6230622a1a-20240610'; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; @@ -1941,7 +1941,7 @@ function sanitizeURL(url) { // Run `yarn generate-inline-fizz-runtime` to generate. var clientRenderBoundary = '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'; var completeBoundary = '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};'; -var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};'; +var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};'; var completeSegment = '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};'; var formReplaying = 'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});'; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js index f01739c24a855..3211d1bf49077 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js @@ -5173,12 +5173,12 @@ function flushCompletedBoundary(request, destination, boundary) { ? 0 === (completedSegments.instructions & 2) ? ((completedSegments.instructions |= 10), destination.push( - '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' )) : 0 === (completedSegments.instructions & 8) ? ((completedSegments.instructions |= 8), destination.push( - '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' )) : destination.push('$RR("') : 0 === (completedSegments.instructions & 2) @@ -5551,4 +5551,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-rc-1df34bdf62-20240605"; +exports.version = "19.0.0-rc-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js index 9a3cd2ea388f6..dd5f57932f795 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") { var React = require("next/dist/compiled/react"); var ReactDOM = require('react-dom'); -var reactDOMPackageVersion = '19.0.0-rc-1df34bdf62-20240605'; +var reactDOMPackageVersion = '19.0.0-rc-6230622a1a-20240610'; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; @@ -2016,7 +2016,7 @@ function sanitizeURL(url) { // Run `yarn generate-inline-fizz-runtime` to generate. var clientRenderBoundary = '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'; var completeBoundary = '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};'; -var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};'; +var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};'; var completeSegment = '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};'; var formReplaying = 'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});'; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js index 3b5c5d02fab70..9e3e2f70509d0 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js @@ -2300,10 +2300,10 @@ var completeBoundaryScript1Full = stringToPrecomputedChunk( ), completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC("'), completeBoundaryWithStylesScript1FullBoth = stringToPrecomputedChunk( - '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' ), completeBoundaryWithStylesScript1FullPartial = stringToPrecomputedChunk( - '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' ), completeBoundaryWithStylesScript1Partial = stringToPrecomputedChunk('$RR("'), completeBoundaryScript2 = stringToPrecomputedChunk('","'), @@ -5717,14 +5717,14 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_728 = React.version; if ( - "19.0.0-rc-1df34bdf62-20240605" !== + "19.0.0-rc-6230622a1a-20240610" !== isomorphicReactPackageVersion$jscomp$inline_728 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_728, - "19.0.0-rc-1df34bdf62-20240605" + "19.0.0-rc-6230622a1a-20240610" ) ); exports.renderToReadableStream = function (children, options) { @@ -5816,4 +5816,4 @@ exports.renderToReadableStream = function (children, options) { safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks); }); }; -exports.version = "19.0.0-rc-1df34bdf62-20240605"; +exports.version = "19.0.0-rc-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js index ef38d94e159f7..132f8e49ea8a3 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js @@ -5125,13 +5125,13 @@ function flushCompletedBoundary(request, destination, boundary) { ? ((completedSegments.instructions |= 10), writeChunk( destination, - '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' )) : 0 === (completedSegments.instructions & 8) ? ((completedSegments.instructions |= 8), writeChunk( destination, - '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' )) : writeChunk(destination, '$RR("') : 0 === (completedSegments.instructions & 2) @@ -5430,13 +5430,13 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_724 = React.version; if ( - "19.0.0-rc-1df34bdf62-20240605" !== + "19.0.0-rc-6230622a1a-20240610" !== isomorphicReactPackageVersion$jscomp$inline_724 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_724 + - "\n - react-dom: 19.0.0-rc-1df34bdf62-20240605\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-6230622a1a-20240610\nLearn more: https://react.dev/warnings/version-mismatch") ); exports.renderToReadableStream = function (children, options) { return new Promise(function (resolve, reject) { @@ -5527,4 +5527,4 @@ exports.renderToReadableStream = function (children, options) { safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks); }); }; -exports.version = "19.0.0-rc-1df34bdf62-20240605"; +exports.version = "19.0.0-rc-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js index c6541ef83ea08..04c3f42c748d2 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") { var React = require("next/dist/compiled/react"); var ReactDOM = require('react-dom'); -var reactDOMPackageVersion = '19.0.0-rc-1df34bdf62-20240605'; +var reactDOMPackageVersion = '19.0.0-rc-6230622a1a-20240610'; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; @@ -2016,7 +2016,7 @@ function sanitizeURL(url) { // Run `yarn generate-inline-fizz-runtime` to generate. var clientRenderBoundary = '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'; var completeBoundary = '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};'; -var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};'; +var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};'; var completeSegment = '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};'; var formReplaying = 'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});'; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js index 76c0c5bd61300..b565ba3c56f43 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js @@ -2317,10 +2317,10 @@ var completeBoundaryScript1Full = stringToPrecomputedChunk( ), completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC("'), completeBoundaryWithStylesScript1FullBoth = stringToPrecomputedChunk( - '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' ), completeBoundaryWithStylesScript1FullPartial = stringToPrecomputedChunk( - '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' ), completeBoundaryWithStylesScript1Partial = stringToPrecomputedChunk('$RR("'), completeBoundaryScript2 = stringToPrecomputedChunk('","'), @@ -5832,13 +5832,13 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_728 = React.version; if ( - "19.0.0-rc-1df34bdf62-20240605" !== + "19.0.0-rc-6230622a1a-20240610" !== isomorphicReactPackageVersion$jscomp$inline_728 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_728 + - "\n - react-dom: 19.0.0-rc-1df34bdf62-20240605\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-6230622a1a-20240610\nLearn more: https://react.dev/warnings/version-mismatch") ); exports.renderToReadableStream = function (children, options) { return new Promise(function (resolve, reject) { @@ -5926,4 +5926,4 @@ exports.renderToReadableStream = function (children, options) { startWork(request); }); }; -exports.version = "19.0.0-rc-1df34bdf62-20240605"; +exports.version = "19.0.0-rc-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js index 2dce5823bab10..e81ff0454735b 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js @@ -20,7 +20,7 @@ var crypto = require('crypto'); var async_hooks = require('async_hooks'); var ReactDOM = require('react-dom'); -var reactDOMPackageVersion = '19.0.0-rc-1df34bdf62-20240605'; +var reactDOMPackageVersion = '19.0.0-rc-6230622a1a-20240610'; var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; @@ -1996,7 +1996,7 @@ function sanitizeURL(url) { // Run `yarn generate-inline-fizz-runtime` to generate. var clientRenderBoundary = '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'; var completeBoundary = '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};'; -var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};'; +var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};'; var completeSegment = '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};'; var formReplaying = 'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});'; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js index 7fc02ad079096..88b32e2e4cc19 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js @@ -2024,10 +2024,10 @@ var completeBoundaryScript1Full = stringToPrecomputedChunk( ), completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC("'), completeBoundaryWithStylesScript1FullBoth = stringToPrecomputedChunk( - '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' ), completeBoundaryWithStylesScript1FullPartial = stringToPrecomputedChunk( - '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};$RR("' + '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("' ), completeBoundaryWithStylesScript1Partial = stringToPrecomputedChunk('$RR("'), completeBoundaryScript2 = stringToPrecomputedChunk('","'), @@ -5456,13 +5456,13 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_751 = React.version; if ( - "19.0.0-rc-1df34bdf62-20240605" !== + "19.0.0-rc-6230622a1a-20240610" !== isomorphicReactPackageVersion$jscomp$inline_751 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_751 + - "\n - react-dom: 19.0.0-rc-1df34bdf62-20240605\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-6230622a1a-20240610\nLearn more: https://react.dev/warnings/version-mismatch") ); function createDrainHandler(destination, request) { return function () { @@ -5789,4 +5789,4 @@ exports.renderToPipeableStream = function (children, options) { } }; }; -exports.version = "19.0.0-rc-1df34bdf62-20240605"; +exports.version = "19.0.0-rc-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom.development.js index 50b7518ba7c2b..8db01a385167a 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.development.js @@ -142,7 +142,7 @@ var Internals = { findDOMNode: null }; -var ReactVersion = '19.0.0-rc-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-rc-6230622a1a-20240610'; /** * HTML nodeType values that represent the type of the node diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom.production.js index 5bbb4129c89ae..09e9499d29d65 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.production.js @@ -206,4 +206,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-rc-1df34bdf62-20240605"; +exports.version = "19.0.0-rc-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js index dfa6df9e6d0b6..ebba208d3dbab 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js @@ -16,7 +16,7 @@ if (process.env.NODE_ENV !== "production") { var React = require("next/dist/compiled/react"); -var ReactVersion = '19.0.0-rc-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-rc-6230622a1a-20240610'; var ReactSharedInternalsServer = // $FlowFixMe: It's defined in the one we resolve to. React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js index 8921335acc127..2550b1a382478 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js @@ -151,4 +151,4 @@ exports.preloadModule = function (href, options) { }); } else Internals.d.m(href); }; -exports.version = "19.0.0-rc-1df34bdf62-20240605"; +exports.version = "19.0.0-rc-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-dom/package.json b/packages/next/src/compiled/react-dom/package.json index 085fbfe4f5de1..7cae0f6a1a0ac 100644 --- a/packages/next/src/compiled/react-dom/package.json +++ b/packages/next/src/compiled/react-dom/package.json @@ -67,10 +67,10 @@ "./package.json": "./package.json" }, "dependencies": { - "scheduler": "0.25.0-rc-1df34bdf62-20240605" + "scheduler": "0.25.0-rc-6230622a1a-20240610" }, "peerDependencies": { - "react": "19.0.0-rc-1df34bdf62-20240605" + "react": "19.0.0-rc-6230622a1a-20240610" }, "browser": { "./server.js": "./server.browser.js", diff --git a/packages/next/src/compiled/react-experimental/cjs/react.development.js b/packages/next/src/compiled/react-experimental/cjs/react.development.js index d1bcf740ce7e3..2d96aa48ef62b 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.development.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.development.js @@ -129,7 +129,7 @@ function printWarning(level, format, args, currentStack) { } } -var ReactVersion = '19.0.0-experimental-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-experimental-6230622a1a-20240610'; var REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element') ; var REACT_PORTAL_TYPE = Symbol.for('react.portal'); diff --git a/packages/next/src/compiled/react-experimental/cjs/react.production.js b/packages/next/src/compiled/react-experimental/cjs/react.production.js index be77c72100288..b052713a3bcb3 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.production.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.production.js @@ -559,4 +559,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-experimental-1df34bdf62-20240605"; +exports.version = "19.0.0-experimental-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js b/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js index 806199e5d1c6c..77efc5682d9e2 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js @@ -1683,7 +1683,7 @@ function postpone(reason) { throw postponeInstance; } -var ReactVersion = '19.0.0-experimental-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-experimental-6230622a1a-20240610'; var getPrototypeOf = Object.getPrototypeOf; diff --git a/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js b/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js index bfc3d825831e5..39f2350364782 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js @@ -564,4 +564,4 @@ exports.useId = function () { exports.useMemo = function (create, deps) { return ReactSharedInternals.H.useMemo(create, deps); }; -exports.version = "19.0.0-experimental-1df34bdf62-20240605"; +exports.version = "19.0.0-experimental-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react-is/package.json b/packages/next/src/compiled/react-is/package.json index c01cf973535c5..4425e958fd1d0 100644 --- a/packages/next/src/compiled/react-is/package.json +++ b/packages/next/src/compiled/react-is/package.json @@ -1,6 +1,6 @@ { "name": "react-is", - "version": "19.0.0-rc-1df34bdf62-20240605", + "version": "19.0.0-rc-6230622a1a-20240610", "description": "Brand checking of React Elements.", "main": "index.js", "sideEffects": false, diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json b/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json index 068bf0c3b18a3..753a9380a4924 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json @@ -47,7 +47,7 @@ "neo-async": "^2.6.1" }, "peerDependencies": { - "react": "0.0.0-experimental-1df34bdf62-20240605", - "react-dom": "0.0.0-experimental-1df34bdf62-20240605" + "react": "0.0.0-experimental-6230622a1a-20240610", + "react-dom": "0.0.0-experimental-6230622a1a-20240610" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react-server-dom-turbopack/package.json b/packages/next/src/compiled/react-server-dom-turbopack/package.json index 813a65ae6a557..a3195b088c38f 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/package.json +++ b/packages/next/src/compiled/react-server-dom-turbopack/package.json @@ -47,7 +47,7 @@ "neo-async": "^2.6.1" }, "peerDependencies": { - "react": "19.0.0-rc-1df34bdf62-20240605", - "react-dom": "19.0.0-rc-1df34bdf62-20240605" + "react": "19.0.0-rc-6230622a1a-20240610", + "react-dom": "19.0.0-rc-6230622a1a-20240610" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json b/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json index 4ee3b210276b5..2a519e5cd49ee 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json @@ -46,8 +46,8 @@ "neo-async": "^2.6.1" }, "peerDependencies": { - "react": "0.0.0-experimental-1df34bdf62-20240605", - "react-dom": "0.0.0-experimental-1df34bdf62-20240605", + "react": "0.0.0-experimental-6230622a1a-20240610", + "react-dom": "0.0.0-experimental-6230622a1a-20240610", "webpack": "^5.59.0" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react-server-dom-webpack/package.json b/packages/next/src/compiled/react-server-dom-webpack/package.json index c1114708c0a88..71bd27598a5b4 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/package.json +++ b/packages/next/src/compiled/react-server-dom-webpack/package.json @@ -46,8 +46,8 @@ "neo-async": "^2.6.1" }, "peerDependencies": { - "react": "19.0.0-rc-1df34bdf62-20240605", - "react-dom": "19.0.0-rc-1df34bdf62-20240605", + "react": "19.0.0-rc-6230622a1a-20240610", + "react-dom": "19.0.0-rc-6230622a1a-20240610", "webpack": "^5.59.0" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react/cjs/react.development.js b/packages/next/src/compiled/react/cjs/react.development.js index 040cea6a7bffd..2b5e6c323f65f 100644 --- a/packages/next/src/compiled/react/cjs/react.development.js +++ b/packages/next/src/compiled/react/cjs/react.development.js @@ -20,7 +20,7 @@ if ( ) { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); } -var ReactVersion = '19.0.0-rc-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-rc-6230622a1a-20240610'; // ----------------------------------------------------------------------------- diff --git a/packages/next/src/compiled/react/cjs/react.production.js b/packages/next/src/compiled/react/cjs/react.production.js index d316eb009852b..94a3f59a62593 100644 --- a/packages/next/src/compiled/react/cjs/react.production.js +++ b/packages/next/src/compiled/react/cjs/react.production.js @@ -536,4 +536,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-rc-1df34bdf62-20240605"; +exports.version = "19.0.0-rc-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/react/cjs/react.react-server.development.js b/packages/next/src/compiled/react/cjs/react.react-server.development.js index 98dba1d42cb0c..17c2f381a7cfa 100644 --- a/packages/next/src/compiled/react/cjs/react.react-server.development.js +++ b/packages/next/src/compiled/react/cjs/react.react-server.development.js @@ -2068,7 +2068,7 @@ function cache(fn) { }; } -var ReactVersion = '19.0.0-rc-1df34bdf62-20240605'; +var ReactVersion = '19.0.0-rc-6230622a1a-20240610'; var Children = { map: mapChildren, diff --git a/packages/next/src/compiled/react/cjs/react.react-server.production.js b/packages/next/src/compiled/react/cjs/react.react-server.production.js index 6ce229eced05b..1e80bd7250e14 100644 --- a/packages/next/src/compiled/react/cjs/react.react-server.production.js +++ b/packages/next/src/compiled/react/cjs/react.react-server.production.js @@ -424,4 +424,4 @@ exports.useId = function () { exports.useMemo = function (create, deps) { return ReactSharedInternals.H.useMemo(create, deps); }; -exports.version = "19.0.0-rc-1df34bdf62-20240605"; +exports.version = "19.0.0-rc-6230622a1a-20240610"; diff --git a/packages/next/src/compiled/unistore/unistore.js b/packages/next/src/compiled/unistore/unistore.js index 1ae669a40e336..91850c3f0d708 100644 --- a/packages/next/src/compiled/unistore/unistore.js +++ b/packages/next/src/compiled/unistore/unistore.js @@ -1 +1 @@ -(()=>{var t={59:t=>{function n(t,i){for(var _ in i)t[_]=i[_];return t}t.exports=function(t){var i=[];function u(t){for(var _=[],a=0;a{var t={448:t=>{function n(t,i){for(var _ in i)t[_]=i[_];return t}t.exports=function(t){var i=[];function u(t){for(var _=[],a=0;a /open-graph/route - * /app/(post)/open-graph.tsx -> /open-graph/route-[0-9a-z]{6} + * /app/opengraph-image.tsx -> /opengraph-image + * /app/(post)/opengraph-image.tsx -> /opengraph-image-[0-9a-z]{6} */ function getMetadataRouteSuffix(page: string) { let suffix = '' @@ -65,10 +65,10 @@ export function normalizeMetadataRoute(page: string) { route += '.txt' } else if (page === '/manifest') { route += '.webmanifest' - } - // For sitemap, we don't automatically add the route suffix since it can have sub-routes - else if (!page.endsWith('/sitemap')) { - // Remove the file extension, e.g. /route-path/robots.txt -> /route-path + } else { + // Remove the file extension, + // e.g. /path/robots.txt -> /route-path + // e.g. /path/opengraph-image.tsx -> /path/opengraph-image const pathnamePrefix = page.slice(0, -(path.basename(page).length + 1)) suffix = getMetadataRouteSuffix(pathnamePrefix) } @@ -76,15 +76,30 @@ export function normalizeMetadataRoute(page: string) { // If it's a metadata file route, we need to append /[id]/route to the page. if (!route.endsWith('/route')) { const { dir, name: baseName, ext } = path.parse(route) - const isStaticRoute = isStaticMetadataRoute(page) - route = path.posix.join( dir, `${baseName}${suffix ? `-${suffix}` : ''}${ext}`, - isStaticRoute ? '' : '[[...__metadata_id__]]', 'route' ) } return route } + +// Normalize metadata route page to either a single route or a dynamic route. +// e.g. Input: /sitemap/route +// when isDynamic is false, single route -> /sitemap.xml/route +// when isDynamic is false, dynamic route -> /sitemap/[__metadata_id__]/route +// also works for pathname such as /sitemap -> /sitemap.xml, but will not append /route suffix +export function normalizeMetadataPageToRoute(page: string, isDynamic: boolean) { + const isRoute = page.endsWith('/route') + const routePagePath = isRoute ? page.slice(0, -'/route'.length) : page + const metadataRouteExtension = routePagePath.endsWith('/sitemap') + ? '.xml' + : '' + const mapped = isDynamic + ? `${routePagePath}/[__metadata_id__]` + : `${routePagePath}${metadataRouteExtension}` + + return mapped + (isRoute ? '/route' : '') +} diff --git a/packages/next/src/lib/metadata/is-metadata-route.test.ts b/packages/next/src/lib/metadata/is-metadata-route.test.ts new file mode 100644 index 0000000000000..99c520fd94b7a --- /dev/null +++ b/packages/next/src/lib/metadata/is-metadata-route.test.ts @@ -0,0 +1,45 @@ +import { getExtensionRegexString } from './is-metadata-route' + +describe('getExtensionRegexString', () => { + function createExtensionMatchRegex( + ...args: Parameters + ) { + return new RegExp(`^${getExtensionRegexString(...args)}$`) + } + + describe('with dynamic extensions', () => { + it('should return the correct regex', () => { + const regex = createExtensionMatchRegex(['png', 'jpg'], ['tsx', 'ts']) + expect(regex.test('.png')).toBe(true) + expect(regex.test('.jpg')).toBe(true) + expect(regex.test('.webp')).toBe(false) + + expect(regex.test('.tsx')).toBe(true) + expect(regex.test('.ts')).toBe(true) + expect(regex.test('.js')).toBe(false) + }) + + it('should match dynamic multi-routes with dynamic extensions', () => { + const regex = createExtensionMatchRegex(['png'], ['ts']) + expect(regex.test('.png')).toBe(true) + expect(regex.test('[].png')).toBe(false) + + expect(regex.test('.ts')).toBe(true) + expect(regex.test('[].ts')).toBe(true) + expect(regex.test('.tsx')).toBe(false) + expect(regex.test('[].tsx')).toBe(false) + }) + }) + + describe('without dynamic extensions', () => { + it('should return the correct regex', () => { + const regex = createExtensionMatchRegex(['png', 'jpg'], null) + expect(regex.test('.png')).toBe(true) + expect(regex.test('.jpg')).toBe(true) + expect(regex.test('.webp')).toBe(false) + + expect(regex.test('.tsx')).toBe(false) + expect(regex.test('.js')).toBe(false) + }) + }) +}) diff --git a/packages/next/src/lib/metadata/is-metadata-route.ts b/packages/next/src/lib/metadata/is-metadata-route.ts index 0cc542d6cc12f..ac1e68e456e6c 100644 --- a/packages/next/src/lib/metadata/is-metadata-route.ts +++ b/packages/next/src/lib/metadata/is-metadata-route.ts @@ -28,8 +28,19 @@ export const STATIC_METADATA_IMAGES = { // TODO-METADATA: support more metadata routes with more extensions const defaultExtensions = ['js', 'jsx', 'ts', 'tsx'] -const getExtensionRegexString = (extensions: readonly string[]) => - `(?:${extensions.join('|')})` +// Match the file extension with the dynamic multi-routes extensions +// e.g. ([xml, js], null) -> can match `/sitemap.xml/route`, `sitemap.js/route` +// e.g. ([png], [ts]) -> can match `/opengrapg-image.png/route`, `/opengraph-image.ts[]/route` +export const getExtensionRegexString = ( + staticExtensions: readonly string[], + dynamicExtensions: readonly string[] | null +) => { + // If there's no possible multi dynamic routes, will not match any []. files + if (!dynamicExtensions) { + return `\\.(?:${staticExtensions.join('|')})` + } + return `(?:\\.(${staticExtensions.join('|')})|((\\[\\])?\\.(${dynamicExtensions.join('|')})))` +} // When you only pass the file extension as `[]`, it will only match the static convention files // e.g. /robots.txt, /sitemap.xml, /favicon.ico, /manifest.json @@ -46,15 +57,16 @@ export function isMetadataRouteFile( new RegExp( `^[\\\\/]robots${ withExtension - ? `\\.${getExtensionRegexString(pageExtensions.concat('txt'))}$` + ? `${getExtensionRegexString(pageExtensions.concat('txt'), null)}$` : '' }` ), new RegExp( `^[\\\\/]manifest${ withExtension - ? `\\.${getExtensionRegexString( - pageExtensions.concat('webmanifest', 'json') + ? `${getExtensionRegexString( + pageExtensions.concat('webmanifest', 'json'), + null )}$` : '' }` @@ -63,15 +75,16 @@ export function isMetadataRouteFile( new RegExp( `[\\\\/]sitemap${ withExtension - ? `\\.${getExtensionRegexString(pageExtensions.concat('xml'))}$` + ? `${getExtensionRegexString(['xml'], pageExtensions)}$` : '' }` ), new RegExp( `[\\\\/]${STATIC_METADATA_IMAGES.icon.filename}\\d?${ withExtension - ? `\\.${getExtensionRegexString( - pageExtensions.concat(STATIC_METADATA_IMAGES.icon.extensions) + ? `${getExtensionRegexString( + STATIC_METADATA_IMAGES.icon.extensions, + pageExtensions )}$` : '' }` @@ -79,8 +92,9 @@ export function isMetadataRouteFile( new RegExp( `[\\\\/]${STATIC_METADATA_IMAGES.apple.filename}\\d?${ withExtension - ? `\\.${getExtensionRegexString( - pageExtensions.concat(STATIC_METADATA_IMAGES.apple.extensions) + ? `${getExtensionRegexString( + STATIC_METADATA_IMAGES.apple.extensions, + pageExtensions )}$` : '' }` @@ -88,8 +102,9 @@ export function isMetadataRouteFile( new RegExp( `[\\\\/]${STATIC_METADATA_IMAGES.openGraph.filename}\\d?${ withExtension - ? `\\.${getExtensionRegexString( - pageExtensions.concat(STATIC_METADATA_IMAGES.openGraph.extensions) + ? `${getExtensionRegexString( + STATIC_METADATA_IMAGES.openGraph.extensions, + pageExtensions )}$` : '' }` @@ -97,8 +112,9 @@ export function isMetadataRouteFile( new RegExp( `[\\\\/]${STATIC_METADATA_IMAGES.twitter.filename}\\d?${ withExtension - ? `\\.${getExtensionRegexString( - pageExtensions.concat(STATIC_METADATA_IMAGES.twitter.extensions) + ? `${getExtensionRegexString( + STATIC_METADATA_IMAGES.twitter.extensions, + pageExtensions )}$` : '' }` @@ -115,6 +131,7 @@ export function isStaticMetadataRouteFile(appDirRelativePath: string) { return isMetadataRouteFile(appDirRelativePath, [], true) } +// @deprecated export function isStaticMetadataRoute(page: string) { return ( page === '/robots' || diff --git a/packages/next/src/lib/metadata/resolvers/resolve-url.test.ts b/packages/next/src/lib/metadata/resolvers/resolve-url.test.ts index b9e1caf796aa5..d70c7bc5dc81a 100644 --- a/packages/next/src/lib/metadata/resolvers/resolve-url.test.ts +++ b/packages/next/src/lib/metadata/resolvers/resolve-url.test.ts @@ -110,6 +110,17 @@ describe('resolveAbsoluteUrlWithPathname', () => { 'https://example.com/foo?bar' ) }) + + it('should not add trailing slash to relative url that matches file pattern', () => { + expect(resolver('/foo.html')).toBe('https://example.com/foo.html') + expect(resolver('/foo.html?q=v')).toBe('https://example.com/foo.html?q=v') + expect(resolver(new URL('/.well-known/bar.jpg', metadataBase))).toBe( + 'https://example.com/.well-known/bar.jpg/' + ) + expect(resolver(new URL('/foo.html', metadataBase))).toBe( + 'https://example.com/foo.html' + ) + }) }) }) diff --git a/packages/next/src/lib/metadata/resolvers/resolve-url.ts b/packages/next/src/lib/metadata/resolvers/resolve-url.ts index 89edce00fa6db..6b4a25bebf3e9 100644 --- a/packages/next/src/lib/metadata/resolvers/resolve-url.ts +++ b/packages/next/src/lib/metadata/resolvers/resolve-url.ts @@ -86,6 +86,13 @@ function resolveRelativeUrl(url: string | URL, pathname: string): string | URL { return url } +// The regex is matching logic from packages/next/src/lib/load-custom-routes.ts +const FILE_REGEX = + /^(?:\/((?!\.well-known(?:\/.*)?)(?:[^/]+\/)*[^/]+\.\w+))(\/?|$)/i +function isFilePattern(pathname: string): boolean { + return FILE_REGEX.test(pathname) +} + // Resolve `pathname` if `url` is a relative path the compose with `metadataBase`. function resolveAbsoluteUrlWithPathname( url: string | URL, @@ -110,18 +117,27 @@ function resolveAbsoluteUrlWithPathname( // - Doesn't have query if (trailingSlash && !resolvedUrl.endsWith('/')) { let isRelative = resolvedUrl.startsWith('/') - let isExternal = false let hasQuery = resolvedUrl.includes('?') + let isExternal = false + let isFileUrl = false + if (!isRelative) { try { const parsedUrl = new URL(resolvedUrl) isExternal = metadataBase != null && parsedUrl.origin !== metadataBase.origin + isFileUrl = isFilePattern(parsedUrl.pathname) } catch { // If it's not a valid URL, treat it as external isExternal = true } - if (!isExternal && !hasQuery) return `${resolvedUrl}/` + if ( + // Do not apply trailing slash for file like urls, aligning with the behavior with `trailingSlash` + !isFileUrl && + !isExternal && + !hasQuery + ) + return `${resolvedUrl}/` } } diff --git a/packages/next/src/server/app-render/app-render.tsx b/packages/next/src/server/app-render/app-render.tsx index 1e56d4e2497c4..f8b94d47fb9c4 100644 --- a/packages/next/src/server/app-render/app-render.tsx +++ b/packages/next/src/server/app-render/app-render.tsx @@ -1433,7 +1433,7 @@ async function renderToHTMLOrFlightImpl( if ( staticGenerationStore.prerenderState && usedDynamicAPIs(staticGenerationStore.prerenderState) && - staticGenerationStore.prerenderState?.isDebugSkeleton + staticGenerationStore.prerenderState?.isDebugDynamicAccesses ) { warn('The following dynamic usage was detected:') for (const access of formatDynamicAPIAccesses( diff --git a/packages/next/src/server/app-render/dynamic-rendering.ts b/packages/next/src/server/app-render/dynamic-rendering.ts index f661334ab0890..24b0fb2473edc 100644 --- a/packages/next/src/server/app-render/dynamic-rendering.ts +++ b/packages/next/src/server/app-render/dynamic-rendering.ts @@ -49,7 +49,7 @@ export type PrerenderState = { /** * When true, stack information will also be tracked during dynamic access. */ - readonly isDebugSkeleton: boolean | undefined + readonly isDebugDynamicAccesses: boolean | undefined /** * The dynamic accesses that occurred during the render. @@ -58,10 +58,10 @@ export type PrerenderState = { } export function createPrerenderState( - isDebugSkeleton: boolean | undefined + isDebugDynamicAccesses: boolean | undefined ): PrerenderState { return { - isDebugSkeleton, + isDebugDynamicAccesses, dynamicAccesses: [], } } @@ -194,7 +194,9 @@ function postponeWithTracking( prerenderState.dynamicAccesses.push({ // When we aren't debugging, we don't need to create another error for the // stack trace. - stack: prerenderState.isDebugSkeleton ? new Error().stack : undefined, + stack: prerenderState.isDebugDynamicAccesses + ? new Error().stack + : undefined, expression, }) diff --git a/packages/next/src/server/app-render/types.ts b/packages/next/src/server/app-render/types.ts index 4f073cb4fa415..47ea6ff38ccf7 100644 --- a/packages/next/src/server/app-render/types.ts +++ b/packages/next/src/server/app-render/types.ts @@ -172,10 +172,17 @@ export interface RenderOptsPartial { } postponed?: string /** - * When true, only the skeleton of the PPR page will be rendered. This will - * also enable other debugging features such as logging. + * When true, only the static shell of the page will be rendered. This will + * also enable other debugging features such as logging in development. */ - isDebugPPRSkeleton?: boolean + isDebugStaticShell?: boolean + + /** + * When true, the page will be rendered using the static rendering to detect + * any dynamic API's that would have stopped the page from being fully + * statically generated. + */ + isDebugDynamicAccesses?: boolean isStaticGeneration?: boolean } diff --git a/packages/next/src/server/async-storage/static-generation-async-storage-wrapper.ts b/packages/next/src/server/async-storage/static-generation-async-storage-wrapper.ts index e7b71e377d54c..956cf140437f2 100644 --- a/packages/next/src/server/async-storage/static-generation-async-storage-wrapper.ts +++ b/packages/next/src/server/async-storage/static-generation-async-storage-wrapper.ts @@ -45,7 +45,7 @@ export type StaticGenerationContext = { | 'isRevalidate' | 'nextExport' | 'isDraftMode' - | 'isDebugPPRSkeleton' + | 'isDebugDynamicAccesses' > & Partial } @@ -83,7 +83,7 @@ export const StaticGenerationAsyncStorageWrapper: AsyncStorageWrapper< const prerenderState: StaticGenerationStore['prerenderState'] = isStaticGeneration && renderOpts.experimental?.isRoutePPREnabled - ? createPrerenderState(renderOpts.isDebugPPRSkeleton) + ? createPrerenderState(renderOpts.isDebugDynamicAccesses) : null const store: StaticGenerationStore = { diff --git a/packages/next/src/server/base-server.ts b/packages/next/src/server/base-server.ts index 7dbd10d9fece5..d5ca7ebf50195 100644 --- a/packages/next/src/server/base-server.ts +++ b/packages/next/src/server/base-server.ts @@ -2016,29 +2016,38 @@ export default abstract class Server< typeof routeModule !== 'undefined' && isAppPageRouteModule(routeModule) - // If this is a request that's rendering an app page that support's PPR, - // then if we're in development mode (or using the experimental test - // proxy) and the query parameter is set, then we should render the - // skeleton. We assume that if the page _could_ support it, we should - // show the skeleton in development. Ideally we would check the appConfig - // to see if this page has it enabled or not, but that would require - // plumbing the appConfig through to the server during development. - const isDebugPPRSkeleton = - query.__nextppronly && - couldSupportPPR && - (this.renderOpts.dev || this.experimentalTestProxy) - ? true - : false + // When enabled, this will allow the use of the `?__nextppronly` query to + // enable debugging of the static shell. + const hasDebugStaticShellQuery = + process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && + typeof query.__nextppronly !== 'undefined' && + couldSupportPPR // This page supports PPR if it has `experimentalPPR` set to `true` in the // prerender manifest and this is an app page. const isRoutePPREnabled: boolean = couldSupportPPR && + // In production, we'd expect to see the `experimentalPPR` flag set in the + // prerender manifest. (( prerenderManifest.routes[pathname] ?? prerenderManifest.dynamicRoutes[pathname] )?.experimentalPPR === true || - isDebugPPRSkeleton) + // Ideally we'd want to check the appConfig to see if this page has PPR + // enabled or not, but that would require plumbing the appConfig through + // to the server during development. We assume that the page supports it + // but only during development. + (hasDebugStaticShellQuery && + (this.renderOpts.dev === true || + this.experimentalTestProxy === true))) + + const isDebugStaticShell: boolean = + hasDebugStaticShellQuery && isRoutePPREnabled + + // We should enable debugging dynamic accesses when the static shell + // debugging has been enabled and we're also in development mode. + const isDebugDynamicAccesses = + isDebugStaticShell && this.renderOpts.dev === true // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed @@ -2276,13 +2285,16 @@ export default abstract class Server< // TODO: investigate, this is not safe across multiple concurrent requests incrementalCache?.resetRequestCache() - type Renderer = (context: { + type RendererContext = { /** * The postponed data for this render. This is only provided when resuming * a render that has been postponed. */ postponed: string | undefined - }) => Promise + } + type Renderer = ( + context: RendererContext + ) => Promise const doRender: Renderer = async ({ postponed }) => { // In development, we always want to generate dynamic HTML. @@ -2362,13 +2374,14 @@ export default abstract class Server< onClose: res.onClose.bind(res), } - if (isDebugPPRSkeleton) { + if (isDebugStaticShell || isDebugDynamicAccesses) { supportsDynamicResponse = false renderOpts.nextExport = true renderOpts.supportsDynamicResponse = false renderOpts.isStaticGeneration = true renderOpts.isRevalidate = true - renderOpts.isDebugPPRSkeleton = true + renderOpts.isDebugStaticShell = isDebugStaticShell + renderOpts.isDebugDynamicAccesses = isDebugDynamicAccesses } // Legacy render methods will return a render result that needs to be @@ -2758,18 +2771,37 @@ export default abstract class Server< } } - const result = await doRender({ + const context: RendererContext = { // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. postponed: !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined, - }) - if (!result) { - return null } + // When we're in minimal mode, if we're trying to debug the static shell, + // we should just return nothing instead of resuming the dynamic render. + if ( + (isDebugStaticShell || isDebugDynamicAccesses) && + typeof context.postponed !== 'undefined' + ) { + return { + revalidate: 1, + value: { + kind: 'PAGE', + html: RenderResult.fromStatic(''), + pageData: {}, + headers: undefined, + status: undefined, + }, + } + } + + // Perform the render. + const result = await doRender(context) + if (!result) return null + return { ...result, revalidate: @@ -2860,9 +2892,8 @@ export default abstract class Server< typeof cacheEntry.revalidate !== 'undefined' && (!this.renderOpts.dev || (hasServerProps && !isNextDataRequest)) ) { - // If this is a preview mode request, we shouldn't cache it. We also don't - // cache 404 pages. - if (isPreviewMode || (is404Page && !isNextDataRequest)) { + // If this is a preview mode request, we shouldn't cache it + if (isPreviewMode) { revalidate = 0 } @@ -2874,6 +2905,18 @@ export default abstract class Server< } } + // If we are rendering the 404 page we derive the cache-control + // revalidate period from the value that trigged the not found + // to be rendered. So if `getStaticProps` returns + // { notFound: true, revalidate 60 } the revalidate period should + // be 60 but if a static asset 404s directly it should have a revalidate + // period of 0 so that it doesn't get cached unexpectedly by a CDN + else if (is404Page) { + const notFoundRevalidate = getRequestMeta(req, 'notFoundRevalidate') + revalidate = + typeof notFoundRevalidate === 'undefined' ? 0 : notFoundRevalidate + } + // If the cache entry has a revalidate value that's a number, use it. else if (typeof cacheEntry.revalidate === 'number') { if (cacheEntry.revalidate < 1) { @@ -2921,6 +2964,12 @@ export default abstract class Server< } if (!cachedData) { + // add revalidate metadata before rendering 404 page + // so that we can use this as source of truth for the + // cache-control header instead of what the 404 page returns + // for the revalidate value + addRequestMeta(req, 'notFoundRevalidate', cacheEntry.revalidate) + if (cacheEntry.revalidate) { res.setHeader( 'Cache-Control', @@ -2939,7 +2988,6 @@ export default abstract class Server< if (this.renderOpts.dev) { query.__nextNotFoundSrcPage = pathname } - await this.render404(req, res, { pathname, query }, false) return null } else if (cachedData.kind === 'REDIRECT') { @@ -3083,9 +3131,11 @@ export default abstract class Server< } } - // If we're debugging the skeleton, we should just serve the HTML without - // resuming the render. The returned HTML will be the static shell. - if (isDebugPPRSkeleton) { + // If we're debugging the static shell or the dynamic API accesses, we + // should just serve the HTML without resuming the render. The returned + // HTML will be the static shell so all the Dynamic API's will be used + // during static generation. + if (isDebugStaticShell || isDebugDynamicAccesses) { return { type: 'html', body, revalidate: 0 } } diff --git a/packages/next/src/server/dev/hot-reloader-turbopack.ts b/packages/next/src/server/dev/hot-reloader-turbopack.ts index 9619bf2c28e4f..c09e7be9ea984 100644 --- a/packages/next/src/server/dev/hot-reloader-turbopack.ts +++ b/packages/next/src/server/dev/hot-reloader-turbopack.ts @@ -1,6 +1,6 @@ import type { Socket } from 'net' import { mkdir, writeFile } from 'fs/promises' -import { join } from 'path' +import { join, extname } from 'path' import ws from 'next/dist/compiled/ws' @@ -63,6 +63,7 @@ import { type TopLevelIssuesMap, isWellKnownError, printNonFatalIssue, + normalizeAppMetadataRoutePage, } from './turbopack-utils' import { propagateServerField, @@ -807,9 +808,13 @@ export async function createHotReloaderTurbopack( await currentEntriesHandling const isInsideAppDir = routeDef.bundlePath.startsWith('app/') + const normalizedAppPage = normalizeAppMetadataRoutePage( + page, + extname(routeDef.filename) + ) const route = isInsideAppDir - ? currentEntrypoints.app.get(page) + ? currentEntrypoints.app.get(normalizedAppPage) : currentEntrypoints.page.get(page) if (!route) { diff --git a/packages/next/src/server/dev/hot-reloader-webpack.ts b/packages/next/src/server/dev/hot-reloader-webpack.ts index f55a9f5ece216..d6e5130c7948f 100644 --- a/packages/next/src/server/dev/hot-reloader-webpack.ts +++ b/packages/next/src/server/dev/hot-reloader-webpack.ts @@ -583,9 +583,9 @@ export default class HotReloaderWebpack implements NextJsHotReloaderInterface { ]) ) - this.pagesMapping = webpackConfigSpan + this.pagesMapping = await webpackConfigSpan .traceChild('create-pages-mapping') - .traceFn(() => + .traceAsyncFn(() => createPagesMapping({ isDev: true, pageExtensions: this.config.pageExtensions, @@ -594,6 +594,7 @@ export default class HotReloaderWebpack implements NextJsHotReloaderInterface { (i: string | null): i is string => typeof i === 'string' ), pagesDir: this.pagesDir, + appDir: this.appDir, }) ) diff --git a/packages/next/src/server/dev/turbopack-utils.ts b/packages/next/src/server/dev/turbopack-utils.ts index 7167fedcbcf87..564eea33c8e59 100644 --- a/packages/next/src/server/dev/turbopack-utils.ts +++ b/packages/next/src/server/dev/turbopack-utils.ts @@ -33,6 +33,7 @@ import { } from './turbopack/entry-key' import type ws from 'next/dist/compiled/ws' import isInternal from '../../shared/lib/is-internal' +import { isMetadataRoute } from '../../lib/metadata/is-metadata-route' export async function getTurbopackJsConfig( dir: string, @@ -519,7 +520,10 @@ export async function handleRouteType({ const type = writtenEndpoint?.type - await manifestLoader.loadAppPathsManifest(page) + await manifestLoader.loadAppPathsManifest( + normalizeAppMetadataRoutePage(page, false) + ) + if (type === 'edge') { await manifestLoader.loadMiddlewareManifest(page, 'app') } else { @@ -995,3 +999,27 @@ export async function handlePagesErrorRoute({ pageEntrypoints: entrypoints.page, }) } + +export function normalizeAppMetadataRoutePage( + route: string, + ext: string | false +): string { + let entrypointKey = route + if (isMetadataRoute(entrypointKey)) { + entrypointKey = entrypointKey.endsWith('/route') + ? entrypointKey.slice(0, -'/route'.length) + : entrypointKey + + if (ext) { + if (entrypointKey.endsWith('/[__metadata_id__]')) { + entrypointKey = entrypointKey.slice(0, -'/[__metadata_id__]'.length) + } + if (entrypointKey.endsWith('/sitemap.xml') && ext !== '.xml') { + // For dynamic sitemap route, remove the extension + entrypointKey = entrypointKey.slice(0, -'.xml'.length) + } + } + entrypointKey = entrypointKey + '/route' + } + return entrypointKey +} diff --git a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts index ee0431a4f218d..909a3ad955a1a 100644 --- a/packages/next/src/server/lib/incremental-cache/fetch-cache.ts +++ b/packages/next/src/server/lib/incremental-cache/fetch-cache.ts @@ -24,10 +24,40 @@ const CACHE_REVALIDATE_HEADER = 'x-vercel-revalidate' as const const CACHE_FETCH_URL_HEADER = 'x-vercel-cache-item-name' as const const CACHE_CONTROL_VALUE_HEADER = 'x-vercel-cache-control' as const +const DEBUG = Boolean(process.env.NEXT_PRIVATE_DEBUG_CACHE) + +async function fetchRetryWithTimeout( + url: Parameters[0], + init: Parameters[1], + retryIndex = 0 +): Promise { + const controller = new AbortController() + const timeout = setTimeout(() => { + controller.abort() + }, 500) + + return fetch(url, { + ...(init || {}), + signal: controller.signal, + }) + .catch((err) => { + if (retryIndex === 3) { + throw err + } else { + if (DEBUG) { + console.log(`Fetch failed for ${url} retry ${retryIndex}`) + } + return fetchRetryWithTimeout(url, init, retryIndex + 1) + } + }) + .finally(() => { + clearTimeout(timeout) + }) +} + export default class FetchCache implements CacheHandler { private headers: Record private cacheEndpoint?: string - private debug: boolean private hasMatchingTags(arr1: string[], arr2: string[]) { if (arr1.length !== arr2.length) return false @@ -53,7 +83,6 @@ export default class FetchCache implements CacheHandler { } constructor(ctx: CacheHandlerContext) { - this.debug = !!process.env.NEXT_PRIVATE_DEBUG_CACHE this.headers = {} this.headers['Content-Type'] = 'application/json' @@ -79,17 +108,18 @@ export default class FetchCache implements CacheHandler { } if (scHost) { - this.cacheEndpoint = `https://${scHost}${scBasePath || ''}` - if (this.debug) { + const scProto = process.env.SUSPENSE_CACHE_PROTO || 'https' + this.cacheEndpoint = `${scProto}://${scHost}${scBasePath || ''}` + if (DEBUG) { console.log('using cache endpoint', this.cacheEndpoint) } - } else if (this.debug) { + } else if (DEBUG) { console.log('no cache endpoint available') } if (ctx.maxMemoryCacheSize) { if (!memoryCache) { - if (this.debug) { + if (DEBUG) { console.log('using memory store for fetch cache') } @@ -118,7 +148,7 @@ export default class FetchCache implements CacheHandler { }) } } else { - if (this.debug) { + if (DEBUG) { console.log('not using memory store for fetch cache') } } @@ -133,21 +163,21 @@ export default class FetchCache implements CacheHandler { ) { let [tags] = args tags = typeof tags === 'string' ? [tags] : tags - if (this.debug) { + if (DEBUG) { console.log('revalidateTag', tags) } if (!tags.length) return if (Date.now() < rateLimitedUntil) { - if (this.debug) { + if (DEBUG) { console.log('rate limited ', rateLimitedUntil) } return } try { - const res = await fetch( + const res = await fetchRetryWithTimeout( `${this.cacheEndpoint}/v1/suspense-cache/revalidate?tags=${tags .map((tag) => encodeURIComponent(tag)) .join(',')}`, @@ -181,7 +211,7 @@ export default class FetchCache implements CacheHandler { } if (Date.now() < rateLimitedUntil) { - if (this.debug) { + if (DEBUG) { console.log('rate limited') } return null @@ -227,7 +257,7 @@ export default class FetchCache implements CacheHandler { } if (res.status === 404) { - if (this.debug) { + if (DEBUG) { console.log( `no fetch cache entry for ${key}, duration: ${ Date.now() - start @@ -245,7 +275,7 @@ export default class FetchCache implements CacheHandler { const cached: IncrementalCacheValue = await res.json() if (!cached || cached.kind !== 'FETCH') { - this.debug && console.log({ cached }) + DEBUG && console.log({ cached }) throw new Error('invalid cache value') } @@ -272,7 +302,7 @@ export default class FetchCache implements CacheHandler { : Date.now() - parseInt(age || '0', 10) * 1000, } - if (this.debug) { + if (DEBUG) { console.log( `got fetch cache entry for ${key}, duration: ${ Date.now() - start @@ -289,7 +319,7 @@ export default class FetchCache implements CacheHandler { } } catch (err) { // unable to get data from fetch-cache - if (this.debug) { + if (DEBUG) { console.error(`Failed to get from fetch-cache`, err) } } @@ -314,7 +344,7 @@ export default class FetchCache implements CacheHandler { JSON.stringify((newValue as Record)[field]) ) ) { - if (this.debug) { + if (DEBUG) { console.log(`skipping cache set for ${key} as not modified`) } return @@ -324,7 +354,7 @@ export default class FetchCache implements CacheHandler { if (!fetchCache) return if (Date.now() < rateLimitedUntil) { - if (this.debug) { + if (DEBUG) { console.log('rate limited') } return @@ -356,7 +386,7 @@ export default class FetchCache implements CacheHandler { tags: undefined, }) - if (this.debug) { + if (DEBUG) { console.log('set cache', key) } const fetchParams: NextFetchCacheParams = { @@ -385,11 +415,11 @@ export default class FetchCache implements CacheHandler { } if (!res.ok) { - this.debug && console.log(await res.text()) + DEBUG && console.log(await res.text()) throw new Error(`invalid response ${res.status}`) } - if (this.debug) { + if (DEBUG) { console.log( `successfully set to fetch-cache for ${key}, duration: ${ Date.now() - start @@ -398,7 +428,7 @@ export default class FetchCache implements CacheHandler { } } catch (err) { // unable to set to fetch-cache - if (this.debug) { + if (DEBUG) { console.error(`Failed to update fetch cache`, err) } } diff --git a/packages/next/src/server/lib/router-utils/setup-dev-bundler.ts b/packages/next/src/server/lib/router-utils/setup-dev-bundler.ts index 79fbba8c00c41..ad1ac8fa5457e 100644 --- a/packages/next/src/server/lib/router-utils/setup-dev-bundler.ts +++ b/packages/next/src/server/lib/router-utils/setup-dev-bundler.ts @@ -1,7 +1,10 @@ import type { NextConfigComplete } from '../../config-shared' import type { FilesystemDynamicRoute } from './filesystem' import type { UnwrapPromise } from '../../../lib/coalesced-function' -import type { MiddlewareMatcher } from '../../../build/analysis/get-page-static-info' +import { + getPageStaticInfo, + type MiddlewareMatcher, +} from '../../../build/analysis/get-page-static-info' import type { MiddlewareRouteMatch } from '../../../shared/lib/router/utils/middleware-route-matcher' import type { PropagateToWorkersField } from './types' import type { NextJsHotReloaderInterface } from '../../dev/hot-reloader-types' @@ -77,6 +80,8 @@ import { getErrorSource } from '../../../shared/lib/error-source' import type { StackFrame } from 'next/dist/compiled/stacktrace-parser' import { generateEncryptionKeyBase64 } from '../../app-render/encryption-utils' import { ModuleBuildError } from '../../dev/turbopack-utils' +import { isMetadataRoute } from '../../../lib/metadata/is-metadata-route' +import { normalizeMetadataPageToRoute } from '../../../lib/metadata/get-metadata-route' export type SetupOpts = { renderServer: LazyRenderServerInstance @@ -397,6 +402,32 @@ async function startWatcher(opts: SetupOpts) { pagesType: isAppPath ? PAGE_TYPES.APP : PAGE_TYPES.PAGES, }) + if (isAppPath && isMetadataRoute(pageName)) { + const staticInfo = await getPageStaticInfo({ + pageFilePath: fileName, + nextConfig: {}, + page: pageName, + isDev: true, + pageType: PAGE_TYPES.APP, + }) + + pageName = normalizeMetadataPageToRoute( + pageName, + !!(staticInfo.generateSitemaps || staticInfo.generateImageMetadata) + ) + + // pageName = pageName.slice(0, -'/route'.length) + // if (pageName.endsWith('/sitemap')) { + + // if (staticInfo.generateSitemaps) { + // pageName = `${pageName}/[__metadata_id__]` + // } else { + // pageName = `${pageName}.xml` + // } + // } + // pageName = `${pageName}/route` + } + if ( !isAppPath && pageName.startsWith('/api/') && diff --git a/packages/next/src/server/request-meta.ts b/packages/next/src/server/request-meta.ts index f45c2afe252c8..772447aa6d043 100644 --- a/packages/next/src/server/request-meta.ts +++ b/packages/next/src/server/request-meta.ts @@ -94,6 +94,11 @@ export interface RequestMeta { cacheEntry: any, requestMeta: any ) => Promise | boolean | void + + /** + * The previous revalidate before rendering 404 page for notFound: true + */ + notFoundRevalidate?: number | false } /** diff --git a/packages/next/src/server/route-matcher-providers/dev/dev-app-route-route-matcher-provider.ts b/packages/next/src/server/route-matcher-providers/dev/dev-app-route-route-matcher-provider.ts index bd681c7ab378f..1a236aa8406a7 100644 --- a/packages/next/src/server/route-matcher-providers/dev/dev-app-route-route-matcher-provider.ts +++ b/packages/next/src/server/route-matcher-providers/dev/dev-app-route-route-matcher-provider.ts @@ -5,6 +5,11 @@ import { RouteKind } from '../../route-kind' import { FileCacheRouteMatcherProvider } from './file-cache-route-matcher-provider' import { isAppRouteRoute } from '../../../lib/is-app-route-route' import { DevAppNormalizers } from '../../normalizers/built/app' +import { + isMetadataRoute, + isStaticMetadataRoute, +} from '../../../lib/metadata/is-metadata-route' +import { normalizeMetadataPageToRoute } from '../../../lib/metadata/get-metadata-route' export class DevAppRouteRouteMatcherProvider extends FileCacheRouteMatcherProvider { private readonly normalizers: { @@ -39,15 +44,67 @@ export class DevAppRouteRouteMatcherProvider extends FileCacheRouteMatcherProvid const pathname = this.normalizers.pathname.normalize(filename) const bundlePath = this.normalizers.bundlePath.normalize(filename) - matchers.push( - new AppRouteRouteMatcher({ - kind: RouteKind.APP_ROUTE, - pathname, - page, - bundlePath, - filename, - }) - ) + if (isMetadataRoute(page) && !isStaticMetadataRoute(page)) { + // Matching dynamic metadata routes. + // Add 2 possibilities for both single and multiple routes: + { + // single: + // /sitemap.ts -> /sitemap.xml/route + // /icon.ts -> /icon/route + // We'll map the filename before normalization: + // sitemap.ts -> sitemap.xml/route.ts + // icon.ts -> icon/route.ts + const metadataPage = normalizeMetadataPageToRoute(page, false) // this.normalizers.page.normalize(dummyFilename) + const metadataPathname = normalizeMetadataPageToRoute(pathname, false) // this.normalizers.pathname.normalize(dummyFilename) + const metadataBundlePath = normalizeMetadataPageToRoute( + bundlePath, + false + ) // this.normalizers.bundlePath.normalize(dummyFilename) + + const matcher = new AppRouteRouteMatcher({ + kind: RouteKind.APP_ROUTE, + page: metadataPage, + pathname: metadataPathname, + bundlePath: metadataBundlePath, + filename, + }) + matchers.push(matcher) + } + { + // multiple: + // /sitemap.ts -> /sitemap/[__metadata_id__]/route + // /icon.ts -> /icon/[__metadata_id__]/route + // We'll map the filename before normalization: + // sitemap.ts -> sitemap.xml/[__metadata_id__].ts + // icon.ts -> icon/[__metadata_id__].ts + const metadataPage = normalizeMetadataPageToRoute(page, true) + const metadataPathname = normalizeMetadataPageToRoute(pathname, true) + const metadataBundlePath = normalizeMetadataPageToRoute( + bundlePath, + true + ) + + const matcher = new AppRouteRouteMatcher({ + kind: RouteKind.APP_ROUTE, + page: metadataPage, + pathname: metadataPathname, + bundlePath: metadataBundlePath, + filename, + }) + matchers.push(matcher) + } + } else { + // Normal app routes and static metadata routes. + matchers.push( + new AppRouteRouteMatcher({ + kind: RouteKind.APP_ROUTE, + page, + pathname, + bundlePath, + filename, + }) + ) + } } return matchers diff --git a/packages/next/src/server/web/spec-extension/unstable-cache.ts b/packages/next/src/server/web/spec-extension/unstable-cache.ts index 56e0801492f18..e132279e0a94e 100644 --- a/packages/next/src/server/web/spec-extension/unstable-cache.ts +++ b/packages/next/src/server/web/spec-extension/unstable-cache.ts @@ -113,7 +113,7 @@ export function unstable_cache( return a.localeCompare(b) }) const sortedSearch = sortedSearchKeys - .map((key) => searchParams.get(key)) + .map((key) => `${key}=${searchParams.get(key)}`) .join('&') // Construct the complete cache key for this function invocation @@ -180,6 +180,7 @@ export function unstable_cache( tags, softTags: implicitTags, fetchIdx, + fetchUrl, }) if (cacheEntry && cacheEntry.value) { @@ -276,10 +277,17 @@ export function unstable_cache( if (!incrementalCache.isOnDemandRevalidate) { // We aren't doing an on demand revalidation so we check use the cache if valid + // @TODO check on this API. addImplicitTags mutates the store and returns the implicit tags. The naming + // of this function is potentially a little confusing + const implicitTags = store && addImplicitTags(store) + const cacheEntry = await incrementalCache.get(cacheKey, { kindHint: 'fetch', revalidate: options.revalidate, tags, + fetchIdx, + fetchUrl, + softTags: implicitTags, }) if (cacheEntry && cacheEntry.value) { diff --git a/packages/next/src/shared/lib/lazy-dynamic/loadable.tsx b/packages/next/src/shared/lib/lazy-dynamic/loadable.tsx index 5950b1d82ce2f..31b6e459e93d8 100644 --- a/packages/next/src/shared/lib/lazy-dynamic/loadable.tsx +++ b/packages/next/src/shared/lib/lazy-dynamic/loadable.tsx @@ -15,7 +15,7 @@ function convertModule

( // Cases: // mod: { default: Component } // mod: Component - // mod: { default: proxy(Component) } + // mod: { $$typeof, default: proxy(Component) } // mod: proxy(Component) const hasDefault = mod && 'default' in mod return { diff --git a/packages/react-refresh-utils/package.json b/packages/react-refresh-utils/package.json index 76a39bfffdc7f..f0ad59412e96d 100644 --- a/packages/react-refresh-utils/package.json +++ b/packages/react-refresh-utils/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-refresh-utils", - "version": "15.0.0-canary.23", + "version": "15.0.0-canary.25", "description": "An experimental package providing utilities for React Refresh.", "repository": { "url": "vercel/next.js", diff --git a/packages/third-parties/package.json b/packages/third-parties/package.json index 25cf5bdeaca50..8ccf3857b714e 100644 --- a/packages/third-parties/package.json +++ b/packages/third-parties/package.json @@ -1,6 +1,6 @@ { "name": "@next/third-parties", - "version": "15.0.0-canary.23", + "version": "15.0.0-canary.25", "repository": { "url": "vercel/next.js", "directory": "packages/third-parties" @@ -26,7 +26,7 @@ "third-party-capital": "1.0.20" }, "devDependencies": { - "next": "15.0.0-canary.23", + "next": "15.0.0-canary.25", "outdent": "0.8.0", "prettier": "2.5.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2e433c18990db..2b5fe5bd0adc3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,10 +15,10 @@ overrides: '@babel/traverse': 7.22.5 '@types/react': npm:types-react@19.0.0-rc.0 '@types/react-dom': npm:types-react-dom@19.0.0-rc.0 - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605 - react-is: 19.0.0-rc-1df34bdf62-20240605 - scheduler: 0.25.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610 + react-is: 19.0.0-rc-6230622a1a-20240610 + scheduler: 0.25.0-rc-6230622a1a-20240610 patchedDependencies: webpack-sources@3.2.3: @@ -61,7 +61,7 @@ importers: version: 11.11.0 '@emotion/react': specifier: 11.11.1 - version: 11.11.1(react@19.0.0-rc-1df34bdf62-20240605)(types-react@19.0.0-rc.0) + version: 11.11.1(react@19.0.0-rc-6230622a1a-20240610)(types-react@19.0.0-rc.0) '@fullhuman/postcss-purgecss': specifier: 1.3.0 version: 1.3.0 @@ -70,7 +70,7 @@ importers: version: 2.2.1(webpack@5.90.0) '@mdx-js/react': specifier: 2.2.1 - version: 2.2.1(react@19.0.0-rc-1df34bdf62-20240605) + version: 2.2.1(react@19.0.0-rc-6230622a1a-20240610) '@next/bundle-analyzer': specifier: workspace:* version: link:packages/next-bundle-analyzer @@ -136,7 +136,7 @@ importers: version: 6.1.2(@types/jest@29.5.5)(jest@29.7.0) '@testing-library/react': specifier: ^15.0.5 - version: 15.0.7(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605)(types-react@19.0.0-rc.0) + version: 15.0.7(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610)(types-react@19.0.0-rc.0) '@types/busboy': specifier: 1.5.3 version: 1.5.3 @@ -441,47 +441,47 @@ importers: specifier: 0.3.0 version: 0.3.0 react: - specifier: 19.0.0-rc-1df34bdf62-20240605 - version: 19.0.0-rc-1df34bdf62-20240605 + specifier: 19.0.0-rc-6230622a1a-20240610 + version: 19.0.0-rc-6230622a1a-20240610 react-17: specifier: npm:react@17.0.2 version: /react@17.0.2 react-builtin: - specifier: npm:react@19.0.0-rc-1df34bdf62-20240605 - version: /react@19.0.0-rc-1df34bdf62-20240605 + specifier: npm:react@19.0.0-rc-6230622a1a-20240610 + version: /react@19.0.0-rc-6230622a1a-20240610 react-dom: - specifier: 19.0.0-rc-1df34bdf62-20240605 - version: 19.0.0-rc-1df34bdf62-20240605(react@19.0.0-rc-1df34bdf62-20240605) + specifier: 19.0.0-rc-6230622a1a-20240610 + version: 19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610) react-dom-17: specifier: npm:react-dom@17.0.2 - version: /react-dom@17.0.2(react@19.0.0-rc-1df34bdf62-20240605) + version: /react-dom@17.0.2(react@19.0.0-rc-6230622a1a-20240610) react-dom-builtin: - specifier: npm:react-dom@19.0.0-rc-1df34bdf62-20240605 - version: /react-dom@19.0.0-rc-1df34bdf62-20240605(react@19.0.0-rc-1df34bdf62-20240605) + specifier: npm:react-dom@19.0.0-rc-6230622a1a-20240610 + version: /react-dom@19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610) react-dom-experimental-builtin: - specifier: npm:react-dom@0.0.0-experimental-1df34bdf62-20240605 - version: /react-dom@0.0.0-experimental-1df34bdf62-20240605(react@19.0.0-rc-1df34bdf62-20240605) + specifier: npm:react-dom@0.0.0-experimental-6230622a1a-20240610 + version: /react-dom@0.0.0-experimental-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610) react-experimental-builtin: - specifier: npm:react@0.0.0-experimental-1df34bdf62-20240605 - version: /react@0.0.0-experimental-1df34bdf62-20240605 + specifier: npm:react@0.0.0-experimental-6230622a1a-20240610 + version: /react@0.0.0-experimental-6230622a1a-20240610 react-server-dom-turbopack: - specifier: 19.0.0-rc-1df34bdf62-20240605 - version: 19.0.0-rc-1df34bdf62-20240605(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605) + specifier: 19.0.0-rc-6230622a1a-20240610 + version: 19.0.0-rc-6230622a1a-20240610(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610) react-server-dom-turbopack-experimental: - specifier: npm:react-server-dom-turbopack@0.0.0-experimental-1df34bdf62-20240605 - version: /react-server-dom-turbopack@0.0.0-experimental-1df34bdf62-20240605(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605) + specifier: npm:react-server-dom-turbopack@0.0.0-experimental-6230622a1a-20240610 + version: /react-server-dom-turbopack@0.0.0-experimental-6230622a1a-20240610(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610) react-server-dom-webpack: - specifier: 19.0.0-rc-1df34bdf62-20240605 - version: 19.0.0-rc-1df34bdf62-20240605(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605)(webpack@5.90.0) + specifier: 19.0.0-rc-6230622a1a-20240610 + version: 19.0.0-rc-6230622a1a-20240610(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610)(webpack@5.90.0) react-server-dom-webpack-experimental: - specifier: npm:react-server-dom-webpack@0.0.0-experimental-1df34bdf62-20240605 - version: /react-server-dom-webpack@0.0.0-experimental-1df34bdf62-20240605(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605)(webpack@5.90.0) + specifier: npm:react-server-dom-webpack@0.0.0-experimental-6230622a1a-20240610 + version: /react-server-dom-webpack@0.0.0-experimental-6230622a1a-20240610(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610)(webpack@5.90.0) react-ssr-prepass: specifier: 1.0.8 - version: 1.0.8(react-is@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605) + version: 1.0.8(react-is@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610) react-virtualized: specifier: 9.22.3 - version: 9.22.3(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605) + version: 9.22.3(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610) relay-compiler: specifier: 13.0.2 version: 13.0.2 @@ -504,11 +504,11 @@ importers: specifier: 0.10.9 version: 0.10.9 scheduler-builtin: - specifier: npm:scheduler@0.25.0-rc-1df34bdf62-20240605 - version: /scheduler@0.25.0-rc-1df34bdf62-20240605 + specifier: npm:scheduler@0.25.0-rc-6230622a1a-20240610 + version: /scheduler@0.25.0-rc-6230622a1a-20240610 scheduler-experimental-builtin: - specifier: npm:scheduler@0.0.0-experimental-1df34bdf62-20240605 - version: /scheduler@0.0.0-experimental-1df34bdf62-20240605 + specifier: npm:scheduler@0.0.0-experimental-6230622a1a-20240610 + version: /scheduler@0.0.0-experimental-6230622a1a-20240610 seedrandom: specifier: 3.0.5 version: 3.0.5 @@ -523,16 +523,16 @@ importers: version: 6.0.0 styled-components: specifier: 6.0.0-rc.3 - version: 6.0.0-rc.3(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605) + version: 6.0.0-rc.3(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610) styled-jsx: specifier: 5.1.6 - version: 5.1.6(@babel/core@7.22.5)(react@19.0.0-rc-1df34bdf62-20240605) + version: 5.1.6(@babel/core@7.22.5)(react@19.0.0-rc-6230622a1a-20240610) styled-jsx-plugin-postcss: specifier: 3.0.2 version: 3.0.2 swr: specifier: ^2.2.4 - version: 2.2.4(react@19.0.0-rc-1df34bdf62-20240605) + version: 2.2.4(react@19.0.0-rc-6230622a1a-20240610) tailwindcss: specifier: 3.2.7 version: 3.2.7(postcss@8.4.31) @@ -753,7 +753,7 @@ importers: packages/eslint-config-next: dependencies: '@next/eslint-plugin-next': - specifier: 15.0.0-canary.23 + specifier: 15.0.0-canary.25 version: link:../eslint-plugin-next '@rushstack/eslint-patch': specifier: ^1.3.3 @@ -800,7 +800,7 @@ importers: dependencies: next: specifier: 14.3.0-canary.15 - version: 14.3.0-canary.15(@babel/core@7.22.5)(@opentelemetry/api@1.4.1)(@playwright/test@1.19.2)(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605)(sass@1.54.0) + version: 14.3.0-canary.15(@babel/core@7.22.5)(@opentelemetry/api@1.4.1)(@playwright/test@1.19.2)(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610)(sass@1.54.0) devDependencies: '@types/fontkit': specifier: 2.0.0 @@ -815,7 +815,7 @@ importers: packages/next: dependencies: '@next/env': - specifier: 15.0.0-canary.23 + specifier: 15.0.0-canary.25 version: link:../next-env '@swc/helpers': specifier: 0.5.11 @@ -836,17 +836,17 @@ importers: specifier: 8.4.31 version: 8.4.31 react: - specifier: 19.0.0-rc-1df34bdf62-20240605 - version: 19.0.0-rc-1df34bdf62-20240605 + specifier: 19.0.0-rc-6230622a1a-20240610 + version: 19.0.0-rc-6230622a1a-20240610 react-dom: - specifier: 19.0.0-rc-1df34bdf62-20240605 - version: 19.0.0-rc-1df34bdf62-20240605(react@19.0.0-rc-1df34bdf62-20240605) + specifier: 19.0.0-rc-6230622a1a-20240610 + version: 19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610) sass: specifier: ^1.3.0 version: 1.54.0 styled-jsx: specifier: 5.1.6 - version: 5.1.6(@babel/core@7.22.5)(react@19.0.0-rc-1df34bdf62-20240605) + version: 5.1.6(@babel/core@7.22.5)(react@19.0.0-rc-6230622a1a-20240610) optionalDependencies: sharp: specifier: ^0.33.4 @@ -943,16 +943,16 @@ importers: specifier: 1.2.0 version: 1.2.0 '@next/polyfill-module': - specifier: 15.0.0-canary.23 + specifier: 15.0.0-canary.25 version: link:../next-polyfill-module '@next/polyfill-nomodule': - specifier: 15.0.0-canary.23 + specifier: 15.0.0-canary.25 version: link:../next-polyfill-nomodule '@next/react-refresh-utils': - specifier: 15.0.0-canary.23 + specifier: 15.0.0-canary.25 version: link:../react-refresh-utils '@next/swc': - specifier: 15.0.0-canary.23 + specifier: 15.0.0-canary.25 version: link:../next-swc '@opentelemetry/api': specifier: 1.6.0 @@ -1090,8 +1090,8 @@ importers: specifier: 0.27.1 version: 0.27.1 '@vercel/turbopack-ecmascript-runtime': - specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240607.3 - version: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240607.3' + specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240610.2 + version: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240610.2' acorn: specifier: 8.11.3 version: 8.11.3 @@ -1339,8 +1339,8 @@ importers: specifier: 2.4.1 version: 2.4.1 react-is: - specifier: 19.0.0-rc-1df34bdf62-20240605 - version: 19.0.0-rc-1df34bdf62-20240605 + specifier: 19.0.0-rc-6230622a1a-20240610 + version: 19.0.0-rc-6230622a1a-20240610 react-refresh: specifier: 0.12.0 version: 0.12.0 @@ -1430,7 +1430,7 @@ importers: version: 1.0.35 unistore: specifier: 3.4.1 - version: 3.4.1(react@19.0.0-rc-1df34bdf62-20240605) + version: 3.4.1(react@19.0.0-rc-6230622a1a-20240610) util: specifier: 0.12.4 version: 0.12.4 @@ -1518,7 +1518,7 @@ importers: version: 2.2.1(webpack@5.90.0) '@mdx-js/react': specifier: '>=0.15.0' - version: 2.2.1(react@19.0.0-rc-1df34bdf62-20240605) + version: 2.2.1(react@19.0.0-rc-6230622a1a-20240610) source-map: specifier: ^0.7.0 version: 0.7.3 @@ -1569,14 +1569,14 @@ importers: packages/third-parties: dependencies: react: - specifier: 19.0.0-rc-1df34bdf62-20240605 - version: 19.0.0-rc-1df34bdf62-20240605 + specifier: 19.0.0-rc-6230622a1a-20240610 + version: 19.0.0-rc-6230622a1a-20240610 third-party-capital: specifier: 1.0.20 version: 1.0.20 devDependencies: next: - specifier: 15.0.0-canary.23 + specifier: 15.0.0-canary.25 version: link:../next outdent: specifier: 0.8.0 @@ -3662,11 +3662,11 @@ packages: resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} dev: true - /@emotion/react@11.11.1(react@19.0.0-rc-1df34bdf62-20240605)(types-react@19.0.0-rc.0): + /@emotion/react@11.11.1(react@19.0.0-rc-6230622a1a-20240610)(types-react@19.0.0-rc.0): resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==} peerDependencies: '@types/react': '*' - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 peerDependenciesMeta: '@types/react': optional: true @@ -3675,12 +3675,12 @@ packages: '@emotion/babel-plugin': 11.11.0 '@emotion/cache': 11.11.0 '@emotion/serialize': 1.1.2 - '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@19.0.0-rc-1df34bdf62-20240605) + '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@19.0.0-rc-6230622a1a-20240610) '@emotion/utils': 1.2.1 '@emotion/weak-memoize': 0.3.1 '@types/react': /types-react@19.0.0-rc.0 hoist-non-react-statics: 3.3.2 - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 dev: true /@emotion/serialize@1.1.2: @@ -3701,12 +3701,12 @@ packages: resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} dev: true - /@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@19.0.0-rc-1df34bdf62-20240605): + /@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@19.0.0-rc-6230622a1a-20240610): resolution: {integrity: sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==} peerDependencies: - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 dependencies: - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 dev: true /@emotion/utils@1.2.1: @@ -5593,14 +5593,14 @@ packages: transitivePeerDependencies: - supports-color - /@mdx-js/react@2.2.1(react@19.0.0-rc-1df34bdf62-20240605): + /@mdx-js/react@2.2.1(react@19.0.0-rc-6230622a1a-20240610): resolution: {integrity: sha512-YdXcMcEnqZhzql98RNrqYo9cEhTTesBiCclEtoiQUbJwx87q9453GTapYU6kJ8ZZ2ek1Vp25SiAXEFy5O/eAPw==} peerDependencies: - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 dependencies: '@types/mdx': 2.0.3 '@types/react': /types-react@19.0.0-rc.0 - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 /@mswjs/cookies@1.1.0: resolution: {integrity: sha512-0ZcCVQxifZmhwNBoQIrystCb+2sWBY2Zw8lpfJBPCHGCA/HWqehITeCRVIv4VMy8MPlaHo2w2pTHFV2pFfqKPw==} @@ -6944,13 +6944,13 @@ packages: redent: 3.0.0 dev: true - /@testing-library/react@15.0.7(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605)(types-react@19.0.0-rc.0): + /@testing-library/react@15.0.7(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610)(types-react@19.0.0-rc.0): resolution: {integrity: sha512-cg0RvEdD1TIhhkm1IeYMQxrzy0MtUNfa3minv4MjbgcYzJAZ7yD0i0lwoPOTPr+INtiXFezt2o8xMSnyHhEn2Q==} engines: {node: '>=18'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610 peerDependenciesMeta: '@types/react': optional: true @@ -6959,8 +6959,8 @@ packages: '@testing-library/dom': 10.1.0 '@types/react': /types-react@19.0.0-rc.0 '@types/react-dom': /types-react-dom@19.0.0-rc.0 - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605(react@19.0.0-rc-1df34bdf62-20240605) + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610) dev: true /@tootallnate/once@1.1.2: @@ -14143,7 +14143,7 @@ packages: /hoist-non-react-statics@3.3.2: resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} dependencies: - react-is: 19.0.0-rc-1df34bdf62-20240605 + react-is: 19.0.0-rc-6230622a1a-20240610 dev: true /homedir-polyfill@1.0.3: @@ -18299,15 +18299,15 @@ packages: resolution: {integrity: sha1-yobR/ogoFpsBICCOPchCS524NCw=} dev: true - /next@14.3.0-canary.15(@babel/core@7.22.5)(@opentelemetry/api@1.4.1)(@playwright/test@1.19.2)(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605)(sass@1.54.0): + /next@14.3.0-canary.15(@babel/core@7.22.5)(@opentelemetry/api@1.4.1)(@playwright/test@1.19.2)(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610)(sass@1.54.0): resolution: {integrity: sha512-vQ376NxcS/zYLJKIZRRfyis9nK+Y23KUqD8Hg93kbrgVWhJW0fZIcKf14ATm8AZg2uxDt4/vj7gVOt1QrWtMIQ==} engines: {node: '>=18.17.0'} hasBin: true peerDependencies: '@opentelemetry/api': ^1.1.0 '@playwright/test': ^1.41.2 - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610 sass: ^1.3.0 peerDependenciesMeta: '@opentelemetry/api': @@ -18325,10 +18325,10 @@ packages: caniuse-lite: 1.0.30001579 graceful-fs: 4.2.11 postcss: 8.4.31 - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605(react@19.0.0-rc-1df34bdf62-20240605) + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610) sass: 1.54.0 - styled-jsx: 5.1.1(@babel/core@7.22.5)(react@19.0.0-rc-1df34bdf62-20240605) + styled-jsx: 5.1.1(@babel/core@7.22.5)(react@19.0.0-rc-6230622a1a-20240610) optionalDependencies: '@next/swc-darwin-arm64': 14.3.0-canary.15 '@next/swc-darwin-x64': 14.3.0-canary.15 @@ -20957,7 +20957,7 @@ packages: '@jest/types': 24.9.0 ansi-regex: 4.1.0 ansi-styles: 3.2.1 - react-is: 19.0.0-rc-1df34bdf62-20240605 + react-is: 19.0.0-rc-6230622a1a-20240610 /pretty-format@27.5.1: resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} @@ -20965,7 +20965,7 @@ packages: dependencies: ansi-regex: 5.0.1 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-1df34bdf62-20240605 + react-is: 19.0.0-rc-6230622a1a-20240610 /pretty-format@29.5.0: resolution: {integrity: sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw==} @@ -20973,7 +20973,7 @@ packages: dependencies: '@jest/schemas': 29.4.3 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-1df34bdf62-20240605 + react-is: 19.0.0-rc-6230622a1a-20240610 dev: true /pretty-format@29.7.0: @@ -20982,7 +20982,7 @@ packages: dependencies: '@jest/schemas': 29.6.3 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-1df34bdf62-20240605 + react-is: 19.0.0-rc-6230622a1a-20240610 dev: true /pretty-ms@7.0.0: @@ -21084,7 +21084,7 @@ packages: dependencies: loose-envify: 1.4.0 object-assign: 4.1.1 - react-is: 19.0.0-rc-1df34bdf62-20240605 + react-is: 19.0.0-rc-6230622a1a-20240610 /proper-lockfile@4.1.2: resolution: {integrity: sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==} @@ -21364,36 +21364,36 @@ packages: strip-json-comments: 2.0.1 dev: true - /react-dom@0.0.0-experimental-1df34bdf62-20240605(react@19.0.0-rc-1df34bdf62-20240605): - resolution: {integrity: sha512-GOjWoRwx7tiDkrGAa0Qc6kNUuNJOi5q+OgYDR14X9mCZZz8aicl7/rNakKZ+aYU74PkJbAf3b9VKP8an6DCuhg==} + /react-dom@0.0.0-experimental-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610): + resolution: {integrity: sha512-rkLgUvHRh4Spb22M7fVs0AKEqdwiw9TMyVQmZw6pj+FJpgn0Hgqb+evnWsT0B656bwplrp/mltS727Xkw4c0uw==} peerDependencies: - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 dependencies: - react: 19.0.0-rc-1df34bdf62-20240605 - scheduler: 0.25.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 + scheduler: 0.25.0-rc-6230622a1a-20240610 dev: true - /react-dom@17.0.2(react@19.0.0-rc-1df34bdf62-20240605): + /react-dom@17.0.2(react@19.0.0-rc-6230622a1a-20240610): resolution: {integrity: sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==} peerDependencies: - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 dependencies: loose-envify: 1.4.0 object-assign: 4.1.1 - react: 19.0.0-rc-1df34bdf62-20240605 - scheduler: 0.25.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 + scheduler: 0.25.0-rc-6230622a1a-20240610 dev: true - /react-dom@19.0.0-rc-1df34bdf62-20240605(react@19.0.0-rc-1df34bdf62-20240605): - resolution: {integrity: sha512-rhPZXaFc9lDagraujwbFFRoV84om75D0VpP1EVcfoclsNdcj7aD+dFgjY6nATQ6n0jNr+OPyH+kagRzfQeuGNQ==} + /react-dom@19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610): + resolution: {integrity: sha512-56G4Pum5E7FeGL1rwHX5IxidSJxQnXP4yORRo0pVeOJuu5DQJvNKpUwmJoftMP/ez0AiglYTY77L2Gs8iyt1Hg==} peerDependencies: - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 dependencies: - react: 19.0.0-rc-1df34bdf62-20240605 - scheduler: 0.25.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 + scheduler: 0.25.0-rc-6230622a1a-20240610 - /react-is@19.0.0-rc-1df34bdf62-20240605: - resolution: {integrity: sha512-StF0rCxn2SXQQOHpTWJCsCpUSajQech83s6XZeQzdiGAviBIaoPFVxna8tkxb8+b0adHqHPq7Jv7ckNAPlCLhQ==} + /react-is@19.0.0-rc-6230622a1a-20240610: + resolution: {integrity: sha512-6BH4F/xpoTJ+BTcb2AmZAzWXInEPUNKgL4u4C1BssZmFkGsvUpZmllLgCEVa105omvex85ZWwKHCy22KftGwDw==} /react-lifecycles-compat@3.0.4: resolution: {integrity: sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==} @@ -21404,91 +21404,91 @@ packages: engines: {node: '>=0.10.0'} dev: true - /react-server-dom-turbopack@0.0.0-experimental-1df34bdf62-20240605(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605): - resolution: {integrity: sha512-Cw3GcTAEkiPhzppdSdgb8iC5PxK1dhjNgVhFrfijbXQSExPCS/fMohaUymqZ+QhYss0PBuothqjBV3HvtPZQSw==} + /react-server-dom-turbopack@0.0.0-experimental-6230622a1a-20240610(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610): + resolution: {integrity: sha512-U/7v8k6XS+EPSn46S8/7igwIkNdlfLRjWOCYNxXRs1/nC/BQa/gYUti4bGrMJ7b/2h7WWIHQOdGZRxOvUKIBHg==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610 dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605(react@19.0.0-rc-1df34bdf62-20240605) + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610) dev: true - /react-server-dom-turbopack@19.0.0-rc-1df34bdf62-20240605(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605): - resolution: {integrity: sha512-lhVtmo5Eo5KCxGefWpcdsbjjadsIZXn8bl9kBrrYxmp34UShuCGoydNAO5Eg9jmQchKvcuzomKaSIQpOjzpQiA==} + /react-server-dom-turbopack@19.0.0-rc-6230622a1a-20240610(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610): + resolution: {integrity: sha512-nhNFHBAB48CMxRZWRo1yrNAbqLrOnDtE6FiSCZuMCkkyiQYtVnWWVIS06O/unlZlY72A97XQyZX9K8RYb8K3iQ==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610 dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605(react@19.0.0-rc-1df34bdf62-20240605) + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610) dev: true - /react-server-dom-webpack@0.0.0-experimental-1df34bdf62-20240605(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605)(webpack@5.90.0): - resolution: {integrity: sha512-ALhLfh1eVQcElQb3DpgF/n9CqR7ldo5QUq3i4JEgyeYKXUgpnUS2SzSRoDTXSL0E4OvublQF3tFSGnVqnOTWgw==} + /react-server-dom-webpack@0.0.0-experimental-6230622a1a-20240610(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610)(webpack@5.90.0): + resolution: {integrity: sha512-HunYxzgNQJ3QCB+wt/X1S0/jalfRWujzHZK5nn5lM72T14M+XEg0mspF55Rmm2+RDE++eFbVqiVLlwFOZ8ln3w==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610 webpack: 5.90.0 dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605(react@19.0.0-rc-1df34bdf62-20240605) + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610) webpack: 5.90.0(@swc/core@1.5.7) dev: true - /react-server-dom-webpack@19.0.0-rc-1df34bdf62-20240605(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605)(webpack@5.90.0): - resolution: {integrity: sha512-SHiKb0QVH/sCVHU1MYI0M6WsS5QqLfMXIaVYyDjptnES3JT18O5nM7LCRNqykqS7xgk2eP+IKUWNHf/Qq7AZDw==} + /react-server-dom-webpack@19.0.0-rc-6230622a1a-20240610(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610)(webpack@5.90.0): + resolution: {integrity: sha512-nr+IsOVD07QdeCr4BLvR5TALfLaZLi9AIaoa6vXymBc051iDPWedJujYYrjRJy5+9jp9oCx3G8Tt/Bs//TckJw==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610 webpack: 5.90.0 dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605(react@19.0.0-rc-1df34bdf62-20240605) + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610) webpack: 5.90.0(@swc/core@1.5.7) dev: true - /react-ssr-prepass@1.0.8(react-is@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605): + /react-ssr-prepass@1.0.8(react-is@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610): resolution: {integrity: sha512-O0gfRA1SaK+9ITKxqfnXsej2jF+OHGP/+GxD4unROQaM/0/UczGF9fuF+wTboxaQoKdIf4FvS3h/OigWh704VA==} peerDependencies: - react: 19.0.0-rc-1df34bdf62-20240605 - react-is: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 + react-is: 19.0.0-rc-6230622a1a-20240610 dependencies: object-is: 1.0.2 - react: 19.0.0-rc-1df34bdf62-20240605 - react-is: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 + react-is: 19.0.0-rc-6230622a1a-20240610 dev: true - /react-virtualized@9.22.3(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605): + /react-virtualized@9.22.3(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610): resolution: {integrity: sha512-MKovKMxWTcwPSxE1kK1HcheQTWfuCxAuBoSTf2gwyMM21NdX/PXUhnoP8Uc5dRKd+nKm8v41R36OellhdCpkrw==} peerDependencies: - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610 dependencies: '@babel/runtime': 7.22.5 clsx: 1.1.1 dom-helpers: 5.2.1 loose-envify: 1.4.0 prop-types: 15.8.1 - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605(react@19.0.0-rc-1df34bdf62-20240605) + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610) react-lifecycles-compat: 3.0.4 dev: true - /react@0.0.0-experimental-1df34bdf62-20240605: - resolution: {integrity: sha512-87pB4CziP34PuDHa7jAIDTW7CpKNDmXn85XNRJGVJf1dHCBbSRuQYKOdNGwfX55Nr5GQIwS16Ux8VsGaXmqBww==} + /react@0.0.0-experimental-6230622a1a-20240610: + resolution: {integrity: sha512-A6J2Uj5Jzgz8pLOj9qyyTEQ0v5SwyT6JASC56XxjAwbi9ckb3UwwG6lTjF+rltg4poT3fjPcPyRjd2Q4cWZy/Q==} engines: {node: '>=0.10.0'} dev: true @@ -21500,8 +21500,8 @@ packages: object-assign: 4.1.1 dev: true - /react@19.0.0-rc-1df34bdf62-20240605: - resolution: {integrity: sha512-FDsCKRtf4Ee3JzBVu2eZRHSWIV2HBFO8jcnEzhH9l2SG1ouA7pdnAxS3s/vA6EqvNOs0gPXqzqFkMJ5sbwQjIQ==} + /react@19.0.0-rc-6230622a1a-20240610: + resolution: {integrity: sha512-SMgWGY//7nO7F3HMuBfmC15Cr4vTe2tlpSCATfnz/wymSftDOKUqc+0smjRhcUeCFCc1zhOAWJ+N//U5CrmOzQ==} engines: {node: '>=0.10.0'} /read-cache@1.0.0: @@ -22505,12 +22505,12 @@ packages: xmlchars: 2.2.0 dev: true - /scheduler@0.0.0-experimental-1df34bdf62-20240605: - resolution: {integrity: sha512-j7dyetNE5KhnJkgnKY1pub6Ad9qpIaF8caYHCo6O0Y2Mu/eOMBtJIHpWe0PlH22b48G8merIec2MPpSlZ+6hZw==} + /scheduler@0.0.0-experimental-6230622a1a-20240610: + resolution: {integrity: sha512-jJZKVNvX9z+p8keIDncyZldGXNZVTBvHrBVWyJ6X9UYxZCtWgbRS0HGLXY9Doqz63wwg1SRIUX7cbgmwF30xKg==} dev: true - /scheduler@0.25.0-rc-1df34bdf62-20240605: - resolution: {integrity: sha512-MDeym3H4Wj0p9M9/68P3lr+vTiVTtBY7hy5pX0bTRvf5B6pmF2lYEBs7MrwbAJEF9NsDdjGFQViW2jv7Y8DZaQ==} + /scheduler@0.25.0-rc-6230622a1a-20240610: + resolution: {integrity: sha512-GTIQdJXthps5mgkIFo7yAq03M0QQYTfN8z+GrnMC/SCKFSuyFP5tk2BMaaWUsVy4u4r+dTLdiXH8JEivVls0Bw==} /schema-utils@2.7.1: resolution: {integrity: sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==} @@ -23532,13 +23532,13 @@ packages: dependencies: inline-style-parser: 0.1.1 - /styled-components@6.0.0-rc.3(react-dom@19.0.0-rc-1df34bdf62-20240605)(react@19.0.0-rc-1df34bdf62-20240605): + /styled-components@6.0.0-rc.3(react-dom@19.0.0-rc-6230622a1a-20240610)(react@19.0.0-rc-6230622a1a-20240610): resolution: {integrity: sha512-5FbCTxynopck99GRwM5Ey0+VRp8pkQq69TwGOJJeYtR7gPvwGjNx8yBPLN7/dfxwwvn9ymOZYB19eQkv2k70wQ==} engines: {node: '>= 16'} peerDependencies: babel-plugin-styled-components: '>= 2' - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610 peerDependenciesMeta: babel-plugin-styled-components: optional: true @@ -23556,8 +23556,8 @@ packages: '@emotion/unitless': 0.8.1 css-to-react-native: 3.2.0 postcss: 8.4.31 - react: 19.0.0-rc-1df34bdf62-20240605 - react-dom: 19.0.0-rc-1df34bdf62-20240605(react@19.0.0-rc-1df34bdf62-20240605) + react: 19.0.0-rc-6230622a1a-20240610 + react-dom: 19.0.0-rc-6230622a1a-20240610(react@19.0.0-rc-6230622a1a-20240610) shallowequal: 1.1.0 stylis: 4.2.0 tslib: 2.5.3 @@ -23572,13 +23572,13 @@ packages: postcss-load-plugins: 2.3.0 dev: true - /styled-jsx@5.1.1(@babel/core@7.22.5)(react@19.0.0-rc-1df34bdf62-20240605): + /styled-jsx@5.1.1(@babel/core@7.22.5)(react@19.0.0-rc-6230622a1a-20240610): resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} engines: {node: '>= 12.0.0'} peerDependencies: '@babel/core': '*' babel-plugin-macros: '*' - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 peerDependenciesMeta: '@babel/core': optional: true @@ -23587,16 +23587,16 @@ packages: dependencies: '@babel/core': 7.22.5 client-only: 0.0.1 - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 dev: false - /styled-jsx@5.1.6(@babel/core@7.22.5)(react@19.0.0-rc-1df34bdf62-20240605): + /styled-jsx@5.1.6(@babel/core@7.22.5)(react@19.0.0-rc-6230622a1a-20240610): resolution: {integrity: sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==} engines: {node: '>= 12.0.0'} peerDependencies: '@babel/core': '*' babel-plugin-macros: '*' - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 peerDependenciesMeta: '@babel/core': optional: true @@ -23605,7 +23605,7 @@ packages: dependencies: '@babel/core': 7.22.5 client-only: 0.0.1 - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 /stylehacks@4.0.3: resolution: {integrity: sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g==} @@ -23739,14 +23739,14 @@ packages: stable: 0.1.8 dev: true - /swr@2.2.4(react@19.0.0-rc-1df34bdf62-20240605): + /swr@2.2.4(react@19.0.0-rc-6230622a1a-20240610): resolution: {integrity: sha512-njiZ/4RiIhoOlAaLYDqwz5qH/KZXVilRLvomrx83HjzCWTfa+InyfAjv05PSFxnmLzZkNO9ZfvgoqzAaEI4sGQ==} peerDependencies: - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 dependencies: client-only: 0.0.1 - react: 19.0.0-rc-1df34bdf62-20240605 - use-sync-external-store: 1.2.0(react@19.0.0-rc-1df34bdf62-20240605) + react: 19.0.0-rc-6230622a1a-20240610 + use-sync-external-store: 1.2.0(react@19.0.0-rc-6230622a1a-20240610) dev: true /symbol-observable@1.0.1: @@ -24842,7 +24842,7 @@ packages: unist-util-is: 5.2.0 unist-util-visit-parents: 5.1.3 - /unistore@3.4.1(react@19.0.0-rc-1df34bdf62-20240605): + /unistore@3.4.1(react@19.0.0-rc-6230622a1a-20240610): resolution: {integrity: sha512-p2Ej8qqrqcD10Ah0ZUKUU/mhRB8pM4q6gzjxq9kZpgxa8dks7oHT8jDP4CqLhoRof3RXOZLKB9EBV1DTzHiJRw==} peerDependencies: preact: '*' @@ -24853,7 +24853,7 @@ packages: react: optional: true dependencies: - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 dev: true /universal-github-app-jwt@1.1.1: @@ -25008,12 +25008,12 @@ packages: engines: {node: '>= 4'} dev: true - /use-sync-external-store@1.2.0(react@19.0.0-rc-1df34bdf62-20240605): + /use-sync-external-store@1.2.0(react@19.0.0-rc-6230622a1a-20240610): resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} peerDependencies: - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 dependencies: - react: 19.0.0-rc-1df34bdf62-20240605 + react: 19.0.0-rc-6230622a1a-20240610 dev: true /use@3.1.1: @@ -25890,8 +25890,8 @@ packages: /zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} - '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240607.3': - resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240607.3} + '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240610.2': + resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240610.2} name: '@vercel/turbopack-ecmascript-runtime' version: 0.0.0 dependencies: diff --git a/run-tests.js b/run-tests.js index 32f532d4cdfdf..98dd35e5de120 100644 --- a/run-tests.js +++ b/run-tests.js @@ -405,8 +405,7 @@ ${ENDGROUP}`) // a starter Next.js install to re-use to speed up tests // to avoid having to run yarn each time console.log(`${GROUP}Creating Next.js install for isolated tests`) - const reactVersion = - process.env.NEXT_TEST_REACT_VERSION || '19.0.0-rc-f994737d14-20240522' + const reactVersion = process.env.NEXT_TEST_REACT_VERSION || '19.0.0-rc.0' const { installDir, pkgPaths, tmpRepoDir } = await createNextInstall({ parentSpan: mockTrace(), dependencies: { diff --git a/scripts/pull-turbo-cache.js b/scripts/pull-turbo-cache.js index fa7e9a06e6f28..9a49d845956c6 100644 --- a/scripts/pull-turbo-cache.js +++ b/scripts/pull-turbo-cache.js @@ -17,7 +17,12 @@ const { spawn } = require('child_process') } ) + child.stderr.on('data', (data) => { + process.stderr.write(data) + }) + child.stdout.on('data', (data) => { + process.stdout.write(data) turboResult += data.toString() }) diff --git a/test/.stats-app/package.json b/test/.stats-app/package.json index e85c3567f8205..12142589b0134 100644 --- a/test/.stats-app/package.json +++ b/test/.stats-app/package.json @@ -3,9 +3,9 @@ "private": true, "license": "MIT", "dependencies": { - "next": "19.0.0-rc-1df34bdf62-20240605", - "react": "19.0.0-rc-1df34bdf62-20240605", - "react-dom": "19.0.0-rc-1df34bdf62-20240605" + "next": "19.0.0-rc-6230622a1a-20240610", + "react": "19.0.0-rc-6230622a1a-20240610", + "react-dom": "19.0.0-rc-6230622a1a-20240610" }, "engines": { "node": ">=18.17.0", diff --git a/test/development/acceptance-app/dynamic-metadata-error.test.ts b/test/development/acceptance-app/dynamic-metadata-error.test.ts index 4c478d31d442b..abbaad9051dba 100644 --- a/test/development/acceptance-app/dynamic-metadata-error.test.ts +++ b/test/development/acceptance-app/dynamic-metadata-error.test.ts @@ -71,7 +71,7 @@ describe('dynamic metadata error', () => { const { cleanup } = await sandbox( next, new Map([[sitemapFilePath, contentMissingIdProperty]]), - '/metadata-base/unset/sitemap/100' + '/metadata-base/unset/sitemap/100.xml' ) await retry(async () => { diff --git a/test/development/middleware-errors/index.test.ts b/test/development/middleware-errors/index.test.ts index feb4c824f2bc5..ae37479743dd6 100644 --- a/test/development/middleware-errors/index.test.ts +++ b/test/development/middleware-errors/index.test.ts @@ -107,7 +107,7 @@ describe('middleware - development errors', () => { it('logs the error correctly', async () => { await next.fetch('/') - const output = stripAnsi(next.cliOutput) + // const output = stripAnsi(next.cliOutput) await check(() => { expect(stripAnsi(next.cliOutput)).toMatch( /middleware.js \(\d+:\d+\) @ eval/ @@ -115,9 +115,9 @@ describe('middleware - development errors', () => { expect(stripAnsi(next.cliOutput)).toMatch(/test is not defined/) return 'success' }, 'success') - expect(output).not.toContain( - 'webpack-internal:///(middleware)/./middleware.js' - ) + // expect(output).not.toContain( + // 'webpack-internal:///(middleware)/./middleware.js' + // ) }) it('renders the error correctly and recovers', async () => { diff --git a/test/e2e/app-dir/app-routes-client-component/app-routes-client-component.test.ts b/test/e2e/app-dir/app-routes-client-component/app-routes-client-component.test.ts index b0a5079ac0a64..a98b19ff6eb37 100644 --- a/test/e2e/app-dir/app-routes-client-component/app-routes-client-component.test.ts +++ b/test/e2e/app-dir/app-routes-client-component/app-routes-client-component.test.ts @@ -1,14 +1,16 @@ -import { nextTestSetup } from 'e2e-utils' +import { FileRef, nextTestSetup } from 'e2e-utils' +import path from 'path' describe('referencing a client component in an app route', () => { const { next } = nextTestSetup({ - files: __dirname, + files: new FileRef(path.join(__dirname)), }) it('responds without error', async () => { expect(JSON.parse(await next.render('/runtime'))).toEqual({ - clientComponent: 'function', - myModuleClientComponent: 'function', + // Turbopack's proxy components are functions + clientComponent: process.env.TURBOPACK ? 'function' : 'object', + myModuleClientComponent: process.env.TURBOPACK ? 'function' : 'object', }) }) }) diff --git a/test/e2e/app-dir/app/index.test.ts b/test/e2e/app-dir/app/index.test.ts index 40e0796506f2d..e1a9aa85701f0 100644 --- a/test/e2e/app-dir/app/index.test.ts +++ b/test/e2e/app-dir/app/index.test.ts @@ -9,32 +9,16 @@ import stripAnsi from 'strip-ansi' const isPPREnabledByDefault = process.env.__NEXT_EXPERIMENTAL_PPR === 'true' describe('app dir - basic', () => { - const { - next, - isNextDev: isDev, - isNextStart, - isNextDeploy, - isTurbopack, - } = nextTestSetup({ - files: __dirname, - buildCommand: process.env.NEXT_EXPERIMENTAL_COMPILE - ? `pnpm next build --experimental-build-mode=compile` - : undefined, - dependencies: { - nanoid: '4.0.1', - }, - }) - - if (isDev && isPPREnabledByDefault) { - it('should allow returning just skeleton in dev with query', async () => { - const res = await next.fetch('/skeleton?__nextppronly=1') - expect(res.status).toBe(200) - - const html = await res.text() - expect(html).toContain('Skeleton') - expect(html).not.toContain('suspended content') + const { next, isNextDev, isNextStart, isNextDeploy, isTurbopack } = + nextTestSetup({ + files: __dirname, + buildCommand: process.env.NEXT_EXPERIMENTAL_COMPILE + ? `pnpm next build --experimental-build-mode=compile` + : undefined, + dependencies: { + nanoid: '4.0.1', + }, }) - } if (process.env.NEXT_EXPERIMENTAL_COMPILE) { it('should provide query for getStaticProps page correctly', async () => { @@ -142,7 +126,7 @@ describe('app dir - basic', () => { }) }) - if (!isDev) { + if (!isNextDev) { it('should successfully detect app route during prefetch', async () => { const browser = await next.browser('/') @@ -229,7 +213,7 @@ describe('app dir - basic', () => { expect(await browser.eval('window.beforeNav')).toBe(1) }) - if (isDev) { + if (isNextDev) { it('should not have duplicate config warnings', async () => { await next.fetch('/') expect( @@ -573,7 +557,7 @@ describe('app dir - basic', () => { }) // TODO-APP: Enable in development - ;(isDev || + ;(isNextDev || // When PPR is enabled, the shared layouts re-render because we prefetch // from the root. This will be addressed before GA. isPPREnabledByDefault @@ -1148,7 +1132,7 @@ describe('app dir - basic', () => { }) }) - if (isDev) { + if (isNextDev) { describe('HMR', () => { it('should HMR correctly for server component', async () => { const filePath = 'app/dashboard/index/page.js' @@ -1368,7 +1352,7 @@ describe('app dir - basic', () => { }) // TODO-APP: disable failing test and investigate later - ;(isDev || + ;(isNextDev || // When PPR is enabled, the shared layouts re-render because we prefetch // from the root. This will be addressed before GA. isPPREnabledByDefault @@ -1508,7 +1492,7 @@ describe('app dir - basic', () => { const val2 = await browser.elementByCss('#value-2').text() // TODO: enable when fetch cache is enabled in dev - if (!isDev) { + if (!isNextDev) { expect(val1).toBe(val2) } }) @@ -1701,7 +1685,7 @@ describe('app dir - basic', () => { expect(element.attribs.nonce).toBeTruthy() }) - if (!isDev) { + if (!isNextDev) { const browser = await next.browser('/script-nonce') await retry(async () => { @@ -1744,7 +1728,7 @@ describe('app dir - basic', () => { }) // Turbopack doesn't use eval by default, so we can check strict CSP. - if (!isDev || isTurbopack) { + if (!isNextDev || isTurbopack) { // This test is here to ensure that we don't accidentally turn CSP off // for the prod version. it('should successfully bootstrap even when using CSP', async () => { diff --git a/test/e2e/app-dir/dynamic-in-generate-params/index.test.ts b/test/e2e/app-dir/dynamic-in-generate-params/index.test.ts index d43ffdf9fad4b..14f2d55395da1 100644 --- a/test/e2e/app-dir/dynamic-in-generate-params/index.test.ts +++ b/test/e2e/app-dir/dynamic-in-generate-params/index.test.ts @@ -18,15 +18,15 @@ describe('app-dir - dynamic in generate params', () => { }) it('should render sitemap with generateSitemaps in force-dynamic config dynamically', async () => { - const firstTime = await getLastModifiedTime(next, 'sitemap/0') - const secondTime = await getLastModifiedTime(next, 'sitemap/0') + const firstTime = await getLastModifiedTime(next, 'sitemap/0.xml') + const secondTime = await getLastModifiedTime(next, 'sitemap/0.xml') expect(firstTime).not.toEqual(secondTime) }) it('should be able to call while generating multiple dynamic sitemaps', async () => { - const res0 = await next.fetch('sitemap/0') - const res1 = await next.fetch('sitemap/1') + const res0 = await next.fetch('sitemap/0.xml') + const res1 = await next.fetch('sitemap/1.xml') assertSitemapResponse(res0) assertSitemapResponse(res1) }) diff --git a/test/e2e/app-dir/dynamic/app/dynamic/named-export/page.js b/test/e2e/app-dir/dynamic/app/dynamic/named-export/page.js index 3285b72c5f559..b767273ab6077 100644 --- a/test/e2e/app-dir/dynamic/app/dynamic/named-export/page.js +++ b/test/e2e/app-dir/dynamic/app/dynamic/named-export/page.js @@ -2,7 +2,7 @@ import dynamic from 'next/dynamic' const Button = dynamic(() => import('./client').then((mod) => { - return { default: mod.Button } + return mod.Button }) ) diff --git a/test/e2e/app-dir/logging/fetch-logging.test.ts b/test/e2e/app-dir/logging/fetch-logging.test.ts index 05076470055f8..04df20d2699dd 100644 --- a/test/e2e/app-dir/logging/fetch-logging.test.ts +++ b/test/e2e/app-dir/logging/fetch-logging.test.ts @@ -225,7 +225,7 @@ describe('app-dir - logging', () => { const output = stripAnsi(next.cliOutput.slice(logLength)) expect(output).toContain('/dynamic/[slug]/icon') expect(output).not.toContain('/(group)') - expect(output).not.toContain('[[...__metadata_id__]]') + expect(output).not.toContain('[__metadata_id__]') expect(output).not.toContain('/route') }) }) diff --git a/test/e2e/app-dir/metadata-dynamic-routes/app/gsp/icon.tsx b/test/e2e/app-dir/metadata-dynamic-routes/app/gsp/icon.tsx new file mode 100644 index 0000000000000..11c40f86bc1f0 --- /dev/null +++ b/test/e2e/app-dir/metadata-dynamic-routes/app/gsp/icon.tsx @@ -0,0 +1,37 @@ +import { ImageResponse } from 'next/og' + +export async function generateImageMetadata({ params }) { + return [ + { + contentType: 'image/png', + size: { width: 48, height: 48 }, + id: 'small', + }, + { + contentType: 'image/png', + size: { width: 72, height: 72 }, + id: 'medium', + }, + ] +} + +export default function icon({ params, id }) { + return new ImageResponse( + ( +

+ Icon {params.size} {id} +
+ ) + ) +} diff --git a/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts b/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts index 9e66abed21d09..2dca3ba618dbc 100644 --- a/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts +++ b/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts @@ -44,7 +44,7 @@ describe('app dir - metadata dynamic routes', () => { describe('sitemap', () => { it('should handle sitemap.[ext] dynamic routes', async () => { - const res = await next.fetch('/sitemap') + const res = await next.fetch('/sitemap.xml') const text = await res.text() expect(res.headers.get('content-type')).toBe('application/xml') @@ -70,23 +70,30 @@ describe('app dir - metadata dynamic routes', () => { it('should support generate multi sitemaps with generateSitemaps', async () => { const ids = ['child0', 'child1', 'child2', 'child3'] - function fetchSitemap(id) { - return next.fetch(`/gsp/sitemap/${id}`).then((res) => res.text()) + function fetchSitemap(id, withExtension) { + return next.fetch(`/gsp/sitemap/${id}${withExtension ? `.xml` : ''}`) } + // Required to have .xml extension for dynamic sitemap for (const id of ids) { - const text = await fetchSitemap(id) + const text = await fetchSitemap(id, true).then((res) => res.text()) expect(text).toContain(`https://example.com/dynamic/${id}`) } + + // Should 404 when missing .xml extension + for (const id of ids) { + const { status } = await fetchSitemap(id, false) + expect(status).toBe(404) + } }) it('should not throw if client components are imported but not used in sitemap', async () => { - const { status } = await next.fetch('/client-ref-dependency/sitemap') + const { status } = await next.fetch('/client-ref-dependency/sitemap.xml') expect(status).toBe(200) }) it('should support alternate.languages in sitemap', async () => { - const xml = await (await next.fetch('/lang/sitemap')).text() + const xml = await (await next.fetch('/lang/sitemap.xml')).text() expect(xml).toContain('xmlns:xhtml="http://www.w3.org/1999/xhtml') expect(xml).toContain( @@ -105,19 +112,19 @@ describe('app dir - metadata dynamic routes', () => { expect(appPathsManifest).toMatchObject({ // static routes '/twitter-image/route': 'app/twitter-image/route.js', - '/sitemap/route': 'app/sitemap/route.js', + '/sitemap.xml/route': 'app/sitemap.xml/route.js', // dynamic '/gsp/sitemap/[__metadata_id__]/route': 'app/gsp/sitemap/[__metadata_id__]/route.js', - '/(group)/dynamic/[size]/apple-icon-ahg52g/[[...__metadata_id__]]/route': - 'app/(group)/dynamic/[size]/apple-icon-ahg52g/[[...__metadata_id__]]/route.js', + '/(group)/dynamic/[size]/apple-icon-ahg52g/[__metadata_id__]/route': + 'app/(group)/dynamic/[size]/apple-icon-ahg52g/[__metadata_id__]/route.js', }) }) it('should generate static paths of dynamic sitemap in production', async () => { const sitemapPaths = ['child0', 'child1', 'child2', 'child3'].map( - (id) => `.next/server/app/gsp/sitemap/${id}.meta` + (id) => `.next/server/app/gsp/sitemap/${id}.xml.meta` ) const promises = sitemapPaths.map(async (filePath) => { expect(await next.hasFile(filePath)).toBe(true) @@ -183,9 +190,7 @@ describe('app dir - metadata dynamic routes', () => { const entryKeys = Object.keys(appPathsManifest) // Only has one route for twitter-image with catch-all routes in dev expect(entryKeys).not.toContain('/twitter-image') - expect(entryKeys).toContain( - '/twitter-image/[[...__metadata_id__]]/route' - ) + expect(entryKeys).toContain('/twitter-image/route') } // edge runtime @@ -316,7 +321,7 @@ describe('app dir - metadata dynamic routes', () => { if (isNextStart) { describe('route segment config', () => { it('should generate dynamic route if dynamic config is force-dynamic', async () => { - const dynamicRoute = '/route-config/sitemap' + const dynamicRoute = '/route-config/sitemap.xml' expect( await next.hasFile(`.next/server/app${dynamicRoute}/route.js`) @@ -453,7 +458,7 @@ describe('app dir - metadata dynamic routes', () => { it('should include default og font files in file trace', async () => { const fileTrace = JSON.parse( await next.readFile( - '.next/server/app/metadata-base/unset/opengraph-image2/[[...__metadata_id__]]/route.js.nft.json' + '.next/server/app/metadata-base/unset/opengraph-image2/[__metadata_id__]/route.js.nft.json' ) ) @@ -463,5 +468,15 @@ describe('app dir - metadata dynamic routes', () => { ) expect(isTraced).toBe(true) }) + + it('should statically optimized single image route', async () => { + const prerenderManifest = JSON.parse( + await next.readFile('.next/prerender-manifest.json') + ) + const dynamicRoutes = Object.keys(prerenderManifest.routes) + expect(dynamicRoutes).toContain('/opengraph-image') + expect(dynamicRoutes).toContain('/opengraph-image-1ow20b') + expect(dynamicRoutes).toContain('/apple-icon') + }) } }) diff --git a/test/e2e/app-dir/metadata/metadata.test.ts b/test/e2e/app-dir/metadata/metadata.test.ts index f03f72937d385..8b63a5f15da04 100644 --- a/test/e2e/app-dir/metadata/metadata.test.ts +++ b/test/e2e/app-dir/metadata/metadata.test.ts @@ -958,7 +958,7 @@ describe('app dir - metadata', () => { ).toBe(true) expect( await next.hasFile( - '.next/server/app/opengraph/static/opengraph-image.png/[[...__metadata_id__]]/route.js' + '.next/server/app/opengraph/static/opengraph-image.png/[__metadata_id__]/route.js' ) ).toBe(false) }) diff --git a/test/e2e/app-dir/static-shell-debugging/app/layout.jsx b/test/e2e/app-dir/static-shell-debugging/app/layout.jsx new file mode 100644 index 0000000000000..750eb927b1980 --- /dev/null +++ b/test/e2e/app-dir/static-shell-debugging/app/layout.jsx @@ -0,0 +1,7 @@ +export default function Layout({ children }) { + return ( + + {children} + + ) +} diff --git a/test/e2e/app-dir/static-shell-debugging/app/page.jsx b/test/e2e/app-dir/static-shell-debugging/app/page.jsx new file mode 100644 index 0000000000000..f7efe39b6fd9c --- /dev/null +++ b/test/e2e/app-dir/static-shell-debugging/app/page.jsx @@ -0,0 +1,17 @@ +import { unstable_noStore } from 'next/cache' +import { Suspense } from 'react' + +function Dynamic() { + unstable_noStore() + return
Dynamic
+} + +export default function Page() { + return ( +
+ Fallback
}> + + + + ) +} diff --git a/test/e2e/app-dir/static-shell-debugging/static-shell-debugging.test.ts b/test/e2e/app-dir/static-shell-debugging/static-shell-debugging.test.ts new file mode 100644 index 0000000000000..438f371a53777 --- /dev/null +++ b/test/e2e/app-dir/static-shell-debugging/static-shell-debugging.test.ts @@ -0,0 +1,40 @@ +import { nextTestSetup } from 'e2e-utils' + +describe('static-shell-debugging', () => { + describe.each([ + { ppr: true, debugging: true }, + { ppr: false, debugging: true }, + { ppr: true, debugging: false }, + { ppr: false, debugging: false }, + ])('ppr = $ppr, debugging = $debugging', (context) => { + const { next } = nextTestSetup({ + files: __dirname, + env: { + __NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING: context.debugging + ? '1' + : undefined, + }, + nextConfig: { experimental: { ppr: context.ppr } }, + }) + + if (context.debugging && context.ppr) { + it('should only render the static shell', async () => { + const res = await next.fetch('/?__nextppronly=1') + expect(res.status).toBe(200) + + const html = await res.text() + expect(html).toContain('Fallback') + expect(html).not.toContain('Dynamic') + }) + } else { + it('should render the full page', async () => { + const res = await next.fetch('/?__nextppronly=1') + expect(res.status).toBe(200) + + const html = await res.text() + expect(html).toContain('Fallback') + expect(html).toContain('Dynamic') + }) + } + }) +}) diff --git a/test/e2e/fetch-failures-have-good-stack-traces-in-edge-runtime/fetch-failures-have-good-stack-traces-in-edge-runtime.test.ts b/test/e2e/fetch-failures-have-good-stack-traces-in-edge-runtime/fetch-failures-have-good-stack-traces-in-edge-runtime.test.ts index b37af4f53343d..22aa7dad2cb82 100644 --- a/test/e2e/fetch-failures-have-good-stack-traces-in-edge-runtime/fetch-failures-have-good-stack-traces-in-edge-runtime.test.ts +++ b/test/e2e/fetch-failures-have-good-stack-traces-in-edge-runtime/fetch-failures-have-good-stack-traces-in-edge-runtime.test.ts @@ -41,18 +41,10 @@ describe('fetch failures have good stack traces in edge runtime', () => { it('when returning `fetch` using an unknown domain, stack traces are preserved', async () => { await webdriver(next.url, '/api/unknown-domain-no-await') - if (process.env.TURBOPACK) { - // pages_api_unknown-domain-no-await_d8c7f5.js:14:5 - await check( - () => stripAnsi(next.cliOutput), - /pages_api_unknown-domain-no-await_.*?\.js/ - ) - } else { - // webpack-internal:///(middleware)/./pages/api/unknown-domain-no-await.js:10:5 - await check( - () => stripAnsi(next.cliOutput), - /at.+\/pages\/api\/unknown-domain-no-await.js/ - ) - } + // TODO: turbopack needs to have its source maps picked up by node.js + await check( + () => stripAnsi(next.cliOutput), + /at.+\/pages\/api\/unknown-domain-no-await.js/ + ) }) }) diff --git a/test/integration/edge-runtime-module-errors/test/module-imports.test.js b/test/integration/edge-runtime-module-errors/test/module-imports.test.js index ec253989ccf1e..136cf33fd629e 100644 --- a/test/integration/edge-runtime-module-errors/test/module-imports.test.js +++ b/test/integration/edge-runtime-module-errors/test/module-imports.test.js @@ -21,6 +21,7 @@ import { expectUnsupportedModuleDevError, expectUnsupportedModuleProdError, getUnsupportedModuleWarning, + getModuleNotFound, } from './utils' jest.setTimeout(1000 * 60 * 2) @@ -296,14 +297,29 @@ describe('Edge runtime code with imports', () => { stderr: true, }) expect(stderr).toContain(getUnsupportedModuleWarning(moduleName)) - context.app = await nextStart( - context.appDir, - context.appPort, - appOption - ) - const res = await fetchViaHTTP(context.appPort, url) + + let logs = { stdout: '', stderr: '' } + const port = await findPort() + + const options = { + onStdout(msg) { + logs.output += msg + logs.stdout += msg + }, + onStderr(msg) { + logs.output += msg + logs.stderr += msg + }, + } + + await nextStart(context.appDir, port, options) + const res = await fetchViaHTTP(port, url) expect(res.status).toBe(200) - expectNoError(moduleName) + + expect(logs.output).not.toContain( + getUnsupportedModuleWarning(moduleName) + ) + expect(logs.output).not.toContain(getModuleNotFound(moduleName)) }) } ) diff --git a/test/integration/externals-pages-bundle/test/externals.test.js b/test/integration/externals-pages-bundle/test/externals.test.js index 2b698534e4166..0fc7b89cd865e 100644 --- a/test/integration/externals-pages-bundle/test/externals.test.js +++ b/test/integration/externals-pages-bundle/test/externals.test.js @@ -32,7 +32,7 @@ describe('default', () => { allBundles += output } expect(allBundles).toContain( - '__turbopack_external_require__("external-package", true)' + '__turbopack_external_require__("external-package")' ) } else { const output = await fs.readFile( diff --git a/test/integration/externals-pages-bundle/test/index.test.js b/test/integration/externals-pages-bundle/test/index.test.js index cd0ee2f1c4eec..b7f1e75e9ddac 100644 --- a/test/integration/externals-pages-bundle/test/index.test.js +++ b/test/integration/externals-pages-bundle/test/index.test.js @@ -28,7 +28,9 @@ describe('bundle pages externals with config.bundlePagesRouterDependencies', () } // we don't know the name of the minified `__turbopack_external_require__`, so we just check the arguments. - expect(allBundles).not.toContain('("external-package",!0)') + expect(allBundles).not.toContain( + '"[externals]/ [external] (external-package, cjs)"' + ) } else { const output = await fs.readFile( join(appDir, '.next/server/pages/index.js'), @@ -52,7 +54,9 @@ describe('bundle pages externals with config.bundlePagesRouterDependencies', () } // we don't know the name of the minified `__turbopack_external_require__`, so we just check the arguments. - expect(allBundles).toContain('("opted-out-external-package",!0)') + expect(allBundles).toContain( + '"[externals]/ [external] (opted-out-external-package, cjs)"' + ) } else { const output = await fs.readFile( join(appDir, '.next/server/pages/index.js'), diff --git a/test/integration/not-found-revalidate/pages/404.js b/test/integration/not-found-revalidate/pages/404.js index cb670e86b596c..6c4da3942ca80 100644 --- a/test/integration/not-found-revalidate/pages/404.js +++ b/test/integration/not-found-revalidate/pages/404.js @@ -14,6 +14,6 @@ export const getStaticProps = () => { notFound: true, random: Math.random(), }, - revalidate: 1, + revalidate: 6000, } } diff --git a/test/integration/not-found-revalidate/test/index.test.js b/test/integration/not-found-revalidate/test/index.test.js index 2f2928961429b..98ff9ea8be548 100644 --- a/test/integration/not-found-revalidate/test/index.test.js +++ b/test/integration/not-found-revalidate/test/index.test.js @@ -81,9 +81,9 @@ const runTests = () => { let res = await fetchViaHTTP(appPort, '/fallback-blocking/hello') let $ = cheerio.load(await res.text()) - const privateCache = - 'private, no-cache, no-store, max-age=0, must-revalidate' - expect(res.headers.get('cache-control')).toBe(privateCache) + expect(res.headers.get('cache-control')).toBe( + `s-maxage=1, stale-while-revalidate` + ) expect(res.status).toBe(404) expect(JSON.parse($('#props').text()).notFound).toBe(true) @@ -91,7 +91,9 @@ const runTests = () => { res = await fetchViaHTTP(appPort, '/fallback-blocking/hello') $ = cheerio.load(await res.text()) - expect(res.headers.get('cache-control')).toBe(privateCache) + expect(res.headers.get('cache-control')).toBe( + `s-maxage=1, stale-while-revalidate` + ) expect(res.status).toBe(404) expect(JSON.parse($('#props').text()).notFound).toBe(true) @@ -146,7 +148,7 @@ const runTests = () => { let $ = cheerio.load(await res.text()) expect(res.headers.get('cache-control')).toBe( - 'private, no-cache, no-store, max-age=0, must-revalidate' + `s-maxage=1, stale-while-revalidate` ) expect(res.status).toBe(404) expect(JSON.parse($('#props').text()).notFound).toBe(true) diff --git a/test/ppr-tests-manifest.json b/test/ppr-tests-manifest.json index d3f170e5f5ea3..19db3c4177518 100644 --- a/test/ppr-tests-manifest.json +++ b/test/ppr-tests-manifest.json @@ -1,6 +1,17 @@ { "version": 2, "suites": { + "test/production/app-dir/fetch-cache/fetch-cache.test.ts": { + "passed": [], + "failed": [ + "fetch-cache should have correct fetchUrl field for fetches and unstable_cache", + "fetch-cache should retry 3 times when revalidate times out", + "fetch-cache should not retry for failed fetch-cache GET" + ], + "pending": [], + "flakey": [], + "runtimeError": false + }, "test/e2e/app-dir/app-static/app-static.test.ts": { "failed": [ "app-dir static/dynamic handling usePathname should have values from canonical url on rewrite", diff --git a/test/production/app-dir/fetch-cache/app/api/revalidate/route.ts b/test/production/app-dir/fetch-cache/app/api/revalidate/route.ts new file mode 100644 index 0000000000000..3f8985e20754e --- /dev/null +++ b/test/production/app-dir/fetch-cache/app/api/revalidate/route.ts @@ -0,0 +1,9 @@ +import { revalidateTag } from 'next/cache' +import { NextRequest, NextResponse } from 'next/server' + +export const dynamic = 'force-dynamic' + +export function GET(req: NextRequest) { + revalidateTag('thankyounext') + return NextResponse.json({ done: true }) +} diff --git a/test/production/app-dir/fetch-cache/app/layout.tsx b/test/production/app-dir/fetch-cache/app/layout.tsx new file mode 100644 index 0000000000000..888614deda3ba --- /dev/null +++ b/test/production/app-dir/fetch-cache/app/layout.tsx @@ -0,0 +1,8 @@ +import { ReactNode } from 'react' +export default function Root({ children }: { children: ReactNode }) { + return ( + + {children} + + ) +} diff --git a/test/production/app-dir/fetch-cache/app/page.tsx b/test/production/app-dir/fetch-cache/app/page.tsx new file mode 100644 index 0000000000000..40db1a33422ff --- /dev/null +++ b/test/production/app-dir/fetch-cache/app/page.tsx @@ -0,0 +1,32 @@ +import { unstable_cache } from 'next/cache' + +export const dynamic = 'force-dynamic' +export const fetchCache = 'default-cache' + +const getCachedRandom = unstable_cache( + async () => { + return Math.random() + }, + [], + { + revalidate: 3, + tags: ['thankyounext'], + } +) + +export default async function Page() { + const data = await fetch( + 'https://next-data-api-endpoint.vercel.app/api/random?a=b', + { next: { tags: ['thankyounext'], revalidate: 3 } } + ).then((res) => res.text()) + + const cachedRandom = getCachedRandom() + + return ( + <> +

hello world

+

{data}

+

{cachedRandom}

+ + ) +} diff --git a/test/production/app-dir/fetch-cache/fetch-cache.test.ts b/test/production/app-dir/fetch-cache/fetch-cache.test.ts new file mode 100644 index 0000000000000..972e8ef280076 --- /dev/null +++ b/test/production/app-dir/fetch-cache/fetch-cache.test.ts @@ -0,0 +1,240 @@ +import glob from 'glob' +import http from 'http' +import fs from 'fs-extra' +import { join } from 'path' +import { FileRef, NextInstance, createNext } from 'e2e-utils' +import { + retry, + killApp, + findPort, + fetchViaHTTP, + initNextServerScript, +} from 'next-test-utils' + +describe('fetch-cache', () => { + let next: NextInstance + let appPort: any + let cliOuptut = '' + let nextInstance: any + let fetchGetReqIndex = 0 + let revalidateReqIndex = 0 + let fetchGetShouldError = false + let fetchCacheServer: http.Server + let fetchCacheRequests: Array<{ + url: string + method: string + headers: Record + }> = [] + let fetchCacheEnv: Record = { + SUSPENSE_CACHE_PROTO: 'http', + } + + const setupNext = async ({ + nextEnv, + minimalMode, + }: { + nextEnv?: boolean + minimalMode?: boolean + }) => { + // test build against environment with next support + process.env.NOW_BUILDER = nextEnv ? '1' : '' + + next = await createNext({ + files: { + app: new FileRef(join(__dirname, 'app')), + }, + nextConfig: { + eslint: { + ignoreDuringBuilds: true, + }, + output: 'standalone', + }, + }) + await next.stop() + + await fs.move( + join(next.testDir, '.next/standalone'), + join(next.testDir, 'standalone') + ) + for (const file of await fs.readdir(next.testDir)) { + if (file !== 'standalone') { + await fs.remove(join(next.testDir, file)) + console.log('removed', file) + } + } + const files = glob.sync('**/*', { + cwd: join(next.testDir, 'standalone/.next/server/pages'), + dot: true, + }) + + for (const file of files) { + if (file.endsWith('.json') || file.endsWith('.html')) { + await fs.remove(join(next.testDir, '.next/server', file)) + } + } + + const testServer = join(next.testDir, 'standalone/server.js') + await fs.writeFile( + testServer, + (await fs.readFile(testServer, 'utf8')).replace( + 'port:', + `minimalMode: ${minimalMode},port:` + ) + ) + appPort = await findPort() + nextInstance = await initNextServerScript( + testServer, + /- Local:/, + { + ...process.env, + ...fetchCacheEnv, + PORT: appPort, + }, + undefined, + { + cwd: next.testDir, + onStderr(data) { + cliOuptut += data + }, + onStdout(data) { + cliOuptut += data + }, + } + ) + } + + beforeAll(async () => { + fetchGetReqIndex = 0 + revalidateReqIndex = 0 + fetchCacheRequests = [] + fetchGetShouldError = false + fetchCacheServer = http.createServer((req, res) => { + console.log(`fetch cache request ${req.url} ${req.method}`, req.headers) + const parsedUrl = new URL(req.url || '/', 'http://n') + + fetchCacheRequests.push({ + url: req.url, + method: req.method?.toLowerCase(), + headers: req.headers, + }) + + if (parsedUrl.pathname === '/v1/suspense-cache/revalidate') { + revalidateReqIndex += 1 + // timeout unless it's 3rd retry + const shouldTimeout = revalidateReqIndex % 3 !== 0 + + if (shouldTimeout) { + console.log('not responding for', req.url, { revalidateReqIndex }) + return + } + res.statusCode = 200 + res.end(`revalidated ${parsedUrl.searchParams.get('tags')}`) + return + } + const keyMatches = parsedUrl.pathname.match( + /\/v1\/suspense-cache\/(.*?)\/?$/ + ) + const key = keyMatches?.[0] + + if (key) { + const type = req.method?.toLowerCase() + console.log(`got ${type} for ${key}`) + + if (type === 'get') { + fetchGetReqIndex += 1 + + if (fetchGetShouldError) { + res.statusCode = 500 + res.end('internal server error') + return + } + } + res.statusCode = type === 'post' ? 200 : 404 + res.end(`${type} for ${key}`) + return + } + res.statusCode = 404 + res.end('not found') + }) + await new Promise(async (resolve) => { + let fetchCachePort = await findPort() + fetchCacheServer.listen(fetchCachePort, () => { + fetchCacheEnv['SUSPENSE_CACHE_URL'] = `[::]:${fetchCachePort}` + console.log( + `Started fetch cache server at http://${fetchCacheEnv['SUSPENSE_CACHE_URL']}` + ) + resolve() + }) + }) + await setupNext({ nextEnv: true, minimalMode: true }) + }) + afterAll(async () => { + await next.destroy() + if (fetchCacheServer) fetchCacheServer.close() + if (nextInstance) await killApp(nextInstance) + }) + + it('should have correct fetchUrl field for fetches and unstable_cache', async () => { + const res = await fetchViaHTTP(appPort, '/?myKey=myValue') + const html = await res.text() + + expect(res.status).toBe(200) + expect(html).toContain('hello world') + + const fetchUrlHeader = 'x-vercel-cache-item-name' + const fetchTagsHeader = 'x-vercel-cache-tags' + const fetchSoftTagsHeader = 'x-next-cache-soft-tags' + const unstableCacheSet = fetchCacheRequests.find((item) => { + return ( + item.method === 'get' && + item.headers[fetchUrlHeader]?.includes('unstable_cache') + ) + }) + const fetchSet = fetchCacheRequests.find((item) => { + return ( + item.method === 'get' && + item.headers[fetchUrlHeader]?.includes('next-data-api-endpoint') + ) + }) + + expect(unstableCacheSet.headers[fetchUrlHeader]).toMatch( + /unstable_cache \/\?myKey=myValue .*?/ + ) + expect(unstableCacheSet.headers[fetchTagsHeader]).toBe('thankyounext') + expect(unstableCacheSet.headers[fetchSoftTagsHeader]).toBe( + '_N_T_/layout,_N_T_/page,_N_T_/' + ) + expect(fetchSet.headers[fetchUrlHeader]).toBe( + 'https://next-data-api-endpoint.vercel.app/api/random?a=b' + ) + expect(fetchSet.headers[fetchSoftTagsHeader]).toBe( + '_N_T_/layout,_N_T_/page,_N_T_/' + ) + expect(fetchSet.headers[fetchTagsHeader]).toBe('thankyounext') + }) + + it('should retry 3 times when revalidate times out', async () => { + await fetchViaHTTP(appPort, '/api/revalidate') + + await retry(() => { + expect(revalidateReqIndex).toBe(3) + }) + expect(cliOuptut).not.toContain('Failed to revalidate') + expect(cliOuptut).not.toContain('Error') + }) + + it('should not retry for failed fetch-cache GET', async () => { + fetchGetShouldError = true + const fetchGetReqIndexStart = fetchGetReqIndex + + try { + await fetchViaHTTP(appPort, '/api/revalidate') + const res = await fetchViaHTTP(appPort, '/') + expect(res.status).toBe(200) + expect(await res.text()).toContain('hello world') + expect(fetchGetReqIndex).toBe(fetchGetReqIndexStart + 2) + } finally { + fetchGetShouldError = false + } + }) +}) diff --git a/test/production/app-dir/metadata-static-route-cache/app/favicon.ico b/test/production/app-dir/metadata-static-route-cache/app/favicon.ico new file mode 100644 index 0000000000000..24591070884d9 Binary files /dev/null and b/test/production/app-dir/metadata-static-route-cache/app/favicon.ico differ diff --git a/test/production/app-dir/metadata-static-route-cache/app/favicon.ico.new b/test/production/app-dir/metadata-static-route-cache/app/favicon.ico.new new file mode 100644 index 0000000000000..82339b3b1dbbc Binary files /dev/null and b/test/production/app-dir/metadata-static-route-cache/app/favicon.ico.new differ diff --git a/test/production/app-dir/metadata-static-route-cache/app/opengraph-image.png b/test/production/app-dir/metadata-static-route-cache/app/opengraph-image.png new file mode 100644 index 0000000000000..e14fafc5cf3bc Binary files /dev/null and b/test/production/app-dir/metadata-static-route-cache/app/opengraph-image.png differ diff --git a/test/production/app-dir/metadata-static-route-cache/app/opengraph-image.png.new b/test/production/app-dir/metadata-static-route-cache/app/opengraph-image.png.new new file mode 100644 index 0000000000000..b7bb4dc1497ba Binary files /dev/null and b/test/production/app-dir/metadata-static-route-cache/app/opengraph-image.png.new differ diff --git a/test/production/app-dir/metadata-static-route-cache/metadata-static-route-cache.test.ts b/test/production/app-dir/metadata-static-route-cache/metadata-static-route-cache.test.ts new file mode 100644 index 0000000000000..9bc2dd31abddf --- /dev/null +++ b/test/production/app-dir/metadata-static-route-cache/metadata-static-route-cache.test.ts @@ -0,0 +1,52 @@ +import { nextTestSetup } from 'e2e-utils' +import crypto from 'crypto' + +function generateMD5(text: string) { + const hash = crypto.createHash('md5') + hash.update(text) + return hash.digest('hex') +} + +describe('app dir - metadata static routes cache', () => { + const { next } = nextTestSetup({ + files: __dirname, + skipStart: true, + }) + + it('should generate different content after replace the static metadata file', async () => { + await next.build() + + const faviconBuildContent = await next.readFile( + '.next/server/app/favicon.ico.body' + ) + const opengrpahImageBuildContent = await next.readFile( + '.next/server/app/opengraph-image.png.body' + ) + + const faviconMd5 = generateMD5(faviconBuildContent) + const opengraphImageMd5 = generateMD5(opengrpahImageBuildContent) + + // Update favicon and opengraph image + const newFaviconContent = await next.readFile('app/favicon.ico.new') + await next.patchFile('app/favicon.ico', newFaviconContent) + + const newOpengraphImageContent = await next.readFile( + 'app/opengraph-image.png.new' + ) + await next.patchFile('app/opengraph-image.png', newOpengraphImageContent) + + await next.build() + const faviconBuildContentNew = await next.readFile( + '.next/server/app/favicon.ico.body' + ) + const opengrpahImageBuildContentNew = await next.readFile( + '.next/server/app/opengraph-image.png.body' + ) + + const faviconMd5New = generateMD5(faviconBuildContentNew) + const opengraphImageMd5New = generateMD5(opengrpahImageBuildContentNew) + + expect(faviconMd5).not.toBe(faviconMd5New) + expect(opengraphImageMd5).not.toBe(opengraphImageMd5New) + }) +}) diff --git a/test/production/app-dir/metadata-static/metadata-static.test.ts b/test/production/app-dir/metadata-static/metadata-static.test.ts index bd1cf476f2aa7..104160a21ce9d 100644 --- a/test/production/app-dir/metadata-static/metadata-static.test.ts +++ b/test/production/app-dir/metadata-static/metadata-static.test.ts @@ -12,7 +12,7 @@ describe('app dir - metadata', () => { for (const key of [ '/robots.txt', - '/sitemap', + '/sitemap.xml', '/opengraph-image', '/manifest.webmanifest', ]) { diff --git a/test/production/standalone-mode/required-server-files/required-server-files-app.test.ts b/test/production/standalone-mode/required-server-files/required-server-files-app.test.ts index 410fa183b3f1b..e2f45d7a2a70b 100644 --- a/test/production/standalone-mode/required-server-files/required-server-files-app.test.ts +++ b/test/production/standalone-mode/required-server-files/required-server-files-app.test.ts @@ -10,11 +10,12 @@ import { initNextServerScript, killApp, } from 'next-test-utils' +import { ChildProcess } from 'child_process' describe('required server files app router', () => { let next: NextInstance - let server - let appPort + let server: ChildProcess + let appPort: number | string const setupNext = async ({ nextEnv, @@ -83,14 +84,17 @@ describe('required server files app router', () => { /- Local:/, { ...process.env, - PORT: appPort, + PORT: `${appPort}`, }, undefined, { cwd: next.testDir, } ) - appPort = `http://127.0.0.1:${appPort}` + + if (process.platform === 'darwin') { + appPort = `http://127.0.0.1:${appPort}` + } } beforeAll(async () => { diff --git a/test/production/standalone-mode/required-server-files/required-server-files-i18n.test.ts b/test/production/standalone-mode/required-server-files/required-server-files-i18n.test.ts index 12da3649353d7..941bd06e3bcb2 100644 --- a/test/production/standalone-mode/required-server-files/required-server-files-i18n.test.ts +++ b/test/production/standalone-mode/required-server-files/required-server-files-i18n.test.ts @@ -14,11 +14,12 @@ import { waitFor, } from 'next-test-utils' import nodeFetch from 'node-fetch' +import { ChildProcess } from 'child_process' describe('required server files i18n', () => { let next: NextInstance - let server - let appPort + let server: ChildProcess + let appPort: number | string let errors = [] let requiredFilesManifest @@ -117,7 +118,7 @@ describe('required server files i18n', () => { /- Local:/, { ...process.env, - PORT: appPort, + PORT: `${appPort}`, }, undefined, { @@ -127,7 +128,12 @@ describe('required server files i18n', () => { }, } ) + + if (process.platform === 'darwin') { + appPort = `http://127.0.0.1:${appPort}` + } }) + afterAll(async () => { await next.destroy() if (server) await killApp(server) diff --git a/test/production/standalone-mode/required-server-files/required-server-files-ppr.test.ts b/test/production/standalone-mode/required-server-files/required-server-files-ppr.test.ts index f7501015d73e0..06142d7e9a8fe 100644 --- a/test/production/standalone-mode/required-server-files/required-server-files-ppr.test.ts +++ b/test/production/standalone-mode/required-server-files/required-server-files-ppr.test.ts @@ -10,11 +10,12 @@ import { initNextServerScript, killApp, } from 'next-test-utils' +import { ChildProcess } from 'child_process' describe('required server files app router', () => { let next: NextInstance - let server - let appPort + let server: ChildProcess + let appPort: number | string let delayedPostpone let rewritePostpone @@ -93,14 +94,17 @@ describe('required server files app router', () => { /- Local:/, { ...process.env, - PORT: appPort, + PORT: `${appPort}`, }, undefined, { cwd: next.testDir, } ) - appPort = `http://127.0.0.1:${appPort}` + + if (process.platform === 'darwin') { + appPort = `http://127.0.0.1:${appPort}` + } } beforeAll(async () => { diff --git a/test/production/standalone-mode/required-server-files/required-server-files.test.ts b/test/production/standalone-mode/required-server-files/required-server-files.test.ts index 7d5d33a3bb079..7f457ce3c8593 100644 --- a/test/production/standalone-mode/required-server-files/required-server-files.test.ts +++ b/test/production/standalone-mode/required-server-files/required-server-files.test.ts @@ -12,13 +12,15 @@ import { initNextServerScript, killApp, renderViaHTTP, + retry, waitFor, } from 'next-test-utils' +import { ChildProcess } from 'child_process' describe('required server files', () => { let next: NextInstance - let server - let appPort + let server: ChildProcess + let appPort: number | string let errors = [] let stderr = '' let requiredFilesManifest @@ -123,7 +125,7 @@ describe('required server files', () => { { ...process.env, ENV_FROM_HOST: 'FOOBAR', - PORT: appPort, + PORT: `${appPort}`, }, undefined, { @@ -134,11 +136,21 @@ describe('required server files', () => { }, } ) + + if (process.platform === 'darwin') { + appPort = `http://127.0.0.1:${appPort}` + } } beforeAll(async () => { await setupNext({ nextEnv: true, minimalMode: true }) }) + + beforeEach(() => { + errors = [] + stderr = '' + }) + afterAll(async () => { await next.destroy() if (server) await killApp(server) @@ -958,60 +970,43 @@ describe('required server files', () => { }) it('should bubble error correctly for gip page', async () => { - errors = [] const res = await fetchViaHTTP(appPort, '/errors/gip', { crash: '1' }) expect(res.status).toBe(500) expect(await res.text()).toBe('Internal Server Error') - await check( - () => - errors.join('\n').includes('gip hit an oops') - ? 'success' - : errors.join('\n'), - 'success' - ) + await retry(() => { + expect(errors.join('\n')).toInclude('gip hit an oops') + }) }) it('should bubble error correctly for gssp page', async () => { - errors = [] const res = await fetchViaHTTP(appPort, '/errors/gssp', { crash: '1' }) expect(res.status).toBe(500) expect(await res.text()).toBe('Internal Server Error') - await check( - () => - errors.join('\n').includes('gssp hit an oops') - ? 'success' - : errors.join('\n'), - 'success' - ) + + await retry(() => { + expect(errors.join('\n')).toInclude('gssp hit an oops') + }) }) it('should bubble error correctly for gsp page', async () => { - errors = [] const res = await fetchViaHTTP(appPort, '/errors/gsp/crash') expect(res.status).toBe(500) expect(await res.text()).toBe('Internal Server Error') - await check( - () => - errors.join('\n').includes('gsp hit an oops') - ? 'success' - : errors.join('\n'), - 'success' - ) + + await retry(() => { + expect(errors.join('\n')).toInclude('gsp hit an oops') + }) }) it('should bubble error correctly for API page', async () => { - errors = [] const res = await fetchViaHTTP(appPort, '/api/error') expect(res.status).toBe(500) expect(await res.text()).toBe('Internal Server Error') - await check( - () => - errors.join('\n').includes('some error from /api/error') - ? 'success' - : errors.join('\n'), - 'success' - ) + + await retry(() => { + expect(errors.join('\n')).toInclude('some error from /api/error') + }) }) it('should normalize optional values correctly for SSP page', async () => { @@ -1284,6 +1279,7 @@ describe('required server files', () => { expect(envVariables.envFromHost).toBe('FOOBAR') }) + // FIXME: update to not mutate the global state it('should run middleware correctly (without minimalMode, with wasm)', async () => { const standaloneDir = join(next.testDir, 'standalone') @@ -1301,7 +1297,7 @@ describe('required server files', () => { /- Local:/, { ...process.env, - PORT: appPort, + PORT: `${appPort}`, }, undefined, { diff --git a/test/turbopack-build-tests-manifest.json b/test/turbopack-build-tests-manifest.json index a104fee5b7388..c6ba6a53e9fd6 100644 --- a/test/turbopack-build-tests-manifest.json +++ b/test/turbopack-build-tests-manifest.json @@ -1,6 +1,17 @@ { "version": 2, "suites": { + "test/production/app-dir/fetch-cache/fetch-cache.test.ts": { + "passed": [], + "failed": [ + "fetch-cache should have correct fetchUrl field for fetches and unstable_cache", + "fetch-cache should retry 3 times when revalidate times out", + "fetch-cache should not retry for failed fetch-cache GET" + ], + "pending": [], + "flakey": [], + "runtimeError": false + }, "test/e2e/404-page-router/index.test.ts": { "passed": [ "404-page-router 404-page-router with basePath of false and i18n of false and middleware false for /error should have the correct router parameters after it is ready", @@ -1924,7 +1935,8 @@ "app dir - metadata dynamic routes social image routes should render og image with opengraph-image dynamic routes", "app dir - metadata dynamic routes social image routes should render og image with twitter-image dynamic routes", "app dir - metadata dynamic routes social image routes should support generate multi images with generateImageMetadata", - "app dir - metadata dynamic routes social image routes should support params as argument in dynamic routes" + "app dir - metadata dynamic routes social image routes should support params as argument in dynamic routes", + "app dir - metadata dynamic routes should statically optimized single image route" ], "pending": [], "flakey": [], @@ -4040,10 +4052,9 @@ "runtimeError": false }, "test/e2e/fetch-failures-have-good-stack-traces-in-edge-runtime/fetch-failures-have-good-stack-traces-in-edge-runtime.test.ts": { - "passed": [ - "fetch failures have good stack traces in edge runtime when returning `fetch` using an unknown domain, stack traces are preserved" - ], + "passed": [], "failed": [ + "fetch failures have good stack traces in edge runtime when returning `fetch` using an unknown domain, stack traces are preserved", "fetch failures have good stack traces in edge runtime when awaiting `fetch` using an unknown domain, stack traces are preserved" ], "pending": [], @@ -15724,6 +15735,15 @@ "pending": [], "flakey": [], "runtimeError": false + }, + "test/production/app-dir/metadata-static-route-cache/metadata-static-route-cache.test.ts": { + "passed": [], + "failed": [ + "app dir - metadata static routes cache should generate different content after replace the static metadata file" + ], + "pending": [], + "flakey": [], + "runtimeError": false } }, "rules": { diff --git a/test/turbopack-dev-tests-manifest.json b/test/turbopack-dev-tests-manifest.json index 76abe5752caa4..c358e0141a355 100644 --- a/test/turbopack-dev-tests-manifest.json +++ b/test/turbopack-dev-tests-manifest.json @@ -6134,10 +6134,11 @@ }, "test/e2e/fetch-failures-have-good-stack-traces-in-edge-runtime/fetch-failures-have-good-stack-traces-in-edge-runtime.test.ts": { "passed": [ - "fetch failures have good stack traces in edge runtime when awaiting `fetch` using an unknown domain, stack traces are preserved", + "fetch failures have good stack traces in edge runtime when awaiting `fetch` using an unknown domain, stack traces are preserved" + ], + "failed": [ "fetch failures have good stack traces in edge runtime when returning `fetch` using an unknown domain, stack traces are preserved" ], - "failed": [], "pending": [], "flakey": [], "runtimeError": false