-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix: --experimental-ssr
fixes
#2937
Conversation
🦋 Changeset detectedLatest commit: cb45642 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 |
Hm, so you're saying that |
Things were broken in a different way before - for example, now buildConfig is respected. Nonetheless, this new test also fails in the main branch. |
Oh, I just read the test. You are expecting to get the |
If you clone this PR and run the following: pnpm install
pnpm build
cd examples/blog
pnpm astro add node --yes
pnpm build You'll see the contents of the public folder inside
Ohhh, I see. I removed that test, but the problem described above persists |
Yeah, perhaps something about minimal is causing a bug then? I'm not sure. Talked about this overall idea with the team and we want to make it so that the flag is still required if using a 3rd-party adapter, but not needed if using a built-in adapter. This mimics how integrations work, where the flag is needed if using a 3rd party one. |
Perfect, I could add that to
After some searching, I think the issue is here. When there is no JavaScript to be generated, the build process is omitted. This leads to sites with static assets (and probably some CSS) to not have its assets copied if there is no JS. |
Ah, yeah that does make sense. I think I can fix that in another PR. |
Here's how the integrations flag is implemented: 9d6e0b5 |
--experimental-ssr
with isBuildingToSSR
--experimental-ssr
fixes
Code looks good, maybe need to rebase with |
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Great, thank you! |
* Replaced `--experimental-ssr` with `isBuildingToSSR` * changest * Improved `isBuildingToSSR` a bit * Added `isBuildingToSSR` to more places!!1! * Added `@deprecated` tag * Replaced missing experimentalSsr * Added failing test * Removed test * Re-added experimental ssr flag * Fixed typo Co-authored-by: Matthew Phillips <matthew@skypack.dev> * Fixed deno tests Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Changes
Replaced--experimental-ssr
with the internal functionisBuildingToSSR
, which reads the brand-newadapter
inside the Astro config.isBuildingToSSR()
everywhere.--experimental-ssr
flag now is required when using 3rd-party adapters.This change has a side effect: it now respects the output given by the integrations through
buildConfig
and (somehow) doesn't copy the contents ofpublic/
into the dist folder. @matthewp maybe you can help me with this?Testing
TBD
Docs
TBD