Skip to content

Lazy load closure sha384 lib when browser native Crypto API is not available #3888

@lannka

Description

@lannka

This is a further enhancement to #3690
It reduces binary size of amp-analytics by 9K under most of browsers.
As a trade-off, it introduces a HTTP round trip for some old browsers, such as IE11 and Android 4.x system browser.

Plan:

  • Have a local implementation of base64()
  • Strip out base64 code from closure sha384 lib
  • Serve the closure lib in CDN (@cramforce any example how do we host such a file?)
  • Lazy load it in CryptoService code

@jridgewell

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions