Skip to content
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

Support tree-shaking and split code into entrypoints #266

Merged
merged 68 commits into from
Sep 15, 2023

Conversation

soerenbf
Copy link
Collaborator

@soerenbf soerenbf commented Sep 11, 2023

Purpose

Make it possible to include only the functionality you need from the SDK for your concordium web3 application.

Changes

  • Split code into several entrypoints (to support commonJS not loading everything)
  • Publish web-sdk as ESM
  • Split WASM module into
    • functionality commonly needed by dApps
    • functionality needed by wallets

Checklist

  • My code follows the style of this project.
  • The code compiles without warnings.
  • I have performed a self-review of the changes.
  • I have documented my code, in particular the intent of the
    hard-to-understand areas.
  • (If necessary) I have updated the CHANGELOG.

@soerenbf soerenbf force-pushed the separate-code-modules branch from 5f85ddb to 8a45a31 Compare September 14, 2023 07:54
@soerenbf soerenbf force-pushed the separate-code-modules branch 2 times, most recently from cf274b1 to 1a29048 Compare September 14, 2023 09:55
@soerenbf soerenbf force-pushed the separate-code-modules branch from 1a29048 to 6e99dde Compare September 14, 2023 10:00
@soerenbf soerenbf force-pushed the separate-code-modules branch from c4a5bb9 to 1eede3c Compare September 14, 2023 10:27
@soerenbf soerenbf force-pushed the separate-code-modules branch from 015f4c6 to 97edb35 Compare September 14, 2023 12:03
Copy link
Collaborator

@limemloh limemloh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

docs/README.md Show resolved Hide resolved
docs/pages/misc-pages/upgrade-guide.md Outdated Show resolved Hide resolved
docs/package.json Show resolved Hide resolved
packages/common/package.json Outdated Show resolved Hide resolved
packages/nodejs/package.json Outdated Show resolved Hide resolved
Co-authored-by: Emil Holm Gjørup <[email protected]>
@@ -4,7 +4,7 @@ import * as Gen from '@concordium/ccd-js-gen';
import * as Path from 'node:path';
import * as Url from 'node:url';
import meow from 'meow';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example seems to fail building now

packages/common/src/GenericContract.ts Show resolved Hide resolved
@soerenbf soerenbf merged commit 583070a into release/10 Sep 15, 2023
10 checks passed
soerenbf added a commit to Concordium/concordium-dapp-libraries that referenced this pull request Sep 20, 2023
In preparation of releasing
Concordium/concordium-node-sdk-js#266, we need
to also update the libraries included in this repo to be tree-shakable.

## Changes

- Added exports field to package.json
- Add ESM build target, and resolve to ES module by default

## Checklist

- [x] My code follows the style of this project.
- [x] The code compiles without warnings.
- [x] I have performed a self-review of the changes.
- [x] I have documented my code, in particular the intent of the
      hard-to-understand areas.
- [x] (If necessary) I have updated the CHANGELOG.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants