Skip to content

Commit 79b2103

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/next-14.2.15
2 parents 541071f + b2f6fc5 commit 79b2103

File tree

11 files changed

+90
-33
lines changed

11 files changed

+90
-33
lines changed

.github/workflows/package-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on: [push]
1010
jobs:
1111
build-and-test:
1212
name: Build & Test
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-22.04
1414
steps:
1515
- name: Checkout source code
1616
uses: actions/checkout@v3

packages/browser-sdk/package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bucketco/browser-sdk",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"packageManager": "[email protected]",
55
"license": "MIT",
66
"repository": {
@@ -27,8 +27,14 @@
2727
"dist"
2828
],
2929
"main": "./dist/bucket-browser-sdk.umd.js",
30-
"module": "./dist/bucket-browser-sdk.mjs",
3130
"types": "./dist/types/src/index.d.ts",
31+
"exports": {
32+
".": {
33+
"import": "./dist/bucket-browser-sdk.mjs",
34+
"require": "./dist/bucket-browser-sdk.umd.js",
35+
"types": "./dist/types/src/index.d.ts"
36+
}
37+
},
3238
"dependencies": {
3339
"@floating-ui/dom": "^1.6.8",
3440
"canonical-json": "^0.0.4",

packages/openfeature-browser-provider/package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bucketco/openfeature-browser-provider",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"packageManager": "[email protected]",
55
"license": "MIT",
66
"repository": {
@@ -26,8 +26,14 @@
2626
"dist"
2727
],
2828
"main": "./dist/bucket-openfeature-browser-provider.umd.js",
29-
"module": "./dist/bucket-openfeature-browser-provider.mjs",
30-
"types": "./dist/types/src/index.d.ts",
29+
"types": "./dist/index.d.ts",
30+
"exports": {
31+
".": {
32+
"import": "./dist/bucket-openfeature-browser-provider.mjs",
33+
"require": "./dist/bucket-openfeature-browser-provider.umd.js",
34+
"types": "./dist/index.d.ts"
35+
}
36+
},
3137
"dependencies": {
3238
"@bucketco/browser-sdk": "2.4.0"
3339
},

packages/openfeature-node-provider/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bucketco/openfeature-node-provider",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"license": "MIT",
55
"repository": {
66
"type": "git",
@@ -26,7 +26,7 @@
2626
"access": "public"
2727
},
2828
"main": "./dist/src/index.js",
29-
"types": "./dist/types/src/index.d.ts",
29+
"types": "./dist/types/index.d.ts",
3030
"devDependencies": {
3131
"@babel/core": "~7.24.7",
3232
"@bucketco/eslint-config": "~0.0.2",

packages/react-sdk/README.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,15 @@ function StartHuddleButton() {
106106
<>
107107
<button onClick={track}>Start huddle!</button>
108108
<button
109-
onClick={() => requestFeedback({ title: "How do you like Huddles?" })}
109+
onClick={(e) =>
110+
requestFeedback({
111+
title: "How do you like Huddles?",
112+
position: {
113+
type: "POPOVER",
114+
anchor: e.currentTarget as HTMLElement,
115+
},
116+
})
117+
}
110118
>
111119
Give feedback!
112120
</button>
@@ -139,15 +147,28 @@ function StartHuddle() {
139147
`useRequestFeedback()` returns a function that lets you open up a dialog to ask for feedback on a specific feature.
140148
See [Automated Feedback Surveys](https://docs.bucket.co/product-handbook/live-satisfaction) for how to do this automatically, without code.
141149

142-
```ts
150+
When using the `useRequestFeedback` you must pass the feature key to `requestFeedback`.
151+
The example below shows how to use `position` to ensure the popover appears next to the "Give feedback!" button.
152+
153+
```tsx
143154
import { useTrackEvent } from "@bucketco/react-sdk";
144155

145156
const requestFeedback = useRequestFeedback();
146157

147-
requestFeedback({
148-
featureId: "bucket-feature-id",
149-
title: "How satisfied are you with file uploads?",
150-
});
158+
<button
159+
onClick={(e) =>
160+
requestFeedback({
161+
featureKey: "huddle-feature-key",
162+
title: "How satisfied are you with file uploads?",
163+
position: {
164+
type: "POPOVER",
165+
anchor: e.currentTarget as HTMLElement,
166+
},
167+
})
168+
}
169+
>
170+
Give feedback!
171+
</button>;
151172
```
152173

153174
See https://github.com/bucketco/bucket-javascript-sdk/blob/main/packages/browser-sdk/FEEDBACK.md#manual-feedback-collection for more information on `requestFeedback`

packages/react-sdk/dev/plain/app.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,16 @@ function Feedback() {
157157
<div>
158158
<h2>Feedback</h2>
159159
<button
160-
onClick={() => {
160+
onClick={(e) =>
161161
requestFeedback({
162-
featureId: "fe123",
163-
});
164-
}}
162+
title: "How do you like Huddles?",
163+
featureKey: "huddle",
164+
position: {
165+
type: "POPOVER",
166+
anchor: e.currentTarget as HTMLElement,
167+
},
168+
})
169+
}
165170
>
166171
Request feedback
167172
</button>

packages/react-sdk/package.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bucketco/react-sdk",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"license": "MIT",
55
"repository": {
66
"type": "git",
@@ -24,11 +24,17 @@
2424
"files": [
2525
"dist"
2626
],
27-
"main": "./dist/bucket-react-sdk.js",
28-
"module": "./dist/bucket-react-sdk.mjs",
29-
"types": "./dist/types/src/index.d.ts",
27+
"main": "./dist/bucket-react-sdk.umd.js",
28+
"types": "./dist/index.d.ts",
29+
"exports": {
30+
".": {
31+
"import": "./dist/bucket-react-sdk.mjs",
32+
"require": "./dist/bucket-react-sdk.umd.js",
33+
"types": "./dist/index.d.ts"
34+
}
35+
},
3036
"dependencies": {
31-
"@bucketco/browser-sdk": "2.4.0",
37+
"@bucketco/browser-sdk": "2.4.1",
3238
"canonical-json": "^0.0.4"
3339
},
3440
"peerDependencies": {

packages/react-sdk/test/usage.test.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
} from "vitest";
1515

1616
import { BucketClient } from "@bucketco/browser-sdk";
17-
import { HttpClient } from "@bucketco/browser-sdk/src/httpClient";
1817

1918
import { version } from "../package.json";
2019
import {
@@ -137,9 +136,6 @@ afterAll(() => server.close());
137136
beforeAll(() => {
138137
vi.spyOn(BucketClient.prototype, "initialize");
139138
vi.spyOn(BucketClient.prototype, "stop");
140-
141-
vi.spyOn(HttpClient.prototype, "get");
142-
vi.spyOn(HttpClient.prototype, "post");
143139
});
144140

145141
beforeEach(() => {

packages/react-sdk/vite.config.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@ export default defineConfig({
2121
entry: resolve(__dirname, "src/index.tsx"),
2222
name: "BucketReactSDK",
2323
fileName: "bucket-react-sdk",
24-
formats: ["es"],
24+
formats: ["es", "umd"],
2525
},
2626
rollupOptions: {
2727
external: ["react", "react-dom"],
28+
output: {
29+
globals: {
30+
react: "React",
31+
},
32+
},
2833
},
2934
},
3035
server: {

0 commit comments

Comments
 (0)