Skip to content

Conversation

MathieuVeber
Copy link
Contributor

@MathieuVeber MathieuVeber commented Mar 10, 2021

Closes #593

What does this PR do?

From now on, when developing with the SDK, you will see warning when using a deprecated action. You can disable this behavior by setting to false the deprecationWarning option on the kuzzle sdk object

How should this be manually tested?

Use a deprecated action and observe the warning(s)

Other changes

Updated doc and added tests

@Aschen
Copy link
Contributor

Aschen commented Mar 10, 2021

I don't see how the deprecation are hidden in production by default?

@MathieuVeber
Copy link
Contributor Author

I don't see how the deprecation are hidden in production by default?

If I understood well, usages of the console once the sdk is build are disabled, also it seems like Kuzzle server doesn't send deprecations info when turned in mode production.

But I might not be the best to answer that @jenow @Yoann-Abbes

@MathieuVeber MathieuVeber marked this pull request as ready for review March 11, 2021 11:29
@codecov
Copy link

codecov bot commented Mar 11, 2021

Codecov Report

Merging #614 (7e12c23) into 7-dev (44f022d) will increase coverage by 0.04%.
The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##            7-dev     #614      +/-   ##
==========================================
+ Coverage   86.75%   86.80%   +0.04%     
==========================================
  Files          33       34       +1     
  Lines        1503     1516      +13     
  Branches      262      265       +3     
==========================================
+ Hits         1304     1316      +12     
  Misses        146      146              
- Partials       53       54       +1     
Impacted Files Coverage Δ
src/controllers/Base.ts 87.50% <ø> (ø)
src/Kuzzle.ts 86.69% <80.00%> (-0.20%) ⬇️
src/controllers/Security.js 95.00% <100.00%> (+0.07%) ⬆️
src/utils/Deprecation.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44f022d...8b869af. Read the comment docs.

@MathieuVeber MathieuVeber linked an issue Mar 11, 2021 that may be closed by this pull request
Copy link
Contributor

@Aschen Aschen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also you should ensure that the Kuzzle class is calling the deprecation util with an unit test

@MathieuVeber
Copy link
Contributor Author

I don't see how the deprecation are hidden in production by default?

Finally, using process.env.NODE_ENV was the solution to this issue

@MathieuVeber MathieuVeber requested a review from Aschen March 16, 2021 13:16
@MathieuVeber MathieuVeber changed the title #593 Print deprecation warning from Kuzzle Print deprecation warning from Kuzzle Mar 16, 2021
@MathieuVeber MathieuVeber merged commit c86a490 into 7-dev Mar 16, 2021
@MathieuVeber MathieuVeber deleted the #593-Print-deprecation-warning-from-Kuzzle branch March 16, 2021 16:05
@Aschen Aschen mentioned this pull request Apr 6, 2021
Aschen added a commit that referenced this pull request Apr 7, 2021
# [7.6.0](https://github.com/kuzzleio/sdk-javascript/releases/tag/7.6.0) (2021-04-06)


#### Bug fixes

- [ [#622](#622) ] Pick first route when multiple non-GET routes of the same size are available   ([scottinet](https://github.com/scottinet))

#### New features

- [ [#621](#621) ] Secure WebSocket connection with cookie authentication   ([Shiranuit](https://github.com/Shiranuit))
- [ [#613](#613) ] Implement index:stats   ([Leodau](https://github.com/Leodau))
- [ [#612](#612) ] Implement security:getUserStrategies   ([Leodau](https://github.com/Leodau))

#### Enhancements

- [ [#620](#620) ] Add kuzzleStack property to KuzzleError   ([Aschen](https://github.com/Aschen))
- [ [#617](#617) ] Add suggest to search result   ([Aschen](https://github.com/Aschen))
- [ [#614](#614) ] Print deprecation warning from Kuzzle   ([MathieuVeber](https://github.com/MathieuVeber))
- [ [#606](#606) ] Add _source property to user objects   ([Aschen](https://github.com/Aschen))
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print deprecation warning from Kuzzle
3 participants