-
Notifications
You must be signed in to change notification settings - Fork 161
Closed
Milestone
Description
I'd really love to have dom.crypto
be of type js.UndefOr[Crypto]
. It seems the impediment is the old deprecated package with the same name.
These are my ideas:
-
change
dom.crypto
to be of typejs.UndefOr[Crypto with DeprecatedCryptoPackage]
so that at least in userland we can use itCrypto
-- actually this won't work - deprecated crypto imports wouldn't be stable, not to mention that there's ajs.UndefOr
there -
Building on @sjrd's suggestion we could keep The great migration to
dom
#588 as it but also add awebCrypto: js.UndefOr[Crypto]
which we could deprecate in 3.x to be replaced bycrypto
-
just nuke the deprecated package, 2.0 is a new world
Any more ideas? I'm kinda happy with 3, but 2 would definitely be acceptable.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Relationships
Development
Select code repository
Activity
armanbilge commentedon Oct 17, 2021
It's a bit ugly, but what if we add an implicit conversion to
Crypto
that brings in all the deprecated aliases? So thatdom.crypto
can still be used as if it is the old package. Would this work?japgolly commentedon Oct 17, 2021
I don't think so. Cos source-compat is the concern the direct import statements would stop working. Plus maybe it wouldn't be worth it if the cost is an implicit anyway :)
armanbilge commentedon Oct 17, 2021
Right, imports 😕
Regarding your idea 2, we already have a deprecated
GlobalCrypto
object or similar that could be used like that I think. Otherwise I'm 👍 with it, I think I suggested something similar as well.japgolly commentedon Oct 17, 2021
Oh another idea, we could add
It would be the same as option 2 above except instead of
webCrypto
it would beCrypto.ifAvailable
. More of a 2bjapgolly commentedon Oct 17, 2021
GlobalCrypto
has the wrong type forcrypto
and it's deprecated anyway.Nice, so we'll go with a 2x option? Do you have a preference between
webCrypto
orCrypto.ifAvailable
or something else?armanbilge commentedon Oct 17, 2021
IMO
dom.webCrypto
is best since it's very close to our eventual target ofdom.crypto
.japgolly commentedon Oct 17, 2021
ok np, I'll do PR that after #588 is in 👍
Add webcrypto
Add webcrypto
webcrypto
#598dom.crypto
actually return aCrypto
object #630