Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecation(crypto): rename an export to match style guide, deprecating original and two other obsolete imports #4525

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

jeremyBanks
Copy link
Contributor

(Originally part of #4515, broken into separate PR as suggested by iuioiua.)

This PR renames crypto.ts's exported const wasmDigestAlgorithms to DIGEST_ALGORITHM_NAMES, to match Deno's style guide and reflect the fact that it includes all algorithm names supported by the digest function, not just a subset. The old name is maintained as a deprecated alias for now. The exported WasmDigestAlgorithm type is deprecated, as it's redundant with the existing DigestAlgorithmName export (all algorithms are available in Wasm, and if that changes in the future it should probably just be an internal implementation detail, not part of the public interface). The FNVAlgorithms export is similarly deprecated (they were previously a special case that was not included in Wasm).

crypto/crypto.ts Outdated Show resolved Hide resolved
@jeremyBanks jeremyBanks requested a review from kt3k March 26, 2024 21:17
@kt3k kt3k changed the title chore(crypto): rename an export to match style guide, deprecating original and two other obsolete imports deprecation(crypto): rename an export to match style guide, deprecating original and two other obsolete imports Mar 27, 2024
Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM

*
* @deprecated (will be removed in 1.0.0) Consider using {@linkcode DIGEST_ALGORITHM_NAMES} instead.
*/
export const wasmDigestAlgorithms = DIGEST_ALGORITHM_NAMES;
Copy link
Contributor

Choose a reason for hiding this comment

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

* A FNV (Fowler/Noll/Vo) digest algorithm name supported by std/crypto.
*
* @deprecated (will be removed in 1.0.0)
*/
export type FNVAlgorithms = "FNV32" | "FNV32A" | "FNV64" | "FNV64A";
Copy link
Contributor

Choose a reason for hiding this comment

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

The use of this export is minimal. A removal version of v1 instead of sooner is overkill and would be non-impactful to remove sooner. See https://github.com/search?q=%22FNVAlgorithms%22&type=code and notice they're almost entirely forks of std. WDYT, @kt3k?

Copy link
Member

Choose a reason for hiding this comment

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

There's no benefit of removing them earlier in my view.

Breaking at 1.0 is more obvious and less confusing. That is better than breaking at random 0.x version in my view

*
* @deprecated (will be removed in 1.0.0) Consider using {@linkcode DigestAlgorithmName} instead.
*/
export type WasmDigestAlgorithm = DigestAlgorithmName;
Copy link
Contributor

Choose a reason for hiding this comment

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

@kt3k kt3k merged commit 9af0532 into denoland:main Mar 28, 2024
11 checks passed
@jeremyBanks jeremyBanks deleted the crypto-export-deprecation branch March 29, 2024 05:32
eryue0220 added a commit to eryue0220/deno_std that referenced this pull request Mar 30, 2024
…220/deno_std into feat/expect-addSnapshotSerializer

* 'feat/expect-addSnapshotSerializer' of github.com:eryue0220/deno_std:
  deprecation(crypto): rename an export to match style guide, deprecating original and two other obsolete imports (denoland#4525)
  chore: add `--allow-dirty` flag to publish dry run (denoland#4535)
  [unstable] BREAKING(semver): remove comparator.semver field (denoland#4533)
  chore(crypto): upgrade dependencies (denoland#4530)
  0.221.0 (denoland#4531)
  docs(fs): polish documentation (denoland#4526)
  fix(fs): `SubdirectoryMoveError` extends `Error` correctly (denoland#4528)
  chore(fs): remove `test.ts` (denoland#4527)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants