-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Vue appEntrypoint
handling
#8794
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for picking this up again @florian-lefebvre! Just pushed some changes but this LGTM.
appEntrypoint
appEntrypoint
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