You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
React and React-Dom dependencies are required in the head script of the page using the widgets, see example use file
the rollup config looks for the widget.jsx file under each component directory to use as the starting point for that widget
the Storybook stories utilize the rollup built JS file for each widget with pure HTML (no React in the stories)
the .storybook/preview-body.html and .storybook/preview-head.html files inject the react and react-dom packages into storybook's rendering of components as well as a default div to use for remounting
when running locally the bundled files are not GZIP compressed since storybook pulls the files from the local file store which does not have the capability to set the content-encoding header that tells the browser that the JS file is GZIP encoded
the script element creation in each story needs to be anonymous function so that it is rerun every time a different story is selected in the UI to ensure that the new content is placed in the default widget div
the JSX notes print out shows left double quotes “ instead of the " value due to being in a code block
Credits
Much of the uploadWidgets.js script came from this stackoverflow answer with some changes and additions to work with this pattern