Repository: withastro/astro
File: packages/astro/src/core/render-context.ts (TypeScript)

Code before:
			partial,
			pathname,
			renderers,
			resolve,
			response,
			request: this.request,
			scripts,
			styles,
			actionResult,
			serverIslandNameMap: manifest.serverIslandNameMap ?? new Map(),
			key: manifest.key,
			trailingSlash: manifest.trailingSlash,
			_metadata: {
				hasHydrationScript: false,
				rendererSpecificHydrationScripts: new Set(),
				hasRenderedHead: false,
				renderedScripts: new Set(),
				hasDirectives: new Set(),
				hasRenderedServerIslandRuntime: false,
				headInTree: false,
				extraHead: [],
				extraStyleHashes: [],
				extraScriptHashes: [],
				propagators: new Set(),
			},
			shouldInjectCspMetaTags: manifest.csp?.shouldInjectCspMetaTags ?? false,
			clientScriptHashes: manifest.csp?.clientScriptHashes ?? [],
			clientStyleHashes: manifest.csp?.clientStyleHashes ?? [],
			cspAlgorithm: manifest.csp?.algorithm ?? 'SHA-256',
		};

		return result;
	}

	#astroPagePartial?: Omit<AstroGlobal, 'props' | 'self' | 'slots'>;

	/**
	 * The Astro global is sourced in 3 different phases:
	 * - **Static**: `.generator` and `.glob` is printed by the compiler, instantiated once per process per astro file
	 * - **Page-level**: `.request`, `.cookies`, `.locals` etc. These remain the same for the duration of the request.
	 * - **Component-level**: `.props`, `.slots`, and `.self` are unique to each _use_ of each component.
	 *
	 * The page level partial is used as the prototype of the user-visible `Astro` global object, which is instantiated once per use of a component.
	 */
	createAstro(
		result: SSRResult,
		astroStaticPartial: AstroGlobalPartial,
		props: Record<string, any>,
		slotValues: Record<string, any> | null,
		apiContext: ActionAPIContext,
	): AstroGlobal {

Review comment (suggestion):
If `shouldInjectCspMetaTags` isn't on `manifest.csp` anymore, then this flag should probably be `!!manifest.csp`

Code after:
			partial,
			pathname,
			renderers,
			resolve,
			response,
			request: this.request,
			scripts,
			styles,
			actionResult,
			serverIslandNameMap: manifest.serverIslandNameMap ?? new Map(),
			key: manifest.key,
			trailingSlash: manifest.trailingSlash,
			_metadata: {
				hasHydrationScript: false,
				rendererSpecificHydrationScripts: new Set(),
				hasRenderedHead: false,
				renderedScripts: new Set(),
				hasDirectives: new Set(),
				hasRenderedServerIslandRuntime: false,
				headInTree: false,
				extraHead: [],
				extraStyleHashes: [],
				extraScriptHashes: [],
				propagators: new Set(),
			},
			shouldInjectCspMetaTags: !!manifest.csp,
			clientScriptHashes: manifest.csp?.clientScriptHashes ?? [],
			clientStyleHashes: manifest.csp?.clientStyleHashes ?? [],
			cspAlgorithm: manifest.csp?.algorithm ?? 'SHA-256',
		};

		return result;
	}

	#astroPagePartial?: Omit<AstroGlobal, 'props' | 'self' | 'slots'>;

	/**
	 * The Astro global is sourced in 3 different phases:
	 * - **Static**: `.generator` and `.glob` is printed by the compiler, instantiated once per process per astro file
	 * - **Page-level**: `.request`, `.cookies`, `.locals` etc. These remain the same for the duration of the request.
	 * - **Component-level**: `.props`, `.slots`, and `.self` are unique to each _use_ of each component.
	 *
	 * The page level partial is used as the prototype of the user-visible `Astro` global object, which is instantiated once per use of a component.
	 */
	createAstro(
		result: SSRResult,
		astroStaticPartial: AstroGlobalPartial,
		props: Record<string, any>,
		slotValues: Record<string, any> | null,
		apiContext: ActionAPIContext,
	): AstroGlobal {