Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Provide the loader as modern es6 module #541

@danimoh

Description

@danimoh

Currently the web loader nimiq.js includes babel polyfills for old browsers and weighs 40kB which is pretty big compared to the web-offline package's 120kB. For people that build their apps using bundlers like webpack this is not optimal or needed, as the polyfills should be added in the bundling process, not be duplicated and only added if the user requested so. Webpack also can be set up to create a lagacy build with polyfills and a modern build without at the same time. Which version to use is then determined by the app at runtime.

For this reason I propose to add a nimiq.esm.js module version of the loader to our npm package which does not include any polyfills.
I would also suggest to add an option to make loading the wasm optional as it is only required if the user intends to use cryptographic functions and can in that case be lazy loaded on demand.

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