Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

Conversation

@lgarron
Copy link
Contributor

@lgarron lgarron commented Aug 1, 2025

It now:

  • Links to the built-in JSON parsing functions on MDN (which contain explanations, examples, and links to specs).
  • Contains an obvious example that is ready to copy, with some conveniences and guiderails. In particular:
    • Avoids top-level await (which is well-supported by browsers but still errors in TypeScript unless you specifically configure it).
    • Includes TypeScript annotations to help make it easy to use the code without hacks.
  • Provides encouragement and rationale to stop using @github/webauthn-json.
  • Includes a fallback example, both as a pragmatic compromise but also to illustrate the tradeoffs vs. completely moving off the library.

@lgarron lgarron force-pushed the update-deprecation-notice branch from bf77816 to 4452dec Compare August 1, 2025 19:29
@lgarron lgarron mentioned this pull request Aug 1, 2025
@lgarron lgarron force-pushed the update-deprecation-notice branch 4 times, most recently from f359cf0 to dea67c7 Compare August 1, 2025 19:47
@lgarron
Copy link
Contributor Author

lgarron commented Aug 1, 2025

  • Uses JSDoc comments which ensure that the functions receive the correct types in TypeScript, while still allowing the code to be pasted into vanilla JS.

Wait, this part is not being picked up properly by TypeScript. Lemme fix that.

@lgarron lgarron force-pushed the update-deprecation-notice branch 2 times, most recently from e15e219 to 8c8af29 Compare August 1, 2025 20:20
@lgarron
Copy link
Contributor Author

lgarron commented Aug 1, 2025

  • Uses JSDoc comments which ensure that the functions receive the correct types in TypeScript, while still allowing the code to be pasted into vanilla JS.

Wait, this part is not being picked up properly by TypeScript. Lemme fix that.

Looks like this is not possible, since apparently JSDoc annotations are ignored in .ts files. So the example will fail TypeScript checking in either JS or TS unless I complicate the code in a way that makes it even harder to understand. So I've just converted it fully to TS and added a comment at the top of the example snippet.

@lgarron lgarron force-pushed the update-deprecation-notice branch 7 times, most recently from e10f901 to ba5da8e Compare August 7, 2025 03:20
lgarron added 3 commits August 6, 2025 20:34
Technically the syntax for referring to an instance method is `PublicKeyCredential#toJSON()` but I think this is problematic. So I've avoided it.
@lgarron lgarron force-pushed the update-deprecation-notice branch from 622da7d to 88f0e8a Compare August 7, 2025 03:34
lgarron and others added 2 commits August 8, 2025 09:12
@KyFaSt KyFaSt merged commit 7a29471 into github:main Aug 11, 2025
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants