ACE-IoT-Solutions / ace-svg-react

Grafana SVG Rendering Panel using the 7+ Plugin Framework
https://grafana.com/grafana/plugins/aceiot-svg-panel/
MIT License
41 stars 14 forks source link

Various cleanup suggestions #3

Closed ryantxu closed 2 years ago

ryantxu commented 4 years ago

This will help me debug a bit if there is a real bug, or somehting in the implementation.

All the state stuff makes me suspicious!

acedrew commented 4 years ago

I'm not able to build with the new monaco editor: Entrypoint module = module.js module.js.map [0] external "react" 42 bytes {0} [built] [1] external "@grafana/ui" 42 bytes {0} [built] [2] external "emotion" 42 bytes {0} [built] [3] ../node_modules/@svgdotjs/svg.js/dist/svg.esm.js 321 KiB {0} [built] [4] external "@grafana/runtime" 42 bytes {0} [built] [5] external "@grafana/data" 42 bytes {0} [built] [6] ../node_modules/webpack/buildin/global.js 472 bytes {0} [built] [7] ./module.ts + 4 modules 133 KiB {0} [built] | ./module.ts 217 bytes [built] | ./ACESVGjsPanel.tsx 8.49 KiB [built] | ./options.tsx 8.85 KiB [built] | ../node_modules/tslib/tslib.es6.js 10 KiB [built] | ./examples.ts 106 KiB [built]

ERROR in ./options.tsx Module not found: Error: Can't resolve './components/MonacoEditor' in '/root/home/acedrew/grafana-plugins/aceiot-svg-react/src' @ ./options.tsx 6:0-57 167:33-45 182:33-45 197:33-45 @ ./module.ts

Trace: Build failed at /root/home/acedrew/grafana-plugins/aceiot-svg-react/node_modules/@grafana/src/cli/utils/useSpinner.ts:13:15 at step (/root/home/acedrew/grafana-plugins/aceiot-svg-react/node_modules/@grafana/toolkit/node_modules/tslib/tslib.js:136:27) at Object.throw (/root/home/acedrew/grafana-plugins/aceiot-svg-react/node_modules/@grafana/toolkit/node_modules/tslib/tslib.js:117:57) at rejected (/root/home/acedrew/grafana-plugins/aceiot-svg-react/node_modules/@grafana/toolkit/node_modules/tslib/tslib.js:108:69) at processTicksAndRejections (internal/process/task_queues.js:97:5)

acedrew commented 4 years ago

I was missing a commit with the component in it, that's why it didn't build. Testing now.

acedrew commented 4 years ago

OK, the main behavior difference between what I had hacked together as a workaround and this, is that with this, the svgMappings are not updated when changing something in the svgMappings options panel. The only way to get it to update seems to be from a full data refresh. Incidentally, since that works, is there a way to trigger a data refresh from inside the panel?