-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert from CJS only to ESM or Hybrid #1354
Comments
maybe deployer code should be in a different package |
@yorhodes Yes that's a good idea, but it won't help much unless we also update the TS output module target to ESM (from commonJS). The CLI already uses the ESM, we'd want to do the same for all the others |
Possibly blocked by NomicFoundation/hardhat#3385 |
Copied from #2553, which is closed as duplicate: The build settings for the monorepo JS packages don't support tree-shaking, which how bundlers drop code apps don't use. Meaning every consumer of the utils/core/sdk packages will bundle every lib we use, every contract factory, and all our code into their app, even if they don't use parts of it. Currently our bundle contribution is 1.5Mb plus all our transitive lib deps. Not horrible, but problematic as we start adding libs for more protocols. To fix this we'd need to change our TS and package.json settings to produce more modern build output.
|
Semi-related: cosmos/cosmjs#904 (comment) |
### Description - Reconfigure tsconfig and package.json for the utils, core, sdk, and helloworld packages - Update imports to use ESM syntax - Add patch for typechain to address [issue 898](dethcrypto/TypeChain#898) ### Drive-by changes Improve package Readme content ### Related issues Fixes #1354 ### Backward compatibility No: package consumers using CJS will need to modify their imports or update to ESM. See [this popular gist](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#pure-esm-package) for details. ### Testing - [x] CI test coverage which invokes a lot of code via the CLI e2e - [x] Manually test in Warp UI by copying packages - [x] Publish beta packages and test in a few popular bundlers
### Description - Reconfigure tsconfig and package.json for the utils, core, sdk, and helloworld packages - Update imports to use ESM syntax - Add patch for typechain to address [issue 898](dethcrypto/TypeChain#898) ### Drive-by changes Improve package Readme content ### Related issues Fixes #1354 ### Backward compatibility No: package consumers using CJS will need to modify their imports or update to ESM. See [this popular gist](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#pure-esm-package) for details. ### Testing - [x] CI test coverage which invokes a lot of code via the CLI e2e - [x] Manually test in Warp UI by copying packages - [x] Publish beta packages and test in a few popular bundlers
### Description - Reconfigure tsconfig and package.json for the utils, core, sdk, and helloworld packages - Update imports to use ESM syntax - Add patch for typechain to address [issue 898](dethcrypto/TypeChain#898) ### Drive-by changes Improve package Readme content ### Related issues Fixes hyperlane-xyz#1354 ### Backward compatibility No: package consumers using CJS will need to modify their imports or update to ESM. See [this popular gist](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#pure-esm-package) for details. ### Testing - [x] CI test coverage which invokes a lot of code via the CLI e2e - [x] Manually test in Warp UI by copying packages - [x] Publish beta packages and test in a few popular bundlers
Restructure core dist so factories are tree-shakeable
enables tree shaking of all the ABIs, deployers, and utils that apps (like the warp UI) don't actually use. And more broadly, CJS is being deprecated.
Revamp libraries in ESM so that integrating for partners is a better experience, so that their bundlers can discard unused packages
All SDK users will pull in 850Kb of factories, 200kb of which are for Test
The text was updated successfully, but these errors were encountered: