Split React bindings into @sigmacomputing/plugin-react package#61
Draft
Pearce-Ropion wants to merge 4 commits into
Draft
Split React bindings into @sigmacomputing/plugin-react package#61Pearce-Ropion wants to merge 4 commits into
Pearce-Ropion wants to merge 4 commits into
Conversation
Move the SigmaClientProvider context and all React hooks (usePlugin, useConfig, useElementColumns, useElementData, useVariable, useUrlParameter, useInteraction, useActionTrigger, useActionEffect, usePluginStyle, useEditorPanelConfig, useLoadingState, usePaginatedElementData) out of @sigmacomputing/plugin into a new packages/plugin-sdk-react workspace. The new package depends on @sigmacomputing/plugin and keeps react as a peer dependency. The framework-agnostic plugin-sdk no longer carries a react peer dep, and its public API now also exports initialize (which the moved test relies on and which is already documented as public). https://claude.ai/code/session_01AZefsCe7wagmamsoVfekuL
Align the npm name with the directory name (packages/plugin-sdk-react) rather than dropping the -sdk suffix. Also updates the UMD bundle filename and global to match. https://claude.ai/code/session_01AZefsCe7wagmamsoVfekuL
* Replace the custom deepEqual helper with the dequal package (dequal/lite is bundled into all output formats via deps.alwaysBundle so consumers and UMD users do not need to provide it) * Set the UMD global name to SigmaPluginReact * Move __VERSION__ injection into tsdown.base.ts / vitest.base.ts since every workspace package shares the root version; per-package configs now just re-export the base * Replace workspace:^ with the actual semver range so npm publish produces a usable tarball, and teach scripts/bump-version.ts to keep internal @sigmacomputing/* dep ranges in sync on every bump https://claude.ai/code/session_01AZefsCe7wagmamsoVfekuL
Split the plugin-sdk-react tsdown config into two builds: ESM + CJS keep dequal external (consumers install it via npm and deduping happens normally), while UMD bundles it so the standalone bundle only needs react and @sigmacomputing/plugin as globals. https://claude.ai/code/session_01AZefsCe7wagmamsoVfekuL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/plugin-sdk-reactworkspace (npm name@sigmacomputing/plugin-react) that housesSigmaClientProvider,PluginContext, and every React hook (usePlugin,useConfig,useElementColumns,useElementData,usePaginatedElementData,useVariable,useUrlParameter,useInteraction,useActionTrigger,useActionEffect,usePluginStyle,useEditorPanelConfig,useLoadingState).@sigmacomputing/plugin(workspace) and keepsreactas a peer dependency. The framework-agnostic@sigmacomputing/pluginno longer declares thereactpeer dep and no longer re-exports anything from./react.@sigmacomputing/pluginnow also exportsinitializefrom its public entry — it was already documented as public API in the README but only reachable via an internal path, and the moved hook tests need it.@sigmacomputing/plugin/ sibling files; behavior is byte-identical aside from import paths. The small internaldeepEqualhelper used byuseEditorPanelConfigis copied into the new package rather than re-exported, since it isn't part of the public surface area.-sdkfrom npm names (directoryplugin-sdk→ npm@sigmacomputing/plugin, directoryplugin-sdk-react→ npm@sigmacomputing/plugin-react). Happy to switch to@sigmacomputing/plugin-sdk-reactif you'd rather match the directory name.Migration for consumers: replace
with
Test plan
yarn lint— cleanyarn types— clean (turbo runs^buildfor both packages first)yarn build— both packages build;@sigmacomputing/plugin-reactESM/CJS/UMD bundles correctly externalizereactand@sigmacomputing/pluginyarn syncpack:lint— cleanyarn test— could not run in this environment (Playwright Chromium download blocked by network policy and no system Chromium available); needs to be verified in CI. The movedhooks.test.tsxis byte-identical to the original except for import paths.https://claude.ai/code/session_01AZefsCe7wagmamsoVfekuL
Generated by Claude Code