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.
We’ve always thought that running all the messages of Frontity through the same API could be a good idea, to add things like a link to the community.
Let’s explore what possible use cases could have such package.
User Stories
As a package developer
I want to have a standard way to add console warnings
so that those messages have links to the community (or other useful information)
As a package developer
I want to have standard way to throw errors
so that those messages have links to the community (or other useful information)
Also, we could avoid those messages in production:
As a package developer
I don’t want my console warning in production
so that we don’t annoy the final readers
Please add as many use cases as you imagine.
Possible solution
Create a frontity package for messages that will centralize this:
import { warn, error } from "@frontity/error";
warn("You are missing one setting in your frontity.settings file");
error("Something went wrong!");
The implementation would be something like:
const community = msg => msg + "\nVisit community.frontity.org for help";
const warn = msg =>
process.env.NODE_ENV === "development" && console.warn(community(msg));
const error = msg => throw new Error(community(msg));
Maybe we could add an options object:
warn(
"You are missing one setting in your frontity.settings file",
{ production: true }
);
Open an issue in gitbook_docs repo to suggest your changes
In this specific case (updating the API reference) I would suggest to (in order of preference):
Directly suggest the change by creating a PR on the proper document (or documents) gitbook_docs repo
Create a task in our internal Documentation Roadmap explain the details, the priority and all the references the DevRel team could need to complete the task