Feature request: Support for Deno/ESM
See original GitHub issueWould be really nice if this lib supported Deno and moved away from CommonJS!
I’m experimenting on porting fido2-lib to a dual mode Node/Deno-lib on my own, and migrating everything to ES6 while at it. But I guess the changes are too big to “pull back” into this lib (?).
What need to be done/What I’m experimenting on:
- Reduce usage on Node-specific stuff; Replace Buffer with ArrayBuffer, replace crypto with webcrypto/subtle where possible
- Favor zero subdependency dependencies when available, bundle and modify them if dependencies depend on eachother
- Favor dependencies that already support import/export module pattern.
- Favor dependencies that support Deno and/or browser usage.
- Pay attention to using one, and only one, implementation of each function. Also make sure that dependencies use the same implementations (base64 is a good example, i found at least 6 different implementations in fido2-lib plus it’s dependencies)
Check out https://github.com/Hexagon/webauthn for ideas and inspiration, and please drop an issue of you find anything that doesn’t look ok 😃
Update 2022-04-25
Status of @hexagon/webauthn - Dual platform - Deno first - Node built
https://github.com/Hexagon/webauthn is pretty much in sync with fido2-lib now.
- All features are implemented
- All Node tests implemented
- Deno first approach, where dependencies are imported by Deno, and a platform independent bundle with zero dependencies is built (
dist/webauthn.js
). The bundle work in both Deno and Node, and it should technically work in browser too. - Code style (lint) upgraded to current recommended standards
- Etc …
Status of hexagon/fido2-lib fork , Dual platform - Node and Deno codebase
I’ve also submitted a pull request with a Node-first/Dual platform version of fido2-lib at PR https://github.com/webauthn-open-source/fido2-lib/pull/80
Two alternatives, both support both Deno and Node 😃
Issue Analytics
- State:
- Created a year ago
- Comments:9 (8 by maintainers)
Top GitHub Comments
New PR opened, #83, with the same result as #80, but much less changes to the code base and file structure. This time i also left Deno outside to keep the PR as small and reviewable as possible.
PR #80 works just as before, with minimum number of changes to get Deno working using the same code base. It’s ready for review 👍