scullyio / scully

The Static Site Generator for Angular apps

Home Page:https://scully.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slow Page Transition with Flash Prevention Plugin

billmcgrane opened this issue · comments

🐞 Bug report

Description

🔬 Minimal Reproduction

Create Angular 16+ app using scullyio and the flash prevention plugin. Observe the transition time from the prerendered page to the dynamic page generated by the SPA.

💻Your Environment

Angular Version:



Angular CLI: 17.1.0
Node: 18.17.1
Package Manager: npm 8.18.0
OS: darwin arm64

Scully Version:



"@scullyio/init": "^2.1.41",
"@scullyio/ng-lib": "^2.1.41",
"@scullyio/scully": "^2.1.41",
"@scullyio/scully-plugin-flash-prevention": "^2.1.41",
"@scullyio/scully-plugin-puppeteer": "^2.1.41",

🔥 Exception or Error



"Scully is using timeouts, add the needed polyfills instead!"

The needed polyfill, zone.js/dist/task-tracking, is no longer exported as of Angular 16 
and therefore cannot be specified as a polyfill. This results in the transition from the 
prerendered to dynamic page taking much longer than normal. 

The behavior is seen with zone.js 0.14.3

I can confirm this is happening, we recently upgraded to angular 17.

@SanderElias - any planned fixes or recommended workarounds? Seems like an important issue.

Thanks @billmcgrane for the message. Angular 17 however requires 0.14.3.

I ended up resolving this however. In Angular 17.3, I don't see any flash when moving from static to dynamic site. So there is no need for the flash prevention plugin from what I see. Angular seems to be doing something where it takes over the pre-rendered html without causing flash. It might be related to the non-destructive hydration improvements Angular recently made.