## This PR
- adds evaluation details to the `finally` stage in hooks.
### Notes
This breaks the signature of the `finally` stages based on [this spec
enhancement](https://github.com/open-feature/spec/pull/280). It is
**not** considered a breaking change to the SDK because hooks are marked
as experimental in the spec, and the change has no impact on known
hooks.
The noteworthy change to the interface is:
```diff
- finally?(hookContext: Readonly<HookContext<T>>, hookHints?: HookHints): HooksReturn;
+ finally?(hookContext: Readonly<HookContext<T>>, evaluationDetails: EvaluationDetails<T>, hookHints?: HookHints): HooksReturn;
```
### Follow-up Tasks
- Update the JS contribs repo
---------
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Inspired by [this
comment](https://github.com/open-feature/js-sdk/pull/1020#discussion_r1777829664)
I've added a lint rule to enforce `import type`, and some additional
package changes to add a `lint:fix`.
The only changes I made manually here is to add the lint rule, and the
package.json script. All the changes are auto-generated by the
`lint:fix`.
---------
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>
Clients were incorrectly populating the hook context provider metadata
field with metadata from the default provider instead of the one bound
to the client.
Signed-off-by: Federico Bond <federicobond@gmail.com>
## This PR
- Updates the server-side before hook type to perform async work without
modifying context.
### Related Issues
Fixes#689
### Notes
I added a test but the test runner isn't not validating types.
---------
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-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
Fixes return type of hooks in client SDK.
Maybe we should make this more clear in the spec @toddbaert.
### Related Issues
Fixes#630
### Notes
<!-- any additional notes for this PR -->
### 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 -->
### How to test
<!-- if applicable, add testing instructions under this section -->
---------
Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>
Co-authored-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
Splits up the types file and restructures the SDK by functionalities.
Feeling quite good with the structure now.
The PR became quite huge, but I could even move one or two more things
(for the client) to the shared implementation.
@toddbaert @beeme1mr Please give feedback if you think the structure is
completely off or something seems odd to you🙂
### Related Issues
<!-- add here the GitHub issue that this PR resolves if applicable -->
Fixes#437
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.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>