JavaScript SDK for OpenFeature
Go to file
Todd Baert 0f2094e236
fix: re-render w/ useWhenProviderReady, add tests (#901)
This PR:

- brings react-sdk test coverage from 0% to ~95%
  - adds DOM-based testing (tests based on asserting DOM entity states)
    - tests for query-style, basic, and detailed evaluation APIs
- tests for suspense functionality and re-rendering on context change
  - tests for some util functions and hooks
  - `renderHook` tests for non suspending hooks
- fixes a bug where `useWhenProviderReady` didn't cause re-render after
the provider is ready if suspense wasn't used (leading to an out-of-date
return value for provider readiness)


![image](https://github.com/open-feature/js-sdk/assets/25272906/e8ee420f-0167-4048-94e3-53176bd883b9)

---------

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2024-04-11 17:41:13 +00:00
.github ci: fix linting PR permissions (#828) 2024-02-22 11:45:33 -05:00
.vscode Fixing readme formatting, removing bad recommendation 2022-05-11 15:52:22 -04:00
packages fix: re-render w/ useWhenProviderReady, add tests (#901) 2024-04-11 17:41:13 +00:00
test-harness@48c56d1314 chore: monorepo conversion + experimental web sdk (#353) 2023-03-09 14:43:41 -05:00
.editorconfig Init 2022-05-10 10:36:02 -04:00
.eslintignore Add linting 2022-05-11 13:37:36 -04:00
.eslintrc.json feat: suspense support, client scoping, context-sensitive re-rendering (#759) 2024-01-11 15:34:04 -05:00
.gitignore chore: monorepo conversion + experimental web sdk (#353) 2023-03-09 14:43:41 -05:00
.gitmodules chore: add integration tests (#225) 2022-10-03 12:32:44 -04:00
.prettierrc Add api, client 2022-05-30 08:58:34 -04:00
.release-please-manifest.json chore(main): release react-sdk 0.3.1-experimental (#906) 2024-04-09 16:20:54 -04:00
CODEOWNERS chore: add CODEOWNERS 2023-03-23 15:23:09 -04:00
CONTRIBUTING.md feat: adds ErrorOptions to Error constructor (#765) 2024-01-20 17:48:01 +00:00
LICENSE Initial commit 2022-05-02 07:30:45 -04:00
README.md chore: fix logo rendering outside of github 2023-09-22 12:37:01 -04:00
jest.config.ts fix: re-render w/ useWhenProviderReady, add tests (#901) 2024-04-11 17:41:13 +00:00
package-lock.json fix: re-render w/ useWhenProviderReady, add tests (#901) 2024-04-11 17:41:13 +00:00
package.esm.json ESM and CommonJS support 2022-05-10 14:12:54 -04:00
package.json fix: re-render w/ useWhenProviderReady, add tests (#901) 2024-04-11 17:41:13 +00:00
release-please-config.json chore: remove release-as 2024-03-25 10:38:20 -04:00
renovate.json chore: update renovate to use best practices (#751) 2024-01-11 17:10:49 -05:00
rollup.config.mjs fix(types): conflicts with peer types (#852) 2024-03-06 16:44:51 +00:00
tsconfig.json feat: maintain state in SDK, add RECONCILING (#795) 2024-03-01 14:09:09 +00:00
tsconfig.rollup.json fix: removed duped core types (#800) 2024-01-31 19:52:16 +00:00
typedoc.json feat: extract and publish core package (#629) 2023-10-31 17:03:37 +00:00

README.md

OpenFeature Logo

OpenFeature JavaScript SDKs

Known Vulnerabilities codecov CII Best Practices FOSSA Status

👋 Hey there! Thanks for checking out the OpenFeature JavaScript SDKs

What is OpenFeature?

OpenFeature is an open standard that provides a vendor-agnostic, community-driven API for feature flagging that works with your favorite feature flag management tool.

Why standardize feature flags?

Standardizing feature flags unifies tools and vendors behind a common interface which avoids vendor lock-in at the code level. Additionally, it offers a framework for building extensions and integrations and allows providers to focus on their unique value proposition.

🔧 Components

This repository contains both the server-side JS and web-browser SDKs. For details, including API documentation, see the respective README files.

Each have slightly different APIs, but share many underlying types and components.

Support the project

🤝 Contributing

Interested in contributing? Great, we'd love your help! To get started, take a look at the CONTRIBUTING guide.

Thanks to everyone that has already contributed

Made with contrib.rocks.

📜 License

Apache License 2.0

FOSSA Status