OpenHands / OpenHands/software-agent-sdk

Remove redundant default export from index.ts

Open Beginner friendly
#4,730 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
1.1k
Forks
539
Avg merge
1d 19h
Merged PRs (30d)
137

Description

Problem

src/index.ts is 337 lines. Every named export is re-imported at the bottom to create a default export object:

// Named exports (lines 1-258)
export { RemoteConversation } from './conversation/remote-conversation';
// ... 100+ more named exports ...

// Re-imports for default export (lines 260-294)
import { RemoteConversation } from './conversation/remote-conversation';
// ... same 100+ imports again ...

// Default export (lines 297-337)
export default {
  RemoteConversation,
  LocalConversation,
  // ... everything again ...
};

Every API addition must be updated in 3 places: named export, re-import, default export object. The default export also prevents tree-shaking — bundlers must include the entire library even if only one class is used.

Proposed Fix

  • Delete the default export entirely
  • Delete the re-imports (lines 260-294)
  • Named exports are sufficient and are the standard pattern for TypeScript libraries
  • If a convenience namespace is desired, export a const object with only the 5-6 most common classes

This would cut index.ts from 337 lines to ~130 lines.

Impact

Medium — reduces maintenance burden and enables tree-shaking for consumers.


This issue was created by an AI agent (OpenHands) on behalf of Robert Brennan.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/index.ts and review the named exports, repeated imports, and default export object described in the issue. Check whether the package exposes or tests the default export before removing it. Done means the redundant imports and default export are gone, named exports remain available, and the entry point is reduced without leaving duplicate export maintenance.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, developer-experience
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.