@@ -1186,8 +1186,8 @@ def get_compilation_time() -> str:
11861186 progress .start ()
11871187 task = progress .add_task (
11881188 f"[{ get_compilation_time ()} ] Compiling:" ,
1189- total = len (self ._pages )
1190- + (len (self ._unevaluated_pages ) * 2 )
1189+ total = len (self ._unevaluated_pages )
1190+ + (( len (self ._unevaluated_pages ) + len ( self . _pages )) * 3 )
11911191 + fixed_pages_within_executor
11921192 + adhoc_steps_without_executor
11931193 + plugin_count ,
@@ -1272,22 +1272,28 @@ def memoized_toast_provider():
12721272 all_imports .update (custom_components_imports )
12731273 progress .advance (task )
12741274
1275- # This has to happen before compiling stateful components as that
1276- # prevents recursive functions from reaching all components.
1277- for component in self ._pages .values ():
1278- # Add component._get_all_imports() to all_imports.
1279- all_imports .update (component ._get_all_imports ())
1275+ with console .timing ("Collect all imports and app wraps" ):
1276+ # This has to happen before compiling stateful components as that
1277+ # prevents recursive functions from reaching all components.
1278+ for component in self ._pages .values ():
1279+ # Add component._get_all_imports() to all_imports.
1280+ all_imports .update (component ._get_all_imports ())
12801281
1281- # Add the app wrappers from this component.
1282- app_wrappers .update (component ._get_all_app_wrap_components ())
1282+ # Add the app wrappers from this component.
1283+ app_wrappers .update (component ._get_all_app_wrap_components ())
1284+
1285+ progress .advance (task )
12831286
12841287 # Perform auto-memoization of stateful components.
12851288 with console .timing ("Auto-memoize StatefulComponents" ):
12861289 (
12871290 stateful_components_path ,
12881291 stateful_components_code ,
12891292 page_components ,
1290- ) = compiler .compile_stateful_components (self ._pages .values ())
1293+ ) = compiler .compile_stateful_components (
1294+ self ._pages .values (),
1295+ progress_function = lambda task = task : progress .advance (task ),
1296+ )
12911297 progress .advance (task )
12921298
12931299 # Catch "static" apps (that do not define a rx.State subclass) which are trying to access rx.State.
0 commit comments