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

v3 upgrade notes / early feedback #353

Open
gnarea opened this issue May 18, 2022 · 1 comment
Open

v3 upgrade notes / early feedback #353

gnarea opened this issue May 18, 2022 · 1 comment
Assignees

Comments

@gnarea
Copy link
Contributor

gnarea commented May 18, 2022

I'm trying to upgrade to v3 (3.0.1-2) in one of our libs but I'm finding that many things are breaking and I'm finding that some upgrade notes would be really useful: For example, I was getting some weird transpilation errors because PKI.js v3 requires asn1js v3 but my library was still using asn1js v2. Is there anything else that would be good to know/do upfront, besides uninstalling @types/pkijs?

I have to pause this work for the next couple of weeks, but in the meantime I thought you might want to know that some types are missing (i.e., type any), at least compared to @types/pkijs:

  • EnvelopedData: unprotectedAttrs.
  • SignedData: signerInfos
  • SignedAndUnsignedAttributes: attributes
  • Certificate: extensions, subject.typesAndValues

I'm also getting about 50 type errors, but at least the handful I've checked so far seem to point to bugs in @types/pkijs: Optional attributes that @types/pkijs defined as required (like RecipientInfo.value, for example).

@microshine
Copy link
Contributor

You are right. The new version of PKIjs uses the updated version of ASN1js. ASN1js was also migrated to TS.

@types/pkijs is old declaration and it may use wrong declarations. The new version creates definition file from TS source directly and it uses API from the v2. All tests use the same calls and test vectors. Most errors after v3 applying must be with type validation (eg optional fields, mixed types). Because the most popular type in JS version was any

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants