Skip to content

Defer Catalog Explorer (and especially Snowflake SDK) load until needed#14982

Merged
jmcphers merged 1 commit into
mainfrom
feature/catalog-explorer-on-demand
Jul 20, 2026
Merged

Defer Catalog Explorer (and especially Snowflake SDK) load until needed#14982
jmcphers merged 1 commit into
mainfrom
feature/catalog-explorer-on-demand

Conversation

@jmcphers

Copy link
Copy Markdown
Collaborator

The Catalog Explorer extension activated on every Positron startup (onStartupFinished) even though it is experimental and disabled by default, and it statically imported snowflake-sdk -- a large module with a sizable dependency tree -- pulling the whole SDK into the extension host's memory at activation regardless of whether the user ever used Snowflake.

This PR makes the extension load on demand and shrinks its resident footprint:

  • On-demand activation. activationEvents changes from onStartupFinished to onView:catalog-explorer plus onCommand: for the palette commands. All of these are gated on config.catalogExplorer.enabled, so the extension (and its module graph) only loads once the feature is actually enabled and used. Enabling now takes effect live without a restart, since flipping the setting reveals the view and triggers activation.
  • Lazy snowflake-sdk load. The SDK is now imported via a cached dynamic import() inside a loader that runs only when the user connects to Snowflake. The type-only import is retained for compile-time types. The Databricks path uses plain fetch and pulls in nothing heavy, so users who never touch Snowflake never pay for the SDK.

Release Notes

New Features

  • N/A

Bug Fixes

  • The experimental Catalog Explorer extension no longer loads on startup when disabled, and its Snowflake SDK is loaded only when connecting to Snowflake, reducing startup cost and memory footprint.

QA Notes

@:catalog-explorer

  • With catalogExplorer.enabled off (default), confirm the extension does not activate on startup and the Catalog Explorer view is hidden.
  • Enable catalogExplorer.enabled and confirm the Catalog Explorer view appears and the extension activates without a restart.
  • Exercise the Databricks catalog flow (browse catalogs/schemas/tables, copy path, generate Python/R code) and confirm behavior is unchanged.
  • Add and authenticate a Snowflake connection and confirm it still works (this is the path that now lazily loads snowflake-sdk).

@jmcphers
jmcphers requested a review from isabelizimm July 18, 2026 00:18
@github-actions

Copy link
Copy Markdown

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:catalog-explorer

Why these tags?
Tag Source
@:critical Always runs (required)
@:catalog-explorer PR description

More on automatic tags from changed files.

readme  valid tags

@isabelizimm isabelizimm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enabling/disabling and adding snowflake providers still acting as normal, LGTM! thanks 🙌

@jmcphers
jmcphers merged commit a19b3ce into main Jul 20, 2026
26 checks passed
@jmcphers
jmcphers deleted the feature/catalog-explorer-on-demand branch July 20, 2026 15:23
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants