Add extensionRegistryURI setting to change where the registry is read from (#20463)

This commit is contained in:
kevinjwang1
2026-03-10 13:22:03 -07:00
committed by GitHub
parent 5caa192cfc
commit 5b8ad9cd65
10 changed files with 134 additions and 16 deletions
@@ -19,12 +19,16 @@ export interface UseExtensionRegistryResult {
export function useExtensionRegistry(
initialQuery = '',
registryURI?: string,
): UseExtensionRegistryResult {
const [extensions, setExtensions] = useState<RegistryExtension[]>([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
const client = useMemo(() => new ExtensionRegistryClient(), []);
const client = useMemo(
() => new ExtensionRegistryClient(registryURI),
[registryURI],
);
// Ref to track the latest query to avoid race conditions
const latestQueryRef = useRef(initialQuery);