Skip to content

feat(schema): enable opt-in to Nuxt v4 features/flags with future. compatibilityVersion#26925

Merged
danielroe merged 15 commits intomainfrom
feat/v4-opt-in
Apr 30, 2024
Merged

feat(schema): enable opt-in to Nuxt v4 features/flags with future. compatibilityVersion#26925
danielroe merged 15 commits intomainfrom
feat/v4-opt-in

Conversation

@danielroe
Copy link
Copy Markdown
Member

@danielroe danielroe commented Apr 24, 2024

🔗 Linked issue

📚 Description

This enables users (for testing purposes) to opt-in to the following coming changes:

... with potentially more to come in the next weeks.

Usage

export default defineNuxtConfig({
  future: {
    compatibilityVersion: 4,
  },
  // Setting the `compatibilityVersion` above flips all the options below to `false`
  // you can granularly re-enable them when testing. Please file issues if so, so that
  // we can address in Nuxt or in the ecosystem.
  // experimental: {
  //   compileTemplate: true,
  //   templateUtils: true,
  //   relativeWatchPaths: true,
  //   defaults: {
  //     useAsyncData: {
  //       deep: true
  //     }
  //   }
  // }
})

@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@TheAlexLichter
Copy link
Copy Markdown
Member

@danielroe could we have a more gradual approach so v4 could be set to true or to an object containing the different changes? That might be easier to upgrade + "future-safe" in case we introduce more changes in a patch/minor.

@danielroe
Copy link
Copy Markdown
Member Author

Good idea. Note that we probably do need to have granular control over things that we plan to allow people to configure on v4+, e.g. directory structure. But others will fully go away.

I think I'll move this to experimental and make it more granular, for now. But this is likely to be very short lived as an option.

@TheAlexLichter
Copy link
Copy Markdown
Member

Good idea. Note that we probably do need to have granular control over things that we plan to allow people to configure on v4+, e.g. directory structure. But others will fully go away.

I think I'll move this to experimental and make it more granular, for now. But this is likely to be very short lived as an option.

While others might go away, it might help with migration to toggle changes "step by step". Grouping some smaller ones is also fine IMO but that could make migration easier. experimental seems like a great place 👍🏻

@danielroe danielroe changed the title feat(schema): enable opt-in to Nuxt v4 features/flags with future.v4 feat(schema): enable opt-in to Nuxt v4 features/flags with future. compatibilityVersion Apr 30, 2024
@TheAlexLichter
Copy link
Copy Markdown
Member

Great solution to have both, a "progressive" flag enabling more future's by default and the detail-level in case something doesn't work or break 👏

@danielroe danielroe merged commit 505e706 into main Apr 30, 2024
@danielroe danielroe deleted the feat/v4-opt-in branch April 30, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants