The team is now working on the WordPress Interactivity API. This unblocks the same UX Frontity framework enabled but directly in WordPress Core, fully compatible with the new Site Editor.
library: Name of the component they want to use. Required.
Why not use the name component for this propety?
Examples
Possible solution
Use a component property in the configuration object to define the Fill for the Slot and Fills pattern
const state = {
fills: {
namespace: {
nameOfTheFill: {
slot: "Name of the slot they want to feel",
component: "AnyComponentWeWantToUseForTheFill",
priority: 5,
props: {
// Object with props that will be passed to the component.
},
},
},
},
};
luisherranz2
I named it library because configuring things in the state that require a function that is stored in libraries is going to be a recursive pattern in Frontity.
I felt like if it was named library, it was easier to remember where it’s coming from.
Two ideas that may follow a similar pattern are handlers and processors.
I was literally going to suggest the same thing - I’ve made a private note on Monday but haven’t shared it yet
Basically, I also felt confused by the library name and component is much clearer to me. Even having worked with the processors before, I haven’t made the connection between that API and the Slot and Fill API, so I think that I would sacrifice the consistency for clarity in this case
SantosGuillamot4
Okay, then it seems it makes sense to change it. As this feature is not a beta, we should make it backwards compatible. I guess that wouldn’t be a problem right?
mmczaplinski5
nope, not a problem
We can add a deprecation warning now and remove it in Frontity 2.0 later.
luisherranz6
I’m still not convinced about this. Remember that it includes the namespace. It is not:
which points to libraries.fills.namespace.AnyComponentWeWantToUseForTheFill.
With library I was trying to:
Inform the user where the code can be found.
Reduce a bit the long string by only using namespace.component.
If we rename it to component, we will be removing that part of the information. So I agree to rename it to component but if we add libraries to the string, to counter for the loss of information: