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

feat: auto-import for composables #1176

Merged
merged 15 commits into from
Oct 20, 2021
Merged

feat: auto-import for composables #1176

merged 15 commits into from
Oct 20, 2021

Conversation

antfu
Copy link
Member

@antfu antfu commented Oct 18, 2021

Close nuxt/nuxt#11862

Continue #969

Followup nuxt/nuxt#12789

  • Update docs
  • Add new autoImports:dirs hook and autoImports: { dirs } option
  • Auto scan ~/composables with both default exports and named exports (using static ESM syntax analyzes)

@netlify
Copy link

netlify bot commented Oct 18, 2021

✔️ Deploy Preview for nuxt3-docs canceled.

🔨 Explore the source changes: d30c745

🔍 Inspect the deploy log: https://app.netlify.com/sites/nuxt3-docs/deploys/616ede2a2c3c68000760d55c

@antfu antfu marked this pull request as draft October 18, 2021 14:50
@antfu
Copy link
Member Author

antfu commented Oct 18, 2021

@pi0 Our current implementation does not expect the auto-import map to be changed during the runtime, I will need to refactor some parts and regenerate the match regex upon changes

@pi0
Copy link
Member

pi0 commented Oct 18, 2021

What about generating a virtual #imports entry? This way we can simply transform implementation to just update regex and can also use same artifact when transform or types not available (while we can shim with #imports)

@antfu antfu marked this pull request as ready for review October 18, 2021 15:15
@pi0
Copy link
Member

pi0 commented Oct 20, 2021

Followup nuxt/nuxt#12789

@pi0 pi0 merged commit 550a9f2 into main Oct 20, 2021
@pi0 pi0 deleted the feat/composables-auto-imports branch October 20, 2021 09:47
@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.

composables/ directory with auto discovery and import
3 participants