Skip to content

Conversation

peterpeterparker
Copy link
Member

@peterpeterparker peterpeterparker commented Oct 15, 2025

Motivation

We want to migrate agent-js to @icp-sdk/core. Since this library currently re-export all underlying libraries - e.g. @dfinity/agent and @dfinity/principal - we are using, in this first step we can solely switch the dependencies.

Temporary "Workaround"

Without migrating all imports to their corresponding sub-paths (will be resolved in #1044), the generate bundles end including the code of the agent which per extension lead the library to become more heavy. As temporary workaroung, we add an explicit exclude in the bundler script which we can remove afterwards.

Notes

Announcement: https://forum.dfinity.org/t/icp-javascript-sdk-v4-0-0-is-released/55915

Changes

  • Update helper script that handles lib upgrades.
  • Replace @dfinity/* peer dependencies by @icp-sdk/core.
  • Exclude @icp-sdk/core from size-limit checker (similarly to the @dfinity/... libs).
  • Temporary manually list @dfinity/... as peer dependencies for the build (see workaround above).

Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
@peterpeterparker peterpeterparker requested review from a team as code owners October 15, 2025 04:47
Copy link
Contributor

github-actions bot commented Oct 15, 2025

size-limit report 📦

Path Size
@dfinity/ckbtc 8.15 KB (0%)
@dfinity/cketh 3.7 KB (0%)
@dfinity/cmc 1.42 KB (0%)
@dfinity/ledger-icrc 4.69 KB (0%)
@dfinity/ledger-icp 7.12 KB (0%)
@dfinity/nns 27.68 KB (0%)
@dfinity/nns-proto 140.99 KB (0%)
@dfinity/sns 19.59 KB (0%)
@dfinity/utils 5.11 KB (0%)
@dfinity/zod-schemas 623 B (0%)
@dfinity/ic-management 4.41 KB (0%)

Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
@peterpeterparker peterpeterparker changed the title build: migrate agent-js to icp-sdk build(core): migrate agent-js to icp-sdk Oct 15, 2025
Copy link
Collaborator

@AntonioVentilii AntonioVentilii left a comment

Choose a reason for hiding this comment

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

LGTM tks!

2 doubts

@peterpeterparker peterpeterparker merged commit 94d9ac6 into main Oct 15, 2025
18 checks passed
@peterpeterparker peterpeterparker deleted the build/migrate-agent-js-to-icp-sdk branch October 15, 2025 13:58
peterpeterparker added a commit that referenced this pull request Oct 15, 2025
# Motivation

We are migrating the peer dependencies to `@icp-sdk/core` (#1104).
Therefore, we have to reflect the change in our READMEs.

# Changes

- Update READMEs with new `npm` and `import` instruction.

---------

Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
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