npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@grafana/plugin-ui

v0.7.0

Published

React components for Grafana plugins

Downloads

827

Readme

plugin-ui

React components for Grafana plugins

Compatibility

There are situations when we require backwards compatibility with core Grafana and new features are only supported by newer versions.

To handle this, we've introduced the compatibility.ts file which contains a list of features and the versions they support for better maintainability.

Considerations

The way we are currently checking whether a feature is supported is by using the Grafana's BuildInfo.

However, there are cases when this version may be masked from plugins.

Only anonymous users (with read-only access) will be able to have their versions hidden, so this should be taken into consideration when deciding whether we should be adding a new feature to our compatibility list.

Unreleased Components

Sometimes we may want improvements/updates of @grafana/ui components but we don't want to update the minimum required versions of Grafana in our plugins and continue supporting older versions.

To work around this, we can import and export the version of the component we want from @grafana/ui in this project. Plugins can then use the component exported from here rather than @grafana/ui.

If updates to a component in @grafana/ui are available in master but not a Grafana release yet, we can copy the components directly into unreleasedComponents to be used in plugins.

Alternatively, we could use the @grafana/ui: canary version instead. However, there are the following tradeoffs:

  • Multiple canary versions will be released in-between @grafana/ui releases

    • This means in-between these release cycles where the component changes aren't available in a package version, the yarn.lock file will need to be updated for every change we make in this project
  • canary versions include @grafana/ui: master branch

    • This means component changes in the master branch which aren't scheduled for the next major release will be included in the canary package.
    • For example, we have changes in <ComponentA /> that won't be released until v7.5.x and <ComponentB /> has changes which are intended to be released for v7.6. Using canary of @grafana/ui will expose the <ComponentB /> major updates too, which we do not want.

Once a @grafana/ui package is then released and available with the component updates, we can remove the component from this folder and export the imported version from the new @grafana/ui package instead.

This means any component in unreleasedComponents should not be modified - they should stay in sync with what is in @grafana/ui (besides changes in imports or stories) and removed from this project as soon as we can replace it with an actual package version.

Storybook

yarn storybook