Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Update Workspace and WorkspaceView public API #1560

Closed

Description

@probablycorey

I'm not sure what the best medium to have this discussion in, so let's just use an issue for now.

WorkspaceView

Add

  • WorkspaceView::eachPaneView # Rename of WorkspaceView::eachPane
  • WorkspaceView::getPaneViews # Rename of WorkspaceView::getPanes

Keep

  • WorkspaceView::appendToBottom
  • WorkspaceView::appendToLeft
  • WorkspaceView::appendToRight
  • WorkspaceView::appendToTop
  • WorkspaceView::prependToBottom
  • WorkspaceView::prependToLeft
  • WorkspaceView::prependToRight
  • WorkspaceView::prependToTop
  • WorkspaceView::eachEditorView
  • WorkspaceView::getActivePaneView
  • WorkspaceView::setTitle
  • WorkspaceView::updateTitle

Deprecate or Remove

  • WorkspaceView::getPanes # Renamed
  • WorkspaceView::eachPane # Renamed
  • WorkspaceView::confirmClose
  • WorkspaceView::focusNextPane
  • WorkspaceView::focusPaneAbove
  • WorkspaceView::focusPaneBelow
  • WorkspaceView::focusPaneOnLeft
  • WorkspaceView::focusPaneOnRight
  • WorkspaceView::focusPreviousPane
  • WorkspaceView::getActivePaneItem # This belongs on Workspace
  • WorkspaceView::getActivePane
  • WorkspaceView::getActiveView
  • WorkspaceView::getFocusedPane
  • WorkspaceView::indexOfPane

Workspace

Add

  • Workspace::getPanes
  • Workspace::getActivePane
  • Workspace::getActivePaneItem

Keep

  • Workspace::getEditors
  • Workspace::eachEditor
  • Workspace::getActiveEditor
  • Workspace::open
  • Workspace::registerOpener
  • Workspace::unregisterOpener

Deprecate or Remove

  • Workspace::destroyActivePane # This should be Pane::destroy() or Pane::close()
  • Workspace::saveActivePaneItem
  • Workspace::saveActivePaneItemAs
  • Workspace::reopenItemSync
  • Workspace::destroyActivePaneItem

Activity

  1. nathansobo commented on Feb 20, 2014

    @nathansobo
    Contributor

    I agree with everything except the methods you're proposing to remove from Workspace. I just don't see the harm they do and they offer utility to us. They're well-defined and unlikely to change. Why not offer them?

    Also, this could be another issue / PR, but I'd really like to rename our each* methods to onEach* to emphasize their now-and-later evented nature.

  2. probablycorey commented on Feb 20, 2014

    @probablycorey
    Author

    I don't see those methods don't offering much utility because they are only used once in Atom Core. The only method used in a package is destroyActivePane and it is used in a spec. Also their functionality can be easily recreated by using getActivePane().destroy(), getActivePane().savePaneItem(), etc...

    We can easily make them public later if we see a pattern emerge. But it is going to be a lot harder to remove them.

  3. nathansobo commented on Feb 20, 2014

    @nathansobo
    Contributor

    Why would we remove them in the future? They do exactly what they say they do.

  4. probablycorey commented on Feb 20, 2014

    @probablycorey
    Author

    Maybe we need to have a hangout about what our API goals are. I think starting out with a smaller API and growing it where problems emerge is a better strategy. It will make package authors job easier because deciding on what API to call is less ambiguous and it will be easier to understand other peoples package code if the API is small and specific.

    I posted this list before, but here are my goals for the API

    1. Easy to use, even without documentation
    2. Hard to misuse
    3. Easy to read and maintain code that uses it
    4. Sufficiently powerful to satisfy requirements
    5. Easy to extend
    6. Appropriate to audience
  5. nathansobo commented on Feb 20, 2014

    @nathansobo
    Contributor

    I agree with your bullet points, but I don't see how these methods violate any of them.

    As for your strategy, I'm not totally convinced. I like the idea of keeping things private that we're unsure about. Other than that, I not sure what is served by holding back methods like this. We saw fit to add them. They have a clear purpose. They're pretty uncontroversial.

    I guess I'm skeptical that someone is going to give us the feedback "I wish this method existed." If they're interested in the task the method performs, they're just going to duplicate its implementation in every package.

    My thinking is that if a method deserves to exist for our own purposes and is unlikely to be removed in our own estimation, we're doing our users a disservice by denying it to them.

  6. kevinsawicki commented on Feb 20, 2014

    @kevinsawicki
    Contributor

    I think starting with a really small public API is the right approach so I'm in favor of making everything listed here private/deprecated.

    Then over the coming months as we see it used in the wild we can add more to the public API on a case by case basis as needs/uses arise.

  7. nathansobo commented on Feb 20, 2014

    @nathansobo
    Contributor

    2 against 1, so I yield. I still think we're being a bit too stingy in our philosophy but losing these particular methods is not going to keep me up at night.

  8. added a commit that references this issue on Feb 20, 2014
    c47e8ad
  9. lock commented on Jan 25, 2019

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  10. locked as resolved and limited conversation to collaborators on Jan 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions