Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

refactor(nuxt)!: rename autoImports to imports #6864

Merged
merged 12 commits into from
Aug 23, 2022
Merged

refactor(nuxt)!: rename autoImports to imports #6864

merged 12 commits into from
Aug 23, 2022

Conversation

antfu
Copy link
Member

@antfu antfu commented Aug 23, 2022

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

As this feature now goes beyond just auto-imports, the naming autoImports becomes a bit confusing and ambiguous. See #6768 for more.

This PR renames Nuxt option autoImports to imports and hooks autoImports:* to imports:*. This also aligns with components option.

πŸ‘‰ Migration

⚠️ Breaking change: Nuxt option autoImports named to imports. Hooks autoImports:* renamed to imports:*.

for nuxt.config.ts:

export default defineConfig({
  // ...
- autoImports: {
+ imports: {
    // ...
  }
})

for module authors:

-nuxt.hook('autoImports:extend', () => { })
+nuxt.hook('imports:extend', () => { })

@netlify
Copy link

netlify bot commented Aug 23, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit 717541c
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/6304e1d69f6c000009f9e3a8

@pi0
Copy link
Member

pi0 commented Aug 23, 2022

I really love renaming of this PR and I think it worth it doing for both nuxt and nitro ( @antfu do you mind to open a PR for it)

Only issue is with deprecation of hooks it doesn't works because we set deprecated hooks in auto imports module and it happens after other modules and hooks by user config are registered. It could be a big breaking change I like to avoid.

@antfu
Copy link
Member Author

antfu commented Aug 23, 2022

Nitro PR: unjs/nitro#433

Hook timing: Is 9c5b034 a good solution?

@pi0
Copy link
Member

pi0 commented Aug 23, 2022

Thanks for both. Hookable issue is solved via unjs/hookable@23d9ff4 btw we can revert it back and try :)

@pi0 pi0 changed the title fix(nuxt)!: rename autoImports to imports refactor(nuxt)!: rename autoImports to imports Aug 23, 2022
@pi0 pi0 merged commit fd94351 into main Aug 23, 2022
@pi0 pi0 deleted the feat/rename-imports branch August 23, 2022 14:22
@pi0 pi0 mentioned this pull request Aug 26, 2022
@pi0 pi0 mentioned this pull request Sep 2, 2022
7 tasks
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants