summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/index.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/index.ts b/src/compiler/index.ts
index d2d7bff08..7e7bfc4c6 100644
--- a/src/compiler/index.ts
+++ b/src/compiler/index.ts
@@ -131,7 +131,12 @@ ${result.imports.join('\n')}
// \`__render()\`: Render the contents of the Astro module.
import { h, Fragment } from '${internalImport('h.js')}';
+const __astroRequestSymbol = Symbol('astro.request');
async function __render(props, ...children) {
+ const Astro = {
+ request: props[__astroRequestSymbol]
+ };
+
${result.script}
return h(Fragment, null, ${result.html});
}
@@ -148,7 +153,7 @@ export async function __renderPage({request, children, props}) {
__render,
};
- import.meta.request = request;
+ props[__astroRequestSymbol] = request;
const childBodyResult = await currentChild.__render(props, children);
// find layout, if one was given.