Migration guide: Mention accessing createApp from a CDN build #774
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.
Description of Problem
I've gone into depth about the problem in #773 but this PR is largely independent of the changes I've proposed there.
In summary, I saw a discussion on Discord where several users were getting confused about migrating a Vue 2 app to Vue 3. The confusion came from the difference between using ESM modules and a CDN build. They had read the migration guide for global API changes but hadn't fully appreciated the differences between ESM and CDN.
To make matters worse, the examples on that page keep flip-flopping between the two styles.
This may not seem like a migration problem but the API change is a significant contributor to the confusion. In Vue 2, everything was done via an object/function called
Vue
. In Vue 3, that object only exists for CDN builds. A familiar-looking object has completely changed roles and unless you grasp the difference between the builds it's really difficult to understand what's going on.Proposed Solution
I've included an extra example near the top of the page that explicitly notes how a CDN build differs from the ESM example. It isn't much but I think it'd make a big difference to anyone who is only familiar with one way or the other.
Rewriting the examples on this page to all use the same style would probably be a good idea but I think that should be addressed as part of #773.
There's also an unrelated trailing-space change in the same file, correcting one of my previous changes.