Design applications to use external configuration sources rather than hardcoding values directly in source code. This allows for configuration changes without requiring code modifications or redeployment.
Design applications to use external configuration sources rather than hardcoding values directly in source code. This allows for configuration changes without requiring code modifications or redeployment.
When defining configurations that might change between environments or user preferences:
For example, instead of hardcoding allowed namespaces:
// Avoid this
export const ALL_NAMESPACES_ALLOWED_LIST = ['jupyter'];
// Prefer dynamic configuration loaded from an external source
export const ALL_NAMESPACES_ALLOWED_LIST = loadFromConfigMap('namespaces.allowed');
Similarly, when importing resources to support configurable features, consider importing complete libraries if it enables easier configuration through external sources:
// This allows for configurable icons via ConfigMap without source code changes
import '@polymer/iron-icons/communication-icons.js';
Enter the URL of a public GitHub repository