Skip to content

Lighten the bundle size #170

@paultranvan

Description

@paultranvan

According to this analyzer, cozy-keys-lib's bundle takes 426 Ko.
We could gain some space by removing heavy and dispensable libs, typically node-forge or tld.js.
Previous work like #43 already improved the weight, although not everything went as planned: #73

tldjs is used to get the domain which can be easily reimplemented in a stub see its definition

node-forge (which can actually be used in browser, despite the name) is used for two things:

  1. support for old browsers that does not have subtle crypto API, such as IE or old Safari
  2. "fast" crypto operations, brought by this commit. It is unclear how it is fast compared to the subtle API and how useful it actually is

The 1. does not seem to be a problem, as we officially does not support IE, and only support Safari >=12, which support subtle API. About 2., this require to keep most of the existing node-forge imports, but newer jslib's versions seem to remove this need.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions