Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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
Migrates
@flags-sdk/statsigfromstatsig-node-lite+statsig-node-vercelto Statsig's new Rust-based SDK@statsig/statsig-node-core. Released as a major (1.0.0) — breaking changes for consumers.Changes
Statsigfromstatsig-node-litewith the instance-basednew Statsig(key, options)from@statsig/statsig-node-core. Methods drop theSyncsuffix and the*WithExposureLoggingDisabledSyncvariants — pass{ disableExposureLogging: true }instead.dataAdapter→dataStore,rulesetsSyncIntervalMs→specsSyncIntervalMs, droppeddisableIdListsSync/initStrategyForIDLists(the new SDK defaults to ID lists off).Experimentis now exported as its own type (was aliased toDynamicConfig); theexperimentadapter getter receives anExperiment.statsig-node-vercelis still pinned tostatsig-node-lite, so I dropped that dependency and inlined aDataStorethat reads from@vercel/edge-configdirectly. It accepts both the legacystatsig.cachekey and the newstatsig|/v[12]/download_config_specs|...key shapes the core SDK uses.src/edge-runtime-hooks.tsand the manualsyncConfigSpecs()workaround. The new SDK uses NAPI native bindings, so it runs on Node.js / Fluid Compute only.apps/docs/content/docs/providers/statsig.mdx): updated bootstrap example (getClientInitializeResponsereturns a JSON string and acceptshashAlgorithminstead ofhash), updated the "Initializing" caveat to use the instance returned bystatsigAdapter.initialize(), and renamed the "Statsig Node Lite" section.Trade-offs to call out
JSON.stringifyoverhead on Edge Config reads. Vercel Edge Config returns parsed JSON objects, but the new SDK'sDataStore.getrequires astring. The inlinecreateEdgeConfigDataStorere-stringifies the object on every read the SDK makes. For large spec payloads this is non-trivial CPU work per sync interval — worth keeping an eye on if you have a highspecsSyncIntervalMsor very large rulesets. (Once Statsig ships a core-compatiblestatsig-node-vercel, we can swap to it and likely avoid the round-trip.)@statsig/statsig-node-coreships native NAPI bindings (Rust), which the Edge Runtime cannot load. Apps using this adapter in Edge middleware/functions must move to the Node.js runtime (Vercel's default Fluid Compute is fine). This aligns with current Vercel guidance — Routing Middleware now runs on Node — but it is a hard break for any consumer still on Edge.Test plan
pnpm installpnpm --filter @flags-sdk/statsig type-checkpnpm --filter @flags-sdk/statsig check(biome)pnpm --filter @flags-sdk/statsig buildpnpm --filter @flags-sdk/statsig test