chartjs / chartjs/chartjs-plugin-annotation
Support for Lighting Web Components security restrictions (LWS)
- Dominant language
- JavaScript
- Stars
- 623
- Forks
- 377
- PR merge metrics
- No merged PRs in 30d
Description
The LWC engine provides "extra" security measures
>LWS confines them to a sandbox where they access a virtual copy of the global window object.
Is it possible to support
```js
(function (global) {
global = global || self;
global.myFunction = function () {};
})(this);
```
[context](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-js.html)
[additional context](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-proxies.html)
Happy to contribution, this may be an issue with the https://github.com/kurkle/color#readme which is included in the umd bundle for chartjs.
seems this is the conflicting spot
https://github.com/chartjs/chartjs-plugin-annotation/blob/1e95744fb98e6fe9426f8b6a7bd17b1fcdee2f42/src/annotation.js#L53C6-L59C10
```js
const value = annotationOptions[key];
if (isObject(value)) {
value.id = key;
annotations.push(value);
}
});
}
```
Contributor guide
Assessment
This issue has not been assessed yet.