-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
Background
We've received some feedback from community developers that Lumos is quite large when bundled, which is not friendly for mobile devices
Bundle Analyzer Output
stats.json.zip
lumos@487f3235fcfc83409f7752f94962e343684686b5 uncompressed version: 1.7 MB
- several different versions of
bn.jsin the bundle, probably due tobrowserify-cryptoandlumos/hdtogether - more than one
buffer.jsin the bundle - cost-effective third-party libraries, such as
ludash.isequal
Plan
- Refactor the
require("crypto")to import by demand - Unify multiple version dependencies into one version
- Refactor some oversized third-party libraries with simple functions, such as
lodash.isequal - Transpile to both ESM and CommonJS, add the
modulefield to point to ESM result - Mark the
package.jsonto"sideEffects: false"if it is possible- When refactoring, note that
@ckb-lumos/config-managermay not be directly marked as"sideEffect: false"since theconfig.initializeConfigis side-effected
- When refactoring, note that
- Decouple the data structure in the
@ckb-lumos/rpcfrom theaxios, allowing developers to choose their own HTTP client if they don't want to use the lumos integrated one
Metadata
Metadata
Assignees
Labels
No labels