Compare commits
12 Commits
core-v1.9.
...
main
Author | SHA1 | Date |
---|---|---|
|
ee236396cd | |
|
9aab3d053b | |
|
3105595926 | |
|
1dbbd5161b | |
|
2287083de7 | |
|
04139affcb | |
|
1e330a2e13 | |
|
7df8a8eedc | |
|
3b3515b601 | |
|
63a1feb213 | |
|
845d24c5fe | |
|
dc1970e717 |
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"packages/nest": "0.2.5",
|
||||
"packages/react": "1.0.0",
|
||||
"packages/web": "1.5.0",
|
||||
"packages/server": "1.18.0",
|
||||
"packages/react": "1.0.1",
|
||||
"packages/web": "1.6.1",
|
||||
"packages/server": "1.19.0",
|
||||
"packages/shared": "1.9.0",
|
||||
"packages/angular/projects/angular-sdk": "0.0.16"
|
||||
}
|
||||
|
|
|
@ -45,13 +45,16 @@
|
|||
"rollup": "^4.0.0",
|
||||
"rollup-plugin-dts": "^6.1.1",
|
||||
"rxjs": "~7.8.0",
|
||||
"shx": "^0.3.4",
|
||||
"shx": "^0.4.0",
|
||||
"ts-jest": "^29.1.2",
|
||||
"ts-node": "^10.9.2",
|
||||
"tslib": "^2.3.0",
|
||||
"typedoc": "^0.26.0",
|
||||
"typescript": "^4.7.4",
|
||||
"uuid": "^11.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"npm": "^10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@adobe/css-tools": {
|
||||
|
@ -8924,6 +8927,16 @@
|
|||
"iconv-lite": "^0.6.2"
|
||||
}
|
||||
},
|
||||
"node_modules/end-of-stream": {
|
||||
"version": "1.4.5",
|
||||
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
|
||||
"integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"once": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/entities": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
|
||||
|
@ -14131,6 +14144,13 @@
|
|||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/nice-try": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
|
||||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/node-addon-api": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz",
|
||||
|
@ -14636,6 +14656,16 @@
|
|||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/p-finally": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
|
||||
"integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/p-limit": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
|
||||
|
@ -15425,6 +15455,17 @@
|
|||
"integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/pump": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz",
|
||||
"integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"end-of-stream": "^1.1.0",
|
||||
"once": "^1.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/punycode": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
|
||||
|
@ -16202,22 +16243,159 @@
|
|||
}
|
||||
},
|
||||
"node_modules/shelljs": {
|
||||
"version": "0.8.5",
|
||||
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz",
|
||||
"integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==",
|
||||
"version": "0.9.2",
|
||||
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.9.2.tgz",
|
||||
"integrity": "sha512-S3I64fEiKgTZzKCC46zT/Ib9meqofLrQVbpSswtjFfAVDW+AZ54WTnAM/3/yENoxz/V1Cy6u3kiiEbQ4DNphvw==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"glob": "^7.0.0",
|
||||
"execa": "^1.0.0",
|
||||
"fast-glob": "^3.3.2",
|
||||
"interpret": "^1.0.0",
|
||||
"rechoir": "^0.6.2"
|
||||
},
|
||||
"bin": {
|
||||
"shjs": "bin/shjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/shelljs/node_modules/cross-spawn": {
|
||||
"version": "6.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz",
|
||||
"integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"nice-try": "^1.0.4",
|
||||
"path-key": "^2.0.1",
|
||||
"semver": "^5.5.0",
|
||||
"shebang-command": "^1.2.0",
|
||||
"which": "^1.2.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.8"
|
||||
}
|
||||
},
|
||||
"node_modules/shelljs/node_modules/execa": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
|
||||
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cross-spawn": "^6.0.0",
|
||||
"get-stream": "^4.0.0",
|
||||
"is-stream": "^1.1.0",
|
||||
"npm-run-path": "^2.0.0",
|
||||
"p-finally": "^1.0.0",
|
||||
"signal-exit": "^3.0.0",
|
||||
"strip-eof": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/shelljs/node_modules/get-stream": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
|
||||
"integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"pump": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/shelljs/node_modules/is-stream": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||
"integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/shelljs/node_modules/npm-run-path": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
|
||||
"integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"path-key": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/shelljs/node_modules/path-key": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
|
||||
"integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/shelljs/node_modules/semver": {
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
||||
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"bin": {
|
||||
"semver": "bin/semver"
|
||||
}
|
||||
},
|
||||
"node_modules/shelljs/node_modules/shebang-command": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
|
||||
"integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"shebang-regex": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/shelljs/node_modules/shebang-regex": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
|
||||
"integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/shelljs/node_modules/signal-exit": {
|
||||
"version": "3.0.7",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
|
||||
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/shelljs/node_modules/which": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"isexe": "^2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"which": "bin/which"
|
||||
}
|
||||
},
|
||||
"node_modules/shiki": {
|
||||
"version": "1.22.2",
|
||||
"resolved": "https://registry.npmjs.org/shiki/-/shiki-1.22.2.tgz",
|
||||
|
@ -16233,19 +16411,20 @@
|
|||
}
|
||||
},
|
||||
"node_modules/shx": {
|
||||
"version": "0.3.4",
|
||||
"resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz",
|
||||
"integrity": "sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==",
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/shx/-/shx-0.4.0.tgz",
|
||||
"integrity": "sha512-Z0KixSIlGPpijKgcH6oCMCbltPImvaKy0sGH8AkLRXw1KyzpKtaCTizP2xen+hNDqVF4xxgvA0KXSb9o4Q6hnA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.3",
|
||||
"shelljs": "^0.8.5"
|
||||
"minimist": "^1.2.8",
|
||||
"shelljs": "^0.9.2"
|
||||
},
|
||||
"bin": {
|
||||
"shx": "lib/cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
|
@ -16800,6 +16979,16 @@
|
|||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-eof": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
|
||||
"integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-final-newline": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
|
||||
|
@ -18992,7 +19181,7 @@
|
|||
"jsdom": "^26.1.0",
|
||||
"ng-packagr": "^20.1.0",
|
||||
"playwright": "^1.53.2",
|
||||
"rxjs": "~7.8.0",
|
||||
"rxjs": "^7.8.2",
|
||||
"tslib": "^2.3.0",
|
||||
"typescript": "^5.8.3",
|
||||
"vitest": "^3.2.4",
|
||||
|
@ -19620,16 +19809,6 @@
|
|||
"fsevents": "~2.3.2"
|
||||
}
|
||||
},
|
||||
"packages/angular/node_modules/@angular/build/node_modules/rxjs": {
|
||||
"version": "7.8.2",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz",
|
||||
"integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"packages/angular/node_modules/@angular/build/node_modules/sass": {
|
||||
"version": "1.89.2",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.89.2.tgz",
|
||||
|
@ -21168,16 +21347,6 @@
|
|||
"fsevents": "~2.3.2"
|
||||
}
|
||||
},
|
||||
"packages/angular/node_modules/rxjs": {
|
||||
"version": "7.8.1",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",
|
||||
"integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"packages/angular/node_modules/strip-ansi": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
|
||||
|
@ -21376,7 +21545,7 @@
|
|||
},
|
||||
"packages/angular/projects/angular-sdk": {
|
||||
"name": "@openfeature/angular-sdk",
|
||||
"version": "0.0.15",
|
||||
"version": "0.0.16",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
|
@ -21534,6 +21703,19 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"packages/nest/node_modules/@openfeature/server-sdk": {
|
||||
"version": "1.18.0",
|
||||
"resolved": "https://registry.npmjs.org/@openfeature/server-sdk/-/server-sdk-1.18.0.tgz",
|
||||
"integrity": "sha512-uP8nqEGBS58s3iWXx6d8vnJ6ZVt3DACJL4PWADOAuwIS4xXpID91783e9f6zQ0i1ijQpj3yx+3ZuCB2LfQMUMA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@openfeature/core": "^1.7.0"
|
||||
}
|
||||
},
|
||||
"packages/nest/node_modules/accepts": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
|
||||
|
@ -21865,33 +22047,33 @@
|
|||
},
|
||||
"packages/server": {
|
||||
"name": "@openfeature/server-sdk",
|
||||
"version": "1.18.0",
|
||||
"version": "1.19.0",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@openfeature/core": "^1.7.0"
|
||||
"@openfeature/core": "^1.9.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@openfeature/core": "^1.7.0"
|
||||
"@openfeature/core": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"packages/shared": {
|
||||
"name": "@openfeature/core",
|
||||
"version": "1.8.1",
|
||||
"version": "1.9.0",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {}
|
||||
},
|
||||
"packages/web": {
|
||||
"name": "@openfeature/web-sdk",
|
||||
"version": "1.5.0",
|
||||
"version": "1.6.1",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@openfeature/core": "^1.8.0"
|
||||
"@openfeature/core": "^1.9.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@openfeature/core": "^1.8.0"
|
||||
"@openfeature/core": "^1.9.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
{
|
||||
"name": "@openfeature/js",
|
||||
"engines": {
|
||||
"npm": "^10.0.0"
|
||||
},
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"description": "OpenFeature SDK for JavaScript",
|
||||
|
@ -61,7 +64,7 @@
|
|||
"rollup": "^4.0.0",
|
||||
"rollup-plugin-dts": "^6.1.1",
|
||||
"rxjs": "~7.8.0",
|
||||
"shx": "^0.3.4",
|
||||
"shx": "^0.4.0",
|
||||
"ts-jest": "^29.1.2",
|
||||
"ts-node": "^10.9.2",
|
||||
"tslib": "^2.3.0",
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
# Changelog
|
||||
|
||||
## [1.0.1](https://github.com/open-feature/js-sdk/compare/react-sdk-v1.0.0...react-sdk-v1.0.1) (2025-08-18)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
* **react:** re-evaluate flags on re-render to detect silent provider … ([#1226](https://github.com/open-feature/js-sdk/issues/1226)) ([3105595](https://github.com/open-feature/js-sdk/commit/31055959265a53f52102590f54fa3168811ec678))
|
||||
|
||||
## [1.0.0](https://github.com/open-feature/js-sdk/compare/react-sdk-v0.4.11...react-sdk-v1.0.0) (2025-04-14)
|
||||
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
<img alt="Specification" src="https://img.shields.io/static/v1?label=specification&message=v0.8.0&color=yellow&style=for-the-badge" />
|
||||
</a>
|
||||
<!-- x-release-please-start-version -->
|
||||
<a href="https://github.com/open-feature/js-sdk/releases/tag/react-sdk-v1.0.0">
|
||||
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.0.0&color=blue&style=for-the-badge" />
|
||||
<a href="https://github.com/open-feature/js-sdk/releases/tag/react-sdk-v1.0.1">
|
||||
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.0.1&color=blue&style=for-the-badge" />
|
||||
</a>
|
||||
<!-- x-release-please-end -->
|
||||
<br/>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@openfeature/react-sdk",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"description": "OpenFeature React SDK",
|
||||
"main": "./dist/cjs/index.js",
|
||||
"files": [
|
||||
|
|
|
@ -8,7 +8,7 @@ import type {
|
|||
JsonValue,
|
||||
} from '@openfeature/web-sdk';
|
||||
import { ProviderEvents, ProviderStatus } from '@openfeature/web-sdk';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import {
|
||||
DEFAULT_OPTIONS,
|
||||
isEqual,
|
||||
|
@ -287,8 +287,7 @@ function attachHandlersAndResolve<T extends FlagValue>(
|
|||
const client = useOpenFeatureClient();
|
||||
const status = useOpenFeatureClientStatus();
|
||||
const provider = useOpenFeatureProvider();
|
||||
|
||||
const controller = new AbortController();
|
||||
const isFirstRender = useRef(true);
|
||||
|
||||
if (defaultedOptions.suspendUntilReady && status === ProviderStatus.NOT_READY) {
|
||||
suspendUntilInitialized(provider, client);
|
||||
|
@ -298,9 +297,22 @@ function attachHandlersAndResolve<T extends FlagValue>(
|
|||
suspendUntilReconciled(client);
|
||||
}
|
||||
|
||||
const [evaluationDetails, setEvaluationDetails] = useState<EvaluationDetails<T>>(
|
||||
const [evaluationDetails, setEvaluationDetails] = useState<EvaluationDetails<T>>(() =>
|
||||
resolver(client).call(client, flagKey, defaultValue, options),
|
||||
);
|
||||
|
||||
// Re-evaluate when dependencies change (handles prop changes like flagKey), or if during a re-render, we have detected a change in the evaluated value
|
||||
useEffect(() => {
|
||||
if (isFirstRender.current) {
|
||||
isFirstRender.current = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const newDetails = resolver(client).call(client, flagKey, defaultValue, options);
|
||||
if (!isEqual(newDetails.value, evaluationDetails.value)) {
|
||||
setEvaluationDetails(newDetails);
|
||||
}
|
||||
}, [client, flagKey, defaultValue, options, resolver, evaluationDetails]);
|
||||
|
||||
// Maintain a mutable reference to the evaluation details to have a up-to-date reference in the handlers.
|
||||
const evaluationDetailsRef = useRef<EvaluationDetails<T>>(evaluationDetails);
|
||||
|
@ -308,7 +320,7 @@ function attachHandlersAndResolve<T extends FlagValue>(
|
|||
evaluationDetailsRef.current = evaluationDetails;
|
||||
}, [evaluationDetails]);
|
||||
|
||||
const updateEvaluationDetailsCallback = () => {
|
||||
const updateEvaluationDetailsCallback = useCallback(() => {
|
||||
const updatedEvaluationDetails = resolver(client).call(client, flagKey, defaultValue, options);
|
||||
|
||||
/**
|
||||
|
@ -319,15 +331,19 @@ function attachHandlersAndResolve<T extends FlagValue>(
|
|||
if (!isEqual(updatedEvaluationDetails.value, evaluationDetailsRef.current.value)) {
|
||||
setEvaluationDetails(updatedEvaluationDetails);
|
||||
}
|
||||
};
|
||||
}, [client, flagKey, defaultValue, options, resolver]);
|
||||
|
||||
const configurationChangeCallback: EventHandler<ClientProviderEvents.ConfigurationChanged> = (eventDetails) => {
|
||||
if (shouldEvaluateFlag(flagKey, eventDetails?.flagsChanged)) {
|
||||
updateEvaluationDetailsCallback();
|
||||
}
|
||||
};
|
||||
const configurationChangeCallback = useCallback<EventHandler<ClientProviderEvents.ConfigurationChanged>>(
|
||||
(eventDetails) => {
|
||||
if (shouldEvaluateFlag(flagKey, eventDetails?.flagsChanged)) {
|
||||
updateEvaluationDetailsCallback();
|
||||
}
|
||||
},
|
||||
[flagKey, updateEvaluationDetailsCallback],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const controller = new AbortController();
|
||||
if (status === ProviderStatus.NOT_READY) {
|
||||
// update when the provider is ready
|
||||
client.addHandler(ProviderEvents.Ready, updateEvaluationDetailsCallback, { signal: controller.signal });
|
||||
|
@ -348,7 +364,14 @@ function attachHandlersAndResolve<T extends FlagValue>(
|
|||
// cleanup the handlers
|
||||
controller.abort();
|
||||
};
|
||||
}, []);
|
||||
}, [
|
||||
client,
|
||||
status,
|
||||
defaultedOptions.updateOnContextChanged,
|
||||
defaultedOptions.updateOnConfigurationChanged,
|
||||
updateEvaluationDetailsCallback,
|
||||
configurationChangeCallback,
|
||||
]);
|
||||
|
||||
return evaluationDetails;
|
||||
}
|
||||
|
|
|
@ -924,17 +924,124 @@ describe('evaluation', () => {
|
|||
OpenFeature.setContext(SUSPEND_OFF, { user: TARGETED_USER });
|
||||
});
|
||||
|
||||
// expect to see static value until we reconcile
|
||||
await waitFor(() => expect(screen.queryByText(STATIC_FLAG_VALUE_A)).toBeInTheDocument(), {
|
||||
timeout: DELAY / 2,
|
||||
});
|
||||
|
||||
// make sure we updated after reconciling
|
||||
// With the fix for useState initialization, the hook now immediately
|
||||
// reflects provider state changes. This is intentional to handle cases
|
||||
// where providers don't emit proper events.
|
||||
// The value updates immediately to the targeted value.
|
||||
await waitFor(() => expect(screen.queryByText(TARGETED_FLAG_VALUE)).toBeInTheDocument(), {
|
||||
timeout: DELAY * 2,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('re-render behavior when flag values change without provider events', ()=> {
|
||||
it('should reflect provider state changes on re-render even without provider events', async () => {
|
||||
let providerValue = 'initial-value';
|
||||
|
||||
class SilentUpdateProvider extends InMemoryProvider {
|
||||
resolveBooleanEvaluation() {
|
||||
return {
|
||||
value: true,
|
||||
variant: 'on',
|
||||
reason: StandardResolutionReasons.STATIC,
|
||||
};
|
||||
}
|
||||
|
||||
resolveStringEvaluation() {
|
||||
return {
|
||||
value: providerValue,
|
||||
variant: providerValue,
|
||||
reason: StandardResolutionReasons.STATIC,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const provider = new SilentUpdateProvider({});
|
||||
await OpenFeature.setProviderAndWait('test', provider);
|
||||
|
||||
// The triggerRender prop forces a re-render
|
||||
const TestComponent = ({ triggerRender }: { triggerRender: number }) => {
|
||||
const { value } = useFlag('test-flag', 'default');
|
||||
return <div data-testid="flag-value" data-render-count={triggerRender}>{value}</div>;
|
||||
};
|
||||
|
||||
const WrapperComponent = () => {
|
||||
const [renderCount, setRenderCount] = useState(0);
|
||||
return (
|
||||
<>
|
||||
<button onClick={() => setRenderCount(c => c + 1)}>Force Re-render</button>
|
||||
<TestComponent triggerRender={renderCount} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const { getByText } = render(
|
||||
<OpenFeatureProvider client={OpenFeature.getClient('test')}>
|
||||
<WrapperComponent />
|
||||
</OpenFeatureProvider>
|
||||
);
|
||||
|
||||
// Initial value should be rendered
|
||||
await waitFor(() => {
|
||||
expect(screen.getByTestId('flag-value')).toHaveTextContent('initial-value');
|
||||
});
|
||||
|
||||
// Change the provider's internal state (without emitting events)
|
||||
providerValue = 'updated-value';
|
||||
|
||||
// Force a re-render of the component
|
||||
act(() => {
|
||||
getByText('Force Re-render').click();
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByTestId('flag-value')).toHaveTextContent('updated-value');
|
||||
});
|
||||
});
|
||||
|
||||
it('should update flag value when flag key prop changes without provider events', async () => {
|
||||
const provider = new InMemoryProvider({
|
||||
'flag-a': {
|
||||
disabled: false,
|
||||
variants: { on: 'value-a' },
|
||||
defaultVariant: 'on',
|
||||
},
|
||||
'flag-b': {
|
||||
disabled: false,
|
||||
variants: { on: 'value-b' },
|
||||
defaultVariant: 'on',
|
||||
},
|
||||
});
|
||||
|
||||
await OpenFeature.setProviderAndWait(EVALUATION, provider);
|
||||
|
||||
const TestComponent = ({ flagKey }: { flagKey: string }) => {
|
||||
const { value } = useFlag(flagKey, 'default');
|
||||
return <div data-testid="flag-value">{value}</div>;
|
||||
};
|
||||
|
||||
const { rerender } = render(
|
||||
<OpenFeatureProvider client={OpenFeature.getClient(EVALUATION)}>
|
||||
<TestComponent flagKey="flag-a" />
|
||||
</OpenFeatureProvider>
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByTestId('flag-value')).toHaveTextContent('value-a');
|
||||
});
|
||||
|
||||
// Change to flag-b (without any provider events)
|
||||
rerender(
|
||||
<OpenFeatureProvider client={OpenFeature.getClient(EVALUATION)}>
|
||||
<TestComponent flagKey="flag-b" />
|
||||
</OpenFeatureProvider>
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByTestId('flag-value')).toHaveTextContent('value-b');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('context, hooks and options', () => {
|
||||
|
|
|
@ -288,7 +288,7 @@ describe('OpenFeatureProvider', () => {
|
|||
{ timeout: DELAY * 4 },
|
||||
);
|
||||
|
||||
expect(screen.getByText('Will says hi')).toBeInTheDocument();
|
||||
expect(screen.getByText('Will says aloha')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,5 +1,27 @@
|
|||
# Changelog
|
||||
|
||||
## [1.19.0](https://github.com/open-feature/js-sdk/compare/server-sdk-v1.18.0...server-sdk-v1.19.0) (2025-08-14)
|
||||
|
||||
|
||||
### ✨ New Features
|
||||
|
||||
* add evaluation-scoped hook data ([#1216](https://github.com/open-feature/js-sdk/issues/1216)) ([07af3a9](https://github.com/open-feature/js-sdk/commit/07af3a9eda895e9edb24c7ee1e3c1c4f16e17431))
|
||||
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
* update core dep ([#1228](https://github.com/open-feature/js-sdk/issues/1228)) ([845d24c](https://github.com/open-feature/js-sdk/commit/845d24c5fecc80de3080e49fde839f08ecac6b33))
|
||||
|
||||
|
||||
### 🧹 Chore
|
||||
|
||||
* update node to v20+ ([#1203](https://github.com/open-feature/js-sdk/issues/1203)) ([1f33453](https://github.com/open-feature/js-sdk/commit/1f33453c23df0763cbf0d0b44db8d91216377009))
|
||||
|
||||
|
||||
### 📚 Documentation
|
||||
|
||||
* Clarify the behavior of setProviderAndWait ([#1180](https://github.com/open-feature/js-sdk/issues/1180)) ([4fe8d87](https://github.com/open-feature/js-sdk/commit/4fe8d87a2e5df2cbd4086cc4f4a380e8857ed8ba))
|
||||
|
||||
## [1.18.0](https://github.com/open-feature/js-sdk/compare/server-sdk-v1.17.1...server-sdk-v1.18.0) (2025-04-11)
|
||||
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
<img alt="Specification" src="https://img.shields.io/static/v1?label=specification&message=v0.8.0&color=yellow&style=for-the-badge" />
|
||||
</a>
|
||||
<!-- x-release-please-start-version -->
|
||||
<a href="https://github.com/open-feature/js-sdk/releases/tag/server-sdk-v1.18.0">
|
||||
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.18.0&color=blue&style=for-the-badge" />
|
||||
<a href="https://github.com/open-feature/js-sdk/releases/tag/server-sdk-v1.19.0">
|
||||
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.19.0&color=blue&style=for-the-badge" />
|
||||
</a>
|
||||
<!-- x-release-please-end -->
|
||||
<br/>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@openfeature/server-sdk",
|
||||
"version": "1.18.0",
|
||||
"version": "1.19.0",
|
||||
"description": "OpenFeature SDK for JavaScript",
|
||||
"main": "./dist/cjs/index.js",
|
||||
"files": [
|
||||
|
@ -48,9 +48,9 @@
|
|||
"node": ">=20"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@openfeature/core": "^1.7.0"
|
||||
"@openfeature/core": "^1.9.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@openfeature/core": "^1.7.0"
|
||||
"@openfeature/core": "^1.9.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,26 @@
|
|||
# Changelog
|
||||
|
||||
|
||||
## [1.6.1](https://github.com/open-feature/js-sdk/compare/web-sdk-v1.6.0...web-sdk-v1.6.1) (2025-08-14)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
* update core dep ([#1228](https://github.com/open-feature/js-sdk/issues/1228)) ([845d24c](https://github.com/open-feature/js-sdk/commit/845d24c5fecc80de3080e49fde839f08ecac6b33))
|
||||
|
||||
## [1.6.0](https://github.com/open-feature/js-sdk/compare/web-sdk-v1.5.0...web-sdk-v1.6.0) (2025-08-12)
|
||||
|
||||
|
||||
### ✨ New Features
|
||||
|
||||
* add evaluation-scoped hook data ([#1216](https://github.com/open-feature/js-sdk/issues/1216)) ([07af3a9](https://github.com/open-feature/js-sdk/commit/07af3a9eda895e9edb24c7ee1e3c1c4f16e17431))
|
||||
* **web-global-build:** impl ([#1225](https://github.com/open-feature/js-sdk/issues/1225)) ([40a512e](https://github.com/open-feature/js-sdk/commit/40a512e21204eb92dc3ef4161b383f9c1fd74da7))
|
||||
|
||||
|
||||
### 📚 Documentation
|
||||
|
||||
* Clarify the behavior of setProviderAndWait ([#1180](https://github.com/open-feature/js-sdk/issues/1180)) ([4fe8d87](https://github.com/open-feature/js-sdk/commit/4fe8d87a2e5df2cbd4086cc4f4a380e8857ed8ba))
|
||||
|
||||
## [1.5.0](https://github.com/open-feature/js-sdk/compare/web-sdk-v1.4.1...web-sdk-v1.5.0) (2025-04-11)
|
||||
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
<img alt="Specification" src="https://img.shields.io/static/v1?label=specification&message=v0.8.0&color=yellow&style=for-the-badge" />
|
||||
</a>
|
||||
<!-- x-release-please-start-version -->
|
||||
<a href="https://github.com/open-feature/js-sdk/releases/tag/web-sdk-v1.5.0">
|
||||
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.5.0&color=blue&style=for-the-badge" />
|
||||
<a href="https://github.com/open-feature/js-sdk/releases/tag/web-sdk-v1.6.1">
|
||||
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.6.1&color=blue&style=for-the-badge" />
|
||||
</a>
|
||||
<!-- x-release-please-end -->
|
||||
<br/>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@openfeature/web-sdk",
|
||||
"version": "1.5.0",
|
||||
"version": "1.6.1",
|
||||
"description": "OpenFeature SDK for Web",
|
||||
"main": "./dist/cjs/index.js",
|
||||
"unpkg": "dist/global/index.min.js",
|
||||
|
@ -50,9 +50,9 @@
|
|||
},
|
||||
"homepage": "https://github.com/open-feature/js-sdk#readme",
|
||||
"peerDependencies": {
|
||||
"@openfeature/core": "^1.8.0"
|
||||
"@openfeature/core": "^1.9.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@openfeature/core": "^1.8.0"
|
||||
"@openfeature/core": "^1.9.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
"versioning": "default"
|
||||
},
|
||||
"packages/react": {
|
||||
"release-as": "1.0.0",
|
||||
"release-type": "node",
|
||||
"prerelease": false,
|
||||
"bump-minor-pre-major": true,
|
||||
|
|
Loading…
Reference in New Issue