-
-
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
Remove second snowpack instance #368
Conversation
🦋 Changeset detectedLatest commit: 300b9e7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pikapkg/astro-www/8PmkjRMjMe93kJQwsHrcFZrJ5deQ |
Closes #357 |
Oh my god this just feels so much better! Output looks good and feels faster too. Saw one issue when running this on snowpack.dev main branch:
|
Also HMR is no longer connecting in dev, also on the Snowpack repo (seems to be trying to connect to |
@FredKSchott maybe you can show me how you're running a local copy of astro in that repo. I haven't been able to get it to work. |
HMR issue is unrelated to this change. Fixed it here: #375 |
Ok, that took longer that it should have. @FredKSchott reason that component throws is because it depends on the very env variable that this PR removes support for. So changing it to use |
packages/astro/src/runtime.ts
Outdated
}; | ||
|
||
return { | ||
runtimeConfig, | ||
load: load.bind(null, runtimeConfig), | ||
shutdown: () => Promise.all([backendSnowpack.shutdown(), frontendSnowpack.shutdown()]).then(() => void 0), | ||
shutdown: () => Promise.all([snowpack.shutdown()]).then(() => void 0), |
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.
Maybe remove the Promise.all()
? Unless we need to add more cleanup relatively soon
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.
oh yeah good point
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.
🎉 🎉 🎉
|
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.
LGTM! Plz run it on snowpack.dev if you can to confirm
@FredKSchott Yep, I did, that's what this comment was in reference to: #368 (comment) I'll update snowpack.dev once this is released. |
* Remove second snowpack instance * Document import.meta.env.SSR * Remove unnecessary Promise.all
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Changes
This gets rid of having 2 snowpack instances. Instead there's just one, but no more
import.meta.env.astro
. So this is a breaking chance.People can use
import.meta.env.SSR
for the same purpose.Testing
Docs
This wasn't documented, I'm adding it.