1
1
import type { ActionAPIContext } from '../actions/runtime/utils.js' ;
2
+ import { getActionContext } from '../actions/runtime/virtual/server.js' ;
2
3
import { deserializeActionResult } from '../actions/runtime/virtual/shared.js' ;
3
4
import { createCallAction , createGetActionResult , hasActionPayload } from '../actions/utils.js' ;
4
5
import {
@@ -12,6 +13,7 @@ import type { ComponentInstance } from '../types/astro.js';
12
13
import type { MiddlewareHandler , Props , RewritePayload } from '../types/public/common.js' ;
13
14
import type { APIContext , AstroGlobal , AstroGlobalPartial } from '../types/public/context.js' ;
14
15
import type { RouteData , SSRResult } from '../types/public/internal.js' ;
16
+ import type { SSRActions } from './app/types.js' ;
15
17
import {
16
18
ASTRO_VERSION ,
17
19
REROUTE_DIRECTIVE_HEADER ,
@@ -32,8 +34,6 @@ import { type Pipeline, Slots, getParams, getProps } from './render/index.js';
32
34
import { isRoute404or500 , isRouteExternalRedirect , isRouteServerIsland } from './routing/match.js' ;
33
35
import { copyRequest , getOriginPathname , setOriginPathname } from './routing/rewrite.js' ;
34
36
import { AstroSession } from './session.js' ;
35
- import { getActionContext } from '../actions/runtime/virtual/server.js' ;
36
- import type { SSRActions } from "./app/types.js" ;
37
37
38
38
export const apiContextRoutesSymbol = Symbol . for ( 'context.routes' ) ;
39
39
@@ -83,13 +83,13 @@ export class RenderContext {
83
83
status = 200 ,
84
84
props,
85
85
partial = undefined ,
86
- actions
86
+ actions,
87
87
} : Pick < RenderContext , 'pathname' | 'pipeline' | 'request' | 'routeData' | 'clientAddress' > &
88
88
Partial <
89
89
Pick < RenderContext , 'locals' | 'middleware' | 'status' | 'props' | 'partial' | 'actions' >
90
90
> ) : Promise < RenderContext > {
91
91
const pipelineMiddleware = await pipeline . getMiddleware ( ) ;
92
- const pipelineActions = actions ?? await pipeline . getActions ( ) ;
92
+ const pipelineActions = actions ?? ( await pipeline . getActions ( ) ) ;
93
93
setOriginPathname ( request , pathname ) ;
94
94
return new RenderContext (
95
95
pipeline ,
0 commit comments