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

feat(nuxt)!: add support for components/global #6070

Merged
merged 8 commits into from
Jul 27, 2022
Merged

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Jul 22, 2022

πŸ”— Linked issue

resolves nuxt/nuxt#14051

❓ 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

⚠️ Breaking change: If you previously was using components/global, please move them to new directory otherwise they will lose Global suffix and will be globally available as lazy chunks.

This PR:

  1. Cleans up component templates and creates two different templates, for client/server modes, which should fix any issues with client/server components being imported in the wrong context. This will be needed for server components. So importing from #components on client-side will no longer pull in server-only components or vice versa.
  2. Supports registering global components with ~/components/global or MyComponent.global.ts. It does not change how they are made available; it's still via async registration.
  3. Adds a couple of test cases for the above.

I'm happy to split out 1 & 2 if that would be helpful in reviewing it. Let me know if so.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added enhancement New feature or request 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing labels Jul 22, 2022
@danielroe danielroe requested a review from pi0 July 22, 2022 14:38
@danielroe danielroe self-assigned this Jul 22, 2022
@netlify
Copy link

netlify bot commented Jul 22, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit df7c5dd
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62e136469d25ef00082f5370

@pi0 pi0 changed the title feat(nuxt): add support for global components via dir and suffix feat(nuxt): add support for components/global Jul 27, 2022
@pi0 pi0 merged commit 4e2667f into main Jul 27, 2022
@pi0 pi0 deleted the feat/global-components branch July 27, 2022 13:05
@pi0 pi0 mentioned this pull request Aug 5, 2022
@pi0 pi0 changed the title feat(nuxt): add support for components/global feat(nuxt)!: add support for components/global Aug 12, 2022
@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
3.x enhancement New feature or request 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

automatic components/global support
2 participants