Adds Angular 20 support.
This also remove the custom jest setup as it was not compatible with
Angular 20 and uses builtin support for vitest in Angular 20.
For this, Angular has been removed from the jest setup and the pipeline
runs it separately now.
Fixes#1206
---------
Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->
## This PR
<!-- add the description of the PR here -->
Adds an Angular SDK as discussed in #976.
It mainly provides directives that conditionally render based on flag
value and provider state.
I did not inject any OpenFeature service or anything like that, as I
think the directives will be the way to access feature flags in the
templates, and the OpenFeature global API can be used directly in
services. But I am not 100% sure on that one.
Happy to receive feedback and opinions :)
A small test app can be found here:
https://github.com/open-feature/angular-test-app
This can be used with [yalc](https://github.com/wclr/yalc).
---------
Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
I've been meaning to do this for a while... it just renames the
`client/` dir to `web/`. I think this is better because there will be
less confusion around the OpenFeature client object (which has it's own
dirs) and because it's more consistent with the associated artifact name
"web-sdk".
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
## This PR
- runs error hook when provider returns reason error or error code
### Related Issues
Fixes#925
### Notes
Based on a conversation in Slack:
https://cloud-native.slack.com/archives/C06E4DE6S07/p1714581197391509
---------
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
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)

---------
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Implements the newest spec changes
[here](https://github.com/open-feature/spec/pull/241).
- Provider state is deprecated (state is now maintained in the SDK
itself). This is non-breaking, we just ignore the provider's own state
now
- add RECONCILING events and state, fire related events with provider's
`on context change`
- add FATAL state
The new tests should help you understand the impact of the changes.
---------
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->
## This PR
<!-- add the description of the PR here -->
This is a first draft of a Nest.js SDK.
Currently it only handles injecting clients and feature flags.
I also added a context factory for the FeatureFlag decorators to be able
to use request information for the execution context.
### Related Issues
<!-- add here the GitHub issue that this PR resolves if applicable -->
Fixes#705
### Notes
<!-- any additional notes for this PR -->
@toddbaert maybe we can do it as we did with the React SDK, merge this
fast and release as experimental to let people experiment and try out?
### Follow-up Tasks
<!-- anything that is related to this PR but not done here should be
noted under this section -->
<!-- if there is a need for a new issue, please link it here -->
We will have to see if we want to stick with the injected feature flags
being wrapped in an observable.
To me this feels the most idiomatic for Nest.js.
### How to test
Tests for the current functionality are included.
---------
Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>
Co-authored-by: Henry Chen <1474479+chenhunghan@users.noreply.github.com>
Co-authored-by: Luiz Guilherme Ribeiro <ltrindaderibeiro@gmail.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
This PR addresses: https://github.com/open-feature/js-sdk/issues/616 by:
- configuring CI to release a new module (in addition to
server/web/react we now release the "core" module (previously called
"shared").
- adding a peer dep to the above module to server/web/react
- adding a workflow to ensure that `shared` is released ahead of
associated web/server/react changes, and which also auto-increments the
peer dep version when the core module is released
- unrelated `typedoc` improvements/updates
> [!NOTE]
> I intend to create a new PR that will rename the dir structure
according to the packages... so `shared/` will become `core/` and
`client/` will become `web/`. I just didn't want to add confusion and
noise to this PR.
---------
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
These are end-to-end tests.
No functional changes. I did use `git mv` to try to preserve history as
best as possible.
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
- implements all integration tests from the test harness for the client
package
Signed-off-by: Moritz Wiesinger <moritz.wiesinger@dynatrace.com>
Co-authored-by: Todd Baert <toddbaert@gmail.com>
This PR transfroms this repo into a monorepo, with server (exsiting),
client (new) and shared (new) packages.
There are no tests yet for the client. Publishing _should_ work but is
yet untested.
The experimental web SDK will be published as `0.0.1-experimental` and
features:
- native browser events
- "close" functionality (implemented in server as well)
- async context setting
- sync evaluation
Though we want `close` and `events` in the server SDK, they are not
implemented in this PR (though it would be very easy to do so and I've
left TODO's about it). **There are no functional changes in the server
SDK with this PR.**
Here is a [direct
link](https://github.com/open-feature/js-sdk/blob/experimental-web-sdk/README.md)
to the README.md changes.
**_I'm not expecting reviewers to go through this with a fine-toothed
comb. Most of the changes are just establishing the monorepo, and the
functional stuff in the new web-sdk is just experimental._**.
Closes: https://github.com/open-feature/js-sdk/issues/367
---------
Signed-off-by: Todd Baert <toddbaert@gmail.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>