sigmacomputing / plugin

MIT License
2 stars 1 forks source link

Provide browser-ready version of @sigmacomputing/plugin #1

Open Pearce-Ropion opened 2 years ago

Pearce-Ropion commented 2 years ago

Attach the plugin client to the window object so that it can be used via a CDN instead of through the node/react pipeline. Some like the following API

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@sigmacomputing/plugin/dist/client.browser.js"></script>
<script type="text/javascript">
client.config.configureEditorPanel([
  { name: "source", type: "element" },
  ...

Some users have reported going through a build system like rollup to enable this:

export default {
  input: 'dist/client.js',
  output: {
    name: 'client',
    file: 'dist/client.browser.js',
    format: 'iife',
  }
};

See SIG-17489