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

docs: add notes about auto imports from composables/ directory - #4675

Merged
pi0 merged 3 commits into
nuxt:mainfrom
Kapcash:docs/auto-imports-details
Apr 29, 2022
Merged

docs: add notes about auto imports from composables/ directory#4675
pi0 merged 3 commits into
nuxt:mainfrom
Kapcash:docs/auto-imports-details

Conversation

@Kapcash

Copy link
Copy Markdown
Contributor

I personally had several confusing moments about composables auto-imports:

  • you need to run the server to get rid of the Cannot find name 'useBar' error.
  • export * from './sub-composable' doesn't work, it has to be named exports.

Also, it's always nice to know what happens under the hood to debug it more easily :)

These documentation changes are the ones that could have saved me some time to understand what happens. So I hope it will help others!

🔗 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

📝 Checklist

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

Specifies that
* the nuxt server must be running to generate auto imports
* second level files under /composables can be generated by *namely* export them from index.ts
@netlify

netlifyBot commented Apr 27, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs ready!

NameLink
🔨 Latest commit83f31ed
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/626bb16c59c8c3000851acb4
😎 Deploy Previewhttps://deploy-preview-4675--nuxt3-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@danielroedanielroe added the documentation Improvements or additions to documentation label Apr 28, 2022
Comment threaddocs/content/2.guide/3.directory-structure/5.composables.md Outdated
Comment threaddocs/content/2.guide/3.directory-structure/5.composables.md Outdated
@pi0pi0 changed the title docs: details & gotchas autoimports composablesdocs: add notes about auto imports from composables/ directoryApr 29, 2022
pi0
pi0 approved these changes Apr 29, 2022

@pi0pi0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding such helpful notes!

@pi0
pi0 merged commit e360e31 into nuxt:mainApr 29, 2022
@pi0pi0 mentioned this pull request May 2, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xdocumentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Kapcash@pi0@danielroe