Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

inform users of node <20.3.1 of required shim #1179

Open
vjjft opened this issue Jul 14, 2023 · 3 comments
Open

inform users of node <20.3.1 of required shim #1179

vjjft opened this issue Jul 14, 2023 · 3 comments

Comments

@vjjft
Copy link

vjjft commented Jul 14, 2023

from:


Capi is compatible with Node <20.3.1 if a basic shim is used, but as shipped it errors on <20.3.1 without indication as to why.

The capi package should inform devs using node <20.3.1 that a basic shim must be used.

Additionally, if the package can assist in adding the basic shim, that would improve dx.

@vjjft
Copy link
Author

vjjft commented Jul 14, 2023

@vjjft
Copy link
Author

vjjft commented Jul 14, 2023

excerpts for context for discussion:

If either/both of the capi package postinstall or the capi cli would check the node version and facilitate any necessary shim, that would be good imo. Thoughts?

Developers may have opinions about how they shim the Web Crypto API. I suppose the CLI could prompt the developer and give them several choices, but this seems out of scope for now. Imo best path forward is engines field + getting those docs merged

afaict that will result in a warning to all <20.3.1 with no context or indication that it actually is compatible

Good point. Should we have the Capi CLI produce a custom warning?

@vjjft vjjft added the task label Jul 14, 2023
@tjjfvi
Copy link
Contributor

tjjfvi commented Jul 16, 2023

We can add a check to the mod.ts that checks if globalThis.crypto is defined, and if not, emit a warning linking to a docs page that describes the issue, common causes (e.g. using Node 18) and fixes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: No status
Development

No branches or pull requests

2 participants