Toolbar side loading unneeded Google font Source Code Pro

I know this sounds pedantic but I'm currently optimising our website. This means trawling through network requests and bundles making sure to cut bloat where I find it. Is there any way we can add a param flag to the new toolbar to remove 'cosmetics' like unneeded fonts? It feels a little bit cheeky that I'm over here cutting bytes everywhere I can and Prismic be dumping fonts into my production page.

G

Hey Gareth, welcome to the Community forum!

Improving the performance, seo and score of your website is always important.
We recently released a new version of the Toolbar, as mentioned in our progress page, and one of the things that we're more excited about is the fact that the Toolbar itself is way lighter than before:

"We drastically improved the performance of the toolbar script. This script is now almost ten times smaller than in the previous version. We managed to make it 100Kb lighter (from 120kb to 14kb) than previously. This will impact all users visiting your website and on the overall performances of your website."

To know if you have this newer version which includes code splitting and smaller file size you can check by typing prismic.version in your browser console for you website like so:

Oct-21-2020 15-02-36

The version should be 4.0.0 , like above. If you don't have this then clear the cache in the browser to refresh and get then latest toolbar.

Although thus is not related to the font embedded into the toolbar, I thought you might want to hear this good news.

As for the styles of it, we don't recommend people to modify the script of the Toolbar because it may cause things to break. So we don't currently have an option to change de CSS properties of it.

Could you tell me in which way is this causing you problems in the dev process?

Thanks a lot

The issue isn't really anything more than the fact the new toolbar side loads the font Source Code Pro from Google fonts which is entirely unnecessary. Arial will do, it sounds pedantic but I don't need 645 bytes downloaded when a client is never going to see it.

On top of this it actually appears that you don't even use Source Code Pro at all so it's redundant.

You use: font-family: SF Pro,Helvetica,"sans-serif";

It seems like it, i've asked the dev team so they can communicate us if there's a reason for having the two fonts. I'll keep you posted in here about any information

In the meantime, what you could do to not have the extra font on your project would be to completely remove the Preview & Toolbar script from your project. We do not recommend this as this will prevent you from making previews in development or production (so you could to share with your client) in the future.

Thanks for the speedy reply. Yeah I think it's redundant, I'd be keen to see if the dev team can resolve this. Many thanks.

Any update on this? Were your developers able to remove the unneeded font?

Hey Gareth, this task is still on the devs pipeline, the team will take over it as soon as possible but we don't have a rough ETA on when this is going to be. We'll update this thread when we have news about this.

Thanks a lot

Hello, just wanted to give you a quick update about this. We've defined that this is a fix that'll be sorted out in the future but we don't have a rough ETA for it's release, therefore I'll leave this thread as an open feature request for future enhancements.

Thank you very much

Ok, great. Thanks for the update!

This is being tracked as an open feature request.

If you have another use-case for this feature, you can 'Flag' this topic to reopen. Please use the :heart: button to show your support for the feature and check out our Feature Request Guidelines.

Has there been any update on this topic?

My team and I recently updated our website's Prismic implementation and our companies compliance team alerted us to the fact we now have a google font dependency we now need to declare in our GDPR consent banner. The preferred solution for us would be to either self-host the font or if possible entirely remove any need for the font.

1 Like

Hi Jamie,

Welcome to the community!

There's been no change to the presence of this font, but the Prismic Toolbar script and font should only be loaded for logged-in Prismic users, so you normal (non-Prismic) website users should never see this script or font, but I'll confirm with the team.

Thanks.

Unfortunately the font does load for all users not just logged-in Prismic users (tested in incognito), which is how I suppose our compliance team became aware of it so quickly :laughing:

Is this the correct GitHub repo for the toolbar? I see the latest version there is 4.0.4, but I see version 4.0.5 on our website.

Sorry for the double post didn't realize the flag comment would eventually appear.

Ok, in that case it behaves different then I thought. The version 4.0.5 is the correct one.

No worries about the double post.

I've reached out to the devs, once I have any update I'll let you know here :slightly_smiling_face:

1 Like

This is being tracked as an open issue. If/When we have more information about this we'll reopen the thread and post it here.

Hello, has there been any update regarding this issue? I want to self host Google Fonts in all of my projects and I would like to get rid of this API call to Google Fonts made by prismic? Is there a way to do that?

Hey, did you manage to get rid of this API call or did you declare it in GDPR consent banner?