Airframe GitHub Storybook

BAgel helper

How to use the built in BAgel helper utility to be notified of component errors, deprecation warnings and accessibility issues in your pages when developing with BAgel

The following snippet needs to be added in to the page before the components have loaded. It's recommended to not enable this in production

Snippet to be included in the head of your page
<script>
  window.bagel = {
    enableHelper: true
  }
</script>

You can also enable the helper via your console browser. Simply type the following into the console on any page that has BAgel installed.

window.bagel.enableHelper()
This will set an item in your local storage allowing BAgel helper to stay enabled across pages.

To disable BAgel helper run the following
window.bagel.disableHelper()

If you need to enable the helper on a BAgel page that is running inside an iframe, such as Storybook grab the iframe and run the command on that.

Enabling BAgel helper on a page inside an iframe
const iframe = document.getElementById("iframe-id")
iframe.contentWindow.bagel.enableHelper()

When the BAgel helper is enabled you will see a "BAgel Helper enabled" message in the console

Run window.bagel.getVersion() and this will return the currently installed version on the page

BAgel helper also has a debug mode that highlights all the components on a page as well as logging the currently installed version. It will also list of all the components on the page, with a total of how many times each one has been used. To enable this run the following in your browser console window.bagel.debug().

Once enabled hovering over any of the BAgel elements will highlight that element and show the elements name.

Figma GitHub Storybook Version 3 release guide Release history BAgel helper QA process