AlaskaAirlines/auro-select

Make JS examples work using modern imports

Closed this issue · 0 comments

Describe the bug

Currently we are loading all examples js on every page load. This creates a problem where we have to account for not making the JS error when looking at a page that doesn't contain the example it is for. It also creates a problem when the selectors and function names are not unique.

With examples that don't share unique selectors you will see only the one that loads last work correctly.

Expected behavior

The examples JS should be page specific. We can achieve this by wrapping the examples in class exports that we only import on the relevant AuroDocSite page.

e.g. only examples existing on the datepicker/api page should be loaded when on that page.

Important DEPENDENCY!

This PR should only be merged in conjunction with the necessary change to AuroDocSite: AlaskaAirlines/AuroDocsSite#92