Reword the section on in-DOM root templates #2332
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change was motivated by #1864.
The section on using an in-DOM template begins by introducing it as a feature used without a build step. That is one use case, but it is also commonly used with server-side frameworks that generate the template HTML dynamically.
While
import { createApp } from 'vue'
can be used 'without a build step', it does seem less natural in that context. This was the problem originally raised in #1864. The idea of using import maps is discussed earlier in the docs, but this specific example leans on that knowledge more heavily than the rest of the docs.Instead, I've started by introducing the feature without explicit motivation, contrasting it with the more common approach. I've then mentioned the use cases at the end, including a link back to the section about using Vue without build tools.