Add functions and mixins to manipulate the utlities map#35977
Add functions and mixins to manipulate the utlities map#35977romaricpascal wants to merge 0 commit intotwbs:mainfrom
Conversation
|
I've fleshed out the proper implementation for the functions/mixins. A couple of notable things:
It's tested out using this |
|
owners don't like when function/mixin not used anywhere :( |
|
Loving this, @romaricpascal! We'll need some documentation added to the Utilities API page I think. Maybe add a new section under I'm not 100% sure on needing to document each function, but I defer to you on that. Could be nice to have a table maybe for those, but the mixins are my main concern. |
|
Oh! And I'd love to see the |
cc983cd to
cb913d8
Compare
I updated the "Using the API" section of the "Utility API" page. I left the existing examples in a "Practical example" section, as they answer the more likely updates people would want to do. Maybe they could be put as a last "cookbook-ish" section rather than nested inside the part describing the mixins? Also found an example in the Color page that was using the Please let me know of any extra updates (or if there's other examples of use of the utilities API in examples I'd have missed).
I'll prepare that! Pretty excited of the positive welcome it's receiving 😄 |
|
The |
59824ca to
62e7f9f
Compare
62e7f9f to
23e5082
Compare
|
Whoops, looks like I nuked my branch on my repo. I'll see if I can recover it somehow, sorry. I'm not quite sure what happened there. Think I may have ran |
Code for #35945. Just threw some code in to get the shapes of the functions. Still need testing, handling all the cases (values not being maps for example), and docs updates (but I'll do that last once the code is set).
The PR adds the following:
a.
utilities-get-optionsb.
utilities-get-optionc.
utilities-get-valuea.
utilities-set-options(defaults to merging with existing, but can be used to completely override by passing$merge: false, allowing to completely redefine a utility if necessary)b.
utilities-set-option(just a thin wrapper onutilities-set-options)c.
utilities-add-valuesd.
utilities-remove-valuesa.
utilities-addb.
utilities-removePlease let me know if there'd be one I missed, or if some are too much (2.b, 3.a. and 3.b for example only bring a consistent API by thinly wrapping other existing functions/mixins)