Improve Vue appEntrypoint handling#8794
Conversation
🦋 Changeset detectedLatest commit: 2500fdc The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
natemoo-re
left a comment
There was a problem hiding this comment.
Code looks fine, would like to know why we need this though!
.changeset/smart-cameras-kneel.md
Outdated
| '@astrojs/vue': major | ||
| --- | ||
|
|
||
| chore: improve app setup call |
There was a problem hiding this comment.
This is pretty non-descriptive and I don't have any info to go off of in the PR description. Would you mind describing specifically why you made these changes?
There was a problem hiding this comment.
Yes.
astro.config.mjs:
integrations: [
vue({
appEntrypoint: '/src/pages/_app',
template: {
compilerOptions: {
//
},
},
}),
],In the /src/pages/_app.js file, if there is no export defualt (app) => {}, it may cause errors.
ematipico
left a comment
There was a problem hiding this comment.
Blocking, for the following reasons:
- the template is empty and doesn't explain anything about the PR
- we don't know what we are fixing, there isn't a test
- there's no test nor explanation about this fix being tested
There is my first astro PR. Is there any documentation on how to create a standard PR? |
Edit the description of the PR. Under Under the No need for documentation, so you can leave that part empty. |
|
Thanks. I'll try it later. |
|
Hi @yoyo837 , are you still interested in this PR? |
Yes, I still want to finish this PR, but I also wouldn't mind opening a new PR when I actually do it. |
ac6566c to
d4e62fa
Compare
|
When I add the test case, I got some error: it seems that https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module |
|
I think the error is correct. Maybe what you want to do is to use |
Need help. |
|
I am not very familiar with the integration, but that is failing because in case of astro/packages/integrations/vue/src/index.ts Lines 46 to 50 in 35cd810 |
appEntrypoint
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
8bdb895 to
b2e3698
Compare
natemoo-re
left a comment
There was a problem hiding this comment.
Thanks for picking this up again @florian-lefebvre! Just pushed some changes but this LGTM.
appEntrypointappEntrypoint handling
|
Thank you everyone for making this PR landed. |
Changes
Improve robustness and compatibility for some case.
When vue's appEntrypoint is configured and it does not return the default function, it will throw an error:
astro.config.mjs:
src/app.js:
An error will be thrown after running:
Testing
Check if a function is available before calling it.
Docs