site-kit-wp icon indicating copy to clipboard operation
site-kit-wp copied to clipboard

Update to latest Google charts library version

Open felixarntz opened this issue 5 years ago • 11 comments

A new Google charts library version was recently published, however it caused critical JS errors in Site Kit (see #3132), so we ensured to keep using version 49 for now. We should still figure out where these errors are actually coming from in regards to the new version 50 release of the charts library, fix them, and update.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • Site Kit should use version 51 of the Google charts library throughout (both in PHP and JS where version 49 is referenced, this needs to be updated).
  • The new version should not result in any JS errors on Site Kit screens where charts are present.

Implementation Brief

  • Update the chartVersion prop on the GoogleChart component
  • ~~In Core/Assets.php change 49 to 50 in the googlesitKit-google-charts Script object~~
  • Remove the googlesitkit-google-charts Script instance and references to it

Test Coverage

  • n/a

Visual Regression Changes

  • Check visual tests but no changes are anticipated

QA Brief

  • There should be no changes to the Charts.
  • Go through Site Kit and check as many charts as possible.

Changelog entry

  • N/A

felixarntz avatar Apr 12 '21 20:04 felixarntz

I've created a PR: https://github.com/google/site-kit-wp/pull/3334

All tests pass without any problem* and I cannot display any error while navigating the plugin.

I'm not sure if some specific data was triggering the error though or it crashed all the time. The comments imply the latter, if that's true then Google charts must have released some minor/patch bug fixes, but the JS file doesn't imply that. It's just hosted at https://www.gstatic.com/charts/50/js/jsapi_compiled_corechart_module.js

*except the known failing e2e WP 4.9

danielgent avatar May 11 '21 13:05 danielgent

Whilst looking into this I found that I can cause the same errors to occur ( as noted in #3132 ) by setting the Google Charts version in Assets.php to 50 and the chartVersion in the GoogleChart component to 49.

The following scenarios work:

  1. Assets.php : 50, GoogleChart: 50
  2. Assets.php : current, GoogleChart: 50
  3. Assets.php : 50, GoogleChart: remove chartVersion prop
  4. Assets.php : current, GoogleChart: remove chartVersion prop

I shall update the IB with the third of these scenarios.

Hazlitte avatar Jun 17 '21 12:06 Hazlitte

@Hazlitte would it be possible to add an estimate here now the IB is completed please?

eclarke1 avatar Jun 21 '21 09:06 eclarke1

IB :heavy_check_mark:

eugene-manuilov avatar Jul 12 '21 18:07 eugene-manuilov

I'm getting some very odd errors in storybook that free failing on a v51 of google charts :thinking: (Which we aren't loading!) https://www.gstatic.com/charts/51/js/jsapi_compiled_default_module.js

In .storybook/preview-head.html I've updated the version to 50 (which isn't in the IB)

danielgent avatar Aug 16 '21 18:08 danielgent

See the version 50 upgrade PR here https://github.com/google/site-kit-wp/pull/3334 and how it fails the VRT and Storybook Test steps (Storybook crashes with errors like this)

v50-errors

However I created a PR with Google Charts upgraded to v51 and those tests pass https://github.com/google/site-kit-wp/pull/3881

Just the PHP Tests / PHP (PHP 7.4, WordPress Nightly) (pull_request) test is failing in both PRs. Seems odd though that the PHP tests only fail for one specific version - I'll check if there's some other issue here by making a new PR with no changes

danielgent avatar Aug 16 '21 18:08 danielgent

Failing PHP test is happening on new PRs that only have comment changes - https://github.com/google/site-kit-wp/pull/3882/checks?check_run_id=3343479892 - not related to this PR then

danielgent avatar Aug 16 '21 19:08 danielgent

Failing PHP test has now been fixed :+1:

danielgent avatar Aug 17 '21 10:08 danielgent

No rush on this but a few questions for @felixarntz in the review.

aaemnnosttv avatar Aug 18 '21 14:08 aaemnnosttv

@aaemnnosttv I think I already replied to them but then forgot to reassign the issue, at least I don't see any other questions. Just to confirm, is #3881 the correct PR? Asking since there's also #3334.

felixarntz avatar Aug 23 '21 17:08 felixarntz

**QA ✅ **

Ran regression tests on Adsense, Search Console and Adsense. image image image image image

Sending to Approval

cole10up avatar Aug 31 '21 18:08 cole10up