-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include all client build artifacts in SSRManifest (#3678)
* Include all client build artifacts in SSRManifest * Adds a changeset
- Loading branch information
Showing
8 changed files
with
83 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Fix regression with SSRManifest and client assets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { defineConfig } from 'astro/config'; | ||
import preact from '@astrojs/preact'; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [preact()], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@test/ssr-scripts", | ||
"version": "0.0.0", | ||
"private": true, | ||
"dependencies": { | ||
"@astrojs/preact": "workspace:", | ||
"astro": "workspace:*" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/astro/test/fixtures/ssr-scripts/src/components/Hello.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
export default function() { | ||
return ( | ||
<div>Hello world</div> | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/astro/test/fixtures/ssr-scripts/src/pages/index.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
import Hello from '../components/Hello.jsx'; | ||
--- | ||
<html lang="en"> | ||
<head> | ||
<title>Astro</title> | ||
</head> | ||
<body> | ||
<Hello client:load /> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { expect } from 'chai'; | ||
import { loadFixture } from './test-utils.js'; | ||
import testAdapter from './test-adapter.js'; | ||
|
||
describe('SSR Hydrated component scripts', () => { | ||
/** @type {import('./test-utils').Fixture} */ | ||
let fixture; | ||
|
||
before(async () => { | ||
fixture = await loadFixture({ | ||
root: './fixtures/ssr-scripts/', | ||
experimental: { | ||
ssr: true, | ||
}, | ||
adapter: testAdapter(), | ||
}); | ||
await fixture.build(); | ||
}); | ||
|
||
it('Are included in the manifest.assets so that an adapter can know to serve static', async () => { | ||
const app = await fixture.loadTestAdapterApp(); | ||
|
||
/** @type {Set<string>} */ | ||
const assets = app.manifest.assets; | ||
expect(assets.size).to.be.greaterThan(0); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.