diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index ad059c3630..7de0a3890f 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,6 +1,6 @@ name: "\U0001F41E Bug report" description: Create a report to help us improve Nuxt -labels: ["pending triage", "3.x"] +labels: ["pending triage"] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index ff8f4c2377..3527bf128b 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,11 +1,8 @@ blank_issues_enabled: true contact_links: - - name: πŸ“š Nuxt 3 Documentation + - name: πŸ“š Nuxt Documentation url: https://nuxt.com/docs - about: Check the documentation for usage of Nuxt 3 - - name: πŸ“š Nuxt 2 Documentation - url: https://v2.nuxt.com - about: Check the documentation for usage of Nuxt 2 + about: Check the documentation for usage of Nuxt - name: πŸ’¬ Discussions url: https://github.com/nuxt/nuxt/discussions about: Use discussions if you have another issue, an idea for improvement or for asking questions. diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index a5614e9304..b155f19563 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -1,6 +1,6 @@ name: "πŸš€ Feature request" description: Suggest a feature that will improve Nuxt -labels: ["pending triage", "3.x"] +labels: ["pending triage"] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/z-bug-report-2.yml b/.github/ISSUE_TEMPLATE/z-bug-report-2.yml deleted file mode 100644 index d4124367b2..0000000000 --- a/.github/ISSUE_TEMPLATE/z-bug-report-2.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: "\U0001F41E Bug report (Nuxt 2)" -description: Create a report to help us improve Nuxt -labels: ["pending triage", "2.x"] -body: - - type: markdown - attributes: - value: | - Please carefully read the contribution docs before creating a bug report - πŸ‘‰ https://nuxt.com/docs/community/reporting-bugs - - Please use a template below to create a minimal reproduction - πŸ‘‰ https://stackblitz.com/github/nuxt/starter/tree/v2 - πŸ‘‰ https://codesandbox.io/s/github/nuxt/starter/v2 - - type: textarea - id: bug-env - attributes: - label: Environment - description: You can use `npx envinfo --system --npmPackages '{nuxt,@nuxt/*}' --binaries --browsers` to fill this section - placeholder: Environment - validations: - required: true - - type: textarea - id: reproduction - attributes: - label: Reproduction - description: Please provide a link to a repo that can reproduce the problem you ran into. A [**minimal reproduction**](https://nuxt.com/docs/community/reporting-bugs#create-a-minimal-reproduction) is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided we might close it. - placeholder: Reproduction - validations: - required: true - - type: textarea - id: bug-description - attributes: - label: Describe the bug - description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks! - placeholder: Bug description - validations: - required: true - - type: textarea - id: additonal - attributes: - label: Additional context - description: If applicable, add any other context about the problem here - - type: textarea - id: logs - attributes: - label: Logs - description: | - Optional if provided reproduction. Please try not to insert an image but copy paste the log text. - render: shell-script diff --git a/.github/workflows/autofix-docs.yml b/.github/workflows/autofix-docs.yml index 3988622373..9165048727 100644 --- a/.github/workflows/autofix-docs.yml +++ b/.github/workflows/autofix-docs.yml @@ -27,7 +27,10 @@ jobs: - name: Install dependencies run: pnpm install + - name: Build (stub) + run: pnpm dev:prepare + - name: Lint (docs) run: pnpm lint:docs:fix - - uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a + - uses: autofix-ci/action@2891949f3779a1cafafae1523058501de3d4e944 diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index ef817dd093..d82ef9100d 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -52,4 +52,4 @@ jobs: - name: Lint (code) run: pnpm lint:fix - - uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a + - uses: autofix-ci/action@2891949f3779a1cafafae1523058501de3d4e944 diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 50759cfff1..a3ce6dbb55 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -5,7 +5,6 @@ on: branches: - main - 3.x - - 2.x permissions: pull-requests: write diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 818fd6e27d..89d0c7aecd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,7 +57,7 @@ jobs: run: pnpm build - name: Cache dist - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 with: retention-days: 3 name: dist @@ -85,19 +85,19 @@ jobs: run: pnpm install - name: Initialize CodeQL - uses: github/codeql-action/init@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 + uses: github/codeql-action/init@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11 with: languages: javascript queries: +security-and-quality - name: Restore dist cache - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: dist path: packages - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 + uses: github/codeql-action/analyze@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11 with: category: "/language:javascript" @@ -124,7 +124,7 @@ jobs: run: pnpm install - name: Restore dist cache - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: dist path: packages @@ -233,7 +233,7 @@ jobs: run: pnpm playwright-core install chromium - name: Restore dist cache - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: dist path: packages @@ -254,6 +254,8 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} build-release: + concurrency: + group: release permissions: id-token: write if: | @@ -283,7 +285,7 @@ jobs: run: pnpm install - name: Restore dist cache - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: dist path: packages @@ -295,6 +297,8 @@ jobs: NPM_CONFIG_PROVENANCE: true release-pr: + concurrency: + group: release permissions: id-token: write pull-requests: write @@ -322,7 +326,7 @@ jobs: run: pnpm install - name: Restore dist cache - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: dist path: packages diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b6ce923d60..2f948ae911 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -31,6 +31,9 @@ jobs: - name: Install dependencies run: pnpm install + - name: Build (stub) + run: pnpm dev:prepare + - name: Lint (docs) run: pnpm lint:docs diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index f652d7684e..3509c8075b 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -14,6 +14,8 @@ permissions: jobs: release-pr: if: github.repository == 'nuxt/nuxt' && github.event.issue.pull_request && github.event.comment.body == '/trigger release' + concurrency: + group: release permissions: id-token: write pull-requests: write @@ -44,7 +46,7 @@ jobs: if [[ $(date -d "$updated_at" +%s) -gt $(date -d "$COMMENT_AT" +%s) ]]; then exit 1 fi - + echo "head_sha=$head_sha" >> $GITHUB_OUTPUT - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d43ba94276..7d3d86ce06 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,8 @@ permissions: {} jobs: release: if: github.repository == 'nuxt/nuxt' && (startsWith(github.event.head_commit.message, 'v3.') || startsWith(github.event.head_commit.message, 'v4.')) + concurrency: + group: release permissions: id-token: write runs-on: ubuntu-latest diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index fb0b7dc233..79ae716526 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 if: github.repository == 'nuxt/nuxt' && success() with: name: SARIF file @@ -68,7 +68,7 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 + uses: github/codeql-action/upload-sarif@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11 if: github.repository == 'nuxt/nuxt' && success() with: sarif_file: results.sarif diff --git a/.github/workflows/semantic-pull-requests.yml b/.github/workflows/semantic-pull-requests.yml index 3bf40386bf..927a2b41a7 100644 --- a/.github/workflows/semantic-pull-requests.yml +++ b/.github/workflows/semantic-pull-requests.yml @@ -20,7 +20,7 @@ jobs: name: Semantic pull request steps: - name: Validate PR title - uses: amannn/action-semantic-pull-request@cfb60706e18bc85e8aec535e3c577abe8f70378e # v5.5.2 + uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3 with: scopes: | kit diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000000..fc78d099a7 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @danielroe diff --git a/README.md b/README.md index a9df118209..c3eaac4a39 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ It provides a number of features that make it easy to build fast, SEO-friendly, - 🏠 [Local Development](#local-development) - ⛰️ [Nuxt 2](#nuxt-2) - πŸ›Ÿ [Professional Support](#professional-support) -- πŸ”— [Follow us](#follow-us) +- πŸ”— [Follow Us](#follow-us) - βš–οΈ [License](#license) --- @@ -101,18 +101,12 @@ Here are a few ways you can get involved: Follow the docs to [Set Up Your Local Development Environment](https://nuxt.com/docs/community/framework-contribution#setup) to contribute to the framework and documentation. -## ⛰️ Nuxt 2 - -You can find the code for Nuxt 2 on the [`2.x` branch](https://github.com/nuxt/nuxt/tree/2.x) and the documentation at [v2.nuxt.com](https://v2.nuxt.com). - -If you expect to be using Nuxt 2 beyond the EOL (End of Life) date (June 30, 2024), and still need a maintained version that can satisfy security and browser compatibility requirements, make sure to check out [HeroDevs’ NES (Never-Ending Support) Nuxt 2](https://www.herodevs.com/support/nuxt-nes?utm_source=nuxt-github&utm_medium=nuxt-readme). - ## πŸ›Ÿ Professional Support - Technical audit & consulting: [Nuxt Experts](https://nuxt.com/enterprise/support) - Custom development & more: [Nuxt Agencies Partners](https://nuxt.com/enterprise/agencies) -## πŸ”— Follow us +## πŸ”— Follow Us

