Skip to content

Auditing our index.ts|tsx files #383

Closed

Description

@niik

We're using folders more and more to logically group classes and components and I think that's fantastic. I wonder, however, if we should consider naming the files after what they contain and leaving the index.ts/index.tsx files as pure export files.

I have too many index.tsx files open in tabs right now and it's harder than it needs to be to find the right one.

Anyone against renaming our index files to what their primary contents is and adding an export-only index.ts in their place?

Activity

  1. joshaber commented on Sep 23, 2016

    @joshaber
    Contributor

    I worry it might add a bit too much ceremony, but that's probably less bad than the billion index files we have now.

    👍

  2. niik commented on Sep 23, 2016

    @niik
    MemberAuthor

    I worry it might add a bit too much ceremony

    Yeah, I think in the case of adding a single item in a directory like in the case of toolbar I don't think we have to have an index.ts file necessarily. We could either have the file roam in its parent directory or we could import the file explicitly.

    @shiftkey Do you have strong feelings either way?

  3. shiftkey commented on Sep 26, 2016

    @shiftkey
    Member

    I do like renaming these existing index.ts/tsx files to be more specific

  4. added
    tech-debt
    on Nov 18, 2016
  5. j-f1 commented on Oct 27, 2017

    @j-f1
    Contributor
    index.{ts,tsx} only containing export * from 'x' and export { foo, bar } from 'x' lines (32)

    app/src/lib/dispatcher/index.ts
    app/src/lib/editors/index.ts
    app/src/lib/git/index.ts
    app/src/lib/progress/index.ts
    app/src/lib/shells/index.ts
    app/src/lib/stats/index.ts
    app/src/main-process/menu/index.ts
    app/src/ui/about/index.ts
    app/src/ui/acknowledgements/index.ts
    app/src/ui/add-repository/index.tsx
    app/src/ui/app-menu/index.ts
    app/src/ui/blank-slate/index.ts
    app/src/ui/cli-installed/index.ts
    app/src/ui/dialog/index.ts
    app/src/ui/diff/image-diffs/index.ts
    app/src/ui/editor/index.ts
    app/src/ui/generic-git-auth/index.ts
    app/src/ui/install-git/index.ts
    app/src/ui/lib/vertical-segmented-control/index.ts
    app/src/ui/merge-branch/index.ts
    app/src/ui/octicons/index.ts
    app/src/ui/preferences/index.ts
    app/src/ui/publish-repository/index.ts
    app/src/ui/repository-settings/index.ts
    app/src/ui/resizable/index.ts
    app/src/ui/shell/index.ts
    app/src/ui/sign-in/index.ts
    app/src/ui/terms-and-conditions/index.ts
    app/src/ui/toolbar/index.tsx
    app/src/ui/untrusted-certificate/index.ts
    app/src/ui/updates/index.ts
    app/src/ui/welcome/index.ts
    

    index.{ts,tsx} files that don’t just re-export other exports:

  6. shiftkey commented on Dec 12, 2017

    @shiftkey
    Member

    I've removed src/ui/index.tsx and src/crash/index.tsx from this list because they're referenced as entry points in webpack - so they're slightly different to the others.

  7. self-assigned this
    on Dec 12, 2017
  8. locked as resolved and limited conversation to collaborators on Jul 19, 2018
  9. unlocked this conversation on Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

tech-debt

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions