GoogleWebComponents / google-chart

Google Charts API web components
https://www.webcomponents.org/element/@google-web-components/google-chart/elements/google-chart
Apache License 2.0
357 stars 130 forks source link

Migrate to LitElement #293

Closed rslawik closed 3 years ago

rslawik commented 4 years ago

LitElement is a base class for creating lightweight web components. It is the next generation after Polymer 3.

This component does not use some of the Polymer features (like data bindings), so switching to LitElement will reduce the footprint of this component. The API can stay backwards compatible.

LitElement introduces asynchronous rendering which fits well with Google Charts rendering (i.e. waiting for 'ready' event). This migration should ideally happen in two steps:

  1. switch to the new base class (keeping Google Chart rendering separate from LitElement lifecycle)
  2. unify Google Charts rendering with LitElement lifecycle
moderndeveloperllc commented 4 years ago

@rslawik Looks like this was done in 4.0.0?

rslawik commented 4 years ago

Only the first step (switching to LitElement) base class is done in 4.0.0.

The second one (unifying the lifecycles) is not complete yet. There are some opportunities for optimisations in LitElement. For example:

I'd keep this issue open until I check if those can be implemented without breaking changes.

rslawik commented 3 years ago

Closing. This can be revisited when migrating to next version of LitElement.