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

feat(nuxt3): expose /app export paths #3323

Merged
merged 5 commits into from
Feb 18, 2022
Merged

feat(nuxt3): expose /app export paths #3323

merged 5 commits into from
Feb 18, 2022

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

resolves nuxt/nuxt#13383

❓ Type of change

  • 🧹 Chore
  • πŸ“– 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

This PR exposes nuxt3/app (for #app), nuxt3/pages and nuxt3/meta (for #meta) as the runtime entrypoints for those respective parts of nuxt3.

This means that module or library authors, for example, can benefit from nuxt3 types without needing to use a generated .nuxt/tsconfig.json.

Because TypeScript isn't quite ready for types for export paths (track in microsoft/TypeScript#33079), we add declaration files at the project root for IDE auto-complete. Both webpack & vite properly respect subpath exports, however, and resolve any imports we need.

Because this is additive, users can continue importing from '#app' - and indeed I would recommend pending any updates to the user-facing docs until nuxt3/bridge are in sync (e.g. both importing from nuxt/app or equivalent), perhaps when we move to RC.

⚠️ Note: Adopting package subpath exports is inherently risky because it breaks any other possible imports/access to the package, so we should take special care to ensure that ... ⚠️

πŸ“ Checklist

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

@danielroe danielroe added enhancement New feature or request chore 🧹 p1-chore Priority 1: no change in change code behavior labels Feb 18, 2022
@danielroe danielroe requested a review from pi0 February 18, 2022 15:05
@danielroe danielroe self-assigned this Feb 18, 2022
@netlify
Copy link

netlify bot commented Feb 18, 2022

βœ”οΈ Deploy Preview for nuxt3-docs canceled.

πŸ”¨ Explore the source changes: 4fa1055

πŸ” Inspect the deploy log: https://app.netlify.com/sites/nuxt3-docs/deploys/620fd6eaa237060008f6f7b2

@danielroe danielroe changed the title feat(nuxt3): expose /app, /meta and /pages export paths feat(nuxt3): expose /app export paths Feb 18, 2022
packages/nuxt3/package.json Show resolved Hide resolved
packages/nuxt3/src/core/nuxt.ts Outdated Show resolved Hide resolved
Co-authored-by: pooya parsa <pyapar@gmail.com>
@pi0 pi0 merged commit 70542a3 into main Feb 18, 2022
@pi0 pi0 deleted the refactor/export-paths branch February 18, 2022 18:26
@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 chore enhancement New feature or request 🧹 p1-chore Priority 1: no change in change code behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

expose app and app types as nuxt3/app
2 participants