Repository navigation
Add Package Sets - #385
Add Package Sets#385joefitzgerald wants to merge 10 commits into
Conversation
|
Could this be achieved via the following
An api to get the full de-duped list of service dependencies for as a general purpose global UI so that we can have something like the deprecations marker in bottom bar, that clicks to a full list of things that would resolve the missing parts. Also out of curiosity, have we opened a similar pull request for the package server to create an endpoint for finding packages that resolve service dependencies? |
|
I was a little shocked to see this: Why has nobody ever used the |
|
Also notable: #120 (comment). |
|
@joefitzgerald What do you think about separating package sets and required services into two separate threads? They seem orthogonal to me and the less we have to agree on, the easier it is to achieve consensus. |
It is only meant for running It nests the packages in |
Strongly agree. Packages with overlapping services, and nuclide-like IDE bundles don't need to be forced into the same abstraction. The latter should be brutally simple, IMO - a set of package names and versions tied to a bundle name, no more. |
|
@nathansobo, @thedaniel This proposal is now for package sets only. Service dependency hinting + metadata has moved to #387. |
|
I've been thinking for a little while that it would be nice to have a "perspective" package (like eclipse perspectives) such that the editor could morph from one thing to another based on the required usage. A simple example would be switching between a normal atom install and Nuclide. When switching to the Nuclide perspective, the required packages would be enabled and any specified core packages would be disabled. With that in mind, would it be reasonable to say that not only can packagesets define a group of packages to add, but also specify which packages should be disabled? {
"packageset": "tree-factor",
"includes": [
"awesome-tree",
"ace-replace"
],
"disables": [
"tree-view",
"find-and-replace"
]
}Ultimately this config would be consumed by apm to install any missing packages and acted on my atom to activate/deactivate the specified packages. |
|
Also, take a look at the package-switch package. |
|
I think the notion of activating / disabling packages as a set ("perspectives") is orthogonal to installing / updating packages as a set. But I suppose they are related in so far as a package set could also be a perspective (or could include multiple) (or could have no perspective(s)). I'd prefer to keep the two separate though. That's a super interesting idea though. |
|
The deactivation of packages isn't apart of the perspective, but actually apart of the package-set construct. I don't think packages should be updated as a set either, that mechanism should stay how it is. Updating a package-set would only be required when the configuration of the package-set has changed in which case it wouldn't actually update the individual packages but install new or disable old packages. I'll go back to Nuclide as my example. Nuclide shouldn't have to have its own installer to be installed easily. A user shouldn't have to look up what packages need to be installed and what packages need to be disabled for it to work correctly. The user should be able to install the "Nuclide IDE" in the Bundles/Package-Sets/whatever tab on settings view and it should install the specified packages AND do whatever else it needs to do to function properly (in this case disable the relevant core packages). |
|
@joefitzgerald Do you have a proposal for the concrete syntax you'll want to use in Initial thoughts/Questions:
|
|
@nathansobo, Are you sure it should be a hash? Theoretically the packages should interact through versioned services. Granted, I realize that isn't bulletproof, but it's better than having two package-sets installed that depend on different versions of a particular package. |
No, I'm not sure. Maybe it should be an array and we always install the most recent version of a given package. Actually that's probably better because we won't get into a scenario where packages depend on being installed via a set to be version-compatible. |
|
I think we want a hash so that we can specify minimum versions. This would allow us to have a flow that requires the user to upgrade some packages. Initially we may not use the version information, but we could in the future. |
|
What about {
"name": "my-package-set",
"packageType": "package-set",
"includes": [
"package1",
{ "package2": { "minVersion": "1.2.3" } },
"package3"
]
}For the average case of including the latest version of a package it's as simple as specifying the package name as a string. Optionally you could give it an object which can have metadata (which could be expanded in the future if need be). |
|
@zephraph I think I may just go with specifying the versions the same way that we allow specifying dependencies; the difference being that we will ignore the maximum version (if specified). This allows us to use the same code we use to handle dependency versioning, minimizing the effort. |
|
✏️ Updated based on a conversation with @joefitzgerald to try and make my position more clear. @joefitzgerald, @nathansobo Apm is about installing packages which it does well. A good extension in my mind is to enable apm to install package sets. Both via api, and command line. A package set based install might have an input that looks like the apm api implementation could look something like The command line could include some simple request wrapping so it could take local files and urls, so you could run Problems with this method.
Benefits as I see it,
|
|
I'm not totally married to supporting this in |
I generally agree with this, but we need to make sure they can be used and worked on outside the atom.io ecosystem, for development or private packages sets etc, so we probably still need to specify some kind of static format even if it's only used for test/dev. |
|
@nathansobo, just updated my comment with an idea as to how package sets could be integrated into apm. Installing could be as simple as a gist with the package config in it. The atom.io website could provide a rest service that allows users to post and consume package sets.
A atom package would be necessary to manage them within atom and that could operate off the same apis or allow you to point at your own gist/repo if you had a set of packages you used on all your machines. |
|
@thedaniel, I updated my comment above on where I think apm actually should be in the packageset installation process. |
|
@nathansobo is the atom.io website on github, I'm pretty interested in looking into what it would take to get service dependencies built into the apm listings so we can add ui for helping users discover packages that utilize or provide services. |
|
In my view this is not viable if it's not supported by atom.io and handled by the existing publishing workflow. I'm not going to invest the time to build alternate publishing, hosting, and distribution workflows. If apm isn't viable, I consider this issue closed. |
- Current values: `package` (the implicit default, if omitted), `ui-theme`, `syntax-theme`
There was a problem hiding this comment.
Should this maintain backwards compatibility?
I think that even if a package was previously installed, uninstalling it when the user uninstalls the package set is a fine behavior to start with. We have very little information about how people will want to use package sets, so there's a high risk of over-engineering this feature, or building the wrong thing entirely. And in this case, the worst outcome is that somebody accidentally uninstalls a package and needs to reinstall it. |
I disagree very strongly. |
I'd be pissed if that happened, but I guess it's something that I'll have to live with. My point with designing this at least somewhat similar to |
Yeah, I'm not saying we should re-invent the wheel here. I'm saying that we may not even need a wheel. In other, less metaphorical words:
|
|
What if instead of just uninstalling all the packages when you go to uninstall the package set, it showed you a list of all the packages that would be uninstalled when you uninstalled the package set. You could then deselect certain items from that list to keep. The package set would be "uninstalled" along with any selected package, but it would leave the others alone. Granted it could be annoying for huge package sets, but it's a simple implementation without removing packages you may be using. |
|
I think there is a half-way house between these extremes:
And that is simply to prompt a user visually (settings-view) or textually (apm) to uninstall packages in the package set, while also providing flags to uninstall all or none. This provides a model with three states for uninstall behavior: [all, none, none:all with prompting] (the latter would be the default behavior. |
Agreed, although not wildly different.
Again agreed, and I'm not saying we should build anything as complex, but they've got some really good concepts. Amongst them are the notions of
Sure, but then I suggest we do not remove any packages when uninstalling a set. Removing them is destructive. Leaving them is messy, but at least it's not destructive. Lesser of two evils. |
Yeah, that's along the lines of something we discussed in this thread last week (or the week before that?), and would work better than blindly removing everything in a package set. |
|
@zephraph and @joefitzgerald well said. That's exactly the point I was trying to get across. I agree, blindly uninstalling a package without giving the user any warning sucks. If that's the only alternative, then that puts me squarely in @thomasjo and @thedaniel's camp. Leaving all the packages sucks too. I'd be almost as pissed if I installed uber-vim-mode, didn't like it, then had to spend 15 minutes tracking down all the crap it left behind. I'd never touch another package set after that experience, that's for sure. Is there anything wrong with showing a single dialog box to let the user choose whether to take additional action or not? (other than additional UI is certainly not something to be added lightly... but in this case, it seems like the best option) |
I agree. In all of the concrete use cases for package sets that I've heard ( I think that if we show a simple, static confirmation dialog that lists the packages to be installed, the user won't be surprised. If they want to uninstall a subset of the packages, they can always do that using the existing UI. I would tend to want to avoid building another way of doing it. |
|
I think the redundancy is justified. The base case is, as you've stated, to remove everything. That's easy to do because we've got a list of everything necessary to be removed. How much harder then is it to add one more layer of UI to let the user specify what should be removed? Personally I think the added control that it gives justifies the extra work. I'm not necessarily suggesting that it has to be a phase 1 feature, but it should be a goal. |
|
If we do uber-vim-mode correctly, there's a good chance you'll decide that you don't like vim-mode but you can't live without paner and cursor-history (for example). I hope that keeping one or two packages while blowing away the package set will appeal to people. That said, I don't feel strongly. In the interest of under-engineering, maybe it makes sense to implement @maxbrunsfeld's static warning for now. It can always be improved once the feature requests and complaints start rolling in. :) |
|
I've seen apt and rpm cited as comparisons, does anyone care to take hints at how pacman's take on this works? I've only used it, but the simplicity is refreshing (enough that I didn't even had to ever care about how it's implemented, contrary to apt). I couldn't help but think of it while reading @maxbrunsfeld's and @bronson's comments. |
|
Just curious, are package sets on hold for now? It seems like, right as consensus was reached, everything went dark. :) Near as I can tell, |
|
@bronson just a heads up: If by " |
|
I did mean that, thanks @Arcanemagus. Still, I'd rather have package sets! (I think...) |
|
Having it integrated into Atom is definitely preferable 😉. |
They aren't consciously on hold, and you're right that it seems some kind of consensus was reached. I just think that @joefitzgerald became busy with other things and no one else from the community / core team has picked up the effort since then. They would still be a good thing to have. |
|
@joefitzgerald, what's the reason for closing? I'm still interested. |
|
This concept has been tested at length by me via go-plus. The concept has a number of side effects and these make it difficult to reason about package sets. For instance, what if you want all packages in a set, except for 1? What happens if you uninstall a package, and then install a new version of the package set? It is possible to achieve everything I described here via use of package-deps. But even that falls short. This leads me back to the drawing board, to attempt a different approach via go-plus which could then be codified as a proposal for apm / core. As others have stated, this actually requires user experience work to make it obvious what will happen when one thing installs other things, and also allows users choice while avoiding undesirable behavior in edge cases (e.g. the uninstall one). |
|
Right on, that makes sense. Thanks! I have yet to see any package manager that doesn't have weird corner cases... Maybe the next attemt will be the first. :) |
|
Corner cases will always exist. The takeaway from my comment is that this needs to be user experience led; it's not a raw apm feature. |

After discussions with @nathansobo, @maxbrunsfeld, @bolinfest, this PR will also add a third category of packages, the
package set:Prior Work:
Goals
Non-Goals
/cc @kevinsawicki @thedaniel @benogle @jlord
This formerly included #387, but #387 was split out.