-
Notifications
You must be signed in to change notification settings - Fork 31
feat: Added react-universal code from labs. #493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…Fixed exports. Exclude example from eslint.
…hub.com/launchdarkly/js-core into yus/sc-248499/move-ld-nextjs-to-js-core
…hub.com/launchdarkly/js-core into yus/sc-248499/move-ld-nextjs-to-js-core
| }, | ||
| "dependencies": { | ||
| "@launchdarkly/node-server-sdk": "workspace:^", | ||
| "launchdarkly-js-client-sdk": "^3.4.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Callout: Use the classic js sdk for now.
| "stripInternal": true, | ||
| "target": "ES2017", | ||
| "types": ["jest", "node"] | ||
| "types": ["jest", "node", "react/canary"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Callout: Need react/canary to be able to use react cache. Nextjs does this so I'm not feeling too bad about it.
| const context = { kind: 'user', key: 'test-user-2' }; | ||
| (ldc as JSSdk).identify(context).then(() => { | ||
| console.log('identify successful, persisting to cookies'); | ||
| setCookie('ld', context); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setCookie automatically stringifies the cookie value.
| ## Usage | ||
|
|
||
| 1. Enable [instrumentationHook](https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation) in `next.config.mjs`: | ||
| 1. On server start, initialize the Node Server SDK. If you are using NextJS App Router, do this in `instrumentation.ts`. You'll need to enable the [instrumentationHook](https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This universal sdk should work with all framework which supports rsc (gatsby, remix, etc).
packages/sdk/react-universal/example/app/components/helloClientComponent.tsx
Show resolved
Hide resolved
… todo to implement variation hooks.
🤖 I have created a release *beep* *boop* --- <details><summary>react-native-client-sdk: 10.2.0</summary> ## [10.2.0](react-native-client-sdk-v10.1.5...react-native-client-sdk-v10.2.0) (2024-07-02) ### Features * Added react-universal code. ([#493](#493)) ([e1d2d30](e1d2d30)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
No description provided.