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

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

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

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

Conversation

@Kapcash
Copy link
Contributor

@Kapcash Kapcash commented Apr 27, 2022

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

netlify bot commented Apr 27, 2022

Deploy Preview for nuxt3-docs ready!

Name Link
🔨 Latest commit 83f31ed
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/626bb16c59c8c3000851acb4
😎 Deploy Preview https://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.

@danielroe danielroe added the documentation Improvements or additions to documentation label Apr 28, 2022
@pi0 pi0 changed the title docs: details & gotchas autoimports composables docs: add notes about auto imports from composables/ directory Apr 29, 2022
Copy link
Member

@pi0 pi0 left a comment

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:main Apr 29, 2022
@pi0 pi0 mentioned this pull request May 2, 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 documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants