Fix Astro.site always being undefined in Container API rendering - #17703
Conversation
β¦Astro.site is available in container rendering (#17682)
π¦ Changeset detectedLatest commit: f7ccb4a The changes in this PR will be included in the next version bump. This PR includes changesets to release 420 packages
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 |
e18e dependency analysisNo dependency warnings found. |
Merging this PR will degrade performance by 10.55%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| β | Simulation | Rendering: streaming [true], .md file |
1.3 ms | 1.4 ms | -10.55% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing triagebot/fix-17682 (f7ccb4a) with main (97140b2)1
Footnotes
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [@astrojs/markdown-remark](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/markdown/remark)) | [`7.2.3` β `7.2.4`](https://renovatebot.com/diffs/npm/@astrojs%2fmarkdown-remark/7.2.3/7.2.4) |  |  | | [astro](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/astro)) | [`7.2.3` β `7.2.4`](https://renovatebot.com/diffs/npm/astro/7.2.3/7.2.4) |  |  | --- ### Release Notes <details> <summary>withastro/astro (@​astrojs/markdown-remark)</summary> ### [`v7.2.4`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#724) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@7.2.3...@astrojs/markdown-remark@7.2.4) ##### Patch Changes - Updated dependencies \[[`05763a0`](withastro/astro@05763a0)]: - [@​astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@​0.10.4 </details> <details> <summary>withastro/astro (astro)</summary> ### [`v7.2.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#724) [Compare Source](https://github.com/withastro/astro/compare/astro@7.2.3...astro@7.2.4) ##### Patch Changes - [#​17747](withastro/astro#17747) [`a90ff66`](withastro/astro@a90ff66) Thanks [@​Princesseuh](https://github.com/Princesseuh)! - Fixes builds hanging when an image file is malformed - [#​17701](withastro/astro#17701) [`05763a0`](withastro/astro@05763a0) Thanks [@​matthewp](https://github.com/matthewp)! - Fixes base path stripping to respect path-segment boundaries. With a configured `base` such as `/docs`, a request like `/docs-archive/page` is no longer treated as being under the base, so routing and `context.url.pathname` now agree on the same pathname. - [#​17742](withastro/astro#17742) [`70b449d`](withastro/astro@70b449d) Thanks [@​Kjubikstronk](https://github.com/Kjubikstronk)! - Fixes `astro build` throwing `TypeError: Missing parameter` for dynamic routes when `build.format: 'preserve'` and `trailingSlash: 'always'` are used together. Stripping the framework-injected `.html` suffix dropped the trailing slash that the compiled route pattern requires, so the route no longer matched itself and its params resolved as empty. - [#​17703](withastro/astro#17703) [`771b0a9`](withastro/astro@771b0a9) Thanks [@​astrobot-houston](https://github.com/astrobot-houston)! - Fixes `Astro.site` always being `undefined` when rendering components via the Container API, even when `site` is set in `astroConfig` - Updated dependencies \[[`05763a0`](withastro/astro@05763a0), [`bc171af`](withastro/astro@bc171af)]: - [@​astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@​0.10.4 - [@​astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@​0.3.7 - [@​astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@​7.2.4 </details> --- ### Configuration π **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) π¦ **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. π **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4zMS4wIiwidXBkYXRlZEluVmVyIjoiNDQuMzEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
Closes #17682
Changes
Astro.siteis now correctly set when rendering components via the Container API. Previously,astroConfig.sitepassed toAstroContainer.create()was accepted in the type signature but never read β the value was never forwarded to the internalcreateManifest()call or written onto theSSRManifest, soAstro.sitewas alwaysundefined.astroConfig.sitethroughAstroContainer.create()β constructor βcreateManifest(), and adds'site'to theAstroContainerManifestPick type so a pre-built manifest can also carry the value.Testing
'Astro.site reflects astroConfig.site'β verifies thatAstro.sitematches the URL set inastroConfig.site.'Astro.site is undefined when astroConfig.site is not set'β verifies the default behavior remains unchanged.Docs
No docs update needed β
AstroContainer.create()already documents theastroConfig.siteoption; this fix makes it work as documented.