Conversation
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c42eb49. Configure here.
|
converting this back to draft because we should make this example deployable to vercel. So will need to align this more towards https://github.com/launchdarkly/js-core/tree/main/packages/sdk/vercel/examples/complete. We can look into https://github.com/vercel-labs/emulate to drive e2e and/or easier example start up. |
57b2c9f to
feb0bf7
Compare
feb0bf7 to
3f83551
Compare
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3f83551. Configure here.
|
|
||
| const response = NextResponse.next(); | ||
| response.headers.set(FLAG_HEADER, String(flagValue)); | ||
| return response; |
There was a problem hiding this comment.
Proxy sets response header but page reads request headers
High Severity
The proxy sets FLAG_HEADER on the response via response.headers.set(), but app/page.tsx reads it via Next.js's headers() which returns request headers. The header will never be visible to the server component, so middlewareValue will always be null and the server-rendered initial state will never work. To forward a header to server components, the proxy needs to clone the incoming request headers and pass them via NextResponse.next({ request: { headers } }). The _request parameter (currently marked unused with an underscore prefix) would need to be used for this.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3f83551. Configure here.


This PR will update the current "complete" example so that it is simpler and aligns with our example specs. This should be an easier to follow usage of our Vercel edge sdk.
NOTE: I am also planning on updating the existing examples in future PRs to modernize the implementation.
Note
Low Risk
Low risk since changes are confined to sample apps and release tooling config; main risk is potential breakage of workspace/build tooling due to updated example dependencies and added release-please tracking.
Overview
Adds a new simplified
packages/sdk/vercel/examples/complete(“hello vercel”) sample that demonstrates edge flag evaluation via an edge middleware-styleproxy.ts(sets anx-ld-flag-valueheader) plus an edge route handler (/api/flag) that the client polls for live updates.Replaces the prior “complete” Apple-store/Tailwind + React SDK bootstrap demo with a minimal Next app: removes middleware rewrites/extra pages and the React client SDK provider, introduces a lazily initialized
getLdEdgeClient()with clearer env var handling (LD_CLIENT_SIDE_ID,EDGE_CONFIG,LAUNCHDARKLY_FLAG_KEY), and updates example configs/deps (Next/React/TS, simplified.gitignore, README).Updates repo/workflows to include the new example workspace, renames the React vercel-edge example package to the public
@launchdarkly/...scope, and extendsrelease-please-config.jsonto keep the new example’s@launchdarkly/vercel-server-sdkdependency in sync.Reviewed by Cursor Bugbot for commit 3f83551. Bugbot is set up for automated code reviews on this repo. Configure here.