[v10] Add support for functions in component configs#1896
[v10] Add support for functions in component configs#1896colinrotherham wants to merge 5 commits intosupport/10.xfrom
Conversation
608a65c to
94917f8
Compare
5562f44 to
c3c6fc7
Compare
94917f8 to
efbb062
Compare
c3c6fc7 to
e1a7744
Compare
efbb062 to
da59959
Compare
e1a7744 to
9ac9e9b
Compare
da59959 to
7f2165b
Compare
9ac9e9b to
93515cf
Compare
93515cf to
906201e
Compare
MatMoore
left a comment
There was a problem hiding this comment.
The changes themselves look fine, but I am just wondering if there are any security considerations here, so just wanted to flag that.
It seems like the function type is effectively a way to embed a form of inline script, and if you are otherwise blocking inline scripts via a CSP, is this circumventing that protection?
There was a problem hiding this comment.
maybe move this to the top so you can use it in the precondition, as it appears in that expression twice.
Thankfully, if this was configured via inline You'll also see that when it comes to HTML:
Config functions are only allowed to be set via Although with JavaScript being JavaScript, you can always continue to overwrite things at will anyway: CharacterCount.prototype.updateCount = () => {
// Overwrite count function
}class CharacterCountDanger extends CharacterCount {
updateCount() {
// Extend count function
}
}i.e. Adding a config option hasn't introduced any new ways to override functions |
|
Ah, that makes sense. I was thinking they would be configurable by data attributes. |
|



Description
This PR adds a new
functionconfig schema type (alongsidestring,boolean,objectandarraytypes)Support for
arraytypes was added recently in:JavaScript configuration
Config function values via
initAll()andcreateAll(), for example to configure the character count function:Checklist