battleaxedotco / brutalism

Battleaxe's component library for Adobe CEP panels
https://battleaxe.dev/brutalism-docs/
MIT License
88 stars 12 forks source link

Extremely slow cold start on panels #10

Closed Inventsable closed 4 years ago

Inventsable commented 4 years ago

Recently isolated an issue with production panels having extremely slow cold starts to the fact they use brutalism. Hasn't affected general web use at all, may be due to unpacked size (local Open Sans font, local Material Design Icons).

Should place as high priority and resolve ASAP -- I suspect it's due to package size, specifically from the fonts.

Inventsable commented 4 years ago

Fixed via 2bb19755290a504d4ad7659dbe6ecc617b60546d.

Turns out this had nothing to do with size at all, and was due to fonts but only peripherally. The panelify component had the following:

@import url(//fonts.googleapis.com/css?family=Open+Sans&display=swap);

Which only on Production context was causing all extensions to error:

Failed to load resource: net::ERR_FILE_NOT_FOUND: 
file://fonts.googleapis.com/css?family=Open+Sans&display=swap

This was being resolved as if a local file, and would cause all rendering to hang idle as the extension waits for a response until eventually timing out. Unfortunately because <Panel> is mounted last and on it's first rendered lifecycle will do a console.clear() there was no error message showing -- spend way too long ripping things apart only to realize it was honestly this absurdly simple of a fix, making Panelify resolve to HTTPS:

@import url("https://fonts.googleapis.com/css?family=Open+Sans&display=swap");

This error makes all previous builds from 1.5.5 - 1.6.2 inherently broken for production, urgent reinstall of anything to brutalism@1.6.3.

adamplouff commented 4 years ago

🙌 mega smart. Good catch on that.

Inventsable commented 4 years ago

Thanks! Be sure to update any projects to 1.6.3 or above since this ended up being a pretty critical bug that doesn't show in dev mode so it's incredibly easy to overlook.