Discord  Twitter  GitHub diff --git a/docs/1.getting-started/1.introduction.md b/docs/1.getting-started/1.introduction.md index 47bfdb0bc4..d092c50579 100644 --- a/docs/1.getting-started/1.introduction.md +++ b/docs/1.getting-started/1.introduction.md @@ -76,7 +76,6 @@ Nuxt is composed of different [core packages](https://github.com/nuxt/nuxt/tree/ - Command line interface: [nuxi](https://github.com/nuxt/nuxt/tree/main/packages/nuxi) - Server engine: [nitro](https://github.com/unjs/nitro) - Development kit: [@nuxt/kit](https://github.com/nuxt/nuxt/tree/main/packages/kit) -- Nuxt 2 Bridge: [@nuxt/bridge](https://github.com/nuxt/bridge) We recommend reading each concept to have a full vision of Nuxt capabilities and the scope of each package. diff --git a/docs/1.getting-started/10.deployment.md b/docs/1.getting-started/10.deployment.md index 582a24d14a..9043f0035c 100644 --- a/docs/1.getting-started/10.deployment.md +++ b/docs/1.getting-started/10.deployment.md @@ -85,13 +85,13 @@ export default defineNuxtConfig({ ## Hosting Providers -Nuxt 3 can be deployed to several cloud providers with a minimal amount of configuration: +Nuxt can be deployed to several cloud providers with a minimal amount of configuration: :read-more{to="/deploy"} ## Presets -In addition to Node.js servers and static hosting services, a Nuxt 3 project can be deployed with several well-tested presets and minimal amount of configuration. +In addition to Node.js servers and static hosting services, a Nuxt project can be deployed with several well-tested presets and minimal amount of configuration. You can explicitly set the desired preset in the [`nuxt.config.ts`](/docs/guide/directory-structure/nuxt-config) file: @@ -125,5 +125,5 @@ Accordingly, you should make sure that the following options are unchecked / dis With these settings, you can be sure that Cloudflare won't inject scripts into your Nuxt application that may cause unwanted side effects. ::tip -Their location on the Cloudfalre dashboard sometimes changes so don't hesitate to look around. +Their location on the Cloudflare dashboard sometimes changes so don't hesitate to look around. :: diff --git a/docs/1.getting-started/12.upgrade.md b/docs/1.getting-started/12.upgrade.md index ab3f5a1dd8..ffeb075ab2 100644 --- a/docs/1.getting-started/12.upgrade.md +++ b/docs/1.getting-started/12.upgrade.md @@ -35,11 +35,17 @@ bunx nuxi upgrade To use the latest Nuxt build and test features before their release, read about the [nightly release channel](/docs/guide/going-further/nightly-release-channel) guide. +::alert{type="warning"} +The nightly release channel `latest` tag is currently tracking the Nuxt v4 branch, meaning that it is particularly likely to have breaking changes right now - be careful! + +You can opt in to the 3.x branch nightly releases with `"nuxt": "npm:nuxt-nightly@3x"`. +:: + ## Testing Nuxt 4 Nuxt 4 is planned to be released **on or before June 14** (though obviously this is dependent on having enough time after Nitro's major release to be properly tested in the community, so be aware that this is not an exact date). -Until then, it is possible to test many of Nuxt 4's breaking changes from Nuxt version 3.12 or via the nightly release channel. +Until then, it is possible to test many of Nuxt 4's breaking changes from Nuxt version 3.12+. ::tip{icon="i-ph-video-duotone" to="https://www.youtube.com/watch?v=r4wFKlcJK6c" target="_blank"} Watch a video from Alexander Lichter showing how to opt in to Nuxt 4's breaking changes already. @@ -47,7 +53,7 @@ Watch a video from Alexander Lichter showing how to opt in to Nuxt 4's breaking ### Opting in to Nuxt 4 -First, opt in to the nightly release channel [following these steps](/docs/guide/going-further/nightly-release-channel#opting-in). +First, upgrade Nuxt to the [latest release](https://github.com/nuxt/nuxt/releases). Then you can set your `compatibilityVersion` to match Nuxt 4 behavior: @@ -103,7 +109,8 @@ Nuxt now defaults to a new directory structure, with backwards compatibility (so * the new Nuxt default `srcDir` is `app/` by default, and most things are resolved from there. * `serverDir` now defaults to `/server` rather than `/server` -* `modules` and `public` are resolved relative to `` by default +* `layers/`, `modules/` and `public/` are resolved relative to `` by default +* if using [Nuxt Content v2.13+](https://github.com/nuxt/content/pull/2649), `content/` is resolved relative to `` * a new `dir.app` is added, which is the directory we look for `router.options.ts` and `spa-loading-template.html` - this defaults to `/`

@@ -125,6 +132,8 @@ app/ app.config.ts app.vue router.options.ts +content/ +layers/ modules/ node_modules/ public/ @@ -150,7 +159,7 @@ nuxt.config.ts 1. Create a new directory called `app/`. 1. Move your `assets/`, `components/`, `composables/`, `layouts/`, `middleware/`, `pages/`, `plugins/` and `utils/` folders under it, as well as `app.vue`, `error.vue`, `app.config.ts`. If you have an `app/router-options.ts` or `app/spa-loading-template.html`, these paths remain the same. -1. Make sure your `nuxt.config.ts`, `modules/`, `public/` and `server/` folders remain outside the `app/` folder, in the root of your project. +1. Make sure your `nuxt.config.ts`, `content/`, `layers/`, `modules/`, `public/` and `server/` folders remain outside the `app/` folder, in the root of your project. However, migration is _not required_. If you wish to keep your current folder structure, Nuxt should auto-detect it. (If it does not, please raise an issue.) The one exception is that if you _already_ have a custom `srcDir`. In this case, you should be aware that your `modules/`, `public/` and `server/` folders will be resolved from your `rootDir` rather than from your custom `srcDir`. You can override this by configuring `dir.modules`, `dir.public` and `serverDir` if you need to. @@ -502,11 +511,11 @@ These options have been set to their current values for some time and we do not * `respectNoSSRHeader`is implementable in user-land with [server middleware](https://github.com/nuxt/nuxt/blob/c660b39447f0d5b8790c0826092638d321cd6821/packages/nuxt/src/core/runtime/nitro/no-ssr.ts#L8-L9) -## Nuxt 2 vs Nuxt 3 +## Nuxt 2 vs Nuxt 3+ In the table below, there is a quick comparison between 3 versions of Nuxt: -Feature / Version | Nuxt 2 | Nuxt Bridge | Nuxt 3 +Feature / Version | Nuxt 2 | Nuxt Bridge | Nuxt 3+ -------------------------|-----------------|------------------|--------- Vue | 2 | 2 | 3 Stability | 😊 Stable | 😊 Stable | 😊 Stable @@ -524,9 +533,9 @@ Vite | ⚠️ Partial | 🚧 Partial | βœ… Nuxi CLI | ❌ Old | βœ… nuxi | βœ… nuxi Static sites | βœ… | βœ… | βœ… -## Nuxt 2 to Nuxt 3 +## Nuxt 2 to Nuxt 3+ -The migration guide provides a step-by-step comparison of Nuxt 2 features to Nuxt 3 features and guidance to adapt your current application. +The migration guide provides a step-by-step comparison of Nuxt 2 features to Nuxt 3+ features and guidance to adapt your current application. ::read-more{to="/docs/migration/overview"} Check out the **guide to migrating from Nuxt 2 to Nuxt 3**. @@ -534,7 +543,7 @@ Check out the **guide to migrating from Nuxt 2 to Nuxt 3**. ## Nuxt 2 to Nuxt Bridge -If you prefer to progressively migrate your Nuxt 2 application to Nuxt 3, you can use Nuxt Bridge. Nuxt Bridge is a compatibility layer that allows you to use Nuxt 3 features in Nuxt 2 with an opt-in mechanism. +If you prefer to progressively migrate your Nuxt 2 application to Nuxt 3, you can use Nuxt Bridge. Nuxt Bridge is a compatibility layer that allows you to use Nuxt 3+ features in Nuxt 2 with an opt-in mechanism. ::read-more{to="/docs/bridge/overview"} **Migrate from Nuxt 2 to Nuxt Bridge** diff --git a/docs/1.getting-started/2.installation.md b/docs/1.getting-started/2.installation.md index 79c9ca8ed7..32e8eb7f29 100644 --- a/docs/1.getting-started/2.installation.md +++ b/docs/1.getting-started/2.installation.md @@ -100,6 +100,6 @@ Well done! A browser window should automatically open for { ### Known issues -- View transitions may not work as expected with nested pages/layouts/async components owing to this upstream Vue bug: . If you make use of this pattern, you may need to delay adopting this experimental feature or implement it yourself. Feedback is very welcome. - - If you perform data fetching within your page setup functions, that you may wish to reconsider using this feature for the moment. (By design, View Transitions completely freeze DOM updates whilst they are taking place.) We're looking at restrict the View Transition to the final moments before `` resolves, but in the interim you may want to consider carefully whether to adopt this feature if this describes you. diff --git a/docs/1.getting-started/6.data-fetching.md b/docs/1.getting-started/6.data-fetching.md index 61d02693ef..1b6fc9bb34 100644 --- a/docs/1.getting-started/6.data-fetching.md +++ b/docs/1.getting-started/6.data-fetching.md @@ -134,7 +134,7 @@ The `useAsyncData` composable is a great way to wrap and wait for multiple `$fet ```vue