Skip to content

perf: import pkc-js via the slim ./client entry#113

Draft
Rinse12 wants to merge 1 commit into
masterfrom
perf/pkc-js-client-entry
Draft

perf: import pkc-js via the slim ./client entry#113
Rinse12 wants to merge 1 commit into
masterfrom
perf/pkc-js-client-entry

Conversation

@Rinse12

@Rinse12 Rinse12 commented Jul 5, 2026

Copy link
Copy Markdown
Member

What

BaseCommand._connectToPkcRpc() is RPC-only — it always constructs
PKC({ pkcRpcClientsOptions: [pkcRpcUrl] }) and never starts a local node. Switch its import from
@pkcprotocol/pkc-js to the new slim @pkcprotocol/pkc-js/client export, which defers the
local-node / signer / kubo-rpc-client / undici / thumbnail graphs behind lazy imports.

One-line change (src/cli/base-command.ts).

Impact

On a slow production host the pkc-js import drops from ~1.97s to ~1.22s; community list -q end to
end from ~3.34s to ~2.6s.

⚠️ Blocked

The ./client export does not exist in the currently published @pkcprotocol/pkc-js (0.0.62). This
PR must not merge until pkc-js ships it — see pkcprotocol/pkc-js#178 (pkcprotocol/pkc-js#179) — and
the @pkcprotocol/pkc-js dependency here is bumped to that release. Opening as a draft to track.

BaseCommand._connectToPkcRpc() is RPC-only (it always passes
pkcRpcClientsOptions), so it can use @pkcprotocol/pkc-js/client — a slim
export that defers the local-node/signer/kubo/undici graphs behind lazy
imports. On a slow host this cuts the pkc-js import from ~1.97s to ~1.22s.

Blocked on @pkcprotocol/pkc-js releasing the ./client export
(pkcprotocol/pkc-js#178 / #179); bump the pkc-js dependency to that release
before merging.
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e0f8979c-c325-48eb-bd00-8e3ec34e2c2a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/pkc-js-client-entry

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant