File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
packages/runtime/src/internal Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -184,7 +184,16 @@ describe("renderRoutes", () => {
184184 const rendererContext = new RendererContext ( "page" ) ;
185185 const route = {
186186 path : "${APP.homepage}/:objectId" ,
187- context : [ { name : "objectId" , value : "<% PATH.objectId %>" } ] ,
187+ context : [
188+ { name : "objectId" , value : "<% PATH.objectId %>" } ,
189+ {
190+ name : "fromProcessor" ,
191+ onChange : {
192+ action : "console.log" ,
193+ args : [ "<% PROCESSORS.route.context() %>" ] ,
194+ } ,
195+ } ,
196+ ] ,
188197 bricks : [ { brick : "div" } ] ,
189198 menu : {
190199 menuId : "my-menu" ,
@@ -227,6 +236,12 @@ describe("renderRoutes", () => {
227236 ) ;
228237 expect ( runtimeContext . pendingPermissionsPreCheck . length ) . toBe ( 2 ) ;
229238 expect ( loadBricksImperatively ) . toBeCalledWith ( [ "my-pre-load-brick" ] , [ ] ) ;
239+ expect ( loadProcessorsImperatively ) . toBeCalledTimes ( 1 ) ;
240+ expect ( loadProcessorsImperatively ) . toHaveBeenNthCalledWith (
241+ 1 ,
242+ new Set ( [ "route.context" ] ) ,
243+ [ ]
244+ ) ;
230245 await ctxStore . waitForAll ( ) ;
231246 expect ( ctxStore . getValue ( "objectId" ) ) . toBe ( "HOST" ) ;
232247 } ) ;
Original file line number Diff line number Diff line change @@ -189,6 +189,22 @@ export async function renderRoutes(
189189 rendererContext . memoizeMenuRequestNode ( routes , menuRequestNode ) ;
190190 }
191191
192+ const usedProcessors = strictCollectMemberUsage (
193+ route . context ,
194+ "PROCESSORS" ,
195+ 2
196+ ) ;
197+ if ( usedProcessors . size > 0 ) {
198+ output . blockingList . push (
199+ catchLoad (
200+ loadProcessorsImperatively ( usedProcessors , getBrickPackages ( ) ) ,
201+ "processors" ,
202+ [ ...usedProcessors ] . join ( ", " ) ,
203+ rendererContext . unknownBricks
204+ )
205+ ) ;
206+ }
207+
192208 let newOutput : RenderOutput ;
193209 if ( route . type === "routes" ) {
194210 newOutput = await renderRoutes (
You can’t perform that action at this time.
0 commit comments