Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

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

Merged
pi0 merged 8 commits into
mainfrom
feat/global-components
Jul 27, 2022
Merged

feat(nuxt)!: add support for components/global#6070
pi0 merged 8 commits into
mainfrom
feat/global-components

Conversation

@danielroe

@danielroedanielroe commented Jul 22, 2022

Copy link
Copy Markdown
Member

🔗 Linked issue

resolvesnuxt/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.

@danielroedanielroe 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 pi0July 22, 2022 14:38
@danielroedanielroe self-assigned this Jul 22, 2022
@netlify

netlifyBot commented Jul 22, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

NameLink
🔨 Latest commitdf7c5dd
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/62e136469d25ef00082f5370

Comment threadpackages/nuxt/src/components/module.ts Outdated
@pi0
pi0force-pushed the feat/global-components branch from 1e62bcf to 9a0c2b0CompareJuly 25, 2022 13:03
pi0
pi0 approved these changes Jul 27, 2022
@pi0pi0 changed the title feat(nuxt): add support for global components via dir and suffixfeat(nuxt): add support for components/globalJul 27, 2022
@pi0
pi0 merged commit 4e2667f into mainJul 27, 2022
@pi0
pi0 deleted the feat/global-components branch July 27, 2022 13:05
@pi0pi0 mentioned this pull request Aug 5, 2022
@pi0pi0 changed the title feat(nuxt): add support for components/globalfeat(nuxt)!: add support for components/globalAug 12, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xenhancementNew feature or request🍰 p2-nice-to-havePriority 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

@danielroe@pi0