iot-app-kit icon indicating copy to clipboard operation
iot-app-kit copied to clipboard

[Bug] reduce friction when consuming react-components as a dependency

Open boweihan opened this issue 1 year ago • 0 comments

Describe the bug Consuming @iot-app-kit/react-components per instructions currently requires pulling in several other dependencies including sass, is-hotkey, react-hotkeys, and react-popper.

To Reproduce Steps to reproduce the behavior: Set up any react application with the following client component code:

import { initialize } from "@iot-app-kit/source-iotsitewise";
import { LineChart, WebglContext } from "@iot-app-kit/react-components";

import "@iot-app-kit/components/styles.css";

const { query } = initialize({
  awsCredentials: {
    accessKeyId: YOUR_ACCESS_KEY_ID,
    secretAccessKey: YOUR_SECRET_ACCESS_KEY,
    sessionToken: YOUR_TOKEN 
  },
  awsRegion: "us-west-2",
});

export default function Client() {
  return (
    <>
      <LineChart
        queries={[
          query.timeSeriesData({
            assets: [
              {
                // Replace sitewse-asset-id with the ID of your AWS IoT SiteWise asset.
                assetId: "sitewise-asset-id",
                // Replace property-id with the ID of your AWS IoT SiteWise asset property.
                properties: [
                  { propertyId: "property-id" },
                ],
              },
            ],
          }),
        ]}
      />
      <WebglContext />
    </>
  );
}

Expected behavior This works with only prescribed dependencies - react-components and source-iotsitewise.

boweihan avatar Aug 18 '23 14:08 boweihan