Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 15 commits into from Apr 30, 2024

Conversation

danielroe
Copy link
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
  //     }
  //   }
  // }
})

Copy link

stackblitz bot commented Apr 24, 2024

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

@danielroe danielroe requested a review from manniL April 24, 2024 16:16
@manniL
Copy link
Member

manniL commented Apr 24, 2024

@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.

Copy link
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.

@manniL
Copy link
Member

manniL commented Apr 25, 2024

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
@manniL
Copy link
Member

manniL commented Apr 30, 2024

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
60 checks passed
@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.

None yet

2 participants