Repository: withastro/astro
File: packages/astro/src/vite-plugin-app/pipeline.ts (TypeScript)

Code before:
					};

					// Additional data for the dev overlay
					const children = `window.__astro_dev_toolbar__ = ${JSON.stringify(additionalMetadata)}`;
					scripts.add({ props: {}, children });
				}
			}

			// TODO: We should allow adding generic HTML elements to the head, not just scripts
			for (const script of settings.scripts) {
				if (script.stage === 'head-inline') {
					scripts.add({
						props: {},
						children: script.content,
					});
				} else if (script.stage === 'page' && isPage(filePath, settings)) {
					scripts.add({
						props: { type: 'module', src: `/@id/${PAGE_SCRIPT_ID}` },
						children: '',
					});
				}
			}
		}

		const { css } = await import('virtual:astro:dev-css');

		// Pass framework CSS in as style tags to be appended to the page.
		const links = new Set<SSRElement>();

		const styles = new Set<SSRElement>();
		for (const { id, url: src, content } of css) {
			// Vite handles HMR for styles injected as scripts
			scripts.add({ props: { type: 'module', src }, children: '' });
			// But we still want to inject the styles to avoid FOUC. The style tags
			// should emulate what Vite injects so further HMR works as expected.
			styles.add({ props: { 'data-vite-dev-id': id }, children: content });
		}

		return { scripts, styles, links };
	}

	componentMetadata(routeData: RouteData) {
		const filePath = new URL(`${routeData.component}`, this.manifest.rootDir);
		return getComponentMetadata(filePath, this.loader);
	}

	async preload(routeData: RouteData, filePath: URL) {
		if (routeIsRedirect(routeData)) {
			return RedirectComponentInstance;
		}


Review comment (suggestion):
If possible, we shouldn't rely on the loader anymore. We actually want to move away from it eventually, because it goes in conflicts with the new architecture.

In fact, it's possible we won't need this pipeline anymore once we're able to provide all the features using `DevApp`

Code after:
						debugInfo: await getInfoOutput({ userConfig: settings.config, print: false }),
					};

					// Additional data for the dev overlay
					const children = `window.__astro_dev_toolbar__ = ${JSON.stringify(additionalMetadata)}`;
					scripts.add({ props: {}, children });
				}
			}

			// TODO: We should allow adding generic HTML elements to the head, not just scripts
			for (const script of settings.scripts) {
				if (script.stage === 'head-inline') {
					scripts.add({
						props: {},
						children: script.content,
					});
				} else if (script.stage === 'page' && isPage(filePath, settings)) {
					scripts.add({
						props: { type: 'module', src: `/@id/${PAGE_SCRIPT_ID}` },
						children: '',
					});
				}
			}
		}

		const { css } = await loader.import(getDevCSSModuleName(routeData.component));

		// Pass framework CSS in as style tags to be appended to the page.
		const links = new Set<SSRElement>();

		const styles = new Set<SSRElement>();
		for (const { id, url: src, content } of css) {
			// Vite handles HMR for styles injected as scripts
			scripts.add({ props: { type: 'module', src }, children: '' });
			// But we still want to inject the styles to avoid FOUC. The style tags
			// should emulate what Vite injects so further HMR works as expected.
			styles.add({ props: { 'data-vite-dev-id': id }, children: content });
		}

		return { scripts, styles, links };
	}

	componentMetadata(routeData: RouteData) {
		const filePath = new URL(`${routeData.component}`, this.manifest.rootDir);
		return getComponentMetadata(filePath, this.loader);
	}

	async preload(routeData: RouteData, filePath: URL) {
		if (routeIsRedirect(routeData)) {
			return RedirectComponentInstance;
		}