When exposing data to the client, treat shared/global values and plugin routes as explicit API surface:
1) Don’t publish global client/window state by sprinkling ad-hoc dictionaries into multiple unrelated API handlers. Instead, use one centralized mechanism:
index.html (e.g., next to globalThis.gitinfo), orExample (centralized injection):
<script>
// after globalThis.gitinfo
globalThis.runtimeInfo = {
isDevelopment: {{ runtime.is_development() | tojson }}
};
</script>
2) Plugin endpoints must be mounted under a stable namespace to prevent collisions with core API routes.
/plugins/<plugin_name>/...Example (route mounting concept):
# core router bootstrap
register_routes(prefix=f"/plugins/{plugin_name}", handlers=plugin_handlers)