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

refactor: remove unused exports identified by ts-unused-exports #2352

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Crosstons
Copy link

This PR removes unused exports that were identified by the ts-unused-exports tool. Removing these unused exports helps in code cleanup, reduces bundle size, and improves maintainability by removing code that isn't being used elsewhere in the project. #2036

Changes:

  • Removed unused exports from /src/bundles/files/protocol.ts (kept only re-exports of Perform, Spawn)
  • Removed unused export realMfsPath from /src/bundles/files/actions.js
  • Removed unused exports (cliCmdKeys, cliCmdPrefixes, cliCommandList) from /src/bundles/files/consts.js
  • Removed unused exports (ACTIONS, sorts, default) from /src/bundles/files/index.js
  • Removed unused default exports from multiple bundle files
  • Removed unused export checkValidAPIAddress from /src/bundles/ipfs-provider.js (kept default export)
  • Removed unused export sortByProperty from /src/lib/sort.js
  • Removed unused exports (normalizeFiles, makeCIDFromFiles, humanSize) from /src/lib/files.js
  • Removed unused exports (after, once, debounce) from /src/lib/hofs/functions.js

All functions are retained for internal use but are no longer exported.

@Crosstons Crosstons requested a review from a team as a code owner March 20, 2025 10:56
Copy link

welcome bot commented Mar 20, 2025

Thank you for submitting this PR!
A maintainer will be here shortly to review it.
We are super grateful, but we are also overloaded! Help us by making sure that:

  • The context for this PR is clear, with relevant discussion, decisions
    and stakeholders linked/mentioned.

  • Your contribution itself is clear (code comments, self-review for the
    rest) and in its best form. Follow the code contribution
    guidelines

    if they apply.

Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
Next steps:

  • A maintainer will triage and assign priority to this PR, commenting on
    any missing things and potentially assigning a reviewer for high
    priority items.

  • The PR gets reviews, discussed and approvals as needed.

  • The PR is merged by maintainers when it has been approved and comments addressed.

We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution.
We are very grateful for your contribution!

Copy link
Member

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

a number of the removed exports are actually being used elsewhere.

@@ -66,7 +66,7 @@ const cumulativeSize = async (ipfs, cidOrPath) => {
* @returns {string}
*/
// TODO: use sth else
export const realMfsPath = (path) => {
const realMfsPath = (path) => {
Copy link
Member

Choose a reason for hiding this comment

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

this is used by files/modals/Modals.js: import { realMfsPath } from '../../bundles/files/actions.js'

@Crosstons
Copy link
Author

a number of the removed exports are actually being used elsewhere.

I'll look back again and will get back to you

@SgtPooki SgtPooki marked this pull request as draft April 4, 2025 22:17
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