feat: added optin support for pages - #1164
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
843dc37 to
b8779e9
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for Opt-In feature targeting in the Next.js SDK pages router, allowing features to be enabled based on user opt-in preferences retrieved from the DevCycle Opt-In API.
- Introduces
hasOptInEnabledfunction to check user opt-in status via API - Updates bucketing logic to fetch remote config when opt-in is enabled
- Adds E2E tests for opt-in functionality with the pages router
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/nextjs/src/common/requests.ts | New file implementing the opt-in API check with React cache |
| sdk/nextjs/src/pages/bucketing.ts | Adds opt-in checking logic and integrates it into the bucketing decision flow |
| e2e/nextjs/pages-router/tests/pages-router.spec.ts | Adds E2E tests for opt-in feature targeting scenarios |
| e2e/nextjs/pages-router/app/pages/optin/index.tsx | New test page demonstrating opt-in feature integration |
| e2e/nextjs/pages-router/app/yarn.lock | Updated package resolution hash |
Comments suppressed due to low confidence (2)
sdk/nextjs/src/pages/bucketing.ts:111
- Debug console.log statement should be removed before merging to production. This appears to be leftover debugging code that will pollute production logs.
sdk/nextjs/src/pages/bucketing.ts:79 - The
useOptInflag is computed but not passed tosdkConfigAPI. Unlike the server implementation inserver/bucketing.tswhich passes the opt-in information to the API, this pages router implementation doesn't include it in the API call parameters. This inconsistency may result in the API not being aware of the opt-in context when processing the request.
const bucketedConfigResponse = await sdkConfigAPI(
config.clientSDKKey!,
user,
obfuscated,
useEdgeDB,
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b8779e9 to
6c21ee1
Compare
6c21ee1 to
9fe90b6
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9fe90b6 to
dfaec20
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a2eb7d4 to
d238f5f
Compare
- js-yaml 3.14.1 -> 3.15.0 (medium, alerts #1175, #1176) - js-yaml 4.1.0 -> 4.3.0 (medium, alerts #1171, #1172, #1173, #1174) - webpack-dev-server -> 5.2.5 (medium, alerts #1167, #1168, #1169) - http-proxy-middleware 2.0.9 -> 2.0.10 (medium, alerts #1164, #1165, #1166) - @babel/core -> 7.29.7 (low, alerts #1139, #1140, #1163) - undici -> 6.27.0 (low/medium/high, alerts #1154-#1161) - tar -> 7.5.16 (medium, alerts #1149-#1152) - ws 6.x -> 6.2.4, ws 7.x -> 7.5.11, ws 8.x -> 8.21.0 (high, alerts #1141, #1142, #1145) - form-data 4.0.5 -> 4.0.6 (high, alerts #1143, #1144) - protobufjs -> 7.6.4 (high/medium, alerts #1135, #1136) - protobufjs-cli 1.2.2 -> 1.3.3 (high, alert #1132) - launch-editor -> 2.14.1 (medium, alerts #1134, #1137, #1138) - markdown-it 12.3.2 -> 14.3.0 (medium, alert #1133) - joi 17.6.0 -> 17.13.4 (medium, alert #1125)
Changes