Ensure related APIs use consistent naming patterns, parameter structures, and calling conventions across the codebase. When introducing new APIs alongside existing ones, maintain naming consistency to provide clarity and reduce cognitive load for developers.
Ensure related APIs use consistent naming patterns, parameter structures, and calling conventions across the codebase. When introducing new APIs alongside existing ones, maintain naming consistency to provide clarity and reduce cognitive load for developers.
Key principles:
loaderData
and actionData
instead of mixing data
and actionData
)routes()
, maintain that pattern)createWorkersKVSessionStorage
)Example of good consistency:
// Before: Inconsistent naming
interface RouteArgs {
data: any; // inconsistent with actionData
actionData: any;
}
// After: Consistent naming
interface RouteArgs {
loaderData: any; // consistent with actionData
actionData: any;
}
This ensures developers can predict API patterns and reduces the learning curve when working with related functionality.
Enter the URL of a public GitHub repository